From nobody Mon Feb 24 00:20:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1Lww15Plz5pHK9; Mon, 24 Feb 2025 00:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1Lwv4mXJz3bQ1; Mon, 24 Feb 2025 00:20:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740356431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXMGKQQI6/shVrG3IQTJepsj1UcpAkS+IFy+1mROvF0=; b=SNBIFrZ6fDIrHiPZwhkeCHlcWyGRMNaFTRxmNNbppufBi9iofpQ9mN0tJ15wiFAz/RDOuk P35ZTqAaTHt7q2TPgQybBixzxZQ7PQgZbQNGWEboziLbG2iPJRJGhmSoJGcPYl6X2VW3qI MxXknfLMsswlHJGZNbzQaibRJIbUVTt23HNPp8YhcYP5zttkbxVKmVLvdos7q+Ms/iV9RT 1e5XwyqED1GoKpbqykYpx167vsoih3XZNsWXNbbBV2D2CqGdLRT5p/Rzck8HbkVipG7SRz d7ftRtS9B5pOhTLUTtESDHKXg8M6bUYkWRyBKgdX8hyovB6N9cfgG9iAkkAJgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740356431; a=rsa-sha256; cv=none; b=f+94r9oqVpEJJjd+qULK8Z815Ac8UKaXMpfz0dZvEt6KIk+hE+f/6ooS4dFnOIsRYWv43r onJBgLhMAj7ZYfKw2O1WqKsMFAhlMRTKCmnOImcAeayUwRwLrb9n+xOhpSyC/YyC6g9/09 HWfTEAO60K1qHCHMkKSBCpdpxNAcbNe0uMh/6nHXSmqrUXcDHGhr3KFo97QAR1VUxAFY0G Cion30o3YC0gvDC1ELvEwcXSqnTfhqCGQLlkJiXCsH+Cd7gwHU+8kzXsRCThsNbdeCe47N 4nihIANib35ULUK3Dmm376hyDze8tIxzxQmCwiVMB8nGu0lsLS7ns4bIqBDKNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740356431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXMGKQQI6/shVrG3IQTJepsj1UcpAkS+IFy+1mROvF0=; b=Zlwl/T+cfwXaIiM0O/zbxQp+LKGKN1NNkrpK/Y9cUYF3CpOG9NHeGKc6SGza4Wh9fzF+Pc BG9uDrgoddN1gCKVV9IH/n8cmMpKu0EOaCqieZNKqAJNd7kSuFfuWNCCmRT0m/bi/dxE36 CW4suPyeTQ5pYsCdkIcZcw42MVsr1eivz0eTeB6/KbB8TEl5nzaVziaIAmZUt7eqgLqdn/ 0tpVkMohIteVMv9/UgRZhQxkzxMzITKmV2LmUz54cvF0AMOJOu5l68yRgsDCJUVbJb0ae6 i4dMvJyy5ApaXWK0cEl1J4kF5sP30LtrnsadZ9D3PqNGkaOCU7R2uVkGW7/beQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1Lwv4C4Cz2Xb; Mon, 24 Feb 2025 00:20:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51O0KVXK074752; Mon, 24 Feb 2025 00:20:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51O0KVO1074749; Mon, 24 Feb 2025 00:20:31 GMT (envelope-from git) Date: Mon, 24 Feb 2025 00:20:31 GMT Message-Id: <202502240020.51O0KVO1074749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ravi Pokala Subject: git: 8d079c6a9a5d - main - if_infininband: Support BPF write for broadcast frames List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d079c6a9a5dfdc75adaf9bc31f2ee8111b849a1 Auto-Submitted: auto-generated The branch main has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=8d079c6a9a5dfdc75adaf9bc31f2ee8111b849a1 commit 8d079c6a9a5dfdc75adaf9bc31f2ee8111b849a1 Author: Nicholas Dance AuthorDate: 2025-02-05 23:33:20 +0000 Commit: Ravi Pokala CommitDate: 2025-02-24 00:13:09 +0000 if_infininband: Support BPF write for broadcast frames To support DHCP for IPoIB links, DHCP clients and servers require the ability to transmit link-layer broadcasts on the IB interfaces. BPF provides the mechanism for doing this. This change updates the if_infiniband driver to be capable of accepting link-layer broadcast requests via BPF using Ethernet formatted frames (the driver currently registers with BPF as DLT_EN10MB). Only Broadcast frames can reliably be interpreted using the Ethernet header format so detect unicast and multicast frames are rejected if passed in using the Ethernet format. This doesn't impact the ability to support native unicast, broadcast or multicast frames if native infiniband header support is added to BPF at a later date. Further the above, this commit also addresses an issue in the existing code that can result in separation of part of the packet header from the rest of the payload if a BPF write was attempted. This was caused by mbuf preallocation of the infiniband header length regardless of length of the prepend data. Reviewed by: rpokala; Greg Foster Tested by: Greg Foster MFC after: 1 week Sponsored by: Vdura Pull Request: https://github.com/freebsd/freebsd-src/pull/1591 --- sys/net/if_infiniband.c | 57 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/sys/net/if_infiniband.c b/sys/net/if_infiniband.c index 7f0bb02f1687..94492421d962 100644 --- a/sys/net/if_infiniband.c +++ b/sys/net/if_infiniband.c @@ -149,6 +149,43 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb) mb->m_pkthdr.len += sizeof(*ibh); } +/* + * For clients using BPF to send broadcasts. + * + * This driver binds to BPF as an EN10MB (Ethernet) device type. As such, it is + * expected BPF and BPF users will send frames with Ethernet headers, which + * we'll do our best to handle. We can't resolve non-native unicast or multicast + * link-layer addresses, but we can handle broadcast frames. + * + * phlen is populated with IB header size if ibh was populated, 0 otherwise. + */ +static int +infiniband_resolve_bpf(struct ifnet *ifp, const struct sockaddr *dst, + struct mbuf *mb, const struct route *ro, struct infiniband_header *ibh, + int *phlen) +{ + struct ether_header *eh = (struct ether_header *)ro->ro_prepend; + /* If the prepend data & address length don't have the signature of a frame + * forwarded by BPF, allow frame to passthrough. */ + if (((ro->ro_flags & RT_HAS_HEADER) == 0) || + (ro->ro_plen != ETHER_HDR_LEN)) { + *phlen = 0; + return (0); + } + + /* Looks like this frame is from BPF. Handle broadcasts, reject otherwise */ + if (!ETHER_IS_BROADCAST(eh->ether_dhost)) + return (EOPNOTSUPP); + + memcpy(ibh->ib_hwaddr, ifp->if_broadcastaddr, sizeof(ibh->ib_hwaddr)); + ibh->ib_protocol = eh->ether_type; + mb->m_flags &= ~M_MCAST; + mb->m_flags |= M_BCAST; + + *phlen = INFINIBAND_HDR_LEN; + return (0); +} + static void update_mbuf_csumflags(struct mbuf *src, struct mbuf *dst) { @@ -306,7 +343,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, struct llentry *lle = NULL; struct infiniband_header *ih; int error = 0; - int hlen; /* link layer header length */ + int hlen = 0; /* link layer header length */ uint32_t pflags; bool addref; @@ -316,10 +353,20 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, phdr = NULL; pflags = 0; if (ro != NULL) { - /* XXX BPF uses ro_prepend */ + /* XXX BPF and ARP use ro_prepend */ if (ro->ro_prepend != NULL) { - phdr = ro->ro_prepend; - hlen = ro->ro_plen; + ih = (struct infiniband_header *)linkhdr; + /* Assess whether frame is from BPF and handle */ + error = infiniband_resolve_bpf(ifp, dst, m, ro, ih, &hlen); + if (error != 0) + goto bad; + + if (hlen != 0) { + phdr = linkhdr; + } else { + phdr = ro->ro_prepend; + hlen = ro->ro_plen; + } } else if (!(m->m_flags & (M_BCAST | M_MCAST))) { if ((ro->ro_flags & RT_LLE_CACHE) != 0) { lle = ro->ro_lle; @@ -386,7 +433,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, * Add local infiniband header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, INFINIBAND_HDR_LEN, M_NOWAIT); + M_PREPEND(m, hlen, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; From nobody Mon Feb 24 00:59:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1MpR0mX3z5pLvR; Mon, 24 Feb 2025 00:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1MpQ1lnHz3tqh; Mon, 24 Feb 2025 00:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740358798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A7EXkDX434IgwKV+3LSQkI7Dih85/+MYXGgcwDXOHyQ=; b=iaeHCU4Mb56/Ogl+1hmEegEvMexBauN1noLR4K7aSjy+espMPv/gNMhZlGAu3KOaoeuyjX M70xddw9tU8oDdZRABRsHUtWj29+dv+bI03nnyeXFa7Txpa4AI15fFT6gSD2SMfzDgVgyx oC87RjnwByimSVLtnu+ml41cyjeAyDpZ2CclthWYJhB4wYnenydhbjwpkYV1vvc1vGTh9k TzzDlFeobw9qT1RXZhx37TDIv01ggPhL2HbRZOzJKkzChRkf5jyCeFiJGtXN7DnZNcgbVg zs7wQFXM0Pq40YEsWzLamnSJMIm8W4dJc+XQ8nZwxmqU/4UGZPD3tRhZ5k6LTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740358798; a=rsa-sha256; cv=none; b=iF//IGWWSoObLzYVHf4/PIYe42davEcQfI4YWZOiIGB+r9vHZxOJ3ZGItHGQcH5bKYGDTc YgAW++oPiyLUl6fzpRUpFECqN71iKeKzVw/7hBFVtKL5VsjNnXEpk9qiuKy06I1aWz/LKH +3k5fTyRxN8oNObyywDBu5hkGkmbnddsCkHzSj8aT99aVqkJB63eZ/Jgz1dufM4l4/w7mf vbFIaVw3CneI3dJzDaUWS65eZsLAmMFVHkVs6N2qoDWr+k6wnghV/Jyj1lxqVHPNLueECB oHnth9YP70kQ0N1hnvtx7ZHycUoxpJoKyyegmNIDtkYslYV4HqZ60ieFd6A+8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740358798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A7EXkDX434IgwKV+3LSQkI7Dih85/+MYXGgcwDXOHyQ=; b=nMFHpWGGXgDqNPrbNvEll0KhAX/yQW6JfU1I15zlzQ8lz6iNQ6hydJpvzczx2qu6YyLXAJ /2YZnuZ9R15aN9VR2OTVUKlO2aaK2I/dWlBJ9l9GTSAVe1AnU3A7nahYoAZS4ayNsC41aC G1aFo642hfoS6so7XXhsMb238Q5DfncE6vMWOYknRTsxijRN3mJzLKmII9sb/ziZf0c++z DCgGt20YUMYEPwy4M6+kM+Svb0NcVTO9LV3BlV7kiBYXX5ZC758KSaYYTOB4tU8NvhPCtP 7dy/ECK0y8pB3EINQzpL0AxtgKUl5phR1n8A6Xskqcf8VgxDu4Fao815MlJNiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1MpQ0tkrz36R; Mon, 24 Feb 2025 00:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51O0xvwG039760; Mon, 24 Feb 2025 00:59:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51O0xvPY039757; Mon, 24 Feb 2025 00:59:57 GMT (envelope-from git) Date: Mon, 24 Feb 2025 00:59:57 GMT Message-Id: <202502240059.51O0xvPY039757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c66308d7bcc3 - main - usbconfig: add -l option to dump_device_desc for single line output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c66308d7bcc3931b60a096bfe6ba0f50105e77de Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c66308d7bcc3931b60a096bfe6ba0f50105e77de commit c66308d7bcc3931b60a096bfe6ba0f50105e77de Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 22:53:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 00:59:06 +0000 usbconfig: add -l option to dump_device_desc for single line output Like pciconf -l add a -l to dump_device_desc for usbconfig which will fold most fields into a single line. We do filter out some we think will not be interesting in this case. While mangling with string output in ways not always anticipated when the program was initially written this should help to parse the available devices for programs like fwget(8). While I had this in mind for other bits for a while I got prompted by D48678 to finally do it. Sponsored by: The FreebSD Foundation MFC after: 3 days Reviewed by: bapt (LGTM), ziaee (man) Differential Revision: https://reviews.freebsd.org/D48974 --- usr.sbin/usbconfig/dump.c | 145 +++++++++++++++++++++++++++++++++++------ usr.sbin/usbconfig/dump.h | 5 +- usr.sbin/usbconfig/usbconfig.8 | 6 +- usr.sbin/usbconfig/usbconfig.c | 20 ++++-- 4 files changed, 148 insertions(+), 28 deletions(-) diff --git a/usr.sbin/usbconfig/dump.c b/usr.sbin/usbconfig/dump.c index 36f026bfc2fb..2a4a5300efeb 100644 --- a/usr.sbin/usbconfig/dump.c +++ b/usr.sbin/usbconfig/dump.c @@ -3,6 +3,10 @@ * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 2024 Baptiste Daroussin + * Copyright (c) 2025 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,22 +32,32 @@ #include +#include #include #include #include +#include #include #include #include #include #include +#include #include #include +#include + #include "dump.h" #include "pathnames.h" +#ifndef IOUSB +#define IOUSB(a) a +#endif + #define DUMP0(n,type,field,...) dump_field(pdev, " ", #field, n->field); +#define DUMP0L(n,type,field,...) dump_fieldl(pdev, " ", #field, n->field); #define DUMP1(n,type,field,...) dump_field(pdev, " ", #field, n->field); #define DUMP2(n,type,field,...) dump_field(pdev, " ", #field, n->field); #define DUMP3(n,type,field,...) dump_field(pdev, " ", #field, n->field); @@ -113,11 +127,21 @@ dump_power_mode(uint8_t value) } static void -dump_field(struct libusb20_device *pdev, const char *plevel, - const char *field, uint32_t value) +_dump_field(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value, bool list_mode) { uint8_t temp_string[256]; + if (list_mode) { + /* Skip fields we are not interested in. */ + if (strcmp(field, "bLength") == 0 || + strcmp(field, "bDescriptorType") == 0 || + strcmp(field, "bMaxPacketSize0") == 0) + return; + + printf("%s=%#06x ", field, value); + return; + } printf("%s%s = 0x%04x ", plevel, field, value); if (strlen(plevel) == 8) { @@ -257,6 +281,20 @@ dump_field(struct libusb20_device *pdev, const char *plevel, printf("\n"); } +static void +dump_field(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value) +{ + _dump_field(pdev, plevel, field, value, false); +} + +static void +dump_fieldl(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value) +{ + _dump_field(pdev, plevel, field, value, true); +} + static void dump_extra(struct libusb20_me_struct *str, const char *plevel) { @@ -396,16 +434,34 @@ load_vendors(void) return (usb_vendors); } +enum _device_descr_list_type { + _DEVICE_DESCR_LIST_TYPE_DEFAULT = 0, + _DEVICE_DESCR_LIST_TYPE_UGEN = 1, + _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR = 2, +}; + static char * -_device_desc(struct libusb20_device *pdev) +_device_desc(struct libusb20_device *pdev, + enum _device_descr_list_type list_type) { static struct usb_vendors *usb_vendors = NULL; char *desc = NULL; const char *vendor = NULL, *product = NULL; - uint16_t vid = libusb20_dev_get_device_desc(pdev)->idVendor; - uint16_t pid = libusb20_dev_get_device_desc(pdev)->idProduct; + uint16_t vid; + uint16_t pid; struct usb_vendor_info *vi; struct usb_product_info *pi; + struct usb_device_info devinfo; + + if (list_type == _DEVICE_DESCR_LIST_TYPE_UGEN) { + asprintf(&desc, "ugen%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + return (desc); + } + + vid = libusb20_dev_get_device_desc(pdev)->idVendor; + pid = libusb20_dev_get_device_desc(pdev)->idProduct; if (usb_vendors == NULL) usb_vendors = load_vendors(); @@ -424,6 +480,44 @@ _device_desc(struct libusb20_device *pdev) } } } + + /* + * Try to gather the information; libusb2 unfortunately seems to + * only build an entire string but not save vendor/product individually. + */ + if (vendor == NULL || product == NULL) { + char buf[64]; + int f; + + snprintf(buf, sizeof(buf), "/dev/" USB_GENERIC_NAME "%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + + f = open(buf, O_RDWR); + if (f < 0) + goto skip_vp_recovery; + + if (ioctl(f, IOUSB(USB_GET_DEVICEINFO), &devinfo)) + goto skip_vp_recovery; + + + if (vendor == NULL) + vendor = devinfo.udi_vendor; + if (product == NULL) + product = devinfo.udi_product; + +skip_vp_recovery: + if (f >= 0) + close(f); + } + + if (list_type == _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR) { + asprintf(&desc, "vendor='%s' product='%s'", + (vendor != NULL) ? vendor : "", + (product != NULL) ? product : ""); + return (desc); + } + if (vendor == NULL || product == NULL) return (NULL); @@ -433,12 +527,12 @@ _device_desc(struct libusb20_device *pdev) product, vendor, libusb20_dev_get_bus_number(pdev)); - return (desc); } void -dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) +dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv, + bool list_mode) { char buf[128]; uint8_t n; @@ -447,18 +541,22 @@ dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) usage = libusb20_dev_get_power_usage(pdev); - desc = _device_desc(pdev); - - printf("%s, cfg=%u md=%s spd=%s pwr=%s (%umA)\n", - desc ? desc : libusb20_dev_get_desc(pdev), - libusb20_dev_get_config_index(pdev), - dump_mode(libusb20_dev_get_mode(pdev)), - dump_speed(libusb20_dev_get_speed(pdev)), - dump_power_mode(libusb20_dev_get_power_mode(pdev)), - usage); + desc = _device_desc(pdev, (list_mode) ? _DEVICE_DESCR_LIST_TYPE_UGEN : + _DEVICE_DESCR_LIST_TYPE_DEFAULT); + + if (list_mode) + printf("%s: ", desc); + else + printf("%s, cfg=%u md=%s spd=%s pwr=%s (%umA)\n", + desc ? desc : libusb20_dev_get_desc(pdev), + libusb20_dev_get_config_index(pdev), + dump_mode(libusb20_dev_get_mode(pdev)), + dump_speed(libusb20_dev_get_speed(pdev)), + dump_power_mode(libusb20_dev_get_power_mode(pdev)), + usage); free(desc); - if (!show_ifdrv) + if (list_mode || !show_ifdrv) return; for (n = 0; n != 255; n++) { @@ -531,12 +629,21 @@ dump_be_dev_quirks(struct libusb20_backend *pbe) } void -dump_device_desc(struct libusb20_device *pdev) +dump_device_desc(struct libusb20_device *pdev, bool list_mode) { struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; ddesc = libusb20_dev_get_device_desc(pdev); - LIBUSB20_DEVICE_DESC(DUMP0, ddesc); + if (list_mode) { + char *desc; + + LIBUSB20_DEVICE_DESC(DUMP0L, ddesc); + desc = _device_desc(pdev, _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR); + printf("%s\n", (desc != NULL) ? desc : ""); + free(desc); + } else { + LIBUSB20_DEVICE_DESC(DUMP0, ddesc); + } } void diff --git a/usr.sbin/usbconfig/dump.h b/usr.sbin/usbconfig/dump.h index 71adb47262ea..6adc8e54e5a9 100644 --- a/usr.sbin/usbconfig/dump.h +++ b/usr.sbin/usbconfig/dump.h @@ -32,10 +32,11 @@ const char *dump_mode(uint8_t value); const char *dump_speed(uint8_t value); const char *dump_power_mode(uint8_t value); void dump_string_by_index(struct libusb20_device *pdev, uint8_t index); -void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv); +void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv, + bool list_mode); void dump_be_quirk_names(struct libusb20_backend *pbe); void dump_be_dev_quirks(struct libusb20_backend *pbe); -void dump_device_desc(struct libusb20_device *pdev); +void dump_device_desc(struct libusb20_device *pdev, bool list_mode); void dump_device_stats(struct libusb20_device *pdev); void dump_config(struct libusb20_device *pdev, uint8_t all_cfg); diff --git a/usr.sbin/usbconfig/usbconfig.8 b/usr.sbin/usbconfig/usbconfig.8 index 3926b03747e5..511fa9c5dddb 100644 --- a/usr.sbin/usbconfig/usbconfig.8 +++ b/usr.sbin/usbconfig/usbconfig.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2022 +.Dd February 12, 2025 .Dt USBCONFIG 8 .Os .Sh NAME @@ -30,6 +30,7 @@ .Nd configure the USB subsystem .Sh SYNOPSIS .Nm +.Op Fl l .Op Fl v .Op Fl a Ar addr .Op Fl i Ar interface_index @@ -40,6 +41,7 @@ .Sm off .Oo Oo Cm /dev/ Oc Cm ugen Oc Ar unit Cm \&. Ar addr .Sm on +.Op Fl l .Op Fl v .Op Fl i Ar interface_index .Op Ar cmds ... @@ -70,6 +72,8 @@ Show help and available commands. Specify interface index as indicated by the command description. If this argument is not specified a value of zero will be used for the interface index. +.It Fl l Cm dump_device_desc +Show numeral only key=value output as one long line. .It Fl u Ar unit Limit device range to USB devices connected to the given USBUS unit. .It Fl v diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c index e28f8de9f75c..7cab4a1354b1 100644 --- a/usr.sbin/usbconfig/usbconfig.c +++ b/usr.sbin/usbconfig/usbconfig.c @@ -25,6 +25,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -91,6 +92,7 @@ struct options { uint8_t got_dump_string:1; uint8_t got_do_request:1; uint8_t got_detach_kernel_driver:1; + uint8_t opt_dump_in_list_mode:1; }; struct token { @@ -504,11 +506,13 @@ flush_command(struct libusb20_backend *pbe, struct options *opt) if (opt->got_list || dump_any) { dump_device_info(pdev, - opt->got_show_iface_driver); + opt->got_show_iface_driver, + opt->opt_dump_in_list_mode && opt->got_dump_device_desc); } if (opt->got_dump_device_desc) { - printf("\n"); - dump_device_desc(pdev); + if (!opt->opt_dump_in_list_mode) + printf("\n"); + dump_device_desc(pdev, opt->opt_dump_in_list_mode); } if (opt->got_dump_all_config) { printf("\n"); @@ -518,14 +522,14 @@ flush_command(struct libusb20_backend *pbe, struct options *opt) dump_config(pdev, 0); } else if (opt->got_dump_all_desc) { printf("\n"); - dump_device_desc(pdev); + dump_device_desc(pdev, false); dump_config(pdev, 1); } if (opt->got_dump_stats) { printf("\n"); dump_device_stats(pdev); } - if (dump_any) { + if (dump_any && !opt->opt_dump_in_list_mode) { printf("\n"); } if (libusb20_dev_close(pdev)) { @@ -559,7 +563,7 @@ main(int argc, char **argv) if (pbe == NULL) err(1, "could not access USB backend\n"); - while ((ch = getopt(argc, argv, "a:d:hi:u:v")) != -1) { + while ((ch = getopt(argc, argv, "a:d:hi:lu:v")) != -1) { switch (ch) { case 'a': opt->addr = num_id(optarg, "addr"); @@ -596,6 +600,10 @@ main(int argc, char **argv) opt->iface = num_id(optarg, "iface"); break; + case 'l': + opt->opt_dump_in_list_mode = 1; + break; + case 'u': opt->bus = num_id(optarg, "busnum"); opt->got_bus = 1; From nobody Mon Feb 24 03:08:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1QfS1y73z5pYKX; Mon, 24 Feb 2025 03:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1QfR3TNHz480x; Mon, 24 Feb 2025 03:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ye7W6xnVfFY7d4kzZn1GLydSeyIFcXVkert3FhkSTBo=; b=E2Fgbg0dJiLLqTaCOl7N/by+/EgG2WKc++ZqEYpFEcZjC11mOZ/e3y7b/27eh+ITKwD/Y2 5+TyZ5c5gPCHpd6SDQbb5KdOeGyrQRS091Gh+a6RRkauh/pIuL6TqWMhcAV6oGfmo7l8Xu OdXdseTgUzltYc8Bp9PvGZszJYrmFLPjOgCjrBbb7Qg6Y6+UTHz6aMcelnBc3ud0mYFxJ5 V5gbq5LXS0XW0FJ6p3qrMiWDstvNVyCBmuUUjxSnipB6UzyxNRLR894G7G5aHT9/QQG1bq RceEPn23umhvISwsHJJM1saSsAPcMZvNfC5Vdgp1ezawibW/pwcXFlIOK1anCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740366495; a=rsa-sha256; cv=none; b=T/dcK5p/+f233sjRp0Rh5/GOPA+9weLG248O3CqinMNUwjZquIEDmvqc6GJACM6/tIK7D9 z5Qj6ukBsSqHYICmld+3eztfmuQSrG1imyzad10gksvqB50K9RZz5WlWUDusC/zKGpalog Rfhk4hYrQda9ikMsybIlMBrj3d6E5kRgPd1nfDBVF/0Ez2w6FjtyCaU3YL2jEcYkym1tdL 6QHGdzqlf3rO08bS3ew/MnUFeqUvPDFbu2hnScXVk8MW+Y/yxFYMPC8sDC1JdWkPM8IPc6 Wc0d7rG04Z67bP/2lYpv0AUAAPbrXPXhscYjaf0uBYSlD95kP4YcKg0t2ZQIQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ye7W6xnVfFY7d4kzZn1GLydSeyIFcXVkert3FhkSTBo=; b=rnDj3i7TpaetQBFCtC0atv+YNYeZ4mGP0YPybzNu36my84l6g4onRWdONw39aPH2h2hOBh +UQwZdhbF6gM/63e5TytWimxBnwvbfPvevC2GF24wnG5ijm7FZp6AuepkCAqQwadj3BvqZ usXqKSvNZZFoW5bXKNRShlJ6m2p0LjY9k/iFizLAuhGOo9k1fT9VTfXlyVb9aohv7nMvcr khxXg9FqfjAxGeSiDVmtAVBLFxsKLL1i9+acB54/6i0W55rxe5vPmeELeO8RyOUtsfJZFE UFH0MsbQkNq7or8POu0fLGMOjfSM6KEiLtzHamJ92vtDIKHsgtqdSxiSA4UBJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1QfR2sGBz74F; Mon, 24 Feb 2025 03:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51O38F8M083229; Mon, 24 Feb 2025 03:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51O38Fk3083226; Mon, 24 Feb 2025 03:08:15 GMT (envelope-from git) Date: Mon, 24 Feb 2025 03:08:15 GMT Message-Id: <202502240308.51O38Fk3083226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f9c7a07d7f5e - main - LinuxKPI: 802.11: synchronize LinuxKPI 802.11 sta from net80211 ni List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9c7a07d7f5e1c3694b463423c43051451b61e87 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f9c7a07d7f5e1c3694b463423c43051451b61e87 commit f9c7a07d7f5e1c3694b463423c43051451b61e87 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 01:32:22 +0000 LinuxKPI: 802.11: synchronize LinuxKPI 802.11 sta from net80211 ni Have a wrapper function dealing with the synchronization for all the dfferent standards (HT and VHT currently). In case HT or VHT is not supported make sure to turn the LinuxKPI "supported" flag off for that. Previously if it was on once it would never be turned off. For HT and VHT properly compute the NSS and also set the max_amsdu_len correctly. Set the NSS directly in the function (which is called in proper order for this) rather than passing the results back and do the setting in the caller. The only thing we need to make sure upfront is that it remains at least 1 (see f5a58c2da239). This all makes the caller and code a tiny bit simpler and work better. There is more synchronization to be done between the chanctx and the deflink bandwidth, which needs to happen dynamically in case net80211 decides to change that under us but no native driver seems to properly implement this (if at all). HT20-only, HT40, and VHT80 are supposed to work for now at least. VHT160 and VHT80P80 have further debug work to do as it does not yet seem to be consistently set in all cases to sync from. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 133 +++++++++++++++++++-------- 1 file changed, 96 insertions(+), 37 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 8daa2fa4dc8e..b53d8eaa7925 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -367,19 +367,17 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) #if defined(LKPI_80211_HT) static void -lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *ht_rx_nss) +lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) { struct ieee80211vap *vap; uint8_t *ie; struct ieee80211_ht_cap *htcap; int i, rx_nss; - if ((ni->ni_flags & IEEE80211_NODE_HT) == 0) + if ((ni->ni_flags & IEEE80211_NODE_HT) == 0) { + sta->deflink.ht_cap.ht_supported = false; return; - - if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && - IEEE80211_IS_CHAN_HT40(ni->ni_chan)) - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + } sta->deflink.ht_cap.ht_supported = true; @@ -401,43 +399,116 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, i sta->deflink.ht_cap.cap = htcap->cap_info; sta->deflink.ht_cap.mcs = htcap->mcs; + if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0) + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + + /* + * 802.11n-2009 20.6 Parameters for HT MCSs gives the mandatory/ + * optional MCS for Nss=1..4. We need to check the first four + * MCS sets from the Rx MCS Bitmask; then there is MCS 32 and + * MCS33.. is UEQM. + */ rx_nss = 0; - for (i = 0; i < nitems(htcap->mcs.rx_mask); i++) { + for (i = 0; i < 4; i++) { if (htcap->mcs.rx_mask[i]) rx_nss++; } - if (ht_rx_nss != NULL) - *ht_rx_nss = rx_nss; + if (rx_nss > 0) + sta->deflink.rx_nss = rx_nss; - IMPROVE("sta->wme, sta->deflink.agg.max*"); + IMPROVE("sta->wme"); + + if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_7935; + else + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_3839; + sta->deflink.agg.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA; +#ifdef __handled_by_driver__ /* iwlwifi only? actually unused? */ + for (i = 0; i < nitems(sta.deflink.agg.max_tid_amsdu_len); i++) { + sta->deflink.agg.max_tid_amsdu_len[j] = ; + } +#endif } #endif #if defined(LKPI_80211_VHT) static void -lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *vht_rx_nss) +lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) { + uint32_t width; + int rx_nss; + uint16_t rx_mcs_map; + uint8_t mcs; - if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) + if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) { + sta->deflink.vht_cap.vht_supported = false; return; + } - if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { -#ifdef __notyet__ - if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; /* XXX? */ - } else + sta->deflink.vht_cap.vht_supported = true; + + sta->deflink.vht_cap.cap = ni->ni_vhtcap; + sta->deflink.vht_cap.vht_mcs = ni->ni_vht_mcsinfo; + + width = (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); + switch (width) { +#if 0 + case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ: + case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ: + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; + break; #endif - if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + default: + /* Check if we do support 160Mhz somehow after all. */ +#if 0 + if ((sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) != 0) sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; - else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + else +#endif sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; } - IMPROVE("VHT sync ni to sta"); - return; + + rx_nss = 0; + rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; + for (int i = 7; i >= 0; i--) { + mcs = rx_mcs_map >> (2 * i); + mcs &= 0x3; + if (mcs != IEEE80211_VHT_MCS_NOT_SUPPORTED) { + rx_nss = i + 1; + break; + } + } + if (rx_nss > 0) + sta->deflink.rx_nss = rx_nss; + + switch (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK) { + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_11454; + break; + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_7991; + break; + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895: + default: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_3895; + break; + } } #endif +static void +lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) +{ + +#if defined(LKPI_80211_HT) + lkpi_sta_sync_ht_from_ni(sta, ni); +#endif +#if defined(LKPI_80211_VHT) + lkpi_sta_sync_vht_from_ni(sta, ni); +#endif +} + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -480,8 +551,6 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], struct ieee80211_vif *vif; struct ieee80211_sta *sta; int band, i, tid; - int ht_rx_nss; - int vht_rx_nss; lsta = malloc(sizeof(*lsta) + hw->sta_data_size, M_LKPI80211, M_NOWAIT | M_ZERO); @@ -581,18 +650,9 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; sta->deflink.rx_nss = 1; - ht_rx_nss = 0; -#if defined(LKPI_80211_HT) - lkpi_sta_sync_ht_from_ni(sta, ni, &ht_rx_nss); -#endif - vht_rx_nss = 0; -#if defined(LKPI_80211_VHT) - lkpi_sta_sync_vht_from_ni(sta, ni, &vht_rx_nss); -#endif + lkpi_sta_sync_from_ni(sta, ni); - sta->deflink.rx_nss = MAX(ht_rx_nss, sta->deflink.rx_nss); - sta->deflink.rx_nss = MAX(vht_rx_nss, sta->deflink.rx_nss); - IMPROVE("he, ... smps_mode, .."); + IMPROVE("he, eht, bw_320, ... smps_mode, .."); /* Link configuration. */ IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); @@ -2531,10 +2591,9 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IMPROVE("net80211 does not consider node authorized"); } -#if defined(LKPI_80211_HT) + sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss); IMPROVE("Is this the right spot, has net80211 done all updates already?"); - lkpi_sta_sync_ht_from_ni(sta, ni, NULL); -#endif + lkpi_sta_sync_from_ni(sta, ni); /* Update sta_state (ASSOC to AUTHORIZED). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); From nobody Mon Feb 24 03:08:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1QfS6ZQLz5pY1w; Mon, 24 Feb 2025 03:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1QfS4z61z47sC; Mon, 24 Feb 2025 03:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BbwPSKS0hp6B9UdBmFdfa6A2QiWfcKhMCf+hzaEQBig=; b=kePAMRmampgoLocsCkM+VUm/G1wxMpeKmp6A9E7XqZE733IIvNS8rQnt2KZODiM62bX/wN CZS88FUPFRDgQMSgRWjkiLs8jt5uG1/qS0PCjiNA8Nv3pRTkZCF17THw7hyeiutf+sOVeA IJGfMK505lLJqHaE2N13eLlp1CV/9iIu0wnn+wgntnc+HuryK8gvJUGy979cN+IC6dvONP qF0LY6qX5NBG+yDzrC4tWT6SNI7Y0PAaiso3K1l/MjleuqLmwMjUqsQrsGFL/Z/j465BAg bSM5j96/MFdnp5oLxPQq3KFgZ1mbaVAHq7odFLnvb891j855wt+BaBwpDgMjGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740366496; a=rsa-sha256; cv=none; b=JnkaTs9a1aE8U50tr2OlLdWJi0b+IgCFidfZSrs6GlMoJJ42axwrIA794TfRv8E3UFFRnA DqIXjzxeIwnNnoovm6Z14YUNhDaPCrNBgR26/iELWKEhD9ugi7zyAJc91ikptdsciDVw2e n90qp3BOb7q09G3c+FlceGJOtmR+4O1mkxyHw5OQL0qS4FOz7hufIWDoBpQiXti3EyJjdE GzQoxH19qm3S4/lJDgEUlVPsBcBxPG14BPPIfR/pviNPvOVfHjyk/ZLy5Nqjrmw8k/EObS qajfHDNpvqFp7iu+ZgGqUVaPGNe6YtRA/F64St6cFJ5/QUFFhYyNGZi6DtA/0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BbwPSKS0hp6B9UdBmFdfa6A2QiWfcKhMCf+hzaEQBig=; b=d64aQbB4KdPOyzFYolIJwYGarLTCGMdHaTSKBwcjVQXR4iHmRo9tDKgA7du6kEZHgowvAT a74YA394I/4NRZYs3qESyraLOBLnzMuLKggEpqQyEaiuklwC6ayTvc1z6lgXvIWKh7iebd mWWbz40qLVcMa0r/1jYSHzIriaXsMkK4if6Jb2qeP8N20JSqmHeMsduHVzG71FY6PzUH53 0M47Z1HlWzpRkau77GQ767M+o2dxmUNjrXtibWirPnfMjyNRrEPLveUFk0bphUDqfa0sqn 1uVnHzB0pEwVvSoBlQohgXw3tjeBCIu+umevNT8tHHDeSnsohGdziBXEUcVYWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1QfS45rCz70n; Mon, 24 Feb 2025 03:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51O38GUc083270; Mon, 24 Feb 2025 03:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51O38GS6083267; Mon, 24 Feb 2025 03:08:16 GMT (envelope-from git) Date: Mon, 24 Feb 2025 03:08:16 GMT Message-Id: <202502240308.51O38GS6083267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 90d8e307ff61 - main - LinuxKPI: 802.11: cleanup chanctx freq/width settings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90d8e307ff610f20dccffe038353affbad0c374e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=90d8e307ff610f20dccffe038353affbad0c374e commit 90d8e307ff610f20dccffe038353affbad0c374e Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 01:42:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 01:42:31 +0000 LinuxKPI: 802.11: cleanup chanctx freq/width settings Cleanup chanctx freq1/2 and width settings using the channel from the net80211 node and the net80211 functions to return the center frequencies (already doing the math for us or using pre-computed values). Set the min_def (minimum channel definition) to def (channel definition) for the moment as it seems to be unused by anything but iwl_mvm_chanctx_def() to avoid complications. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 43 +++++++++++++--------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b53d8eaa7925..6d6d14e06a57 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1732,39 +1732,45 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; chanctx_conf->def.chan = chan; chanctx_conf->def.width = NL80211_CHAN_WIDTH_20_NOHT; - chanctx_conf->def.center_freq1 = chan->center_freq; - chanctx_conf->def.center_freq2 = 0; + chanctx_conf->def.center_freq1 = ieee80211_get_channel_center_freq1(ni->ni_chan); + chanctx_conf->def.center_freq2 = ieee80211_get_channel_center_freq2(ni->ni_chan); IMPROVE("Check vht_cap from band not just chan?"); KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC, ("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan)); #ifdef LKPI_80211_HT if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_40; - } else + else chanctx_conf->def.width = NL80211_CHAN_WIDTH_20; } #endif #ifdef LKPI_80211_VHT if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { #ifdef __notyet__ - if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_80P80; - chanctx_conf->def.center_freq2 = 0; /* XXX */ - } else -#endif - if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + else if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_160; - else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + else +#endif + if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; } #endif /* Responder ... */ - chanctx_conf->min_def.chan = chan; +#if 0 + chanctx_conf->min_def.chan = chanctx_conf->def.chan; chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20_NOHT; - chanctx_conf->min_def.center_freq1 = chan->center_freq; - chanctx_conf->min_def.center_freq2 = 0; - IMPROVE("currently 20_NOHT min_def only"); +#ifdef LKPI_80211_HT + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) || IEEE80211_IS_CHAN_VHT(ni->ni_chan)) + chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20; +#endif + chanctx_conf->min_def.center_freq1 = chanctx_conf->def.center_freq1; + chanctx_conf->min_def.center_freq2 = chanctx_conf->def.center_freq2; +#else + chanctx_conf->min_def = chanctx_conf->def; +#endif /* Set bss info (bss_info_changed). */ bss_changed = 0; @@ -1797,15 +1803,6 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width; vif->bss_conf.chanreq.oper.center_freq1 = chanctx_conf->def.center_freq1; -#ifdef LKPI_80211_HT - if (vif->bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_40) { - /* Note: it is 10 not 20. */ - if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) - vif->bss_conf.chanreq.oper.center_freq1 += 10; - else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) - vif->bss_conf.chanreq.oper.center_freq1 -= 10; - } -#endif vif->bss_conf.chanreq.oper.center_freq2 = chanctx_conf->def.center_freq2; } else { From nobody Mon Feb 24 03:08:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1QfV1cPpz5pYCG; Mon, 24 Feb 2025 03:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1QfT5PdVz47n6; Mon, 24 Feb 2025 03:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j/lHMHgEL5PHL7QasQOgg0Y6WgWWjVRU9iYnKTb1ASA=; b=wzm9/Kdns7GF3n1no8IZ31Y1TkOkMZyupMGIoMVTYLdlBkXR2xZVwMbYGoXfEsfu5+qLuX OuiivcOucZotHugycZJeUkO58yaB1T5WcNTdmZaYw0uJcqvBCHL6qDzWx7Pst8Q0AoDPpS LW1Sy6J8F2lPe1ZT98HpvBSDxOmtO6ufFuEBhb/AeThMge+c8TZ6E12Rqkt46kmCpd/VcY HEku1fR6oOELfEeZNtqqf2Pc7r0F/Ep1EKo0ylPcUvRpIkLH0y5zdkNlR78m0cc9LYF4rD XViOboiR64Izj3bfVoJoCZvsX8iNVeh0a0HItfJLsCbkMrXqrbJ6hGka34L4pQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740366497; a=rsa-sha256; cv=none; b=iVfE6v75tea2cAGFWcWBHrhWs7fmuf0dtc2FMnfKV5Fb/jnrq+KUHT6QtBnuNtDTU9nEhH QP02WtARgGcwyIWR7isixNRXkK2BxDHV5NvV0ER+zC3G6Q2lrxD41p4DZv7ZhKfJA+Uem0 DKeFe0U0q3ZooZSz+IWMxvBTwBE6KTqOHGu4rcgy8HIqymjQoIq7XaJ028Fv8YSUVCb+f3 0vz9fpFvM4HbMe7znqkNwEQkPBRJljL7gYTFTwwNAmOBJyVs74ndmxPHHZWd5dUTGH4qh+ vuQu00oHYqQX4W8StchLhOJrp14fTOQl3+WF1Jkh1feLWusiHEUtrgxjh/wBeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j/lHMHgEL5PHL7QasQOgg0Y6WgWWjVRU9iYnKTb1ASA=; b=M8hWQhY960hhHHEXXpk1tvkunQLP0lRHkZ/G5jJ9eBu1372bt2R67OzVSOL8B/QtTXQgSV mfayC9EhSd6zN/3efBkCsR2nDEdi99pT0I5hBVZiDpFrsnobM4g6q4INH2livgElpOwJdy rJiggPziETRxNvMhpJtqZJ/9xHOptIda681296kaVGg423Ss4Jb/vn7sjGED8mHyxHCnKa KKN2zzzfZlmq69/WUt2aGYIQjtnF/4lk8/zphqJYtUD2Un+OUACelEc+kGZppGijoRPGyN UHDeWdDrSwoU635SCaXRNlaxSZS2XUzHfnXZAIFzEnxRUvHzrP/E1SWm0zhZDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1QfT4mxfz6qw; Mon, 24 Feb 2025 03:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51O38H4n083306; Mon, 24 Feb 2025 03:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51O38HGR083303; Mon, 24 Feb 2025 03:08:17 GMT (envelope-from git) Date: Mon, 24 Feb 2025 03:08:17 GMT Message-Id: <202502240308.51O38HGR083303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ac2c7271b7c2 - main - LinuxKPI: 802.11: disable A-MDPU TX for now for LinuxKPI WiFi drivers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac2c7271b7c2624d7cf3af6bdaf82b00323edfd3 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ac2c7271b7c2624d7cf3af6bdaf82b00323edfd3 commit ac2c7271b7c2624d7cf3af6bdaf82b00323edfd3 Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 02:24:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 02:24:34 +0000 LinuxKPI: 802.11: disable A-MDPU TX for now for LinuxKPI WiFi drivers Clear IEEE80211_FHT_AMPDU_TX from iv_flags_ht to avoid doing A-MPDU TX. For Intel we need to support two different variations at least, both likely needing net80211 surgery first. The good news is that turning it off in net80211 will make it work for modern iwlwifi/mvm chipsets/fw. Realtek will need some mac80211 functions to be implemented at least. Once we've done all and tested one after the other we can remove this again. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 6d6d14e06a57..66c1fa29615a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3529,6 +3529,10 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], if (!lkpi_hwcrypto && ieee80211_hw_check(hw, AMPDU_AGGREGATION)) vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX; #endif +#if defined(LKPI_80211_HT) + /* 20250125-BZ Keep A-MPDU TX cleared until we sorted out AddBA for all drivers. */ + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_TX; +#endif if (hw->max_listen_interval == 0) hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); From nobody Mon Feb 24 03:08:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1QfW2CKJz5pY3y; Mon, 24 Feb 2025 03:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1QfV6zJtz47v6; Mon, 24 Feb 2025 03:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5c7AARLVBBmMZmr2rpNlRXk/hWjYfO74Vq8WVisPcPE=; b=c0FD1xFRxVkIqpj75Sv/eFAYtBD6l0HAQjqprK6r4+rHu7L6Xm7A1YOEPff7IdQZKYf294 wiSeGB6FiyizG6R+ggMSnwCPxq/rVxnI8+G26NFqIDsXRu+DiE36by1pBwhxI0uVamUVAu FA7P9C7/dxNVVirml5g/NyI0KhvHfZvAf7durkRu8VkUgLL/FZrAsccDU569qVaylvhByy /aj3eolSebCEBXEeX7AjonZiSJOg34qvtZsE1ZXT7PqI6uLYGAlt+y1HPrPkYwDhCc9SYz wKIz6k6DDplADxsNIfDbbVSU/m5NqoRFAH1TlGsrOSN6WQeOj8awb1MkH5goTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740366499; a=rsa-sha256; cv=none; b=YvaTEmKvtvtw3aznGokHla0JrVEdO1Fr02trgDRnL7kRzavAMkMDVlMMveECPX5H1+CGu3 bKwMurGNA6HN/4qzcIdYf+iUjPg9bI2RzNW3MUXTIEVGLandfbQLKp3XvYUB83VluZVWgr uMndrLly7NVIvjGTeengDiVXcH+keoGyM8T326prIW7GTjmhmfiCde1Mbk678W3w7I6WFI TsdbCzExo3gQG+Hy82VWC8IcnZIZHr6mc/MEGE+bQ6u3WLLsDoA5uZCNGBJW6d4b0FYMuI gZQWsFhoyA6SRUKl8qxAF9fTJ624ZZQ+McIdWI7VUwtNBAmWfdZU50tjfzFRTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5c7AARLVBBmMZmr2rpNlRXk/hWjYfO74Vq8WVisPcPE=; b=v5GtWc0DXZLQJEjkP3wg8PLlT3HeFzJZSL9jos1Mnt3I5K5ZVAjYrrRTmY3g2QYZI3VewN zD3YuULnQdNg68wF/mHAe64Ee56ecFe0zCT5fbZkJbnvE4+pr/VJbqpo0zhcA8YDVV5Kk3 AVhxjU6yilY+TOeVd83q/kmUaPwvw8KpNfxdJnJRG2osyWIkl38XZmcPNNppgRat6mzagj CAKDGNYFq/vLKzZB085/rdSLwyu1XD3ZQ0wkPY5sengjHd98Qj11mrf5U3nBHNw5nv/7og H1K2i5OKzNY4zeJOpiH2mJ/R23hgBcR7nQH1CdBV4A5EEVdiIb4t9/JkvbIxgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1QfV60xbz74G; Mon, 24 Feb 2025 03:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51O38IRZ083341; Mon, 24 Feb 2025 03:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51O38I5p083338; Mon, 24 Feb 2025 03:08:18 GMT (envelope-from git) Date: Mon, 24 Feb 2025 03:08:18 GMT Message-Id: <202502240308.51O38I5p083338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 389265e3ca82 - main - LinuxKPI: 802.11: factor out dynamic_rx_chains computation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 389265e3ca827ad88b3b8ad787251471161d6634 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=389265e3ca827ad88b3b8ad787251471161d6634 commit 389265e3ca827ad88b3b8ad787251471161d6634 Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 02:43:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 02:56:18 +0000 LinuxKPI: 802.11: factor out dynamic_rx_chains computation For the moment we set dynamic_rx_chains to the rx_nss value which should be correct given we count from 1 there too and we call lkpi_get_max_rx_chains() after we synced ht/vht initially already. Long-term some of these counting bits should be further factored out into their own functions and used both here and for the sync code. This will likely want to change as well once more dyamic synncronization takes place. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 66c1fa29615a..63f6f5a182b5 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -509,6 +509,33 @@ lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) #endif } +static uint8_t +lkpi_get_max_rx_chains(struct ieee80211_node *ni) +{ + uint8_t chains; +#if defined(LKPI_80211_HT) || defined(LKPI_80211_VHT) + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); +#endif + + chains = 1; +#if defined(LKPI_80211_HT) + IMPROVE("We should factor counting MCS/NSS out for sync and here"); + if (sta->deflink.ht_cap.ht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + +#if defined(LKPI_80211_VHT) + if (sta->deflink.vht_cap.vht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + + return (chains); +} + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -1726,8 +1753,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf = &lchanctx->chanctx_conf; } - chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->rx_chains_static = 1; + chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->radar_enabled = (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; chanctx_conf->def.chan = chan; @@ -1758,6 +1785,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; } #endif + chanctx_conf->rx_chains_dynamic = lkpi_get_max_rx_chains(ni); /* Responder ... */ #if 0 chanctx_conf->min_def.chan = chanctx_conf->def.chan; From nobody Mon Feb 24 10:15:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1c731gfdz5nm4n; Mon, 24 Feb 2025 10:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1c7315l0z4567; Mon, 24 Feb 2025 10:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740392111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JxrbieA8xOcm+nZpP++VsqJGrmEq8x7EibXtpT66ts4=; b=FG62gNmPa9o0U+s0pQmx2qn9E4jf585IdChBoPdpkl9GI9dyYXm0H/uh3IT/1y0mV8wCtR /DOw7yI6KSclEeSK2/ZEaNQSJWVSq7MaUxWATkZOLF4Yh8say00oPX/RehR7XeiDLisHzi p9kUkmkXSJCHpebHTTQoc46QCSekwweIb+51ZJ2d7RkMpk8xqRnPXjzA+GuSHggSwdl10E uOi4NxuME+Jn/tv20gq0gwQrinhryBxOyyh5e+mwhdiK1TLR2P/IVs5OB2RbHQ59TIH206 TxnkBnB4hcnUV4Xmo/L/9C+Bwn2Xu8AzJoJl6DOt9ogR11g3xw12RjWYmvJ1jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740392111; a=rsa-sha256; cv=none; b=CRjchlYeWGwsotbE70HVqbpc4QFmxdEEWaHF6mZAZ7CsmsE9YN6ZMzlbXQvmSFPu1Je5St ncKpoI4iBmZi1tcgbotKkfKcc/SLlhh3D0FBSxJISBcKvsEG4ggzuhATTNLkJOjtCC9zD1 kZq1mZiZsLMNJ+LgNFdnebNic3Mfc+VzHtdkXKqiiUtsg5TsVVIwxdIqvLhVEsncBmO5ZT maVffJNr0JgcsTjM6LHyC+478eNjByxPO1oTyLNy7q6LxDrsb15RcAC7aw/0547x7LWQtj 2Wka7UDwyW5fzvak8B6RbTy6V3jXa+am3ZOU3CLO7WQ90/pU/wmPuA7t3OH/0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740392111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JxrbieA8xOcm+nZpP++VsqJGrmEq8x7EibXtpT66ts4=; b=HvOaxzKOA6gC8CSIuZKPaQUH051Qa5Fdmwu2sEYcryn86Qr3COBNNxDtufmVZml7Y11SuL pmgr8xQ/q9VE3hJDLlCNxoW2EUMfanS1qYyAfouYGbF2ESgjo6B040ll+pA7t9Hc1NgNi/ DylfDqq9s5fQM9eS5p1vsdJ5VELakdGzjj1EPrdlIhXyl1pvqyXZwjA6w226VqKR29/hIy PdzG5kM3jUnQxUxBOOgviawT/UDVN/sLKS82+LyFx4/cMMWpSSn2VR9qg0HpxrCpOdLTEg l6j0iUCrqnG7PncNzMyPViUqWqYfXT6hWZunkNvrPVEWJFq8Seu1q9ROfwqIhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1c730fqYzcrl; Mon, 24 Feb 2025 10:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OAFB7p086748; Mon, 24 Feb 2025 10:15:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OAFBOZ086745; Mon, 24 Feb 2025 10:15:11 GMT (envelope-from git) Date: Mon, 24 Feb 2025 10:15:11 GMT Message-Id: <202502241015.51OAFBOZ086745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: a5e380e51cdb - main - netinet: Update a comment for in_localip() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5e380e51cdba64a392846a4eeda000f948f42ce Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a5e380e51cdba64a392846a4eeda000f948f42ce commit a5e380e51cdba64a392846a4eeda000f948f42ce Author: Zhenlei Huang AuthorDate: 2025-02-24 10:14:39 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-24 10:14:39 +0000 netinet: Update a comment for in_localip() The function in_localip() was changed to return bool but the comment was left unchanged. Fixes: c8ee75f2315e Use network epoch to protect local IPv4 addresses hash MFC after: 3 days --- sys/netinet/in.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 7196eabc123e..4c0908937ddc 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -147,7 +147,7 @@ in_localaddr(struct in_addr in) } /* - * Return 1 if an internet address is for the local host and configured + * Return true if an internet address is for the local host and configured * on one of its interfaces. */ bool From nobody Mon Feb 24 14:04:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1jCY1kf9z5pBDW; Mon, 24 Feb 2025 14:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1jCY13ynz46bG; Mon, 24 Feb 2025 14:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740405865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iI9uPKaRWrnWIgd47rZCDSZ1K69/0IkUvP2PbuK/BV4=; b=iwf/hNtsuGUMmuUbXen3MmaTWFZl1gUHXbWEvsaduLhqBUoDVamqnNUhu2xmy4YXSPMROG STgVwjZSt7AfTmyVkEIYcKIJMsaL6Z/k62K148dG5CsNyn/nsAatsxtqdwJHTKfjXP4Esl Qs7CRlu1dp2GDtMgH4QfBNcKaPxSh2L/vIys6gty6awRP4RxNp+aXwlBnUMa4keVNY8Zye 2ZtjgjYmBTGFNDYSrw3sdxyKfeHnExwWF3u63ci9WsrP3IT7ZZ0tLeK4GP2dVzinJhen1l x7z+rVMr1V4z/DUCX5MeCZb3wF1mdTNGV8+VcqRIxS/Q9lj6vccu4BG6sS6z7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740405865; a=rsa-sha256; cv=none; b=KmPAMHuFett3vNXzVn17UmZm3cFJJ5YlbTsRmd2Y54vE2WgyYChCaY3PKCzAynrPb+dXvM SAz6IuGQ2TRLJiT4QtT2Qg30QS//bTSF8lO67mcxVlku6omHszUt4tVDUd7m3JznSBzwgI CehaWkP7NNjGPFYedrcm+LyErutTX5T4zpnmkEECKPINxwwfS5X6+pxuhfW7rItVBvOaBr LpFiQyfHEDup7m1/iuxyr+h31+o0W3qeZu0n9Gxi4AUmp3+7glZlJyt26Hu0FGZPY24Q1k Z4vf92iDP4HwUYDNZm8FurV9LTIkAeI3UvAbV01+yEEdzRju7YdN2oFuX+8tdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740405865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iI9uPKaRWrnWIgd47rZCDSZ1K69/0IkUvP2PbuK/BV4=; b=JosFNhENJHL3wH8mEkhVl7MEbf37Rp8LN6ftZPJsFGisf6Nsbz8djmNQg6tKGQqE7CHLaK 7QWylzC9diPj1r5RPuIbdzL3Q3qq8pXCWfGyINAmeOVlEJIXdGL5d6HlBVbo52QswllvIb NK2v8m8Cv5+orO6zRPJip+4iZXCsYflyO+Dc4KunbRDcpHQLX9zkGYJLfx4sQf/E1S9Jyr AtmuIVf4lld9suvwGtsZYpNDFfgzzLoFU24XhRigmjIvF7U7FVkCr0Zw74AXAmfrct5mFe tBqXbLgqtntnHsV1WF3zee2M3l/9iyARDjXAprIL6pQ3nmzpechuir82gop1dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1jCY0Mhnzjxn; Mon, 24 Feb 2025 14:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OE4OAE014811; Mon, 24 Feb 2025 14:04:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OE4Os9014808; Mon, 24 Feb 2025 14:04:24 GMT (envelope-from git) Date: Mon, 24 Feb 2025 14:04:24 GMT Message-Id: <202502241404.51OE4Os9014808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: a18e99945414 - main - mana: Increase default tx and rx ring size to 1024 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a18e99945414fb1f9d455b780c6fcf2d09cc68d8 Auto-Submitted: auto-generated The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=a18e99945414fb1f9d455b780c6fcf2d09cc68d8 commit a18e99945414fb1f9d455b780c6fcf2d09cc68d8 Author: Wei Hu AuthorDate: 2025-02-24 13:56:06 +0000 Commit: Wei Hu CommitDate: 2025-02-24 13:56:06 +0000 mana: Increase default tx and rx ring size to 1024 Tcp perfomance tests show high number of retries under heave tx traffic. The numbers of queue stops and wakeups also increase. Further analysis suggests the FreeBSD network stack tends to send TSO packets with multiple sg entries, typically ranging from 10 to 16. On mana, every two sgs takes one unit of tx ring. Therefore, adding up one unit for the head, it takes 6 to 9 units of tx ring to send a typical TSO packet. Current default tx ring size is 256, which can get filled up quickly under heavy load. When tx ring is full, the send queue is stopped waiting for the ring space to be freed. This could cause the network stack to drop packets, and lead to tcp retransmissions. Increase the default tx and rx ring size to 1024 units. Also introduce two tuneables allowing users to request tx and rx ring size in loader.conf: hw.mana.rx_req_size hw.mana.tx_req_size When mana is loading, the driver checks these two values and round them up to power of 2. If these two are not set or the request values are out of the allowable range, it sets the default ring size instead. Also change the tx and rx single loop completion budget to 8. Tested by: whu MFC after: 2 weeks Sponsored by: Microsoft --- sys/dev/mana/mana.h | 23 +++++++++-- sys/dev/mana/mana_en.c | 96 +++++++++++++++++++++++++++++++++++++++------- sys/dev/mana/mana_sysctl.c | 16 ++++++++ 3 files changed, 119 insertions(+), 16 deletions(-) diff --git a/sys/dev/mana/mana.h b/sys/dev/mana/mana.h index 906b28eb56b6..a805aa047b9d 100644 --- a/sys/dev/mana/mana.h +++ b/sys/dev/mana/mana.h @@ -106,9 +106,23 @@ enum TRI_STATE { #define DEFAULT_FRAME_SIZE (ADAPTER_MTU_SIZE + 14) #define MAX_FRAME_SIZE 4096 -#define RX_BUFFERS_PER_QUEUE 512 - -#define MAX_SEND_BUFFERS_PER_QUEUE 256 +/* Unit number of RX buffers. Must be power of two + * Higher number could fail at allocation. + */ +#define MAX_RX_BUFFERS_PER_QUEUE 8192 +#define DEF_RX_BUFFERS_PER_QUEUE 1024 +#define MIN_RX_BUFFERS_PER_QUEUE 128 + +/* Unit number of TX buffers. Must be power of two + * Higher number could fail at allocation. + * The max value is derived as the maximum + * allocatable pages supported on host per guest + * through testing. TX buffer size beyond this + * value is rejected by the hardware. + */ +#define MAX_SEND_BUFFERS_PER_QUEUE 16384 +#define DEF_SEND_BUFFERS_PER_QUEUE 1024 +#define MIN_SEND_BUFFERS_PER_QUEUE 128 #define EQ_SIZE (8 * PAGE_SIZE) #define LOG2_EQ_THROTTLE 3 @@ -507,6 +521,9 @@ struct mana_port_context { unsigned int max_queues; unsigned int num_queues; + unsigned int tx_queue_size; + unsigned int rx_queue_size; + mana_handle_t port_handle; int vport_use_count; diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index 735b94bba6cd..a1d2d1015b89 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -67,6 +67,9 @@ static int mana_up(struct mana_port_context *apc); static int mana_down(struct mana_port_context *apc); +extern unsigned int mana_tx_req_size; +extern unsigned int mana_rx_req_size; + static void mana_rss_key_fill(void *k, size_t size) { @@ -492,6 +495,7 @@ mana_xmit(struct mana_txq *txq) if_t ndev = txq->ndev; struct mbuf *mbuf; struct mana_port_context *apc = if_getsoftc(ndev); + unsigned int tx_queue_size = apc->tx_queue_size; struct mana_port_stats *port_stats = &apc->port_stats; struct gdma_dev *gd = apc->ac->gdma_dev; uint64_t packets, bytes; @@ -635,7 +639,7 @@ mana_xmit(struct mana_txq *txq) } next_to_use = - (next_to_use + 1) % MAX_SEND_BUFFERS_PER_QUEUE; + (next_to_use + 1) % tx_queue_size; (void)atomic_inc_return(&txq->pending_sends); @@ -1423,6 +1427,7 @@ mana_poll_tx_cq(struct mana_cq *cq) unsigned int wqe_unit_cnt = 0; struct mana_txq *txq = cq->txq; struct mana_port_context *apc; + unsigned int tx_queue_size; uint16_t next_to_complete; if_t ndev; int comp_read; @@ -1436,6 +1441,7 @@ mana_poll_tx_cq(struct mana_cq *cq) ndev = txq->ndev; apc = if_getsoftc(ndev); + tx_queue_size = apc->tx_queue_size; comp_read = mana_gd_poll_cq(cq->gdma_cq, completions, CQE_POLLING_BUFFER); @@ -1521,7 +1527,7 @@ mana_poll_tx_cq(struct mana_cq *cq) mb(); next_to_complete = - (next_to_complete + 1) % MAX_SEND_BUFFERS_PER_QUEUE; + (next_to_complete + 1) % tx_queue_size; pkt_transmitted++; } @@ -1867,9 +1873,9 @@ mana_cq_handler(void *context, struct gdma_queue *gdma_queue) mana_gd_ring_cq(gdma_queue, arm_bit); } -#define MANA_POLL_BUDGET 8 -#define MANA_RX_BUDGET 256 -#define MANA_TX_BUDGET MAX_SEND_BUFFERS_PER_QUEUE +#define MANA_POLL_BUDGET 256 +#define MANA_RX_BUDGET 8 +#define MANA_TX_BUDGET 8 static void mana_poll(void *arg, int pending) @@ -1976,7 +1982,7 @@ mana_deinit_txq(struct mana_port_context *apc, struct mana_txq *txq) if (txq->tx_buf_info) { /* Free all mbufs which are still in-flight */ - for (i = 0; i < MAX_SEND_BUFFERS_PER_QUEUE; i++) { + for (i = 0; i < apc->tx_queue_size; i++) { txbuf_info = &txq->tx_buf_info[i]; if (txbuf_info->mbuf) { mana_tx_unmap_mbuf(apc, txbuf_info); @@ -2034,15 +2040,19 @@ mana_create_txq(struct mana_port_context *apc, if_t net) M_DEVBUF, M_WAITOK | M_ZERO); /* The minimum size of the WQE is 32 bytes, hence - * MAX_SEND_BUFFERS_PER_QUEUE represents the maximum number of WQEs + * apc->tx_queue_size represents the maximum number of WQEs * the SQ can store. This value is then used to size other queues * to prevent overflow. + * Also note that the txq_size is always going to be page aligned, + * as min val of apc->tx_queue_size is 128 and that would make + * txq_size 128 * 32 = 4096 and the other higher values of + * apc->tx_queue_size are always power of two. */ - txq_size = MAX_SEND_BUFFERS_PER_QUEUE * 32; + txq_size = apc->tx_queue_size * 32; KASSERT(IS_ALIGNED(txq_size, PAGE_SIZE), ("txq size not page aligned")); - cq_size = MAX_SEND_BUFFERS_PER_QUEUE * COMP_ENTRY_SIZE; + cq_size = apc->tx_queue_size * COMP_ENTRY_SIZE; cq_size = ALIGN(cq_size, PAGE_SIZE); gc = gd->gdma_context; @@ -2125,7 +2135,7 @@ mana_create_txq(struct mana_port_context *apc, if_t net) gc->cq_table[cq->gdma_id] = cq->gdma_cq; /* Initialize tx specific data */ - txq->tx_buf_info = malloc(MAX_SEND_BUFFERS_PER_QUEUE * + txq->tx_buf_info = malloc(apc->tx_queue_size * sizeof(struct mana_send_buf_info), M_DEVBUF, M_WAITOK | M_ZERO); @@ -2133,7 +2143,7 @@ mana_create_txq(struct mana_port_context *apc, if_t net) "mana:tx(%d)", i); mtx_init(&txq->txq_mtx, txq->txq_mtx_name, NULL, MTX_DEF); - txq->txq_br = buf_ring_alloc(4 * MAX_SEND_BUFFERS_PER_QUEUE, + txq->txq_br = buf_ring_alloc(4 * apc->tx_queue_size, M_DEVBUF, M_WAITOK, &txq->txq_mtx); /* Allocate taskqueue for deferred send */ @@ -2323,10 +2333,10 @@ mana_create_rxq(struct mana_port_context *apc, uint32_t rxq_idx, gc = gd->gdma_context; rxq = malloc(sizeof(*rxq) + - RX_BUFFERS_PER_QUEUE * sizeof(struct mana_recv_buf_oob), + apc->rx_queue_size * sizeof(struct mana_recv_buf_oob), M_DEVBUF, M_WAITOK | M_ZERO); rxq->ndev = ndev; - rxq->num_rx_buf = RX_BUFFERS_PER_QUEUE; + rxq->num_rx_buf = apc->rx_queue_size; rxq->rxq_idx = rxq_idx; /* * Minimum size is MCLBYTES(2048) bytes for a mbuf cluster. @@ -2763,6 +2773,62 @@ mana_detach(if_t ndev) return err; } +static unsigned int +mana_get_tx_queue_size(int port_idx, unsigned int request_size) +{ + unsigned int new_size; + + if (request_size == 0) + /* Uninitialized */ + new_size = DEF_SEND_BUFFERS_PER_QUEUE; + else + new_size = roundup_pow_of_two(request_size); + + if (new_size < MIN_SEND_BUFFERS_PER_QUEUE || + new_size > MAX_SEND_BUFFERS_PER_QUEUE) { + mana_info(NULL, "mana port %d: requested tx buffer " + "size %u out of allowable range (%u - %u), " + "setting to default\n", + port_idx, request_size, + MIN_SEND_BUFFERS_PER_QUEUE, + MAX_SEND_BUFFERS_PER_QUEUE); + new_size = DEF_SEND_BUFFERS_PER_QUEUE; + } + mana_info(NULL, "mana port %d: tx buffer size %u " + "(%u requested)\n", + port_idx, new_size, request_size); + + return (new_size); +} + +static unsigned int +mana_get_rx_queue_size(int port_idx, unsigned int request_size) +{ + unsigned int new_size; + + if (request_size == 0) + /* Uninitialized */ + new_size = DEF_RX_BUFFERS_PER_QUEUE; + else + new_size = roundup_pow_of_two(request_size); + + if (new_size < MIN_RX_BUFFERS_PER_QUEUE || + new_size > MAX_RX_BUFFERS_PER_QUEUE) { + mana_info(NULL, "mana port %d: requested rx buffer " + "size %u out of allowable range (%u - %u), " + "setting to default\n", + port_idx, request_size, + MIN_RX_BUFFERS_PER_QUEUE, + MAX_RX_BUFFERS_PER_QUEUE); + new_size = DEF_RX_BUFFERS_PER_QUEUE; + } + mana_info(NULL, "mana port %d: rx buffer size %u " + "(%u requested)\n", + port_idx, new_size, request_size); + + return (new_size); +} + static int mana_probe_port(struct mana_context *ac, int port_idx, if_t *ndev_storage) @@ -2782,6 +2848,10 @@ mana_probe_port(struct mana_context *ac, int port_idx, apc->max_queues = gc->max_num_queues; apc->num_queues = min_t(unsigned int, gc->max_num_queues, MANA_MAX_NUM_QUEUES); + apc->tx_queue_size = mana_get_tx_queue_size(port_idx, + mana_tx_req_size); + apc->rx_queue_size = mana_get_rx_queue_size(port_idx, + mana_rx_req_size); apc->port_handle = INVALID_MANA_HANDLE; apc->port_idx = port_idx; apc->frame_size = DEFAULT_FRAME_SIZE; diff --git a/sys/dev/mana/mana_sysctl.c b/sys/dev/mana/mana_sysctl.c index 844a05040595..acb3628f09bc 100644 --- a/sys/dev/mana/mana_sysctl.c +++ b/sys/dev/mana/mana_sysctl.c @@ -34,9 +34,17 @@ static int mana_sysctl_cleanup_thread_cpu(SYSCTL_HANDLER_ARGS); int mana_log_level = MANA_ALERT | MANA_WARNING | MANA_INFO; +unsigned int mana_tx_req_size; +unsigned int mana_rx_req_size; + SYSCTL_NODE(_hw, OID_AUTO, mana, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "MANA driver parameters"); +SYSCTL_UINT(_hw_mana, OID_AUTO, tx_req_size, CTLFLAG_RWTUN, + &mana_tx_req_size, 0, "requested number of unit of tx queue"); +SYSCTL_UINT(_hw_mana, OID_AUTO, rx_req_size, CTLFLAG_RWTUN, + &mana_rx_req_size, 0, "requested number of unit of rx queue"); + /* * Logging level for changing verbosity of the output */ @@ -166,6 +174,14 @@ mana_sysctl_add_port(struct mana_port_context *apc) "enable_altq", CTLFLAG_RW, &apc->enable_tx_altq, 0, "Choose alternative txq under heavy load"); + SYSCTL_ADD_UINT(ctx, apc->port_list, OID_AUTO, + "tx_queue_size", CTLFLAG_RD, &apc->tx_queue_size, 0, + "number of unit of tx queue"); + + SYSCTL_ADD_UINT(ctx, apc->port_list, OID_AUTO, + "rx_queue_size", CTLFLAG_RD, &apc->rx_queue_size, 0, + "number of unit of rx queue"); + SYSCTL_ADD_PROC(ctx, apc->port_list, OID_AUTO, "bind_cleanup_thread_cpu", CTLTYPE_U8 | CTLFLAG_RW | CTLFLAG_MPSAFE, From nobody Mon Feb 24 14:40:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1k1T42z2z5pFPd; Mon, 24 Feb 2025 14:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1k1T2pVGz4QDY; Mon, 24 Feb 2025 14:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740408045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QGRN9iVhPlZSmn0Hxn9NCU1LVYF3EUWEaiO78u+WCGE=; b=Vpd12morf1TnNiqHn/BsEdSSPBsMRj2MRup1AvHU0/nyRoDWm5cqhMytdJDncvoJdebxMl 2wxIp/LsJeGHa4ghgtz3Q2Td0qk6ac2REeo0/xu0/74FZ7zOmMSS3dayZguKWN1kzgjyVy lZrXdfZwcOXUxOCGV9FpiOZ7lbJN6WQdDY9DuXv1rzR9HS93oChmqKGLJ8IkC1Oq+Q+cp+ 7aBqQwMIxo3vq9UtfBaA+BV1YWfco5iWqT7KiFU0LsHJy2i17W5XKHSbCwGoJY7gLwC9nv 7IvFK44oCi2g4KEIe7cLkZRvyyGfVE/TyeZIAdgTqJEdYO6Fb6W8lyLZg9cdKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740408045; a=rsa-sha256; cv=none; b=qjWNyG+YgCd2sI7dnx/fa/NHNvbNyfe/n4gJgz0wwV1rxT9qqtik4oDQb1se1NIO/Mc7nx eTjovqzMFQRuPWsy9aufNQrLiPwCLcEziHLTDOFCis/pfJh0DLZtNqG5H7X3rBQxjG/+ht Wr6/VRODzDu3m+YzhoDgef6BAp6rtleKOPxqUGD09q+aB9IJAJJ4HloMWW2XBhbmF90RtJ S64SrZ1crHtbWfxLY+fQnttLtd/fdRnv3Zmpbr/OYd7+/LLF9LaLolkzfff/Pu2qBjRxqN XqA+XxyPW+tCOFDbDkyIjP/VNydbxUhk4iAvEY4dejNzoTE/2PBPeCcdtHS3ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740408045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QGRN9iVhPlZSmn0Hxn9NCU1LVYF3EUWEaiO78u+WCGE=; b=hxfONBqYKlLWm8TLs0pgPDelUmbgoIQRTC1khNbzobzi9xipO/UpZERM1r/LRLnPNFnGlV GaoiTyD21OD/XuZEb2Zbhne5WKopBQsG8qxROeCZEqpenhz6fjoDYT1IH3Wx93jdNtpy8B HYzmBCmdayEYov9VvxLzhQxFD88f4r4SRhStYRAzgFG+YPrMXzFEs8cNzRnf7PziJzTs/f IBPXrT7P8kKOJSlo1icP2HGW/kaORH00cwYGvCrZNvaoutL+0b4hY9uZgfrKdFo/GNsyBh emYaZDRyoigyJMSkBb3+oNhRt93TmTQGITEz+B/Tu4luj/zlGJ3x6EGo/LbIPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1k1T2NjszlW6; Mon, 24 Feb 2025 14:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OEej9Q082001; Mon, 24 Feb 2025 14:40:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OEejYi081998; Mon, 24 Feb 2025 14:40:45 GMT (envelope-from git) Date: Mon, 24 Feb 2025 14:40:45 GMT Message-Id: <202502241440.51OEejYi081998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 7d1d7f42302d - main - stand: Fix brand positioning on framebuffer console List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d1d7f42302d80c33243501601b77323acc0717f Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=7d1d7f42302d80c33243501601b77323acc0717f commit 7d1d7f42302d80c33243501601b77323acc0717f Author: Jose Luis Duran AuthorDate: 2025-02-24 14:36:10 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-24 14:36:10 +0000 stand: Fix brand positioning on framebuffer console The drawer.lua script ignores the values in loader_brand_x and loader_brand_y on framebuffer consoles, always positioning the brand at (1, 1). Allow it to be positioned by accepting the x and y values just like the text version. For example: /boot/lua/gfx-nanobsd.lua: return { brand = { graphic = { "" }, requires_color = true, image = "/boot/images/freebsd-logo-rev.png" } } /boot/loader.conf.d/bootloader.conf: loader_logo="none" loader_brand="nanobsd" loader_brand_x="15" PR: 255202 Reviewed by: manu, imp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49092 --- stand/lua/drawer.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 2d04e29ac462..1bf741b2373e 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -327,7 +327,7 @@ local function drawbrand() if core.isFramebufferConsole() and gfx.term_putimage ~= nil and branddef.image ~= nil then - if gfx.term_putimage(branddef.image, 1, 1, 0, 7, 0) + if gfx.term_putimage(branddef.image, x, y, 0, 7, 0) then return true end From nobody Mon Feb 24 14:40:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1k1V5wMgz5pFZg; Mon, 24 Feb 2025 14:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1k1V3s0Nz4QM7; Mon, 24 Feb 2025 14:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740408046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oPbZLct5Te+E5l7xxjFgn9LprtfeIVaC3n+PcjNq4/w=; b=vkLWOs8CQFl0ztWbDkcCaxjC0KqKZ8FRwFoAGLh1doK3I848Se56rgbGfO5D2o/r90fygU ulFcprbkN6wg9LeqdNBNm0UZSWkZx4arbioA98j/KXcmcElT+5qQAf2MYwIYepIoIo6C9n Nxm+l1FzaXDde2XzW+w9PcI8lanDgWD1HiLcAZaYAlgf+EqViCy1q6Pdr45BqAh4aJ47cA 1/Fpc/bD92kyOCG5srhi2HHz8Y1vlICCBt9YJA0ZL8OsrMYb0lhj6DgppWfapno/51T871 aHzNRSZcn9MJqVVR1D7jn3VChrajg6sGLtb4Qi82Hxaa+QocqxRaqCmMt8oq+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740408046; a=rsa-sha256; cv=none; b=NsOZ13Ooauk2P050ovdFEnTWsTVe9Omy31pXdnChzAil2tpoDY6x/0k/VQTrCYmaM8Vm3e OsFk381k0tO/h4adycXToxWlqTZaFqfhcnzjlKVnVuolMFwTRnMg+jRlgI/htWjy7Bko0A Jr7oQoGQGdh6gVuEfyQ7Ilzvmk3TDK5YuF/ITbaZldEusei8oXjmchLXKINd5/qbC9VMZj ssV1XcvzDUtEaQcHFdVVXNV0Y9PxWdzrXAZQ4ppPK66ITyaMmkGyNEK0IVLAkYEDsjMPaI 9eBjLaMmPKgg/Bbll/mQyVmnIjRPvu9bxJsdyN+J2eEiI0PD4mxQjYBgRgp9Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740408046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oPbZLct5Te+E5l7xxjFgn9LprtfeIVaC3n+PcjNq4/w=; b=y1sVzDgthdbD0uKeq5vBhfJ5YG3WUF7Gj37+ZsWuX9KQGDr0/y0SkHWTo4LUtrd5Om81dx EEX5T7SRDfnwxQyKK1bBi7gGAGQFpol/JBK3aqnf7YJov/dZuVmBxY38VHPxwKG0nu9ScH Z6qVbhkNCny3hpDMPuw6WDMJPbrCtx4VWGg98HA7cQzhQ1rajn6aYOL8Jl2thvPoX4nFnw pBRTyys4Igsbt41EfqQ6LNQ1KmQM2vQfWCwJyNdtboIsiqUVGSNTBZ5E/n6Sgpb8oVXVCV DAX6GXzp9ttgr/WZFRGDu4IO7Jn1oRps5nMYI2mRUZY9BZYwRTqHLmJVZTXGAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1k1V3CmdzlSH; Mon, 24 Feb 2025 14:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OEekol082041; Mon, 24 Feb 2025 14:40:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OEekwk082038; Mon, 24 Feb 2025 14:40:46 GMT (envelope-from git) Date: Mon, 24 Feb 2025 14:40:46 GMT Message-Id: <202502241440.51OEekwk082038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 61d8af38bf1c - main - openssh: Fix blacklistd sshd-session integration List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16 commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16 Author: Jose Luis Duran AuthorDate: 2025-02-24 14:38:52 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-24 14:38:52 +0000 openssh: Fix blacklistd sshd-session integration In version 9.8, the server was split into a listener binary, sshd(8), and a per-session binary "sshd-session". Our blacklistd changes also have to be moved from sshd.c to sshd-session.c. Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49116 --- crypto/openssh/sshd-session.c | 3 +++ crypto/openssh/sshd.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 3092cd91242e..ee983176d3aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -109,6 +109,7 @@ #include "sk-api.h" #include "srclimit.h" #include "dh.h" +#include "blacklist_client.h" /* Re-exec fds */ #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) @@ -1316,6 +1317,8 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); + BLACKLIST_INIT(); + if (privsep_preauth(ssh) == 1) goto authenticated; diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 68e48d75369a..fd48835ebd2a 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -101,7 +101,6 @@ #include "sk-api.h" #include "addr.h" #include "srclimit.h" -#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -1876,9 +1875,6 @@ main(int ac, char **av) } #endif #endif - - - BLACKLIST_INIT(); } /* server specific fatal cleanup */ From nobody Mon Feb 24 14:56:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1kMl1CFbz5pHSk; Mon, 24 Feb 2025 14:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1kMk6FlSz3PcW; Mon, 24 Feb 2025 14:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740408994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ah7iqrbK5orDm/dK7TVFOka0laoLPU91xr9xdlH3ByU=; b=uQ+P+mc8nHtBtiy9wr2n4s8vnYxrpYuqAiYIuH3wJZDF+90TiOGSQzdEXjtzqJPVVIslSL FWnDKN4XKaSvqysKqROvgfikX5rIceRzKbuFPRl+/ajjUv3Fj2m6/+aOlFTWXjuegQh1Ap 1cBrhA0KgIGD+tlRmJVtUWEp6P6V7acScZlmOE5TOjIqqs/NB1nVVAGv/9uYMGoYWFVXmH yavV2+UO+t4n0PeE0hiHF8PFYAFHQ+74C4Sy/IiO2E/xK2atkvsf6hpl0TZgEt6qDCuLYF SAFtAYl2tKJIeLls2I7iEec8t6RB265vmIojR0xqvPLwzpMYpYnin8XRtf/zGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740408994; a=rsa-sha256; cv=none; b=cKtqUwyWbR8EykQ9BhzV0RE8Bdc5zErUAAOiRJPivb9q6nBKE/cq3RGemXy+GyUd+5QxfY C6zvB88JqdsqlkJ96eh6YO/KZrntSdq7lIo651CrgXNrDd+j/AJAqpc0vT2I2l7WPICDGQ IR0KWhWnwqpCsH8ILlHLR2yKAOobscYsRj04FZPUub9ZTqe+VovwvAZ3w1m1Q2p965CKR5 QB2JZaa3PrdLX/bbEiTvFD+QJX9RzgphhLx7jnT3drhx9G2eizU8kDbHOTZ4I0R9v0bW9D /+WLV3yWP6GKJPaeHaV+bxYdsPt9VVprBIIeTUfBDZSMN2ZTfbfAKBd0Jjri/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740408994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ah7iqrbK5orDm/dK7TVFOka0laoLPU91xr9xdlH3ByU=; b=Eo4rOhQidKoVZvyTt1omzIYjHJ9PcDfGqBO/PW3KPZVsiEbgGMi5SGVRKPtGSSijAL5zCr 2DpuZpgc5v8RjujsEC63Z5s2O+6D6um8ypQwNgItmvUuHPh+GK4kuSwb89tfBMusslQQ7e eGK7OJ/gGtq7dA9U6tEqNfGARtlFt+BvmclBA4iIl085ZgZypx7emJgBKGNA4leXKacC5v VXjb/1tX/d96hLHODAleHTgvL9TqwSr8bb2HssgkR7G/nOiCorIarzFyPxqUBwlVtUY0Kp fR79DcddpaAE4ccFqfv0MQhxTopJgzg605OPpWhaicwRy4+fNs67qiwxBac+UQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1kMk5ksZzlv7; Mon, 24 Feb 2025 14:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OEuYa5008840; Mon, 24 Feb 2025 14:56:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OEuYcu008837; Mon, 24 Feb 2025 14:56:34 GMT (envelope-from git) Date: Mon, 24 Feb 2025 14:56:34 GMT Message-Id: <202502241456.51OEuYcu008837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a1452eec4768 - main - dtrace: fix signature mismatch for taskqueue callbacks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1452eec4768272056aa070db94ea7184ce1117c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a1452eec4768272056aa070db94ea7184ce1117c commit a1452eec4768272056aa070db94ea7184ce1117c Author: SHENGYI HONG AuthorDate: 2025-02-23 17:42:41 +0000 Commit: Mark Johnston CommitDate: 2025-02-24 14:56:29 +0000 dtrace: fix signature mismatch for taskqueue callbacks Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49112 --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 608bff1d23ae..cfd403ac1a01 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -594,7 +594,8 @@ static dtrace_probe_t *dtrace_probe_lookup_id(dtrace_id_t id); static void dtrace_enabling_provide(dtrace_provider_t *); static int dtrace_enabling_match(dtrace_enabling_t *, int *); static void dtrace_enabling_matchall(void); -static void dtrace_enabling_reap(void); +static void dtrace_enabling_matchall_task(void *); +static void dtrace_enabling_reap(void *); static dtrace_state_t *dtrace_anon_grab(void); static uint64_t dtrace_helper(int, dtrace_mstate_t *, dtrace_state_t *, uint64_t, uint64_t); @@ -12991,6 +12992,12 @@ dtrace_enabling_match(dtrace_enabling_t *enab, int *nmatched) return (0); } +static void +dtrace_enabling_matchall_task(void *args __unused) +{ + dtrace_enabling_matchall(); +} + static void dtrace_enabling_matchall(void) { @@ -13118,7 +13125,7 @@ retry: * Called to reap ECBs that are attached to probes from defunct providers. */ static void -dtrace_enabling_reap(void) +dtrace_enabling_reap(void *args __unused) { dtrace_provider_t *prov; dtrace_probe_t *probe; @@ -16719,8 +16726,8 @@ dtrace_module_loaded(modctl_t *ctl) return; } - (void) taskq_dispatch(dtrace_taskq, - (task_func_t *)dtrace_enabling_matchall, NULL, TQ_SLEEP); + (void)taskq_dispatch(dtrace_taskq, + (task_func_t *)dtrace_enabling_matchall_task, NULL, TQ_SLEEP); mutex_exit(&dtrace_lock); From nobody Mon Feb 24 15:53:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1ld51YWVz5pNX0; Mon, 24 Feb 2025 15:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1ld50yJ6z3x78; Mon, 24 Feb 2025 15:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=inwscEDRqm69WuvORk/QRUdVNSYSS1xrqgvy9Qu7jeQ=; b=k7Wdj9nmu9K0BmhoZK8cYwFZHVRwbRV0Xs7uVfoUB2VnbphlCiQVqxKl9LN0YEpAzfaSlT FdavHxzPLqTfNFpoOfPQkT39oVVA3Uydk6rsn7TYvqltVBACowQcWSa3UD5fwbyku9MepG 9Z6h/7CFEOsRP9IE9EvDzji8ir+ppvop5kBF3IEQ4K6H01y4Ot2cCpyrXeSuDUXQPCFXUR krA7bUQE8b3Gf+ji6EyezixmruY5es2RDUUWdObyNJT3w5URnNPcBdtyYhR+We0yXUDlS5 iId7cbJE5+ltFQ65Wi8u1f0oF83qPWBlXjNOg8ztwB1VI5r2/g0L3Q5v7EVdbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740412393; a=rsa-sha256; cv=none; b=uVQ3g1s6hW+njcYIK27dWQBnSfmN6Wb8W0K/BKqI/qX/ryrKwLWntOMACWq0ExmegjOdH9 lIMFugHlNVaPkMWa3jf8kzPUjehdYtA+4d+Pj2Z8G5v5s1u56Y/V/+/dSlEZ7D3+aixjFh D7YTvM9KctHnr19KnRwTS35wQDhnWEH3StyuswKB78Wghuc3B18IDYvV4PkfeLlIQcPiY1 U2y0GXjucYUSjrdIoLHeREdolgoNxgwC3OrKTX6z3LxlLsF0Nt414iFBbBcf/VqHe1SKNC 9qzscQOUYMaUfnFh2PS7D8GzTGEoIMoYWmTZoy2LjSnXla74LbjGl0zwfEDqEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=inwscEDRqm69WuvORk/QRUdVNSYSS1xrqgvy9Qu7jeQ=; b=pF2OVcSFdRYQNQPdmkg3rE1AKjuWSQ5l6vALYUC8hvZ7oFo6Owi8UPwBMnicaprJFyCnVF T1K9rIMNH5rvK2OzH2hDW7vTAxRw7qdYXbhFFflQ1jKumrPbLMaGqlzm4CII4OtHpdjK2a Ejy6xulDg10YtuYkeiWdwoH7H7Nkn5oKDZn1dwxmiedsL+aZHnquaoI6IycIChQ4GmHrRo OaEEFogLmBm5pUeBBvqcYiCGCI9LmhR0qcJH/o3nkw21Gpi6YuW9wcif41XrlK8Rqk+F/U Tjs61dDaZ5wbG+RY9wh3O0LsUgr5H3Ww/2SYU5MTbIYeuo5FNKr4Vtq/cNawlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1ld50LTBznNL; Mon, 24 Feb 2025 15:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OFrC0f018918; Mon, 24 Feb 2025 15:53:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OFrCnS018915; Mon, 24 Feb 2025 15:53:12 GMT (envelope-from git) Date: Mon, 24 Feb 2025 15:53:12 GMT Message-Id: <202502241553.51OFrCnS018915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: eb3be1cb9f4c - stable/14 - upgt: Deprecate ancient 802.11b/g driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268 commit eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268 Author: Ed Maste AuthorDate: 2025-02-18 13:18:56 +0000 Commit: Ed Maste CommitDate: 2025-02-24 15:52:49 +0000 upgt: Deprecate ancient 802.11b/g driver Recently-reported bugs in this driver should be fixed, but also the hardware it supports is obsolete so mark it for deprecation. PR: 284876 Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49045 (cherry picked from commit 7f8a5c5a1585fd9b56adfd8de4f9194ba5cc0785) --- share/man/man4/upgt.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 805d045e61dd..508c87c6a925 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -48,7 +48,7 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 17, 2008 +.Dd February 18, 2025 .Dt UPGT 4 .Os .Sh NAME @@ -74,6 +74,11 @@ module at boot time, place the following line in .Bd -literal -offset indent if_upgt_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed in +.Fx 15.0 . .Sh DESCRIPTION The .Nm From nobody Mon Feb 24 15:54:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1lfx2DYqz5pNJk; Mon, 24 Feb 2025 15:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1lfx1TwDz3y1K; Mon, 24 Feb 2025 15:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0B2bU4ARjtdYuo5j7ViDDBITTF2LZuRuW3KQ0SfEOo=; b=d493ZMyrO+J9zHdB+T1qsCbSBSdcqnOuRXJK5gXwUofdljpOENseCwtz1jAqZttTsXkP1q oln9OOcGp90hT9HZnWk8nslnnemI/E8D0OBRVQ+3r9tHu8FFqBs9XGLCI3dzHOa7XN+B0O TBTW61zZInIIj0UdOjBUBaZvjhTFpq8DBeGY8G4Rxfj9Llazxkiczx+odlrRSRJEO6O9od v90bwLntdWk6hYYUCuwdUqq9HE15WSXPJa/kO9qPk4CLWlulXiGOPASfcuArDAFNRfWtVm 5ALEl7O3G62aRImJr5ZabDs2azSpHO9Wlz3Ou7L5J3wisaiQk/szNu6MXG+47Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740412489; a=rsa-sha256; cv=none; b=QOrQwtjuKj7Dz71x+Hn2z3gqYN7iJpUzxIvIUs+ploySLYU4SaWK+LzroZD4+RP5OU8YT4 WnI8SuMcbYdluMgcrqiEH3f1I/w4tvweWYPvKlVezXia3kacFQFXte2NZ25cMP6dBCVBKh K+bin0+oW4Wn3pNrwiUMv8b3F3hdfZchUvikOFsvvBVp9zjaybzjFJT3fsY6kc8BCyQ+5e slQXmuPCctGGsKCCCs+3XaG3AbK0LcmKL1Dxk8+kPz6vfXcu9jW1Kx9UBe4LG4OBRip6B3 hP7w7bLzKJhHMyuNPaSvlU0O2EQWrl7X9JQXLBH+UP87A3ETnhvKZfckCqLw/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0B2bU4ARjtdYuo5j7ViDDBITTF2LZuRuW3KQ0SfEOo=; b=GWlLiqa1SGp08tPrhwLHbqOANXxErdZDuJlfQWNs+5IxICZgUnwOlOBajUMVmj5xyyU1Vs vz0H+CdECd7h0gYgX6ok2c5fl85ROuIiyJ8H3uAPz9VEPSvfehqQq7Fi0kbfhyNUxAPOK4 9UN2oCU1J17vgNFjL/psmNSCq/OOSbkwiSw4pMQQTgz3WmyyvFQDHvnDgzWM3APpLmB8ih 94j+XnesfhVLdn5JQUxCsXTCwG9WQpeHwMVQvENjMRAh0lAbV5a6dbt8ew53Boe57yiXdz RCoEAublVdgYwuT4dzrYpKUASQ5CEFi28jWojxjzO3wPRbioj8ll3wIEImTXgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1lfx0yyhznL9; Mon, 24 Feb 2025 15:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OFsm2N019513; Mon, 24 Feb 2025 15:54:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OFsm7Z019510; Mon, 24 Feb 2025 15:54:48 GMT (envelope-from git) Date: Mon, 24 Feb 2025 15:54:48 GMT Message-Id: <202502241554.51OFsm7Z019510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 96e06df5bcf1 - stable/13 - upgt: Deprecate ancient 802.11b/g driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 96e06df5bcf18ca20c3bc6ac76a63cc3a5954158 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=96e06df5bcf18ca20c3bc6ac76a63cc3a5954158 commit 96e06df5bcf18ca20c3bc6ac76a63cc3a5954158 Author: Ed Maste AuthorDate: 2025-02-18 13:18:56 +0000 Commit: Ed Maste CommitDate: 2025-02-24 15:53:42 +0000 upgt: Deprecate ancient 802.11b/g driver Recently-reported bugs in this driver should be fixed, but also the hardware it supports is obsolete so mark it for deprecation. PR: 284876 Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49045 (cherry picked from commit 7f8a5c5a1585fd9b56adfd8de4f9194ba5cc0785) (cherry picked from commit eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268) --- share/man/man4/upgt.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 805d045e61dd..508c87c6a925 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -48,7 +48,7 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 17, 2008 +.Dd February 18, 2025 .Dt UPGT 4 .Os .Sh NAME @@ -74,6 +74,11 @@ module at boot time, place the following line in .Bd -literal -offset indent if_upgt_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed in +.Fx 15.0 . .Sh DESCRIPTION The .Nm From nobody Mon Feb 24 15:54:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1lfy4365z5pNXJ; Mon, 24 Feb 2025 15:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1lfy1m0bz3y5b; Mon, 24 Feb 2025 15:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+VbMr3xgbM+5LjjcXBor0tEH1PZL8kKHwa9HdGcxJtA=; b=ZsrTtcfezMmvoFjZGbkkR5KBk5Twy1jf9CiEGskyvEQtGf2QkUaeRru4LAN8KWGYajUCMg T2gGhS0r/3XKbAIQjFgEDJbLJ8Ec1RnR3iWSYBqbzD74NPhhgCXdXGOFpyw1aEfL6BdpNe rXARv05hUfwQ2yGQKbRPW/0cGDnqCZXX+sHk16DJu/TfCl3xEiX67rvq+gOLNa2UhHSghH LO+pXE2wgvVWpfJXUnxXlwhlwtsfkSbXVz1k4tVIQVGlJXO6KfUeO7I75GSCEzi6B/lOVA w5jorYF+Z+snAvwCyFatrhI4lH3nuBsjja0/rC0BXwxkTiLWwrMnEiqs9iC4Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740412490; a=rsa-sha256; cv=none; b=NX/04Dn/dTGT01bqD5uvXm61ZD4cv+Q7CH+N+nm9WxIZ4QfnbvygcPCWBZY7XOkYehXOES Y/pSFAxbyzHmFtUNwAnvL/0mP/nix/nEN/O9uFpuLvH5Gy+dGcMMUr5IqikcGaTZn5L2bb tiYDfcO+lCOaB2VscD54b1lubRqQ7MZO/slB9qgqSjMAM2RWKwaDNwS473pFYG52LbZVne M28ym/FKCR02CdI0WAaG8dgRTRqd6Gmw0X/U2o/0ekoKdblXAuDza9/cOO6YtAw9D6nYCT o3Yc9aRfYcBOn/6qqt5BgwiRs4JdGvQYjHhasYC1uHIi1WFHlZcOWnGNwTR59A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+VbMr3xgbM+5LjjcXBor0tEH1PZL8kKHwa9HdGcxJtA=; b=v+J5Z71Eq7PDkQTdTbDLk+UaW9OYVrRlskJEk8CgpMMT2avvVj42NrdR63AJ+UEhpcfB0u fSnUhZ1XPPTZxJj6gr1or/vGAgpdBHyZ9p74fxNd5ID1wbB3lsBrzQ1IkaCEJ0ROIGoeo0 z94KBijrvmm9wPz7gEaikKKQpWAoxG2MMrTuwLlgfi0sKKTEvf2Rv/u+4NsRDVxTHuoY/u xMhRV9rmzGQn7jYWNv8wnaOFv5QFStnhhjpFIp7NQ0FmwuCYpg53QI9zgBZaksxVuDJ+R5 GzaiZTkk0My9ceKVOK6Dj/t2jMq5IBIFZI5NdjvQ99ED90f8MsyWcbTsWR3pWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1lfy188jznCJ; Mon, 24 Feb 2025 15:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OFso2L019548; Mon, 24 Feb 2025 15:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OFso1b019545; Mon, 24 Feb 2025 15:54:50 GMT (envelope-from git) Date: Mon, 24 Feb 2025 15:54:50 GMT Message-Id: <202502241554.51OFso1b019545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ab4d246b781c - stable/13 - Deprecate publickey(5) stuff List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ab4d246b781c844b0fc14a3f525e316e4654f087 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ab4d246b781c844b0fc14a3f525e316e4654f087 commit ab4d246b781c844b0fc14a3f525e316e4654f087 Author: Emmanuel Vadot AuthorDate: 2025-01-22 16:56:58 +0000 Commit: Ed Maste CommitDate: 2025-02-24 15:53:42 +0000 Deprecate publickey(5) stuff This uses DES and it's likely that nobody uses that in 2025. If somebody uses this we help them by deprecating and removing this. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D30682 (cherry picked from commit 723425f837270dd3b22098168ae9464a1ebe38c6) (cherry picked from commit 9197c04a251bc531ee5fca8e11cf7b64237a42f3) --- usr.bin/chkey/chkey.1 | 5 +++++ usr.bin/chkey/chkey.c | 1 + usr.bin/keylogin/keylogin.1 | 5 +++++ usr.bin/keylogin/keylogin.c | 1 + usr.bin/keylogout/keylogout.1 | 5 +++++ usr.bin/keylogout/keylogout.c | 1 + usr.bin/newkey/newkey.8 | 5 +++++ usr.bin/newkey/newkey.c | 1 + usr.sbin/keyserv/keyserv.8 | 5 +++++ usr.sbin/keyserv/keyserv.c | 1 + 10 files changed, 30 insertions(+) diff --git a/usr.bin/chkey/chkey.1 b/usr.bin/chkey/chkey.1 index 508227ba9601..e754d676e5d1 100644 --- a/usr.bin/chkey/chkey.1 +++ b/usr.bin/chkey/chkey.1 @@ -26,3 +26,8 @@ database. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/chkey/chkey.c b/usr.bin/chkey/chkey.c index 3e568b88b9d6..d04f070fb50f 100644 --- a/usr.bin/chkey/chkey.c +++ b/usr.bin/chkey/chkey.c @@ -96,6 +96,7 @@ main(int argc, char **argv) char *cryptpw; #endif + fprintf(stderr, "chkey is deprecated and removed from FreeBSD 15.\n"); while ((ch = getopt(argc, argv, "f")) != -1) switch(ch) { case 'f': diff --git a/usr.bin/keylogin/keylogin.1 b/usr.bin/keylogin/keylogin.1 index 32a3e8e1b5b4..69b59cb68c5e 100644 --- a/usr.bin/keylogin/keylogin.1 +++ b/usr.bin/keylogin/keylogin.1 @@ -31,3 +31,8 @@ to be used by any secure network services, such as NFS. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/keylogin/keylogin.c b/usr.bin/keylogin/keylogin.c index 021935163a1d..c8a4206df3b3 100644 --- a/usr.bin/keylogin/keylogin.c +++ b/usr.bin/keylogin/keylogin.c @@ -54,6 +54,7 @@ main(void) char fullname[MAXNETNAMELEN + 1]; struct key_netstarg netst; + fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); if (!getnetname(fullname)) { fprintf(stderr, "netname lookup failed -- make sure the "); fprintf(stderr, "system domain name is set.\n"); diff --git a/usr.bin/keylogout/keylogout.1 b/usr.bin/keylogout/keylogout.1 index 1480a83aece5..b2d0071416ef 100644 --- a/usr.bin/keylogout/keylogout.1 +++ b/usr.bin/keylogout/keylogout.1 @@ -43,3 +43,8 @@ This will break secure NFS if it is done on a server. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/keylogout/keylogout.c b/usr.bin/keylogout/keylogout.c index 03eeee0f6417..faad41462340 100644 --- a/usr.bin/keylogout/keylogout.c +++ b/usr.bin/keylogout/keylogout.c @@ -47,6 +47,7 @@ main(int argc, char **argv) { static char secret[HEXKEYBYTES + 1]; + fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); if (geteuid() == 0) { if ((argc != 2 ) || (strcmp(argv[1], "-f") != 0)) { fprintf(stderr, diff --git a/usr.bin/newkey/newkey.8 b/usr.bin/newkey/newkey.8 index 51dca6688bd0..294198c50972 100644 --- a/usr.bin/newkey/newkey.8 +++ b/usr.bin/newkey/newkey.8 @@ -53,6 +53,11 @@ password of the given username. .Xr keylogin 1 , .Xr publickey 5 , .Xr keyserv 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . .Sh NOTES The Network Information Service .Pq NIS diff --git a/usr.bin/newkey/newkey.c b/usr.bin/newkey/newkey.c index 20d8302461b8..0371688996fe 100644 --- a/usr.bin/newkey/newkey.c +++ b/usr.bin/newkey/newkey.c @@ -105,6 +105,7 @@ main(int argc, char *argv[]) struct hostent *h; #endif + fprintf(stderr, "newkey is deprecated and removed from FreeBSD 15.\n"); if (argc != 3 || !(strcmp(argv[1], "-u") == 0 || strcmp(argv[1], "-h") == 0)) { usage(); diff --git a/usr.sbin/keyserv/keyserv.8 b/usr.sbin/keyserv/keyserv.8 index 17007c7d8f40..578f548cbe73 100644 --- a/usr.sbin/keyserv/keyserv.8 +++ b/usr.sbin/keyserv/keyserv.8 @@ -81,3 +81,8 @@ Display status of DES support (enabled/disabled). .Xr keylogin 1 , .Xr keylogout 1 , .Xr publickey 5 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.sbin/keyserv/keyserv.c b/usr.sbin/keyserv/keyserv.c index 0a4d084c25dc..7099c6cbe39e 100644 --- a/usr.sbin/keyserv/keyserv.c +++ b/usr.sbin/keyserv/keyserv.c @@ -117,6 +117,7 @@ main(argc, argv) register SVCXPRT *transp; struct netconfig *nconf = NULL; + fprintf(stderr, "keyserv is deprecated and removed from FreeBSD 15.\n"); __key_encryptsession_pk_LOCAL = &key_encrypt_pk_2_svc_prog; __key_decryptsession_pk_LOCAL = &key_decrypt_pk_2_svc_prog; __key_gendes_LOCAL = &key_gen_1_svc_prog; From nobody Mon Feb 24 16:10:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1m141JTSz5pPck; Mon, 24 Feb 2025 16:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1m140gCWz471P; Mon, 24 Feb 2025 16:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740413432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LhX193wRd3cD/0tvvxeDFCuR3h+AQsAOpMLANf+SBho=; b=J+UJERClX4PhmWn8GFx0hOb23qZzO8iJSRjDPyYaYYVkoe/3SYVauzorEWCJQALep8gwzK fzuqLLqrXEyP51vQLWNO2Zn6GEPlpoRxxv7dxmBrgSr8wTyUaX97lk2CI6DAqvDdDlSMR1 geI3acZtvHWGZNXi1f4jUEVcaSTJWjCVgrOfH8HBuJyLz9PPDk//n0fWS64cuu6b8UzBb7 R74x1cqS0HfUfvI2DvcxKsv50Q8TRLzLk1t8MW6zDMGn7Uu2YMuMU3v0w4he3Av90ZIw/5 Bu9XhMsjfZ1QhdQPNUPImVBpSZ32MBiwTpf9zu5jOBTEuFtblADLSu1RgFAITQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740413432; a=rsa-sha256; cv=none; b=Odc1kScyCqYihXbilKNyesuPp9KAy/k4alcH7KknLTExsr65tXrC7jEcJ+N0ue7Vg6GcLa J5ve5yC8Tloxan9vwi2iP0biykQr9z2q4+PC1dfT9f4SJehwUj8zIyz3utMFOXaDm9+bV7 id4w66CmCyEyK6vUPo8VJlXVQkoqV4kEVyjtg4CL1phuegemqOPYFLJnORehg6Mr1TWYqo IuTm4QCRuwfyviZ5rN5Z519mARc+LktWRJQpmA34hV4uwxmlN0NNR1i1qBqoogenlZCm9U xf9QACok/QXF4X2sbDPRQfxnsw/iWTwCgGtAkXPOtsewYHq6Y9VllpPeWAUSiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740413432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LhX193wRd3cD/0tvvxeDFCuR3h+AQsAOpMLANf+SBho=; b=OzmwfCQXpjmYqNVnGVhEFbLkGB45cVYDl21Z2EnEmJvzk8yHcuDAo2yOVU/adqs8jpRfJg 6GMtDzJW63EBcuxwYx3SQgdV3/h12uEfZbuPHT4Jqq9iNTDrmhpwJdGus0zMsNlPdrXxt6 45Qg2RrwG2Fi0aPHCe/W8zM+TUS/o/AzhkvctM3IolhI2OIWkgpAz2e6CmuLrJc3qIaKOd D4dtjBQdI+x21fNCpii3ha8r6ZDVvD/ptgyWeqBCsiMfMkc4chK6JpLA/rMooTJamh4qef FN3XStjpFv+KPoVW+M2CE8oWg/tZ9V0cmP2NGwFpqBK0hvwT0A1whwEE2WlD6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1m136phpznpX; Mon, 24 Feb 2025 16:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OGAV8n049975; Mon, 24 Feb 2025 16:10:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OGAVD7049972; Mon, 24 Feb 2025 16:10:31 GMT (envelope-from git) Date: Mon, 24 Feb 2025 16:10:31 GMT Message-Id: <202502241610.51OGAVD7049972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: f510c5b2135b - main - netinet: fix build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f510c5b2135b7ec1dad8329413b83766646cc7e0 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f510c5b2135b7ec1dad8329413b83766646cc7e0 commit f510c5b2135b7ec1dad8329413b83766646cc7e0 Author: Gleb Smirnoff AuthorDate: 2025-02-24 16:08:54 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-24 16:08:54 +0000 netinet: fix build Fixes: 3b281d1421a78b588c5fc4182009ce62d8823d95 --- sys/netinet/in.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in.h b/sys/netinet/in.h index fa710af7cd58..e42422341ada 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -689,8 +689,8 @@ void in_ifdetach(struct ifnet *); static inline bool in_broadcast(struct in_addr in) { - return (in.s_addr == htonl(INADDR_BROADCAST) || - in.s_addr == htonl(INADDR_ANY)); + return (in.s_addr == __htonl(INADDR_BROADCAST) || + in.s_addr == __htonl(INADDR_ANY)); } #define in_hosteq(s, t) ((s).s_addr == (t).s_addr) From nobody Mon Feb 24 16:14:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1m5N1HQZz5pQ4c; Mon, 24 Feb 2025 16:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1m5M70gHz48lW; Mon, 24 Feb 2025 16:14:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740413656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQsBwGukloxHvjnQ6v5yqdURUnkOMUyp2lp5NGPRhu8=; b=mht9Zoy/8Jxr9YBHkmhXdAb7TtRxUC4SOx1ygI8wZm/UtUxajXX+AtFyA7S5rvj0B405KL ObkaoONwt9GL19zQB0JU4OOuW2Lv9F+AgghvYvioXhzsNhxbmLOw7HCMnRkj4CE/MLKFDS WFl0qitpZvMW7seCvCxLT3gxbRYi8Eq/sZSi1XR+QetmUa0bMXGt2VXdhhqQgqZl6VCAcz 5baRD2NXH+JNXJ5Nxu6dFLQ5yFM6yX6VC/6gvwE+wOqhTh+EcPqflEWRKLLvArpAokvKqU Pq+LMZpgPGdJ8vNRcu7n0C7XyrFBEB11kHYNK/s8mQpIzIg411JiZjNYH3XJJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740413656; a=rsa-sha256; cv=none; b=dh0GFVHxKid6s0RLc4EVhQcvH7NRngQjxA7V+Q6/1SsFob4CHGB78dfW01BUHcz7TzU/93 4cifaKXZ3hCCcCafFXB0KySVFpPDcJV9vvLpdGJIrFwKcNLzdRjTom2HBqcMrXsiCSA8U1 sUaogNUtR2N/YVDqgeBouJrrP/UfC8Voq7ENRS3OGbUXp8zHkztMufevTRCXgIBfnE0ICu 1JtDMqXVvSwEeSMOsmwXs9o1pbSbdLhuJ/56CoL4w2OBmKL+VTWM5gCj3Mgk9QfsOsI7db vPy469ZzlaugFPepeSzp5y8Sflc6EfPZqfVjNwhmlmLkx0fAXJP/7cFbj1aSOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740413656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQsBwGukloxHvjnQ6v5yqdURUnkOMUyp2lp5NGPRhu8=; b=LKW1DstJlnZhr356PYc+ygxcNmJmfOnrxhAvc2FFCJQUVwigDJdIv2o8xGZdTkIiHJHivW HfvNdkLqRmWcAxS7jtTs9Smp2B8kGVanfsN/zF6n7xexAVfA1kN97+9CTaIYsQDsJuqGJK 2z+wbgWhkmCvAEveZkA9MI8lhcAN1nHt1iuUn0MhpAemmwMcOs2O0ascmfzzlz2grICrdR eIeOjn/rWG5mBCw2Tw6VxPaFDeOmns1TBzgDVRPl395wxI/6h4Y2TrpKLQY8j5tFvlpmpJ KuZr8VtUQ8OEiUzmF3amVHhojvsb7EGcsVEUKLhrXrHBi41LH7debMMF/DqUNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1m5M69f4zp44; Mon, 24 Feb 2025 16:14:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OGEFsR058240; Mon, 24 Feb 2025 16:14:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OGEFYf058237; Mon, 24 Feb 2025 16:14:15 GMT (envelope-from git) Date: Mon, 24 Feb 2025 16:14:15 GMT Message-Id: <202502241614.51OGEFYf058237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 26eeda7bd656 - main - safexel manuals: Improve apropos and HW relnotes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26eeda7bd65603cdc6ff764349f55416b9766b43 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=26eeda7bd65603cdc6ff764349f55416b9766b43 commit 26eeda7bd65603cdc6ff764349f55416b9766b43 Author: Alexander Ziaee AuthorDate: 2024-11-22 17:45:36 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-24 16:13:38 +0000 safexel manuals: Improve apropos and HW relnotes safe.4: Improve document description (Nd) for apropos. Remove Nm from sysctls in synopsis. This was causing this page to get pulled into results for `apropos sysctl`. Instead, use kernel declaration macros like vt(4). Convert the HARDWARE tagged list to a column list for better rendering in HW Relnotes. Tested in man(1) at MANWIDTH 59 and 80. safexcel.4: Nd: s/security packet/cryptographic offload/ for apropos. HARDWARE: Create this section for inclusion in the HW relnotes. SPDX: both tagged MFC after: 3 days MFC to: 13.5 Reported by: markj (cryptographic offload, Inside Secure) Reviewed by: jhb, markj, mhorne Accepted by: markj (src), mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D47706 --- share/man/man4/safe.4 | 34 +++++++++++++++++++--------------- share/man/man4/safexcel.4 | 13 ++++++++++--- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/share/man/man4/safe.4 b/share/man/man4/safe.4 index 61f2041ff333..89375d058bf7 100644 --- a/share/man/man4/safe.4 +++ b/share/man/man4/safe.4 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2003 Sam Leffler, Errno Consulting .\" All rights reserved. .\" @@ -22,13 +24,13 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.\"/ -.Dd July 29, 2020 +.\" +.Dd November 22, 2024 .Dt SAFE 4 .Os .Sh NAME .Nm safe -.Nd SafeNet crypto accelerator +.Nd SafeNet SafeXcel 1141/1741 crypto accelerator .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -46,11 +48,15 @@ module at boot time, place the following line in safe_load="YES" .Ed .Pp -.Nm sysctl Va hw.safe.debug -.Nm sysctl Va hw.safe.dump -.Nm sysctl Va hw.safe.rnginterval -.Nm sysctl Va hw.safe.rngbufsize -.Nm sysctl Va hw.safe.rngmaxalarm +In +.Xr sysctl.conf 5 : +.Bd -ragged -offset indent +.Cd hw.safe.debug +.Cd hw.safe.dump +.Cd hw.safe.rnginterval +.Cd hw.safe.rngbufsize +.Cd hw.safe.rngmaxalarm +.Ed .Sh DESCRIPTION The .Nm @@ -106,15 +112,13 @@ to dump the hardware interrupt registers. .Sh HARDWARE The .Nm -driver supports cards containing any of the following chips: -.Bl -tag -width "SafeNet 1141" -offset indent -.It SafeNet 1141 -The original chipset. +driver supports the following SafeXcel chips: +.Bl -column "SafeNet 1141" "The original chipset. Supports" -offset indent +.It SafeNet 1141 Ta The original chipset. Supports DES, Triple-DES, AES, MD5, and SHA-1 symmetric crypto operations, RNG, public key operations, and full IPsec packet processing. -.It SafeNet 1741 -A faster version of the 1141. +.It SafeNet 1741 Ta A faster version of the 1141. .El .Sh SEE ALSO .Xr crypt 3 , diff --git a/share/man/man4/safexcel.4 b/share/man/man4/safexcel.4 index d5e079822ecc..e14eebe40da2 100644 --- a/share/man/man4/safexcel.4 +++ b/share/man/man4/safexcel.4 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2020 Rubicon Communications, LLC (Netgate) .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,12 +24,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 2020 +.Dd November 22, 2024 .Dt SAFEXCEL 4 .Os .Sh NAME .Nm safexcel -.Nd Inside Secure SafeXcel-IP-97 security packet engine +.Nd Inside Secure SafeXcel-IP-97 cryptographic offload engine .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -69,6 +71,11 @@ AES-CCM .Nm also implements SHA1 and SHA2 transforms, and can combine AES-CBC and AES-CTR with SHA1-HMAC and SHA2-HMAC for encrypt-then-authenticate operations. +.Sh HARDWARE +The +.Nm +driver supports the cryptographic acceleration functions of the +Inside Secure EIP-97 device found on some Marvell systems-on-chip. .Sh SEE ALSO .Xr crypto 4 , .Xr ipsec 4 , From nobody Mon Feb 24 16:20:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1mDc5yhzz5pQdM; Mon, 24 Feb 2025 16:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1mDc4Xy9z3FZD; Mon, 24 Feb 2025 16:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740414032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XpavRXfchEUAqDwOMPSE0F8R8sWVsRQ8eeRC3uzTTMM=; b=IVMi4LWjH9c1Yvk37hncGsDBx2PSYx5RpnYSdutcq3QBlIcY4xSKt3aZSmlUnzNEO/g6UO Gkf9k5gAwHvwlM6VWvjzC0BllGfbbhhmp5e7k2nMq7PhhAaN2qRyV+y6NQSYUk/KrM4W6o ARqPrxOSc6GpM9YdVOdLem4ON/xLE0j95R/U2jXUPpQB8pdPHsQV9tJD8yP0GUXT7cE53d R2tT1SNnIll7kV5iR0DgYGJrpXbllkC4nawU7WheETr8oB6iMrCDc7pDC8VCN2iz3ao8rt neHwmgYHxg4Snm+a/9kwa43YUuGgVX1rv1jji9mcqM+lVukE848Pte6dhhGZ5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740414032; a=rsa-sha256; cv=none; b=li9YLcd/dQt8nZ/RjzV2aE1eWsPszWIAfYiktwcNr8r8qd/rxPm5DchI78iCnq+Y/wqqAp 3cFn+U5IDQuWdhXY1IvlHJ9/wPtEoAihqkh8l7dZcO5Kw1MTkgoNiSdzrENXabbnkRBpEe yFUrRZSjIyjZbcm09GfC7hjgJTM3nHwyfahZBtugvOQzy+P6mNA0/TLr5XDy8E/yvbsEa3 ZnOkFCOGmJz/YkB/3mMhxlg86nZdFCPEO5UeKIVCpcSeROSdwmG5BIXjILC24BcnvX+/W7 30pCr8VWUzSMuKcx5AQ1gHD3KX/QoRgW1NStLvm9h2pfC5BaRym/juPBdpioIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740414032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XpavRXfchEUAqDwOMPSE0F8R8sWVsRQ8eeRC3uzTTMM=; b=IhBdtGmYjOigZjXvUbTQ00palvkWoqEBzL8UhUkOevsgqGUGjHmlk+6g5EtnIOMiXs8LlR EZ3q4+UmEXUGYLqBOGFYgYhqvQKJZhHXYjF6k01MEsIwALZH8+UDi5cyc2mynS6zdSRi3F slPKH8WcRfLL7kAbsY9FTcNeWQAP6+KcLPAkjcwkO6lIJhGoDzr1sHUvQtyb5jSA55cUTN 87R7wBvKYHcIwBr62pyKTbLVxqAg6dGjVAkaDablFf+JxK3prf3IFNZep/mMMHi1J0WWr2 KbgTo8US9pgaK/d7QdegaBwo378S+njznJwAMqAInq5qBvxOwOQgWtigCsQImQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1mDc43rlzp6R; Mon, 24 Feb 2025 16:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OGKWU8068743; Mon, 24 Feb 2025 16:20:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OGKW6e068740; Mon, 24 Feb 2025 16:20:32 GMT (envelope-from git) Date: Mon, 24 Feb 2025 16:20:32 GMT Message-Id: <202502241620.51OGKW6e068740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: f4727eca4057 - main - sh.1: document optional arguments to `:` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4727eca405763dd1feb4ca3e17be40c2da337de Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=f4727eca405763dd1feb4ca3e17be40c2da337de commit f4727eca405763dd1feb4ca3e17be40c2da337de Author: Alexander Ziaee AuthorDate: 2025-01-09 17:51:57 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-24 16:19:22 +0000 sh.1: document optional arguments to `:` TIL the `:` command accepts and discards arguments, and this is occasionally used to embed comments in interesting places. While here, fix another `...` argument that was not marked up. MFC after: 3 days Thanks: Community Discord Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48398 --- bin/sh/sh.1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index a34f7676fffa..3d3f200a8e17 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 20, 2024 +.Dd January 10, 2025 .Dt SH 1 .Os .Sh NAME @@ -1945,8 +1945,9 @@ make it the first or last character listed. .Ss Built-in Commands This section lists the built-in commands. .Bl -tag -width indent -.It Ic \&: +.It Ic \&: Op Ar arg Ar ... A null command that returns a 0 (true) exit value. +Any arguments are discarded. .It Ic \&. Ar file The commands in the specified file are read and executed by the shell. The @@ -1968,7 +1969,7 @@ it is sought in the current working directory. .It Ic \&[ A built-in equivalent of .Xr test 1 . -.It Ic alias Oo Ar name Ns Oo = Ns Ar string Oc ... Oc +.It Ic alias Oo Ar name Ns Oo = Ns Ar string Oc Ar ... Oc If .Ar name Ns = Ns Ar string is specified, the shell defines the alias From nobody Mon Feb 24 17:32:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1nq61WTQz5pXgl; Mon, 24 Feb 2025 17:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1nq610PZz3qY2; Mon, 24 Feb 2025 17:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740418322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uWUA2CSGjSXgEhW6n7Gljc+G2PO5Dzkk0iz3Xb/r2nI=; b=xZTf1OhdmMEQgS6Z0rlOzScQzW+15ZBbQU7188PyI+N9wHmwzrXl3eJxnyJLAVE2nEdD4T ft6pl8g+1qJcLxR9s20KRDv58pZRvBMOywAAIHbKgmmtdHDD6ZlqygPDwcF5wDqozZ4RPG 9FgxUoGvdj/TFwZwTwRu2WRHVAjXczCso+5Ko8k8C3nbmFq7RMc8oeaV8caxkhVyMasNcP rfTAenxRbnG1vxkXjyahhZyKM6GJhZGn+t3gr1Aw2FPyuxKXpsnf73wyURULpmR8lE45NO oIhjgTBg+JHk374ISawL/E8gmDOgZWDxZCv9C9JjQQC09IW0nQvJXe5GHTdCMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740418322; a=rsa-sha256; cv=none; b=aN713MA+C2WBFyBLx17tn6RtIUoaX6043Nm4mpIF7EM/3YIlC99nYl1YVKoS0CQx4haCOj zjWntLgl3FQ7lrGz8Z1F2xFBowicDOpSQROUuigMIaL9edc3w0p+Xh+SOSirK0YwhyFCGU 4DWu1fwJ/YTsKmnBgqlie2cdD/J3B/J+KagagSr2TCKhO+AMjnAuXuCz04ER7liLH9k08e wHLpMG9qQ7iTQj9YOvdYvnxPfpUWzhltB2WIynnsiNxen4yBVTfVidZNrWRkKDaVZ051by XNifjBqx6j9G0svYQiI+q7t71aVVfSTG6DScyPz/jfWeHtQdNgFpqpUsMZJeUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740418322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uWUA2CSGjSXgEhW6n7Gljc+G2PO5Dzkk0iz3Xb/r2nI=; b=ropX4PHws5uJXy0ee3jzJPjnbkqbRznqY+Lou10NkeTXesU3fCp2NYLjuN4aAqUGRdMIRo jpcS+KGnH75pnVbtdPvxeoUjGvkCHZZBu6bNMhXFKLresc0KkgcFk8rGCUe0N4cUfSPpoB cdMvCtyBGKQrCZV3l1W6BUss4DQnKTxH3q0mhgxRtqbve3xruSsA0Hh5GeAaZ0GNYjJC5P Eyb8VNi5oQwu+N3hv/r8Ke9k+Oul+bl8NPPcWPX3xtnBCO1pRncVZ3hKYlh7B9p+ji7qkN YekbNG1J1XjwEy7TTHlre/FKpm1c4rmacDTJxQlJmwpYDEjT1AIiK5epg7++TA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1nq60Vn0zq81; Mon, 24 Feb 2025 17:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OHW2OT002744; Mon, 24 Feb 2025 17:32:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OHW25t002741; Mon, 24 Feb 2025 17:32:02 GMT (envelope-from git) Date: Mon, 24 Feb 2025 17:32:02 GMT Message-Id: <202502241732.51OHW25t002741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 5a0d9605a44b - main - bridge.4: Remove incorrect line + polish List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a0d9605a44bf39402211e009365f1043faa2b0b Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=5a0d9605a44bf39402211e009365f1043faa2b0b commit 5a0d9605a44bf39402211e009365f1043faa2b0b Author: Alexander Ziaee AuthorDate: 2025-02-24 17:28:51 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-24 17:30:53 +0000 bridge.4: Remove incorrect line + polish In an AMA on Community Discord, it was revealed that simply setting a bridge to up is not equivelant to setting it as "inet6 auto_linklocal". Remove the incorrect line, and while here: + reset sysctl list width to indent, saving 2/13 lines on MANWIDTH 59/80 + tag spdx + break two long lines over 80 characters MFC after: 3 days Reported by: Antranig Vartanian Reported by: Jan Bramkamp Reported by: Niclas Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48981 --- share/man/man4/bridge.4 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 31a0ce43a263..b741ec0b73c8 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-4-Clause +.\" .\" $NetBSD: bridge.4,v 1.5 2004/01/31 20:14:11 jdc Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. @@ -33,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 10, 2023 +.Dd April 10, 2024 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -125,7 +128,8 @@ variable to .Li 0 . .Pp -All the bridged member interfaces need to be up in order to pass network traffic. +All the bridged member interfaces need to be up +in order to pass network traffic. These can be enabled using .Xr ifconfig 8 or @@ -165,11 +169,6 @@ variable configures an IPv6 link-local address on .Li bridge0 interface: .Bd -literal -offset indent -ifconfig_bridge0_ipv6="up" -.Ed -.Pp -or in a more explicit manner: -.Bd -literal -offset indent ifconfig_bridge0_ipv6="inet6 auto_linklocal" .Ed .Pp @@ -261,7 +260,7 @@ the appropriate interfaces. Either stage can be disabled. The filtering behavior can be controlled using .Xr sysctl 8 : -.Bl -tag -width ".Va net.link.bridge.pfil_onlyip" +.Bl -tag -width indent .It Va net.link.bridge.pfil_onlyip Controls the handling of non-IP packets which are not passed to .Xr pfil 9 . @@ -470,8 +469,8 @@ ifconfig_fxp0="up" .Ed .Pp Consider a system with two 4-port Ethernet boards. -The following will cause a bridge consisting of all 8 ports with Rapid Spanning -Tree enabled to be created: +The following will cause a bridge consisting of all 8 ports with +Rapid Spanning Tree enabled to be created: .Bd -literal -offset indent ifconfig bridge0 create ifconfig bridge0 \e From nobody Mon Feb 24 17:35:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1ntZ2x7rz5pXTj; Mon, 24 Feb 2025 17:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1ntY6TS3z3rFl; Mon, 24 Feb 2025 17:35:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740418501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jljqb6mLF4U79GZD/wpmP5lUm8ormDOadt+XfSiHC1o=; b=Z4uzi3CwB+Nvvp7QuUNbv2FTzXPZ8iJAeGxzo2SsPtPf2eYd3vYtGEd0y8YS9B3HiK4Zgy 85SksYj9Ggkc0/XS09wIXZNHsp1h+sb4oSfCwNsUl1oWK9CyqXbfluGTznlpR8OCUBkH4d ceBB5d8w+5R+ABeLoexYoid/Z360uropeBL8rTfx5mbM6ojnWGTX1oJ1aO1RK4xe50ov90 xbO+k/Hu72b/3bPIA3of2CK33mAeeCQbe2+OI2vo22OrY6UWDYCoQXX3VEcsDdg2EIMY+7 bFcbCUW67L+HMjUDEMLzFJdX1bsNieMmNpAEh7T+C4UOOIwpIY0n3w27Tb1rDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740418501; a=rsa-sha256; cv=none; b=OWaH/mk5Y5OU9eH05q0BIw6Hg0JGfilITks6q135Nuf6TIqYC/H++jtQziAu1b5nPtZTmj N2E9FOQXL2PxfASbpC6UQHGf0BjbHVMTkqL83eR+aGhNiU+zaHW9jieNebM3PVNLaPC3yl LuGwhSOZ2I3I+55geVrYeFNWMHGpwwxerYwbd1oJ9JGPMGkS8y0rbCmJ6SllSSqUWOWa3k BbA7je451DVhWiAocPQCgHrKjkCR8kFOxbtCT/XOFEMFgO0Ndx+nDPUxk1OiNblktrE9PJ RfB8dEHHaX0QUd4+MuLccOfgMWqAdZ58MZ8lg7Tk09CC9nNjaX8Qav+MPcEvpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740418501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jljqb6mLF4U79GZD/wpmP5lUm8ormDOadt+XfSiHC1o=; b=P+TZsdaFfY+P/wdLjIYRHQvpEPPNSs4tQTd4CXL9z9HutrKnqURZXWXTt0bm0K6Byj+/GH ldTpKURlHVGtrkZ9sx7O96YtHywGPsP1BdEdcOKfahHeTaKGwyBhzUc9Oq3Jsj8PRZtr0Z 4VDGbzGdJ5hfxet7DoSNrjanyI8e1MKpxlTgLcptCdlUMB1fYZUGODvucO2t5ym17iTyfy r3LPp64zWkc9iMJ2BMR0fqYXal/wbn3iFVI4jFHuOq4J32spIvCS7D0HbsyqmaBVNRODgh Bida87GBVDl7tzvNl6jgkX1vxgEQmlND44edwv3+3YKmEvSDBV47t0NeOJ1Dhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1ntY5vY4zqpd; Mon, 24 Feb 2025 17:35:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OHZ1B3008794; Mon, 24 Feb 2025 17:35:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OHZ1OQ008791; Mon, 24 Feb 2025 17:35:01 GMT (envelope-from git) Date: Mon, 24 Feb 2025 17:35:01 GMT Message-Id: <202502241735.51OHZ1OQ008791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 7c3c8605d62f - main - recv.2: Improve style in RETURN VALUES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7c3c8605d62f5d27a5228a3787aae6e573f77d59 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7c3c8605d62f5d27a5228a3787aae6e573f77d59 commit 7c3c8605d62f5d27a5228a3787aae6e573f77d59 Author: Alexander Ziaee AuthorDate: 2025-02-24 17:33:24 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-24 17:33:38 +0000 recv.2: Improve style in RETURN VALUES Reported by: des MFC after: 3 days Fixes: 571df2c64a3c1 (Explain how recv functions can) Reviewed by: mhorne, des Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48995 --- lib/libsys/recv.2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libsys/recv.2 b/lib/libsys/recv.2 index 9dc1f3cc84ca..f3ee60b75663 100644 --- a/lib/libsys/recv.2 +++ b/lib/libsys/recv.2 @@ -316,14 +316,14 @@ On data reception the .Fa msg_len field is updated to the length of the received message. .Sh RETURN VALUES -On successful completion, +On successful completion, the .Fn recv , .Fn recvfrom , and .Fn recvmsg -return the number of bytes received. +functions return the number of bytes received, while the .Fn recvmmsg -returns the number of messages received. +function returns the number of messages received. If no messages are available to be received and the peer has performed an orderly shutdown, 0 is returned. Otherwise, -1 is returned and From nobody Mon Feb 24 18:13:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1plF2cjRz5pcKZ; Mon, 24 Feb 2025 18:13:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1plF04jbz3DQ4; Mon, 24 Feb 2025 18:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740420825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x8KUwZZOXOLcPk2VDIRZCmWC/tdkG49YbJtn8+nZQ0I=; b=EXFRTFXTuA+1kNncC2UTzwiEJWHvU/UIus2QhzHgeNAY2Q45ALvHQc/1k3+uthOyGxoGup 2gAZ0ffs9gZvRWLQMp/T9yWHuabIBQKgz2uKlivCtyT+sU77BoUWWjDHhlx9hKg619ZP1P wXkxTJgMp0ZGO7AAvr5jpDfs56ZWbdUePiJbBdn1tiCGJ/a6mZ8gBGBSoz6JTG/CH2wFOF jYx0siiy0Xs3Kp1HB1uHeHJTrsuD7ZVtTqcoGmRH0sWWh2mvzGlXjt72Wawot/AGdDRpvj E7h1+kgwsk+1cLNzJGRi6eyAr2MjObVNTp++6zBb2GOlvbFYrpeEk5AwR/YkNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740420825; a=rsa-sha256; cv=none; b=wzhJA272f3o7YgETomBgcyRP+B42e5mZONqDObPVDaZHeNY6Z+woiJ8IbJnxiQ9MhiotPB mMjOOaYSqUkeVzRzsrcRDuj8U4EWD3u9u7jqbERJZx/8hpKnsM5dp/iegxepfOHkZNVdo/ eBuW4UXw+u6U+eEwAujqpUtHLfzqKF5aGOwvVYwc3PfhhM4N1Upkm/WQfhFYCvKNkPha7g 0H1LnpK+pc86RfnRogrGOaT8TpZn6HpY7q2YkfivGh9PlEsEKxMsBEYhyrQsiybSgPfL/I clBpwuyqaFbKzQkseLyq9STaefLUaNAP7X7WceRIeMYjJNDTJGDF9JQmMgANuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740420825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x8KUwZZOXOLcPk2VDIRZCmWC/tdkG49YbJtn8+nZQ0I=; b=C9S7i11z+9VbJjHUNfpvTUM4EB9+/1FpGvXLJDK5iBs7VR+bDYGsHaccIb80MrTj8rnc+5 3+iYhn+DEuFokWPuaDSbS+WNtHBDR55NyPzkXi5P6H2VOJkVQ0ZAu2mvYeDL0wfC1g2K9P GwfzmfSq+PxahuWzV/n21K2XqMxKlC2gTe0ruWQwdw35jReCaZi5bs7htRdq+x2wVZ3m7t MvXyyRc50ENeLvSfeKj/NQOfO7A8wvIzRyU98aZRVwIlhOxR2YAsnPHfQw79k8wQYq3EDh X1Tg5x69estz8gIRPz4GqVyzPA4cqz794+n5+soIkRaoSln6ioXzaGkMjlfdMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1plD62fqzrnq; Mon, 24 Feb 2025 18:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OIDi73083596; Mon, 24 Feb 2025 18:13:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OIDi6k083591; Mon, 24 Feb 2025 18:13:44 GMT (envelope-from git) Date: Mon, 24 Feb 2025 18:13:44 GMT Message-Id: <202502241813.51OIDi6k083591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 476f352b5a08 - stable/14 - Use the correct idle routine on recent AMD EPYC servers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 476f352b5a080d94ea2c375fdb311813feb7e14b Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=476f352b5a080d94ea2c375fdb311813feb7e14b commit 476f352b5a080d94ea2c375fdb311813feb7e14b Author: Andrew Gallatin AuthorDate: 2024-11-08 21:37:32 +0000 Commit: Ed Maste CommitDate: 2025-02-24 18:11:34 +0000 Use the correct idle routine on recent AMD EPYC servers We have been incorrectly choosing the "hlt" idle method on modern AMD EPYC servers for C1 idle. This is because AMD also uses the Functional Fixed Hardware interface. Due to not parsing the table properly for AMD, and due to a weird quirk where the mwait latency for C1 is mis-interpreted as the latency for hlt, we wind up choosing hlt for c1, which has a far higher wake up latency (similar to IO) of roughly 400us on my test system (AMD 7502P). This patch fixes this by: - Looking for AMD in addition to Intel in the FFH (Note the vendor id of "2" for AMD is not publically documented, but AMD has confirmed they are using "2" and has promised to document it.) - Using mwait on AMD when specified in the table, and when CPUid says its supported - Fixing a weird issue where we copy the contents of cx_ptr for C1 and when moving to C2, we do not reinitialize cx_ptr. This leads to mwait being selected, and ignoring the specified i/o halt method unless we clear mwait before looking at the table for C2. Differential Revision: https://reviews.freebsd.org/D47444 Reviewed by: dab, kib, vangyzen Sponsored by: Netflix (cherry picked from commit fd67ff5c7a6cd9a2e82e6a02ea249cec76a4c030) --- sys/dev/acpica/acpi_cpu.c | 9 +++++++-- sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 80855cf168e9..63e17de1ff28 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -131,6 +131,7 @@ struct acpi_cpu_device { #define PIIX4_PCNTRL_BST_EN (1<<10) #define CST_FFH_VENDOR_INTEL 1 +#define CST_FFH_VENDOR_AMD 2 #define CST_FFH_INTEL_CL_C1IO 1 #define CST_FFH_INTEL_CL_MWAIT 2 #define CST_FFH_MWAIT_HW_COORD 0x0001 @@ -855,7 +856,8 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) acpi_cpu_cx_cst_free_plvlx(sc->cpu_dev, cx_ptr); #if defined(__i386__) || defined(__amd64__) if (acpi_PkgFFH_IntelCpu(pkg, 0, &vendor, &class, &address, - &accsize) == 0 && vendor == CST_FFH_VENDOR_INTEL) { + &accsize) == 0 && + (vendor == CST_FFH_VENDOR_INTEL || vendor == CST_FFH_VENDOR_AMD)) { if (class == CST_FFH_INTEL_CL_C1IO) { /* C1 I/O then Halt */ cx_ptr->res_rid = sc->cpu_cx_count; @@ -872,7 +874,9 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) "degrading to C1 Halt", (int)address); } } else if (class == CST_FFH_INTEL_CL_MWAIT) { - acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); + if (vendor == CST_FFH_VENDOR_INTEL || + (vendor == CST_FFH_VENDOR_AMD && cpu_mon_mwait_edx != 0)) + acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); } } #endif @@ -922,6 +926,7 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->res_type, &cx_ptr->res_rid, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx) { + cx_ptr->do_mwait = false; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu%d: Got C%d - %d latency\n", device_get_unit(sc->cpu_dev), cx_ptr->type, diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index f19c557e270b..6609871bf89e 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -62,6 +62,7 @@ extern char cpu_vendor[]; extern char cpu_model[]; extern u_int cpu_vendor_id; extern u_int cpu_mon_mwait_flags; +extern u_int cpu_mon_mwait_edx; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; extern u_int cpu_maxphyaddr; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index d97c9c47e97d..000f99c683e7 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -113,6 +113,7 @@ u_int cpu_stdext_feature3; /* %edx */ uint64_t cpu_ia32_arch_caps; u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ +u_int cpu_mon_mwait_edx; /* MONITOR/MWAIT supported on AMD (CPUID.05H.EDX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ u_int cpu_maxphyaddr; /* Max phys addr width in bits */ @@ -1606,6 +1607,7 @@ finishidentcpu(void) if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { do_cpuid(5, regs); cpu_mon_mwait_flags = regs[2]; + cpu_mon_mwait_edx = regs[3]; cpu_mon_min_size = regs[0] & CPUID5_MON_MIN_SIZE; cpu_mon_max_size = regs[1] & CPUID5_MON_MAX_SIZE; } From nobody Mon Feb 24 18:17:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1pq62fjDz5pcd8; Mon, 24 Feb 2025 18:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1pq61qzcz3G7L; Mon, 24 Feb 2025 18:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740421026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y8WYG52VaxGiY3n5gJa9ZhIX7b+zvLsoC7ZRM6d7X6s=; b=GONlLNAhPckmiVW2lOeQueYlmnCxndIzsAKRs66yzXFLfE4QMbP0LR0EmA7VKRxM8LTu3+ U35PczfSmGQra8j+nDJl9iWoe8bz+akyNbCpIP/nIHHMJT1aG+OOuAGcH2m2gubLjh+s8F khd5faOKXZbWaSRlfa5pKoljwErPEONxxBmwtD8dnVfBTx9KvrBUkprzmjfdipKvxlUINe 9ELZNDuBnUDQHb5iF0dghzMXUdBn2RAkOCVXJNSti8rwXmUsM1GBgvypCjQeyCrHAz2bHa h8nh0UPBluRwELhIwtQ8nzx4MCSK3cJ/uwe0Q1qVX/A9CqB4zEmnMzSLFN5kAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740421026; a=rsa-sha256; cv=none; b=DSDvHkmQhLIo3+2afvPsjwxF9f5rkIqq7DWurMCKLlpkomjoWw72pISRReQYoQ3Gj9/W8+ POSr/CWl6X5JbyVmtJkMlFukF7vVKaC3y6nk1mEwjStmWnOhfYBDYi9uCfuQ8YA57CSfBg jBiQwpnqMozjUTIrUOpaib+/yvIfhmg0qD7hgU1jHHlYEU9yMmhXZHzEeMo5KwJTQLZa7H Jlo7W5Vvb0kX55CosQymNfLbyvO8uGwpZEH04dzp19rr/O8mN+QQEMBSWSpJrMhNsX/WH6 IMbKgHD5u1+DznU3R4VF+xI8xK+9IIz97EDfZ3cU9THXcwuHzSQ3bNMtuuapPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740421026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y8WYG52VaxGiY3n5gJa9ZhIX7b+zvLsoC7ZRM6d7X6s=; b=GRff5VwJHvf3ANFkWH71skL2BDIGrK7Oaj41puEoUOIah08L/4onBwfAlYw6bFDy2cyrjW sfCOHjtPutcOBJuW+HcxUPz+Tp/xmfh4VUqnMvupKIxEbxt4t4WJibIVyHN1f92JDi+8kx r0Z6/wAEW/xltMhcIOrho3/2ruIIHc2ABIRlfCvjDNQGr0+RCIfLOv5Y7oxhB5P6E7oNBz snEL8Dz6iNMq+bcxMc7LnSwXvAChJfHo3H7eCu59w6Trezc7XhWgczy19pZhDoOZAzg8N/ gEca/LrQJ1A0EVboT/dgo3cOK3ueUnu9E5+vWEPA56SbIEsAH7YH3iqlR+BF5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1pq60scLzrwd; Mon, 24 Feb 2025 18:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OIH56e084717; Mon, 24 Feb 2025 18:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OIH5Ee084714; Mon, 24 Feb 2025 18:17:05 GMT (envelope-from git) Date: Mon, 24 Feb 2025 18:17:05 GMT Message-Id: <202502241817.51OIH5Ee084714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0932ae6b9977 - stable/14 - lpd: Tighten permissions on /var/run/printer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0932ae6b99779a4da1c8032f6622e46750786181 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0932ae6b99779a4da1c8032f6622e46750786181 commit 0932ae6b99779a4da1c8032f6622e46750786181 Author: Stanislav Shalunov AuthorDate: 2024-10-11 15:49:02 +0000 Commit: Ed Maste CommitDate: 2025-02-24 18:11:34 +0000 lpd: Tighten permissions on /var/run/printer Exclude group read/write permissions as well. Otherwise, group wheel can submit things w/o the normal accounting. While group wheel is generally trusted on the machine, submitting jobs w/o checks is not one of the functions we document for that group. PR: 17289 Differential Revision: https://reviews.freebsd.org/D47040 (cherry picked from commit 6cde8f3ef7cd060be39d78055eaf982b06b19a3b) --- usr.sbin/lpr/lpd/lpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c index 19456c9406df..c9a7e1615b74 100644 --- a/usr.sbin/lpr/lpd/lpd.c +++ b/usr.sbin/lpr/lpd/lpd.c @@ -326,7 +326,7 @@ main(int argc, char **argv) sigaddset(&nmask, SIGTERM); sigprocmask(SIG_BLOCK, &nmask, &omask); - (void) umask(07); + (void) umask(077); signal(SIGHUP, mcleanup); signal(SIGINT, mcleanup); signal(SIGQUIT, mcleanup); From nobody Mon Feb 24 18:17:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1pqt5F4Pz5pcQG; Mon, 24 Feb 2025 18:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1pqs5CH5z3GZ2; Mon, 24 Feb 2025 18:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740421065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qwjz2aJVxsqG7GNAoc8qGzIT3K+wXaDiTYQrbZAIcP0=; b=lqxb9PpThEvoWMVzXyOzenjEvGoy31b5TTbTReRjXP8AxwupMAam1+hcPwn+pQHq/Gj8+r dRXskLUfamsvuG+kMIjkFSIO5N8qcAHgFbYLx5KYC9X5u/tKwGYPgkCWJytA5/nV4zq+Sl rE3wO0U57kDIGvAo8MUMXNUICXC3zcAzQcBcTlE/ltpUesNGFEs8JhvLWioyVV0v9QWvQE 2s0tzdHxT158ir3Up80VpdMWNf0fpdcMy3pIUbgGIVRS0+Iayl6cF0Lue2AvkOhFKGJmS+ ZTt1FdnVRrkEM2qP8DCeDtnZGgatRZllbvvUNbUVywc53YCUg9Gyi52MPC8RFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740421065; a=rsa-sha256; cv=none; b=ucZ9237PAJWgy+rUtKl217XpnYfqkLXOKs6DNO7Pa9ql4wQQE8pNOxJmyn9ufpUQGaUvvK A4YH9z1Fyd1+7o6+EX24AsHrDVMcPzBqfDHi5K2zEjsRlPl/meh3QPU1fMv04aSDNNXEEb EgmjS1iLCBPiQe9Pvlyba32/miBTGb6Zcsadc24cZrhcBrMDddtHu0CzYj5TwT1LI8LS2P H2TbDkiVI+NZmSRZiH5AgCbfTBmyvCZ1tqgzjF67znAS5Zix6XMLJY7imdMGdAdeYpGYrC j60tCV6n0dLT9CGgPJyHkyLwILF9Vvi3AKnaS1yy6aWQhr8bDKH/JXlGIkINjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740421065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qwjz2aJVxsqG7GNAoc8qGzIT3K+wXaDiTYQrbZAIcP0=; b=J1AKdpUUPXynwCec5dW+exfnZ4E7APR7FqCnu7HMZTW5zpJJZcY55EiTC3wgYW60SoDqxC St7272ENspsJYZeFEmxEBi3YLe9mIyWslQsSkADq8yC4sX3MIQ+4B+p03ODuiRHq8sKeMA dHoSckKkPnePkLZ46lN7FfiAUWrTfiEmrWvgND7SdrUlOwz0tMEE/NuYwYdcPFVihevyJK 01sfGQ/RVku3peBX1RFkjWmfcSLNGr25Twnud07mQVU+Xk2DbyVQm0jIhHJZpry76f84Fq j6fLjsbFVW/oHmadsjsc3T/gosri4ONlpUNvypoWIy2le14jjnYA5ofMgyuBUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1pqs4p3Zzrns; Mon, 24 Feb 2025 18:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OIHjlM085039; Mon, 24 Feb 2025 18:17:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OIHjVo085036; Mon, 24 Feb 2025 18:17:45 GMT (envelope-from git) Date: Mon, 24 Feb 2025 18:17:45 GMT Message-Id: <202502241817.51OIHjVo085036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: fc889167c319 - stable/14 - firewire: Add deprecation notice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fc889167c319dfa9952bb2bcad6d5dbcad00cf7a Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fc889167c319dfa9952bb2bcad6d5dbcad00cf7a commit fc889167c319dfa9952bb2bcad6d5dbcad00cf7a Author: Ed Maste AuthorDate: 2025-01-22 20:51:45 +0000 Commit: Ed Maste CommitDate: 2025-02-24 18:11:34 +0000 firewire: Add deprecation notice This was originally discussed as part of FreeBSD 15 planning, but did not happen in time. Add the deprecation notice now, with an expectation that it will be removed before FreeBSD 16. Reviewed by: brooks, imp Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48598 (cherry picked from commit cda74c35cb37aa8ecb536aae8d93451eafec15df) --- share/man/man4/firewire.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/firewire.4 b/share/man/man4/firewire.4 index 4195d4da694c..27c502ddef40 100644 --- a/share/man/man4/firewire.4 +++ b/share/man/man4/firewire.4 @@ -29,7 +29,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 6, 2022 +.Dd January 23, 2025 .Dt FIREWIRE 4 .Os .Sh NAME @@ -49,6 +49,11 @@ module at boot time, place the following line in .Bd -literal -offset indent firewire_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed prior to +.Fx 16.0 . .Sh DESCRIPTION .Fx provides machine-independent bus support and raw drivers for From nobody Mon Feb 24 20:27:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sj36qNxz5ppr3; Mon, 24 Feb 2025 20:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj337SBz3nkg; Mon, 24 Feb 2025 20:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fA+AI6Nbn9L89uoetMEn2xwBwfQFpggCnI1VnWAXOhY=; b=NusfFURpXM7AxGEYh0EmQwOoh1/8Fec8lLsDpalotTOaUjQ2IA423B59GBPLHqlHORwl8d IgEkZdE7xC37mc1UougOZH8dbWVUHC8h3eiYYItbCbOh1+v9SNF//OcTOh81X9LJAP+pPu KCgRsjN9qqen5FgqTrnt6mFb60EQ3wyXaOpQ0RRE0LnnBQMnQzhU8KJhWTjpWawI/EJDYf v+zy+PrU+CWY6TcqFUtNyN2gmmeb7iawTydp9PBVrt+fqvV05PovHp/KbjcJPPCAcDbbaX vceQW4q09CcqppfHSUBXqlocFAnOIJpXBH3zosgkhgQepEtzZ8V5iJTd0zD9Eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428823; a=rsa-sha256; cv=none; b=pZhXiQ9XTQOEtQsVFHrD7yH+Z4rY+TKSpP55rh7z4ispbxQkl06VFHf89JXJnKFWY7eMjQ Wsvfr5OuJ6A6iggvgB0uGp5TsdE5rpUHLEoi95DlYiw1SYks/FUcWkyAO105ZjiWPDkfu9 qjdFSUMaPDSq8tUw+M8Ot0DG1EgRqSCtazryyrpdyCG2JuKwWFczq3WeT+0J991kDTk83l dAfAm4PdMAcK6l8SPGzNw1fy4jzYxQDNJaQH/7xb7HJZNObiwLNl/LBD37FiJ7+R7yBXxM 7R1FrItU4UTqVUwvQn24KJ66nAENMw/o8OoxJUzgOF142qoyAnJtRd+gofzu6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fA+AI6Nbn9L89uoetMEn2xwBwfQFpggCnI1VnWAXOhY=; b=xlv7TK+F+J/kOuCjCeOfoRlqKY42bgzag3LSUQf4SK7hUxdgqHA4TK2GcOVp5C2sqoa2cY 8ZVq1n1NCxwIeats+Lb76z8kwTLBGmY/Cp99eaBOkTyvSUSNkq4hKy4AmYBTbBRE754G3K /i+N9+uGyD54KU9igCVjcVFPdu9RAxR4lB9RcEcUISTloI4LnLd4AUcMGDpjQWz6VOb5Mi TvNaCbYfqGHT3+s+Uq2mMSINW80rv1p+wTmRQU6VHYjjEP+y/YNNcBCE5zERPctcIcpTiU aDKF/8eABvUBWOzGZYQvOmilOoeNuc5xJRbtmaRa54yttg4C/X7v2Lgc9UUn8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sj30lh6zwYN; Mon, 24 Feb 2025 20:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR2xQ027012; Mon, 24 Feb 2025 20:27:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR2Nj027009; Mon, 24 Feb 2025 20:27:02 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:02 GMT Message-Id: <202502242027.51OKR2Nj027009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b3c037c2bcad - stable/14 - net80211 / LinuxKPI 802.11: add 802.11-2016 VHT Extended NSS BW defines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b3c037c2bcad385b372539875e57fdd2f7215e3d Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b3c037c2bcad385b372539875e57fdd2f7215e3d commit b3c037c2bcad385b372539875e57fdd2f7215e3d Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211 / LinuxKPI 802.11: add 802.11-2016 VHT Extended NSS BW defines Add the mask and shift for the VHT Extended NSS BW Support field. Document them in net80211 and further related bitmasks in LinuxKPI. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48975 (cherry picked from commit 75fb66d8241d0487baf482c975c1de3b55d9a315) --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 3 ++- sys/compat/linuxkpi/common/include/net/cfg80211.h | 3 ++- sys/net80211/ieee80211.h | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 58ebbcfe0097..0169e12b1804 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -115,7 +115,8 @@ enum ieee80211_rate_control_changed_flags { #define IEEE80211_TKIP_ICV_LEN 4 #define IEEE80211_TKIP_IV_LEN 8 /* WEP + KID + EXT */ -#define IEEE80211_VHT_EXT_NSS_BW_CAPABLE (1 << 13) /* assigned to tx_highest */ +/* 802.11-2016, 9.4.2.158.3 Supported VHT-MCS and NSS Set field. */ +#define IEEE80211_VHT_EXT_NSS_BW_CAPABLE (1 << 13) /* part of tx_highest */ #define IEEE80211_VHT_MAX_AMPDU_1024K 7 /* 9.4.2.56.3 A-MPDU Parameters field, Table 9-163 */ diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 0b6a66033536..ee16449ecd1c 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -236,7 +236,8 @@ struct ieee80211_sta_ht_cap { #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */ -#define IEEE80211_VHT_CAP_EXT_NSS_BW_MASK 0xc0000000 +#define IEEE80211_VHT_CAP_EXT_NSS_BW_MASK IEEE80211_VHTCAP_EXT_NSS_BW +#define IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT IEEE80211_VHTCAP_EXT_NSS_BW_S struct ieee80211_sta_vht_cap { /* TODO FIXME */ diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index af411016a170..814221430f7f 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -970,6 +970,10 @@ struct ieee80211_vht_operation { #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x20000000 #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN_S 29 +/* 802.11-2016, 9.4.2.158.2 VHT Capabilities Information field. */ +#define IEEE80211_VHTCAP_EXT_NSS_BW 0xc0000000 +#define IEEE80211_VHTCAP_EXT_NSS_BW_S 30 + /* * XXX TODO: add the rest of the bits */ From nobody Mon Feb 24 20:27:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sj44qFqz5ppys; Mon, 24 Feb 2025 20:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj41pMvz3nw9; Mon, 24 Feb 2025 20:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s6ohe8mBuqmFxUxJ5dvurhD0wKG7bfYTIGBXJGbvu5M=; b=dCibmDmjVn2KNVzNC6M55PBb0GGDQnoxwSR4bpUVD84U9rMaDoD31x65l9tsGyfdCtS3jO gCvs56VIK1PabvsKmas/WTMJ2ZfhANQkqSnd6CgjoeT5JhmRP+LRhRa2Zyvrst5RFpr7TF Mv+Xu0pD7ZW6wYEkUmNG7kPfUpN+Np7Mts3ZtROUcQYnJIC4u5jqexe3OezqEv6eGndyZg yTs0SuYFxFvUkEAr6N/4uW4OtqaVsREwKIF4UIywqm2T8Zt+K78f7woZE8kFIv6cedG5PZ CfkgEp7x3EkOsX5l+u5wkQCZtnmgTxH5zt9/4A9KlDBqa6BjnXdbvGpxQAzVAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428824; a=rsa-sha256; cv=none; b=WNTXOqKi4z0S38AOzLVE8QKMKfLhiFGLy/RybqFz8eReJP4VUOadDwfuqglZGdCuYwOba0 1vlu9UMpl8zn4JaZBEwCxuwQOIn4IqK9iEOsdIRyv/X+MrXLdUF0QISwncSYTIN+2VShUr rg1GRiuhN8cVLpfR1CtEKhVqGa6rKDGwsaZPw/XgwvTdWHTdNgRJWqcQ1XoH2sqzOe93vS gVjuPGkxlECuTBKx/j80Py+psRZPSQpgne1wdt++rEFmxarpKH8k2Wronq25KyfQMVG1Lp Ihk1X6AtBMhLIyTgo+gD/iMq+wf2BcYxKCuDzokF5j0O+2Q/coh9Wx2mxl/maQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s6ohe8mBuqmFxUxJ5dvurhD0wKG7bfYTIGBXJGbvu5M=; b=Q1qNUdtkMzL8rdnCGbiu4ioFhA/I2R1UJYPU+5S39ErJGwtbexR0JaEOrKdw1ZptPvBVXR kCGUu/53rWtnJnhFwW2oc/Yjn1FWNWSJGMhJlFTwghealeCZGRgLubhptgn03SZsGDRzat inTrJmK7iiyLJXCHQ39YOYKYogCJS3FlbjAlrYPkhK6wg2IB2Tuh/MCD79BCl+3GArOJQB PSwTMjSkqbjWgRc75OWifgdFrcRneZvKCZEkJw8vmRBuSvi7+FfvdJowdvp2h6PyHw4ba5 bU8miREkGj7YU00sqgVe1qrjDdziQlL1evip+SmOJk5tXqjHi1qzYY4UkruJyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sj4194szvnF; Mon, 24 Feb 2025 20:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR4oj027050; Mon, 24 Feb 2025 20:27:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR4nC027047; Mon, 24 Feb 2025 20:27:04 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:04 GMT Message-Id: <202502242027.51OKR4nC027047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7563a2b96f56 - stable/14 - net80211/ifconfig: swap IEEE80211_FVHT_USEVHT160 and 80P80 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7563a2b96f567018d63744a957a33e546aa39ed1 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7563a2b96f567018d63744a957a33e546aa39ed1 commit 7563a2b96f567018d63744a957a33e546aa39ed1 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211/ifconfig: swap IEEE80211_FVHT_USEVHT160 and 80P80 ieee80211_setupcurchan() compares the flags in a greater than manner. In this case VHT160 should be > VHT80P80 as it is preferable. Swap the two flags and add a comment to note this. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48976 (cherry picked from commit 8f2e5b6ef32304ce340b91057b1eb4b191dbeac1) --- sbin/ifconfig/ifieee80211.c | 4 ++-- sys/net80211/ieee80211_var.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index d4dcfdf63254..9f66281931c0 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -133,8 +133,8 @@ #define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ #define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ #define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ -#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ -#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000008 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ #define IEEE80211_FVHT_STBC_TX 0x00000020 /* CONF: STBC tx enabled */ #define IEEE80211_FVHT_STBC_RX 0x00000040 /* CONF: STBC rx enabled */ #endif diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 4c5dbcb7cfc0..afd3beeb5d73 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -728,11 +728,15 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FVEN_BITS "\20" +/* + * These flags are compared in ieee80211_setupcurchan(). + * Thus 160 should be > 80P80. + */ #define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ #define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ #define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ -#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ -#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000008 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ #define IEEE80211_FVHT_STBC_TX 0x00000020 /* CONF: STBC tx enabled */ #define IEEE80211_FVHT_STBC_RX 0x00000040 /* CONF: STBC rx enabled */ From nobody Mon Feb 24 20:27:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sj60xTlz5ppnp; Mon, 24 Feb 2025 20:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj53Mzmz3p1L; Mon, 24 Feb 2025 20:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wRzmUCMi36xmtuSLNezWOB725mF5STr+L4sH39Stee4=; b=PcwXMRQQQO/Zm0JxoYwSiTTFIoiXtaMrGJ3GuidNxPxUESiNI87DvjCC3lG9Er5jbAGuYj iEaejdsAMRt/abVLT+0fb164xVvgtETiCplWtHJI9qWKuIZ5IRwB4hpjFCSPRSEnueQXZV MhnDqMgRzfPYlBvm10bVBW6tce0Zn6Izz1LNS/wWsVdBkZUgHUWb2f9HwnY3b5XoLPD61O u/l6stO/CXo1LyQI94cucz3iMPqNLuaIZSPu27TBMW7k7dG/k1f/ZbRiMubelmdRFVbRFj HZ4unHwW73Gi6BTs3Y5Wu7UyiUB7KiMj2ftTNlFMfmDtEw6EApHKIubM6sq3KQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428825; a=rsa-sha256; cv=none; b=DZ4P3nWVBZ75iHPZ0rmIpqz3UxfUP7xfG6P10837dIosSzuIRbh5fpnEyYt0q/mfV4qiCp +LxnNjWo8vAjVGdROyKscJsODxpL3OYaYJvVA6MwTJ/SKXZCdUrypltq1g9oEqskAqZ+NJ l/YYkJmk7SR1/2gGqbRKwM1hOw0czdp+XNfiKRqxZHL91apwVRidUCE0DsFeDBW5nwgwcJ PtLqIVit52YYdkISRByttNU4DXeSkVtvMCFP5Lmw7qXr9dQHKvsCybRB7IJ3HG3zPcfXwU reJao03hsA1OPfLDAWFfERZDHRsO7pwWjsPnkCzyMucsDvrZf3KWQlLV4IuguQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wRzmUCMi36xmtuSLNezWOB725mF5STr+L4sH39Stee4=; b=hKwvNi76ZhSe2/yPLvLtcJGSahtdh2OpFDwyNEPJ1SX+G6Qe+DzzcQWCDrquVrlS4VRjkZ Z3idjZsa/DoQICIzsRr3YxjLAe1g3Pg60GFz6+yWe4mMmcgYiw462OE/ZUWD0uBDJimvaV s33H0L3pgbU5Btq/0+1ce8QALM/9ePWI2RXJt5IWiXlvav2i/V+gwXXOgCYSKjwIHZIQSJ QKNOxIQx3xIzGRYArkEqxLzqsATvYegRp2/FokiZpZ2ElwuxunG90IdWnTzLxrWNTkqFNd fk+JVHG3Rmy++pDDJ86dNie2qVYm99RajXVWnAfLTjyvjR7Tem8oNfd1+AiYQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sj52hY3zwMY; Mon, 24 Feb 2025 20:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR5dp027086; Mon, 24 Feb 2025 20:27:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR58R027083; Mon, 24 Feb 2025 20:27:05 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:05 GMT Message-Id: <202502242027.51OKR58R027083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 48f8ed03d32d - stable/14 - net80211: rename \4 in IEEE80211_VHTCAP_BITS for clarity List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 48f8ed03d32de35a2075271512edab9902e19377 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=48f8ed03d32de35a2075271512edab9902e19377 commit 48f8ed03d32de35a2075271512edab9902e19377 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211: rename \4 in IEEE80211_VHTCAP_BITS for clarity Bits 2 and 3 (\3 and \4 of the %b flag mask) are the 'Supported Channel Width Set' indicating VHT160 (B2) or VHT160 and VHT80P80 (B3) support. Though longer rename \4 from CHAN80P80 to CHAN160+80P80 to not confuse the reader that VHT160 might not be supported. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48977 (cherry picked from commit 7f31d95c98e64eff7b269e457789ed9cfc7b2779) --- 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 814221430f7f..a5008796d89f 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -978,7 +978,7 @@ struct ieee80211_vht_operation { * XXX TODO: add the rest of the bits */ #define IEEE80211_VHTCAP_BITS \ - "\20\1MPDU7991\2MPDU11454\3CHAN160\4CHAN8080\5RXLDPC\6SHORTGI80" \ + "\20\1MPDU7991\2MPDU11454\3CHAN160\4CHAN160+80P80\5RXLDPC\6SHORTGI80" \ "\7SHORTGI160\10RXSTBC1\11RXSTBC2\12RXSTBC3\13RXSTBC4\14BFERCAP" \ "\15BFEECAP\27VHT\37RXANTPTN\40TXANTPTN" From nobody Mon Feb 24 20:27:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sj717RPz5ppr4; Mon, 24 Feb 2025 20:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj64GhGz3nmn; Mon, 24 Feb 2025 20:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=icE8xMwtllwWzQ4NtzCng+y6JAcQKL8hJarcJpgkjw0=; b=wW/OWSiDY0rfEOvZAup1E7hcOj6hDGLLG3poQfHCcN8tuTD2AH0DYcLU5azwL7Rh60BjfC +ib7XtQOCCut+yO3KDKaZK18uOoy0bx/V6/O3yNPV27i5fVitxaAKMVK1ddW0uBWSyS0lv QY9UgWdegSS3he7NAkyLVLxj96eoo9Jtr9DXnZLZ0pihdGHQ9AbOA+cWIMRYaoqP/sn/q6 b/hg2r36V8/9vLDxdHbYI8uSiJGKk3Tmw69tCcDPWe/m1qbeokXvhdmmRc/JJFjQ1RBWaZ 87B92/ch4UrO5pF5g93K5f+UKz+Ndxe4+3hnlF1JYpOLBdCEf2OwAkENu3BrLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428826; a=rsa-sha256; cv=none; b=K241p7171SLvmHA+3a+PN24xbO8ntVnpyTynD6M0hZYVxRUVdCC0e2ywfi4JUV78Sl+hNB +ppSiG9JB6xqGQBNQYt8YVhLPeV5Q2GAu9Lxx0Aw1+QR6LItvv6zHIwiXUboqcVI9vt5uG sMfryg35aewlTlk9SyjdZMjWA9M86HHfMn69UFsNvfztN0+9d4HQYLasif6fmmLInhAg9G yHCNxo7NLDblX2HkDxZKA0xCz1JpskhUhBKoqu5OhBEdwKRt1MchJ30ZqWV8qrBXip1J3Y TX3zqDM5HWwgXIFUQRE5IL8mVG6kKmjMvR8/EZceCrl/zJXNNn+C3TraTiqBCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=icE8xMwtllwWzQ4NtzCng+y6JAcQKL8hJarcJpgkjw0=; b=uPZMFvXt31WBDHp4CtQHAAPNaRWBPQtP4Kat8lyMM/RmH5kiaUqNvkb4M+QuXX15AClNo4 26HQN92tO1KgaQEqFtAYvjBFp72ChZ21+c7ZYZ9rk4tOICVT+SQDpU8cL3Ha5hNv5+IbJR WOIoyCHeMzeSe72UEuBBGaoc7Rjhrcd6OBettCkzpeOn0O1+eJEicB6mzcwRCzDvz6Blz1 Sj/A704h1e+EawaadQLmswfoAIk3cVjGKAzlrPXtGmtZal0tXOob4Ugz4qZlstKIE3eJVI AzwHEDu423sGkU7EfRsH7UqwGnGjdWviXlX4XxqDx6O4ck1z7H8Bjb0RnU7IaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sj62xhlzwW0; Mon, 24 Feb 2025 20:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR6Co027122; Mon, 24 Feb 2025 20:27:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR6xd027119; Mon, 24 Feb 2025 20:27:06 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:06 GMT Message-Id: <202502242027.51OKR6xd027119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3b84a5133a57 - stable/14 - net80211: crypto: enhance comment about IEEE80211_RX_F_MMIC_STRIP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b84a5133a57fd9be48a738b524460f4222815f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3b84a5133a57fd9be48a738b524460f4222815f3 commit 3b84a5133a57fd9be48a738b524460f4222815f3 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:40 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211: crypto: enhance comment about IEEE80211_RX_F_MMIC_STRIP net80211 crypto currently re-uses the M[ichael]MIC flag for MIC as well at least in CCMP. This is a bit confusing so at least try to improve the comment that it becomes more obvious. In the long-term we may want to just add a MIC flag as well? Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48978 (cherry picked from commit d688c20395a9f46d89edab4c57b863b6d752b061) --- 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 1ac9328714f7..929de475f4bf 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -567,7 +567,7 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_F_FAIL_MIC 0x00000080 /* Failed MIC check */ #define IEEE80211_RX_F_DECRYPTED 0x00000100 /* Hardware decrypted */ #define IEEE80211_RX_F_IV_STRIP 0x00000200 /* Decrypted; IV stripped */ -#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; MMIC stripped */ +#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; [Micheal] MIC ([M]MIC) stripped */ #define IEEE80211_RX_F_SHORTGI 0x00000800 /* This is a short-GI frame */ #define IEEE80211_RX_F_CCK 0x00001000 #define IEEE80211_RX_F_OFDM 0x00002000 From nobody Mon Feb 24 20:27:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sj80xspz5ppr7; Mon, 24 Feb 2025 20:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj74CSsz3p1X; Mon, 24 Feb 2025 20:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1V8KYL0heYPpIQQ+2wNL4IpckPWOj/h7FuP4IH+gbQA=; b=M+TT5SMsJSVcUXzzqmhbNJ+Zi521aLLOMxPk9gvN+u9UqmYMXTzWUGkPG039b3pBJ3wSBd woOHbW0IAk27ixNu4ZXaTzD1BHomOyMPshbhG/bmEefTn8REfLRWius4bx1kfNCZwQezfa Q8wnpPV6NHiC1Ff3srs8uz4YXXaW4CggQN8bRosrlmr4vubqg54U13r/xkcCeMnXE7QLj7 vAXSmsdlYYf9HuML6Kx+UQXsbrtO3p8RK7o216dwh1EXKz/PQ1m2KSGoxEBYvxh40kKeqv 5shRR9j7Rl4WhQfoO4Qe+8C0kkZhqvI/u4EYRo6skwIRf54UIXHy8kKwEJG/vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428827; a=rsa-sha256; cv=none; b=KxfJSv/MoShEW7dMSHEGvYpa4t9qexVhtSaBVpvd2j1PoJ/TzgL066nXXpgA/PmnWTqi6t rV13lwpsJE4PjGJ1xWBMFsapRlwPtLd0bu7d7foRjW5jVvKJ7P+O6of3VA3eUAjUhvzGAi yytFbR1S0Cbuj+mxbx6fb8uNN3otK2VVD66zSdZaUrA2nIUGSteGIlHb5YyZHGdKcX5Ffm o/q7pkrgaAv2pAbf2VjBbFjxTofg0m90oGXTSQgr2cQ0dbAE9kzqNQnLApntWixzWAtPZ6 ZH67ntnYJlru06B7776ICMxJK+ZNin5rRd/dcdYvUp/77m01kV4snr2oCBEENg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1V8KYL0heYPpIQQ+2wNL4IpckPWOj/h7FuP4IH+gbQA=; b=EtXb3HZ9zuCk9lGvxa1WMlcvqeFdNXLtjmorvit513q4xXbfSPIbbxGxyfewrRWzCWC7lW s86eXnXzrOM5zVtyRbSbWh+v7TPHHrPbmlK+FA9v3B2jVRwTPveIEZFcO7gsQCB4teO26u AfUcHVNw9zUKNPDS4Brm5BBgAz3Y6jszBFs+1tSvxaTyA4xaLHDGVT1w6jEsE3942nThzs 6+zbF1b2KGpOK8lRlW3WMFTEvrj2PY9APsR+zHj/X0tHhivTqj7uR1vTfmZkXH2rl+++ck GKSMcwtz48xtCuOZBzf3dqBMjvgvkBmEdFqv9RfgiixkKMD41khcYro0MQDzGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sj73bB1zw3X; Mon, 24 Feb 2025 20:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR7K6027165; Mon, 24 Feb 2025 20:27:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR7pI027162; Mon, 24 Feb 2025 20:27:07 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:07 GMT Message-Id: <202502242027.51OKR7pI027162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6ddcff36f154 - stable/14 - net80211: use IEEE80211_KEY_UNDEFINED() insetad of checking they keyix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ddcff36f1545b8868094eff686132e293553d52 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6ddcff36f1545b8868094eff686132e293553d52 commit 6ddcff36f1545b8868094eff686132e293553d52 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211: use IEEE80211_KEY_UNDEFINED() insetad of checking they keyix For ieee80211_node_delucastkey() rather than checking the keyix to be IEEE80211_KEYIX_NONE use the IEEE80211_KEY_UNDEFINED() macro (which chekes the wk_cipher to be 'none'). Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48980 (cherry picked from commit 9763fec11b83a7bfc2d2ba0681830d186a3f6a6e) --- sys/net80211/ieee80211_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 17ddc8533e41..f2fc3d21a361 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2209,7 +2209,7 @@ ieee80211_node_delucastkey(struct ieee80211_node *ni) IEEE80211_NODE_LOCK(nt); nikey = NULL; status = 1; /* NB: success */ - if (ni->ni_ucastkey.wk_keyix != IEEE80211_KEYIX_NONE) { + if (IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) { keyix = ni->ni_ucastkey.wk_rxkeyix; status = ieee80211_crypto_delkey(ni->ni_vap, &ni->ni_ucastkey); if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) { From nobody Mon Feb 24 20:27:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sj91LQfz5pptK; Mon, 24 Feb 2025 20:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj85sN7z3nn5; Mon, 24 Feb 2025 20:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8PeaQyGTimWYxlcmAEee5c/n8h9wOQZsIJGkyfxJB6A=; b=ZpggzUoycjDn+XrHcDGJoDnyBFAXWgUeBk5gRe6wQM855tZpl3viWNm1+hRsSoEWC84s4q Ax4LXvq2mwYDJACGWfYJ17b6/BbGMgvfgWkEDIHCefWJj8HAUCYkoCjg66qLqux6B8RnAc EnuySnx43vHhN65ZJsi0fCZP/zmdiSjtIg03cqEf6B/jEpRWYjXLkvS+lCLcJ6uuXRkC9m 6gc/J7HYAc/RtdPKp/k5N4+0CRnI0GN8SU1jqbLKqccsWpDM91BEotXaX6qtziAI9yMslg uFXoW0kTZtpmb9sd2WIKcnHwBk5Ep27vG7UqoJi+0g6TiXQxDGoiEAuDgHIQeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428828; a=rsa-sha256; cv=none; b=JgDfOE3VEdFqYWVokmPazh+j4XvLebfPezX/VIn1I78zfVTecbBjaky54bf9nJ6cEMyO0j t5IWLj6IfN+k0V4ydEk4IZO6/GnJ7VtGp30DBOfYns/2Lk/tT4UZyIXOzKdArm4tGHQQCy 4Owaavr4Kcfy9K9S8Xch31tpP6s6Gi3upbbMzVQ+D6Ma17WjfeSxI2ghRKrnKqma+SVXR3 feEUB43yU1te1AhDzEA0JqG886dDgQ6cnReO6oHsqQJSjS0CAzVb+TPtJB2nmW8KvL9pTH mN2oqPrQlOGOgamzx9XkzOEO2U2TVmn0xPo+bKm3JixJ6XX81VpT3+SiTky1lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8PeaQyGTimWYxlcmAEee5c/n8h9wOQZsIJGkyfxJB6A=; b=BwrwaHji5B9QXa6IIyLL9KAzVQ6AXmpoQp8QmmfvuVTCUxrO7jYARvoLCCCHEGdUqGIEea gaw2gX7hMk/8RuYXvbVpCj5qwxD582eAxRVL7hfaDxhFNaKA7P8vC4DpGqH7lVwdLahWaE 1rYxTpFGWsaZSmDCISdW9mFYDdCfxoK/aelyM8KtZE+dEbAEpNDpC3N5Kh6FFSKiY/Kie5 TiP8glUbT3vRGcn3nxMvIIn7f6TTjsOVTLuPill1syHLM7VAMNnE3Cmc1InF9HsJ3mErB/ 3G54FdhPmC7zTbxj2KejFFE47CUPm2chvoVFRZvL58zw2Hk7aLqdsoDsbTnnxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sj84n8ZzvnG; Mon, 24 Feb 2025 20:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR8JM027201; Mon, 24 Feb 2025 20:27:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR8G6027198; Mon, 24 Feb 2025 20:27:08 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:08 GMT Message-Id: <202502242027.51OKR8G6027198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 09d83ae036c7 - stable/14 - LinuxKPI: 802.11: adjust the hw_scan channel list List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 09d83ae036c7cd28256fede833fbd33f78afd769 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=09d83ae036c7cd28256fede833fbd33f78afd769 commit 09d83ae036c7cd28256fede833fbd33f78afd769 Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 23:26:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: adjust the hw_scan channel list Until net80211 will grow proper scan offload with the various options needed and will allow switching the scan engine try to improve the situation if we are doing a hw_scan and the device supports SINGLE_SCAN_ON_ALL_BANDS. In that case create the channel list from our device information of supported channels rather than from the net80211 scan list. Filter out currently unsupported bands. While the general "scan EBUSY" problem remains at least in my local testing I am seeing a lot more 2 and 5 GHz band results rather than being stuck on a single band (as was also often the case with iwm for me in the past). Tested by: rene (previous version) (cherry picked from commit c272abc5c6a72881f1252f069d79990201559d1a) --- sys/compat/linuxkpi/common/src/linux_80211.c | 61 +++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index d0dde529c7a8..02cacc62a4c2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2020-2024 The FreeBSD Foundation - * Copyright (c) 2020-2024 Bjoern A. Zeeb + * Copyright (c) 2020-2025 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -3268,7 +3268,6 @@ sw_scan: /* XXX want to adjust ss end time/ maxdwell? */ } else { - struct ieee80211_channel *c; struct ieee80211_scan_request *hw_req; struct linuxkpi_ieee80211_channel *lc, **cpp; struct cfg80211_ssid *ssids; @@ -3285,14 +3284,31 @@ sw_scan: band_mask = 0; nchan = 0; - for (i = ss->ss_next; i < ss->ss_last; i++) { - nchan++; - band = lkpi_net80211_chan_to_nl80211_band( - ss->ss_chans[ss->ss_next + i]); - band_mask |= (1 << band); - } - - if (!ieee80211_hw_check(hw, SINGLE_SCAN_ON_ALL_BANDS)) { + if (ieee80211_hw_check(hw, SINGLE_SCAN_ON_ALL_BANDS)) { +#if 0 /* Avoid net80211 scan lists until it has proper scan offload support. */ + for (i = ss->ss_next; i < ss->ss_last; i++) { + nchan++; + band = lkpi_net80211_chan_to_nl80211_band( + ss->ss_chans[ss->ss_next + i]); + band_mask |= (1 << band); + } +#else + /* Instead we scan for all channels all the time. */ + for (band = 0; band < NUM_NL80211_BANDS; band++) { + switch (band) { + case NL80211_BAND_2GHZ: + case NL80211_BAND_5GHZ: + break; + default: + continue; + } + if (hw->wiphy->bands[band] != NULL) { + nchan += hw->wiphy->bands[band]->n_channels; + band_mask |= (1 << band); + } + } +#endif + } else { IMPROVE("individual band scans not yet supported, only scanning first band"); /* In theory net80211 should drive this. */ /* Probably we need to add local logic for now; @@ -3346,9 +3362,11 @@ sw_scan: *(cpp + i) = (struct linuxkpi_ieee80211_channel *)(lc + i); } +#if 0 /* Avoid net80211 scan lists until it has proper scan offload support. */ for (i = 0; i < nchan; i++) { - c = ss->ss_chans[ss->ss_next + i]; + struct ieee80211_channel *c; + c = ss->ss_chans[ss->ss_next + i]; lc->hw_value = c->ic_ieee; lc->center_freq = c->ic_freq; /* XXX */ /* lc->flags */ @@ -3357,6 +3375,27 @@ sw_scan: /* lc-> ... */ lc++; } +#else + for (band = 0; band < NUM_NL80211_BANDS; band++) { + struct ieee80211_supported_band *supband; + struct linuxkpi_ieee80211_channel *channels; + + /* Band disabled for scanning? */ + if ((band_mask & (1 << band)) == 0) + continue; + + /* Nothing to scan in band? */ + supband = hw->wiphy->bands[band]; + if (supband == NULL || supband->n_channels == 0) + continue; + + channels = supband->channels; + for (i = 0; i < supband->n_channels; i++) { + *lc = channels[i]; + lc++; + } + } +#endif hw_req->req.n_ssids = ssid_count; if (hw_req->req.n_ssids > 0) { From nobody Mon Feb 24 20:27:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjC0yvhz5pq1h; Mon, 24 Feb 2025 20:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj96Yhpz3nlK; Mon, 24 Feb 2025 20:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fM92Zes/vdGct5LmEIUCbt3SwUd84isdViCoD4eKEMo=; b=TIIpimJ0CPU+nFUrfDOJkRJVQPhPQBE/cnD3EwreCyIEOLqoAqjnrs/4KAjd5fN9SPpxCs 3wRQVV8JXaA8tMiSQDoFdVDTUzXKphqseKvDvPl/64BhL75jB/W/K5Pq38W9o21vCYum6z aX6uktIUbHMnYQmq9KLYRtKTyYsGlax34jUJD0JlCOg93WBDPelL4v0ttXIuL4RbXxSokI EU8met4Mm5YNKt6eqT8o1hMLJvX6VOeBiKMiJeRkSVG+v7+zaO+ig3Z+eoUSjgboEDRzR0 NbHoFKuSrRP7Qegb0EWu327NwT7jmrUCOyLc3cAWX9AdbZ+YhRVUd9xEcH2Tdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428830; a=rsa-sha256; cv=none; b=y2qapqUKRkRiy599gCl12PxWuW8mSVEUoP4yHbDywyYYwSY1moDyi2VZ7SX04fQw53K3Ul oFxdsuxPI9QU2I0vRw1XczF1yMCVydtxSeROvEOfRSLI8IHI/9nbsPRtmnNHMkRayrmdyo L+zhCJcmBwHDqEdvo58XSof/v0Wk65YKMPObAv72w0kKOHGU/X1FfJg2ldLekMHJdp4Hi8 0pc+R8gT9aiZNi1HcRvRF3OdVM/GCJOD0oGoSq87Nr25LOtWe1rOBWR2vsFQbam0KiKdRc i87CmQ5c+6alQGN678ke4HF8xb4lYm1wtEtYP3dIYkDzqDise2Zl/IB/YaIzUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fM92Zes/vdGct5LmEIUCbt3SwUd84isdViCoD4eKEMo=; b=vigChASSiu3ZvxpokKnY9sNoDgScip7SLYFMl2CEOKfR3+2SSU1gsXlXSJEFg8PRaeTs7T JQTnLE3stcvnErtLds8Z3KPXIYTxTgcxENuAZNgJnxPbyhwBzhidtRUeC/yMB+4K0BBCZx JT6k1jY8YksCsBJRbtzrlLPNbAlsB2x/UYeJruvTKX7kNM0td2bGpxR19JMDlMqd0KZFBh 97A0sL7snRNHm0yAG0cF/r+uNq9hPmaAzOo7TReKwmDcsUzVrCPHCGRy2skVR3Q9LelKJt vWG8vm9UVRq+L7LtyXXIPHoJpiFm8Lx6WyTFtG7jZIjmj5SHr2RIKCC71Xpppg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sj95sZGzwSY; Mon, 24 Feb 2025 20:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR9Af027236; Mon, 24 Feb 2025 20:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR96p027233; Mon, 24 Feb 2025 20:27:09 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:09 GMT Message-Id: <202502242027.51OKR96p027233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6062817529c8 - stable/14 - LinuxKPI: 802.11: implement various VHT helper functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6062817529c88812af89607a0bde14720c64cc16 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6062817529c88812af89607a0bde14720c64cc16 commit 6062817529c88812af89607a0bde14720c64cc16 Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 11:05:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: implement various VHT helper functions Implement ieee80211_rate_set_vht(), ieee80211_rate_get_vht_{mcs,nss}(), and ieee80211_get_vht_max_nss(). Sponsored by: The FreeBSD Foundation (cherry picked from commit 5778cbdae7616c09efa6ccdd8c611d82cbc75f00) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 136 +++++++++++++++++++--- 1 file changed, 118 insertions(+), 18 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 8872be569e44..f5d3e1036edc 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2024 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2020-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -1876,26 +1877,133 @@ ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, /* -------------------------------------------------------------------------- */ -static __inline void -ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint32_t f1, uint32_t f2) +static inline void +ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint8_t mcs, uint8_t nss) { - TODO(); + + /* XXX-BZ make it KASSERTS? */ + if (((mcs & 0xF0) != 0) || (((nss - 1) & 0xf8) != 0)) { + printf("%s:%d: mcs %#04x nss %#04x invalid\n", + __func__, __LINE__, mcs, nss); + return; + } + + r->idx = mcs; + r->idx |= ((nss - 1) << 4); } -static __inline uint8_t +static inline uint8_t ieee80211_rate_get_vht_nss(struct ieee80211_tx_rate *r) { - TODO(); - return (0); + return (((r->idx >> 4) & 0x07) + 1); } -static __inline uint8_t +static inline uint8_t ieee80211_rate_get_vht_mcs(struct ieee80211_tx_rate *r) { - TODO(); - return (0); + return (r->idx & 0x0f); } +static inline int +ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, + enum ieee80211_vht_chanwidth chanwidth, /* defined in net80211. */ + int mcs /* always 0 */, bool ext_nss_bw_cap /* always true */, int max_nss) +{ + enum ieee80211_vht_mcs_support mcs_s; + uint32_t supp_cw, ext_nss_bw; + + switch (mcs) { + case 0 ... 7: + mcs_s = IEEE80211_VHT_MCS_SUPPORT_0_7; + break; + case 8: + mcs_s = IEEE80211_VHT_MCS_SUPPORT_0_8; + break; + case 9: + mcs_s = IEEE80211_VHT_MCS_SUPPORT_0_9; + break; + default: + printf("%s: unsupported mcs value %d\n", __func__, mcs); + return (0); + } + + if (max_nss == 0) { + uint16_t map; + + map = le16toh(vht_cap->supp_mcs.rx_mcs_map); + for (int i = 7; i >= 0; i--) { + uint8_t val; + + val = (map >> (2 * i)) & 0x03; + if (val == IEEE80211_VHT_MCS_NOT_SUPPORTED) + continue; + if (val >= mcs_s) { + max_nss = i + 1; + break; + } + } + } + + if (max_nss == 0) + return (0); + + if ((le16toh(vht_cap->supp_mcs.tx_mcs_map) & + IEEE80211_VHT_EXT_NSS_BW_CAPABLE) == 0) + return (max_nss); + + supp_cw = le32_get_bits(vht_cap->vht_cap_info, + IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); + ext_nss_bw = le32_get_bits(vht_cap->vht_cap_info, + IEEE80211_VHT_CAP_EXT_NSS_BW_MASK); + + /* If requested as ext nss not supported assume ext_nss_bw 0. */ + if (!ext_nss_bw_cap) + ext_nss_bw = 0; + + /* + * Cover 802.11-2016, Table 9-250. + */ + + /* Unsupported settings. */ + if (supp_cw == 3) + return (0); + if (supp_cw == 2 && (ext_nss_bw == 1 || ext_nss_bw == 2)) + return (0); + + /* Settings with factor != 1 or unsupported. */ + switch (chanwidth) { + case IEEE80211_VHT_CHANWIDTH_80P80MHZ: + if (supp_cw == 0 && (ext_nss_bw == 0 || ext_nss_bw == 1)) + return (0); + if (supp_cw == 1 && ext_nss_bw == 0) + return (0); + if ((supp_cw == 0 || supp_cw == 1) && ext_nss_bw == 2) + return (max_nss / 2); + if ((supp_cw == 0 || supp_cw == 1) && ext_nss_bw == 3) + return (3 * max_nss / 4); + break; + case IEEE80211_VHT_CHANWIDTH_160MHZ: + if (supp_cw == 0 && ext_nss_bw == 0) + return (0); + if (supp_cw == 0 && (ext_nss_bw == 1 || ext_nss_bw == 2)) + return (max_nss / 2); + if (supp_cw == 0 && ext_nss_bw == 3) + return (3 * max_nss / 4); + if (supp_cw == 1 && ext_nss_bw == 3) + return (2 * max_nss); + break; + case IEEE80211_VHT_CHANWIDTH_80MHZ: + case IEEE80211_VHT_CHANWIDTH_USE_HT: + if ((supp_cw == 1 || supp_cw == 2) && ext_nss_bw == 3) + return (2 * max_nss); + break; + } + + /* Everything else has a factor of 1. */ + return (max_nss); +} + + static __inline void ieee80211_reserve_tid(struct ieee80211_sta *sta, uint8_t tid) { @@ -2239,14 +2347,6 @@ ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif, uint32_t link_id) return (-1); } -static __inline int -ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, uint32_t chanwidth, - int x, bool t, int nss) -{ - TODO(); - return (-1); -} - static __inline bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif, uint32_t link_id) { From nobody Mon Feb 24 20:27:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjD6zXdz5pq40; Mon, 24 Feb 2025 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjD3h8Sz3njC; Mon, 24 Feb 2025 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+2+EbZHH3SQ2mu7iisAAptsUqrqRPVTNTl7sEweS3+4=; b=r09A5tUaX+kdoSeyaITL4Jl298ehdpnG9mzlkM8OKIhQhneVXOz7DJMCMHOYiM9m/aHILw gfGJd1olTy9+FCUkZ9ktcUs1HXhEp/ljZWsHiqzJ4PE/M/HEWtBGbe5BhSaTZTldIsU0bP m8HnBkwzhMetNLPe8AyzI1d8lMcotayqTmLysgpXo0aOTGZpMPoXByGVej2rlbvZ9LNcNP gX912W9cwTLY+s2rWKGJgdgs1vrcGWX6j2xBk0e+/dSa+DmApd1CdTwjCPZ50TND5mSoIF w7QvNo+tu9upToMn7IRtKw6tcv7E9Ci4RW8cy9p1qMtOu4LqcNAiwU722kPfag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428832; a=rsa-sha256; cv=none; b=nF93kqeCKChHYsAvirtKcUkguHk+Gov2dEfUeHa/7eX2JPRrHSpeCG64ttqM4FELOftauw s3xyDJw25OgnMIY0vRPSpd6hDGsyB2hUQ1TG78U7m3O89/JIH9SCQvaIqNwB6zJ9ojnqhL eW444IeJvSCfc5AjLpOz1r1NaJiYWlJU0TBoBy1Dm2zUuPUVyv8PMW/JF8kFyw0m9vVdzr 1pNP/10OoUD4bpbxArxCUJrm5ZSnqsk70nl38wn5e6WurGAsZ00vF96Cl0coovTb7Vsm/i 19q3yTPVNGJoyq6M0lVvzdcWwrne2m2xnk+wT357gOqIkKbOvEIISocm6tJYGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+2+EbZHH3SQ2mu7iisAAptsUqrqRPVTNTl7sEweS3+4=; b=R8JyV6tbmwdhEmsv+OGbw+pWE4emHmpRNlxzrd5ZX7WK7JyG83nieah/y4/2JqHalLYvj0 7ot0lkwkPGcoU88ALGdp2L0qagjqDomcosdO20aFZU6HayUzRYhrRMU2j7qLd4Yyt2TdeN ea4QVxyF07MDxFKaAXJsQltCIDKXFqQQqgE2lTI4npWsm0MKs8PN9nkpDXU3OMATIGixAJ eVaTiZM4nJX85+aoxJCaD3pJs1K/SOJCYhgU3oBbnWsZAR4iSy6ieiE6n9dxatPzAex+Vl yvFb+OsMNtVIGg96XnMile89Q+YIZj01BiQuVp31FiPp2esq1JrcLEc6KjKnzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjD0RxMzw3Y; Mon, 24 Feb 2025 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRBCH027308; Mon, 24 Feb 2025 20:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRBOG027305; Mon, 24 Feb 2025 20:27:11 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:11 GMT Message-Id: <202502242027.51OKRBOG027305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e8376bc284f1 - stable/14 - net80211: crypto: ccmp: fix more hardware offload bits List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e8376bc284f187e0299def398259a9a4ecdeb61f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e8376bc284f187e0299def398259a9a4ecdeb61f commit e8376bc284f187e0299def398259a9a4ecdeb61f Author: Bjoern A. Zeeb AuthorDate: 2025-01-27 13:54:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 net80211: crypto: ccmp: fix more hardware offload bits Add the missing IEEE80211_RX_F_DECRYPTED and IEEE80211_RX_F_MMIC_STRIP (really just MIC_STRIP) checks to make hwaccel offload work. This makes rtw8x drivers pass RX packets again at least with LinuxKPI if HW_CRYPTO support is enabled. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D49030 (cherry picked from commit 3afc0bfecb1a927c37672dc245688c575e4d9ec4) --- sys/net80211/ieee80211_crypto_ccmp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 8f7d5eed593c..06028cf2a37c 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -602,6 +602,7 @@ done: static int ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen) { + const struct ieee80211_rx_stats *rxs; struct ccmp_ctx *ctx = key->wk_private; struct ieee80211vap *vap = ctx->cc_vap; struct ieee80211_frame *wh; @@ -613,6 +614,10 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen uint8_t *pos; u_int space; + rxs = ieee80211_get_rx_params_ptr(m); + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_DECRYPTED) != 0) + return (1); + ctx->cc_vap->iv_stats.is_crypto_ccmp++; wh = mtod(m, struct ieee80211_frame *); @@ -675,6 +680,14 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen space = m->m_len; } } + + /* + * If the MIC (we use MMIC despite not being Micheal) was stripped + * by HW/driver we are done. + */ + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) != 0) + return (1); + if (memcmp(mic, a, ccmp.ic_trailer) != 0) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, "%s", "AES-CCM decrypt failed; MIC mismatch"); From nobody Mon Feb 24 20:27:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjD3zJWz5pq3w; Mon, 24 Feb 2025 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjC1X4Vz3p1w; Mon, 24 Feb 2025 20:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=503gNOOULJ4Fj/0mM3Cf5Ru17Mu34NC5Mxi+/S5MWCU=; b=ER3bkE8TvRWb5vxWPTP/WZCgBEVBG1CLlAe1sXLGv6Z9yTw+O7WSx16IYTlEAobMC05OTu ZORPpFqi64nBhcuVupdDH0HnDdH3P5fDdwDKnp5U72sTOgq2fVmZRJyzKPC/5fSJDbobDR aPuDMeOa6sXdays2p5mfM9qSyPryR+RqDhCRMZBR3rzDqOMkdFlLEV1EzBQUw8rxFnobY/ RSVUfONtaUYeBSBGEiqJeqfvbyvRFqml2FxGyJm2+uJNscbIbGFSQPxzLfWhZUttMSpn2L R52ij9ijSZa1cXCzk5vyxgWVyZMZFsHz881gYbEGgqy1OksODskllV+CM9FSvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428831; a=rsa-sha256; cv=none; b=koBrjWzaizpoQ/1kpICEA/CTcmbSHubSZ+7gGzv744O2TyDGp9UjjwlGNbNlGJSlgJdcJ7 kd/2WYw+VQ76lLdAq/Q1bWbgIOLXDBkIF48PoMnIEHsab4647aBFqlj897lKwQ0Lk9hHQa uMNdWiiJlakNNUFRwm3N3iYOEBU1aLEQ8j+DAqLJmX2JrikI8MX2jgf0M9gYkoRUsp9UCA ZJg6hgreKGsSxwCupEogLnyj2bzLeZCh2jSgj4nMalaHanQ20s20q87ql35GZt4MJ+T8/7 8xNvc7lbBkQfTqXBdKs2mBXlhzahCL+W4inNTdLaC0XmNdIDOwrTL5UhFhn7kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=503gNOOULJ4Fj/0mM3Cf5Ru17Mu34NC5Mxi+/S5MWCU=; b=yqsVnDVPqUgoNk9UfZlPGNxRMZAI+Os/vkp4zPKqXLKvhn6Gnl9hdNdC3q9Y29dG5f4p5Q DiamvN30T3VaG5d/XzvjK3+gsXJsoCvSw629XiYeFALmqox53SWlX4UAGMZT44dM17AmC4 1uChkumGgNRRa8954RGUkYr++t6lw7GskgKsYF5Z4TqqNhExpmDbUqG5HDdLqIpYuW4xNY tVoOURnKBUs8sungh44ZqL3HD9LmChUAE2I5Hp4qKe6+gMAwuTbzI8pJm2uKAWWJVLT+I8 F6E4ajrXSXsb3sZc90f1xTAsGCpbdsTh+9i93jYxh8zdfQd0IJ+Z3kNYe975yA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjB6l8rzwYP; Mon, 24 Feb 2025 20:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRApC027273; Mon, 24 Feb 2025 20:27:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRAdr027270; Mon, 24 Feb 2025 20:27:10 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:10 GMT Message-Id: <202502242027.51OKRAdr027270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bdc94f09bd96 - stable/14 - net80211/crypto: LinuxKPI/802.11: introduce IEEE80211_RX_F_PN_VALIDATED List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bdc94f09bd96b28dcb841afa31f44b0879130134 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bdc94f09bd96b28dcb841afa31f44b0879130134 commit bdc94f09bd96b28dcb841afa31f44b0879130134 Author: Bjoern A. Zeeb AuthorDate: 2025-01-07 12:02:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 net80211/crypto: LinuxKPI/802.11: introduce IEEE80211_RX_F_PN_VALIDATED There are cases when we see "rx seq# violation (CCMP)". Historically these were AHDEMO/IBBS cases (IEEE80211_KEY_NOREPLAY, see 5d766a09daab2). With iwlwifi(4) doing RSS for newer chipsets and us not having any idea about multiple rx-queues (passed all the way through) leads to the same problem. An easy way to trigger this is doing an IPv6 all-nodes echo request. With a sufficient amount of nodes answering the answers will be hashed to different queues and re-ordering will likely take place as queues get released individually. However crypto validation is already done in fw/driver for these cases and we need to carry the state forward. Add IEEE80211_RX_F_PN_VALIDATED to indicate that the checks were done passing the information from driver through LinuxKPI to net80211. LinuxKPI enforces that a frame was indeed decrypted; otherwise the flag would be invalid. This also avoids returning an error and no key from ieee80211_crypto_decap() and thus avoids dropping the frame. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D49029 (cherry picked from commit ec6185c52661d3af0dac6dcc8701fc49fae3e1d9) --- sys/compat/linuxkpi/common/src/linux_80211.c | 16 +++++++++++++++- sys/net80211/_ieee80211.h | 1 + sys/net80211/ieee80211_crypto_ccmp.c | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 02cacc62a4c2..7b0ddc3cbf9a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2024 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2020-2025 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -5425,6 +5425,20 @@ no_trace_beacons: rx_stats.c_freq = rx_status->freq; rx_stats.c_ieee = ieee80211_mhz2ieee(rx_stats.c_freq, rx_stats.c_band); + /* + * We only need these for LKPI_80211_HW_CRYPTO in theory but in + * case the hardware does something we do not expect always leave + * these enabled. Leaving this commant as documentation for the || 1. + */ +#if defined(LKPI_80211_HW_CRYPTO) || 1 + if (rx_status->flag & RX_FLAG_DECRYPTED) { + rx_stats.c_pktflags |= IEEE80211_RX_F_DECRYPTED; + /* Only valid if decrypted is set. */ + if (rx_status->flag & RX_FLAG_PN_VALIDATED) + rx_stats.c_pktflags |= IEEE80211_RX_F_PN_VALIDATED; + } +#endif + /* XXX (*sta_statistics)() to get to some of that? */ /* XXX-BZ dump the FreeBSD version of rx_stats as well! */ diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 929de475f4bf..8b86cd612168 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -573,6 +573,7 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_F_OFDM 0x00002000 #define IEEE80211_RX_F_HT 0x00004000 #define IEEE80211_RX_F_VHT 0x00008000 +#define IEEE80211_RX_F_PN_VALIDATED 0x00010000 /* Decrypted; PN validated */ /* Channel width */ #define IEEE80211_RX_FW_20MHZ 1 diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 45e795a8799b..8f7d5eed593c 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -238,6 +238,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) struct ieee80211_frame *wh; uint8_t *ivp, tid; uint64_t pn; + bool noreplaycheck; rxs = ieee80211_get_rx_params_ptr(m); @@ -261,8 +262,10 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) } tid = ieee80211_gettid(wh); pn = READ_6(ivp[0], ivp[1], ivp[4], ivp[5], ivp[6], ivp[7]); - if (pn <= k->wk_keyrsc[tid] && - (k->wk_flags & IEEE80211_KEY_NOREPLAY) == 0) { + + noreplaycheck = (k->wk_flags & IEEE80211_KEY_NOREPLAY) != 0; + noreplaycheck |= (rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_PN_VALIDATED) != 0; + if (pn <= k->wk_keyrsc[tid] && !noreplaycheck) { /* * Replay violation. */ @@ -302,7 +305,14 @@ finish: * Ok to update rsc now. */ if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { - k->wk_keyrsc[tid] = pn; + /* + * Do not go backwards in the IEEE80211_KEY_NOREPLAY cases + * or in case hardware has checked but frames are arriving + * reordered (e.g., LinuxKPI drivers doing RSS which we are + * not prepared for at all). + */ + if (pn > k->wk_keyrsc[tid]) + k->wk_keyrsc[tid] = pn; } return 1; From nobody Mon Feb 24 20:27:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjJ5NJxz5pptQ; Mon, 24 Feb 2025 20:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjG4nZZz3nlb; Mon, 24 Feb 2025 20:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YerEhvD4HTQm6KJS76s/GgHQk9FdAQfGigCl9er8N7M=; b=yZ4NNb8oH/wDoM2Gy/4s9BZthi/l+i6FllFHyFE4+UvOJcQ9UhiXf1bJMiD62vZmHOclF9 OkxzLqYVupL8lmVSoXT7tqa7uL84zHH5+bSdRVJaVIDTtI3+5EhzxP8lO/Oqp+I68az/yC dBbo6SepQS6an78pSxPpv43MVI+ScFStTu86yCc0SKAgT1wkemZM6k+sDlf8eVH8yoeIS5 tQoFD5Nsl6nyw99AYksvd0sA/AcEVikTHIKoqKc5QN93quHEBrygYOuUd870ACrJWgpQdt s6YvlGG412OgKWQUokbpl6dXJgde8BjJ+0cpf1WtVF3kc+bbSmx/+rH4ZEJc8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428834; a=rsa-sha256; cv=none; b=wfl8DVEoqG7HolHMuppjQh6a1g9zkKzuYBBJ98oTP87bSEJgMiBa8m0s41OXond+9fuOrY 2FzkvNYwy+O2fLEvrrGLtl4V+Gdz3SwS9VoL/BsyTLGl02i5ysBPj16RHXay+COOlS/cIH CD9k989d6kRiYIUnzld+6vk+bn04BMd9iHNFxzS6djRMi/B6ASO4zvJkH3LboNtJxiPVo1 YxVYKbBkRxizswwzU3dbDcyM1qxH4K81A6puQWbyJ54TiXsthTZ9fVr/6LA2GMW61dFqu2 OpomaVnRI/71rQFpbA4w/iFH4NTT/Dfc8Ljbd4sLEdf7RlF1ZZZ7CL15tolyIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YerEhvD4HTQm6KJS76s/GgHQk9FdAQfGigCl9er8N7M=; b=Jqwu457K44h4K3imPnkZkYysQ7Mzdm5vJdmJo/7Mgdl9d2yp3FLOYW7TdHsE0YmiCk7/ur j0Jpxi6CN3nb1pVXnKrvCVx5/uRGTXNV90cuj4y3crw3AtHmVMjiLIUk13gWewq1ntsupZ tUt+flDZjH6GYgYZ4YKmZNn53iBG2Ah0NBSDaXeUeuYN9c6yWANHblIcYqeVKAjnhrvjzc Zi4juvb3J+f7OtISbFZlQVYhol6bph2JDf2z3irr40vZ1qWuckPTKiXwdgkbHXXZcLXSsu S/7ZId1MCsMdIa+kQgspXp1Ck/832BDvIQdZYpg+NizjeaipiJl96TvuX1tQlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjF1d07zwPx; Mon, 24 Feb 2025 20:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRD3D027350; Mon, 24 Feb 2025 20:27:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRDGC027347; Mon, 24 Feb 2025 20:27:13 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:13 GMT Message-Id: <202502242027.51OKRDGC027347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6b244c766608 - stable/14 - LinuxKPI: 802.11: fill in a lot more RX status fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b244c766608d70ea4e9e7615f34c4339b86486c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6b244c766608d70ea4e9e7615f34c4339b86486c commit 6b244c766608d70ea4e9e7615f34c4339b86486c Author: Bjoern A. Zeeb AuthorDate: 2025-01-28 00:20:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: fill in a lot more RX status fields Convert a lot more LinuxKPI rx_status fields to net80211 rx_stats bits for as much as we can see fit. Factor the entire logic out into its own function as it got quite long. Now only net80211 needs to start using more of these values and report them. Also fix some related fields and struct definitions in LinuxKPI. Sponsored by: The FreeBSD Foundation (cherry picked from commit 49010ba706d39fba0d8bc128d96e6122e65eb8ad) --- .../linuxkpi/common/include/linux/ieee80211.h | 4 +- sys/compat/linuxkpi/common/include/net/cfg80211.h | 9 +- sys/compat/linuxkpi/common/include/net/mac80211.h | 10 +- sys/compat/linuxkpi/common/src/linux_80211.c | 196 +++++++++++++++++---- 4 files changed, 170 insertions(+), 49 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 0169e12b1804..20527a8174f5 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -100,7 +100,9 @@ struct ieee80211_mmie_16 { #define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020 #define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100 -#define IEEE80211_RATE_SHORT_PREAMBLE BIT(0) +enum ieee80211_rate_flags { + IEEE80211_RATE_SHORT_PREAMBLE = BIT(0), +}; enum ieee80211_rate_control_changed_flags { IEEE80211_RC_BW_CHANGED = BIT(0), diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index ee16449ecd1c..bcbf629abb2f 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -175,11 +175,10 @@ struct rate_info { }; struct ieee80211_rate { - /* TODO FIXME */ - uint32_t bitrate; - uint32_t hw_value; - uint32_t hw_value_short; - uint32_t flags; + uint32_t flags; /* enum ieee80211_rate_flags */ + uint16_t bitrate; + uint16_t hw_value; + uint16_t hw_value_short; }; struct ieee80211_sta_ht_cap { diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index f5d3e1036edc..43df740b0bd0 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -600,8 +600,10 @@ enum ieee80211_rx_status_flags { RX_FLAG_DUP_VALIDATED = BIT(5), RX_FLAG_FAILED_FCS_CRC = BIT(6), RX_FLAG_ICV_STRIPPED = BIT(7), - RX_FLAG_MACTIME_PLCP_START = BIT(8), - RX_FLAG_MACTIME_START = BIT(9), + RX_FLAG_MACTIME = BIT(8) | BIT(9), + RX_FLAG_MACTIME_PLCP_START = 1 << 8, + RX_FLAG_MACTIME_START = 2 << 8, + RX_FLAG_MACTIME_END = 3 << 8, RX_FLAG_MIC_STRIPPED = BIT(10), RX_FLAG_MMIC_ERROR = BIT(11), RX_FLAG_MMIC_STRIPPED = BIT(12), @@ -616,12 +618,12 @@ enum ieee80211_rx_status_flags { RX_FLAG_AMPDU_IS_LAST = BIT(21), RX_FLAG_AMPDU_LAST_KNOWN = BIT(22), RX_FLAG_AMSDU_MORE = BIT(23), - RX_FLAG_MACTIME_END = BIT(24), + /* = BIT(24), */ RX_FLAG_ONLY_MONITOR = BIT(25), RX_FLAG_SKIP_MONITOR = BIT(26), RX_FLAG_8023 = BIT(27), RX_FLAG_RADIOTAP_TLV_AT_END = BIT(28), - RX_FLAG_MACTIME = BIT(29), + /* = BIT(29), */ RX_FLAG_MACTIME_IS_RTAP_TS64 = BIT(30), RX_FLAG_FAILED_PLCP_CRC = BIT(31), }; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 7b0ddc3cbf9a..0cffa36d96cb 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5309,6 +5309,160 @@ lkpi_80211_lhw_rxq_task(void *ctx, int pending) } } +static void +lkpi_convert_rx_status(struct ieee80211_hw *hw, + struct ieee80211_rx_status *rx_status, + struct ieee80211_rx_stats *rx_stats, + uint8_t *rssip) +{ + struct ieee80211_supported_band *supband; + int i; + uint8_t rssi; + + memset(rx_stats, 0, sizeof(*rx_stats)); + rx_stats->r_flags = IEEE80211_R_NF | IEEE80211_R_RSSI; + /* XXX-BZ correct hardcoded noise floor, survey data? */ + rx_stats->c_nf = -96; + if (ieee80211_hw_check(hw, SIGNAL_DBM) && + !(rx_status->flag & RX_FLAG_NO_SIGNAL_VAL)) + rssi = rx_status->signal; + else + rssi = rx_stats->c_nf; + /* + * net80211 signal strength data are in .5 dBm units relative to + * the current noise floor (see comment in ieee80211_node.h). + */ + rssi -= rx_stats->c_nf; + if (rssip != NULL) + *rssip = rssi; + rx_stats->c_rssi = rssi * 2; + rx_stats->r_flags |= IEEE80211_R_BAND; + rx_stats->c_band = + lkpi_nl80211_band_to_net80211_band(rx_status->band); + rx_stats->r_flags |= IEEE80211_R_FREQ | IEEE80211_R_IEEE; + rx_stats->c_freq = rx_status->freq; + rx_stats->c_ieee = ieee80211_mhz2ieee(rx_stats->c_freq, rx_stats->c_band); + + rx_stats->c_rx_tsf = rx_status->mactime; + + /* XXX RX_FLAG_MACTIME_IS_RTAP_TS64 ? */ + if ((rx_status->flag & RX_FLAG_MACTIME) == + (RX_FLAG_MACTIME_START|RX_FLAG_MACTIME_END)) { + rx_stats->r_flags |= IEEE80211_R_TSF64; + /* XXX RX_FLAG_MACTIME_PLCP_START ? */ + if ((rx_status->flag & RX_FLAG_MACTIME) == RX_FLAG_MACTIME_START) + rx_stats->r_flags |= IEEE80211_R_TSF_START; + if ((rx_status->flag & RX_FLAG_MACTIME) == RX_FLAG_MACTIME_END) + rx_stats->r_flags |= IEEE80211_R_TSF_END; + /* XXX-BZ if TSF_END will net80211 do the unwind of time? */ + } + + if (rx_status->chains != 0) { + int cc; + int8_t crssi; + + rx_stats->c_chain = rx_status->chains; + rx_stats->r_flags |= IEEE80211_R_C_CHAIN; + + cc = 0; + for (i = 0; i < nitems(rx_status->chain_signal); i++) { + if (!(rx_status->chains & BIT(i))) + continue; + crssi = rx_status->chain_signal[i]; + crssi -= rx_stats->c_nf; + rx_stats->c_rssi_ctl[i] = crssi * 2; + rx_stats->c_rssi_ext[i] = crssi * 2; /* XXX _ext ??? ATH thing? */ + /* We currently only have the global noise floor value. */ + rx_stats->c_nf_ctl[i] = rx_stats->c_nf; + rx_stats->c_nf_ext[i] = rx_stats->c_nf; + cc++; + } + if (cc > 0) + rx_stats->r_flags |= (IEEE80211_R_C_NF | IEEE80211_R_C_RSSI); + } + + /* XXX-NET80211 We are not going to populate c_phytype! */ + + switch (rx_status->encoding) { + case RX_ENC_LEGACY: + supband = hw->wiphy->bands[rx_status->band]; + if (supband != NULL) + rx_stats->c_rate = supband->bitrates[rx_status->rate_idx].bitrate; + /* Is there a LinuxKPI way of reporting IEEE80211_RX_F_CCK / _OFDM? */ + break; + case RX_ENC_HT: + rx_stats->c_pktflags |= IEEE80211_RX_F_HT; + if ((rx_status->enc_flags & RX_ENC_FLAG_SHORT_GI) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_SHORTGI; + rx_stats->c_rate = rx_status->rate_idx; /* mcs */ + break; + case RX_ENC_VHT: + rx_stats->c_pktflags |= IEEE80211_RX_F_VHT; + if ((rx_status->enc_flags & RX_ENC_FLAG_SHORT_GI) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_SHORTGI; + rx_stats->c_rate = rx_status->rate_idx; /* mcs */ + rx_stats->c_vhtnss = rx_status->nss; + break; + case RX_ENC_HE: + case RX_ENC_EHT: + TODO("net80211 has not matching encoding for %u", rx_status->encoding); + break; + } + + switch (rx_status->bw) { + case RATE_INFO_BW_20: + rx_stats->c_width = IEEE80211_RX_FW_20MHZ; + break; + case RATE_INFO_BW_40: + rx_stats->c_width = IEEE80211_RX_FW_40MHZ; + break; + case RATE_INFO_BW_80: + rx_stats->c_width = IEEE80211_RX_FW_80MHZ; + break; + case RATE_INFO_BW_160: + rx_stats->c_width = IEEE80211_RX_FW_160MHZ; + break; + case RATE_INFO_BW_320: + case RATE_INFO_BW_HE_RU: + case RATE_INFO_BW_EHT_RU: + case RATE_INFO_BW_5: + case RATE_INFO_BW_10: + TODO("net80211 has not matching bandwidth for %u", rx_status->bw); + break; + } + + if ((rx_status->enc_flags & RX_ENC_FLAG_LDPC) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_LDPC; + if ((rx_status->enc_flags & RX_ENC_FLAG_STBC_MASK) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_STBC; + + /* + * We only need these for LKPI_80211_HW_CRYPTO in theory but in + * case the hardware does something we do not expect always leave + * these enabled. Leaving this commant as documentation for the || 1. + */ +#if defined(LKPI_80211_HW_CRYPTO) || 1 + if (rx_status->flag & RX_FLAG_DECRYPTED) { + rx_stats->c_pktflags |= IEEE80211_RX_F_DECRYPTED; + /* Only valid if decrypted is set. */ + if (rx_status->flag & RX_FLAG_PN_VALIDATED) + rx_stats->c_pktflags |= IEEE80211_RX_F_PN_VALIDATED; + } + 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_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 +} + /* For %list see comment towards the end of the function. */ void linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, @@ -5326,7 +5480,7 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, struct ieee80211_hdr *hdr; struct lkpi_sta *lsta; int i, offset, ok; - int8_t rssi; + uint8_t rssi; bool is_beacon; if (skb->len < 2) { @@ -5403,44 +5557,8 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, no_trace_beacons: #endif - memset(&rx_stats, 0, sizeof(rx_stats)); - rx_stats.r_flags = IEEE80211_R_NF | IEEE80211_R_RSSI; - /* XXX-BZ correct hardcoded rssi and noise floor, how? survey? */ - rx_stats.c_nf = -96; - if (ieee80211_hw_check(hw, SIGNAL_DBM) && - !(rx_status->flag & RX_FLAG_NO_SIGNAL_VAL)) - rssi = rx_status->signal; - else - rssi = rx_stats.c_nf; - /* - * net80211 signal strength data are in .5 dBm units relative to - * the current noise floor (see comment in ieee80211_node.h). - */ - rssi -= rx_stats.c_nf; - rx_stats.c_rssi = rssi * 2; - rx_stats.r_flags |= IEEE80211_R_BAND; - rx_stats.c_band = - lkpi_nl80211_band_to_net80211_band(rx_status->band); - rx_stats.r_flags |= IEEE80211_R_FREQ | IEEE80211_R_IEEE; - rx_stats.c_freq = rx_status->freq; - rx_stats.c_ieee = ieee80211_mhz2ieee(rx_stats.c_freq, rx_stats.c_band); - - /* - * We only need these for LKPI_80211_HW_CRYPTO in theory but in - * case the hardware does something we do not expect always leave - * these enabled. Leaving this commant as documentation for the || 1. - */ -#if defined(LKPI_80211_HW_CRYPTO) || 1 - if (rx_status->flag & RX_FLAG_DECRYPTED) { - rx_stats.c_pktflags |= IEEE80211_RX_F_DECRYPTED; - /* Only valid if decrypted is set. */ - if (rx_status->flag & RX_FLAG_PN_VALIDATED) - rx_stats.c_pktflags |= IEEE80211_RX_F_PN_VALIDATED; - } -#endif - - /* XXX (*sta_statistics)() to get to some of that? */ - /* XXX-BZ dump the FreeBSD version of rx_stats as well! */ + rssi = 0; + lkpi_convert_rx_status(hw, rx_status, &rx_stats, &rssi); lhw = HW_TO_LHW(hw); ic = lhw->ic; From nobody Mon Feb 24 20:27:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjM3N38z5ppwM; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjK47s3z3nx7; Mon, 24 Feb 2025 20:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBjHTKLRe+H25ogrPp1PSsSE2h7GBDoeNIsb+Onykp0=; b=VolY+KLc2eS0CpbFL1q4SPP2ME7dt8yILEciRhpdrBuQv1DCpE6hlE50NeF7hhCFWAveDv z4UbiEHld2fzjepnaWgc5fGYJFUZ8CqdSsDW7sZ/uevsa2sx1FmTxGg6FJYPBHFjBLiwf4 FuECalFInUpDd81Lms9U9mzHtW9hjx91SyYYJ2YGcDJl1kLugm7fa7lB1QrvcJu9DFNEEd CcUANG9WPd+2DAiQfWTo+mtna2vgV9QRCzs7AWoFZ47kHyryFJ/sdK0GPVUgSaiwrvtphs dGXTi6+JNvHqkiRgOPgZkXEC7tdOfwT0ZM0p+gSZQJj6QdvgU42zdJ0Pt+Ca2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428837; a=rsa-sha256; cv=none; b=GiH01r345OUuV2XIkZyvNtS9jZL7hqFzeSDlD06+H39sJFeNj2FDA0DMCvhAmCirlAMz2d bcRjMhVrzMFpWu8w0kJbfBIzVlYx4OXepTemuMp44jH2vbLPBV2RZ+nqCG+sf+E1ihUEb/ QyNtLTepvWiArORasWmoXvXgLsjEyIfVQkFw8bR8DzOfTFFcJwhet61vkBmgj4iVkvfLhu FX8YddKBsLFYKpuF9pQP6hJmDe+EowZ1Mh0YGnMRD36WtnIsPdnXYQOarsxDpAKUVfPW1P 9zFsprAJc0ukUJABARQR0D+k6+6D+OcIB8HtKcAUJarQKQAXmWc2YtMtvVOnHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBjHTKLRe+H25ogrPp1PSsSE2h7GBDoeNIsb+Onykp0=; b=S7Laar+uDsmkeoLLR99zsHW+T/5q/VSOxKfNN3K7l+O1/HEADptOc3iPvwcwJyXLfWv90N NANvnCYIBTAj6yNSpQbZbZZNqXgczEWloHEHBA5Me9iDZe8wnYVYkdBz722rmTCekuVDq9 +kjTjUwYpZ9XOpZ6nC8EC1AqWSMla77ZfdLuDozYJlADOEco9M1qwEpodEB33VkvSsatoY bcyi2Kq0XeBV2z3pQ9E+iSWd4Dxuf5LPY8oQRYX3cZSPNfw3wWusMgHRthud9wNaN/o/Lq UwvQ6h0uFB7YTfSquz4YjRm64TYVrln/0Fz0Pg6GZFEr5mjccbPCmEyv+rEvww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjJ4HT0zwSZ; Mon, 24 Feb 2025 20:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRGe2027457; Mon, 24 Feb 2025 20:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRGTv027454; Mon, 24 Feb 2025 20:27:16 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:16 GMT Message-Id: <202502242027.51OKRGTv027454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 00295a19ab1a - stable/14 - LinuxKPI: 802.11: ieee80211_vif_usable_links() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00295a19ab1ad789bdad9f88e692ab9efeb99d38 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=00295a19ab1ad789bdad9f88e692ab9efeb99d38 commit 00295a19ab1ad789bdad9f88e692ab9efeb99d38 Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 11:59:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: ieee80211_vif_usable_links() ieee80211_vif_usable_links() shows up in TODO() tracking. Turns out the return (1) is likely wrong and should be 0 given we do not support MLD yet. For now return the valid_links bitmap and leave an IMPROVE as likely not all of the valid ones will be useable. Sponsored by: The FreeBSD Foundation (cherry picked from commit d2407a21bd032587194dff46779862ffcd5c33d8) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index f1b1ec97cbbc..8d6d690b2f57 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2539,8 +2539,8 @@ ieee80211_get_eht_iftype_cap_vif(const struct ieee80211_supported_band *band, static inline uint32_t ieee80211_vif_usable_links(const struct ieee80211_vif *vif) { - TODO(); - return (1); + IMPROVE("MLO usable links likely are not just valid"); + return (vif->valid_links); } static inline bool From nobody Mon Feb 24 20:27:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjM3McDz5pq6N; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjJ67pfz3p3y; Mon, 24 Feb 2025 20:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ITUeeOy6fb//Yq65rbEVH32wgW/kHIanIbOoauVr6rY=; b=XUCMq0d+P+ivc4J9RKXb74ZQ/pThzWor85azZyiCpo4y4gUXZCP9avHjuFwGbOGdHw++Ov hdcuuLSEWbgHFmIjUIlx7O4oWfaGx3q8jSesAAWeWiDO8EvA1GZTDh3pgc6ucE35lKPLwW p/82v27zhrHX/n1XEXqjRhKvfDBYjIdnsuK754GoEfRWW1TWiyzdupg+j0xgOHvqyB5CsY ldGXcb+sd5G6+/UMdCOCyTbYCUuHjRGX4eF0zpyBNH28pahsa907z/07LjVcx1bEAPTeeB 2qojo7qQzRvAefRX/B3gExtv9pWB5VE9P3UR1b2L4Tqy362vhjx4rU+El8w+gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428836; a=rsa-sha256; cv=none; b=ZjTDXEdL8bsuXrZLyEkOGHCExXx1H2xZHeheNuMNsu2mfMicD19FX57lFXDRZKLlyucywe LRGZN2uhZCCcgm9hisCi2X+uxCwGydZs+1TdiyjwhOnDjcx3XqJI4IAeJKVMecFO6nOv93 MSfD6vffmJZYrwD7ZSrDnANcCSDtZeadBWRLFOmKxjCaPIxP9FZ01HIPOI+LNIYGB24Qvh bqIZfIcA2i+32qOKUv7UAJ+xD+lywnTiz4jLWF08yUlrOmTzZksYw9zOzdeeDI40iLHzGU PgJrsoHox+Ro5/IRQN2E0ArQVayCJv6fkVnx2JwP1in/3AkWqOtCOXbdzU3bXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ITUeeOy6fb//Yq65rbEVH32wgW/kHIanIbOoauVr6rY=; b=fepeAoBvsJi2MqGfX+G0Ti0fsRrFBTYI36/kKJKAccxrrs0XqDAvaCt6yUYJeTg2kZo/4z pqPQBaktnZ2sHv3ID7vAHlRCGcLVsqpURfwQfwbM4IyKKEgZhULOhME9Fjd/sGe7xfhyoJ X4R/qaCj86iOKpAxh1L8lO1om9FtSeoJSwQ4eaaK98wtHOr5a7zz3mu8sknRT1GhCS1D0/ GAlUVv7NPkErbRHtvN+162HCyBq+pHp0HCd3u3GnhqZmkboTh+R8KuNBt4yT98lAp1Da7v +zZFKNeHXmbF5mYYqoU2+34u9e+1Ji406qxaG/r7pLBsPGA+oksX/N0W0RZtPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjH5RZMzvrR; Mon, 24 Feb 2025 20:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRFxe027420; Mon, 24 Feb 2025 20:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRFei027417; Mon, 24 Feb 2025 20:27:15 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:15 GMT Message-Id: <202502242027.51OKRFei027417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 00fc02712d23 - stable/14 - LinuxKPI; 802.11: start implementing cfg80211_calculate_bitrate() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00fc02712d23663b993f887aa41081fff9760163 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=00fc02712d23663b993f887aa41081fff9760163 commit 00fc02712d23663b993f887aa41081fff9760163 Author: Bjoern A. Zeeb AuthorDate: 2024-12-28 10:10:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI; 802.11: start implementing cfg80211_calculate_bitrate() For now we only return the legacy rate and have two TODOs for HT and VHT which still need to be implemented as needed. Sponsored by: The FreeBSD Foundation (cherry picked from commit a7c19b8a99a604e8940c7475220df5de7e295ffa) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 6 ++--- sys/compat/linuxkpi/common/src/linux_80211.c | 30 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index bcbf629abb2f..cf1e05dde7ea 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1304,6 +1304,7 @@ void linuxkpi_wiphy_delayed_work_cancel(struct wiphy *, int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, struct linuxkpi_ieee80211_regdomain *regd); +uint32_t linuxkpi_cfg80211_calculate_bitrate(struct rate_info *); uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t); struct linuxkpi_ieee80211_channel * @@ -1574,11 +1575,10 @@ cfg80211_find_vendor_ie(unsigned int oui, int oui_type, return (__DECONST(uint8_t *, elem)); } -static __inline uint32_t +static inline uint32_t cfg80211_calculate_bitrate(struct rate_info *rate) { - TODO(); - return (-1); + return (linuxkpi_cfg80211_calculate_bitrate(rate)); } static __inline uint32_t diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 0cffa36d96cb..7bb051a67ade 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5891,6 +5891,36 @@ linuxkpi_wiphy_free(struct wiphy *wiphy) kfree(lwiphy); } +static uint32_t +lkpi_cfg80211_calculate_bitrate_ht(struct rate_info *rate) +{ + TODO("cfg80211_calculate_bitrate_ht"); + return (rate->legacy); +} + +static uint32_t +lkpi_cfg80211_calculate_bitrate_vht(struct rate_info *rate) +{ + TODO("cfg80211_calculate_bitrate_vht"); + return (rate->legacy); +} + +uint32_t +linuxkpi_cfg80211_calculate_bitrate(struct rate_info *rate) +{ + + /* Beware: order! */ + if (rate->flags & RATE_INFO_FLAGS_MCS) + return (lkpi_cfg80211_calculate_bitrate_ht(rate)); + + if (rate->flags & RATE_INFO_FLAGS_VHT_MCS) + return (lkpi_cfg80211_calculate_bitrate_vht(rate)); + + IMPROVE("HE/EHT/..."); + + return (rate->legacy); +} + uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t channel, enum nl80211_band band) From nobody Mon Feb 24 20:27:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjL3RJYz5pq6M; Mon, 24 Feb 2025 20:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjJ5fmzz3nnh; Mon, 24 Feb 2025 20:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ph74QVLhjWNDm8MlCOaE0Mopv9Ih21j1gDA6s+EhBvk=; b=c8v7k1wXFm/+ynd5EQuuGcAKhtNsP4dvWj2vLpTw5Z1KkVXibYCmfmjDw3t5KCQ9vRA6yf Z2A9vcydivUq1GDu4o1T+iW5iCZZhf6RfEvgrr5IXkUHpYWwCH+RsWuUdjQBf41Qc8KHeM Xg757SvgbqSGjJ+G2oy3WS9nmpXnxHzFuUtjnv0Jt8FK13mtAIfnnIo5Wdb8pOrGyVJeDk PjkVUaYtLZOkQ/x4gdvwuA6I29n1QQL46HlcazCgJ9DAXVp8UuAYqBihtuZ4d0gkacfEUy secw0AjFALx5eDi/K570iH7bL1IbgPlOTGqmojOXL2KGjvB6+DrlYtzmHzNgLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428836; a=rsa-sha256; cv=none; b=tHxp62mjyh/6EgINgd7kXQKqbnyikevvu6+x+0ocq0TNqvglmHuFszPHge8FgqFM6wyCSr elLJrttocSRWUcohu9BjPbUTX+FHjIa06ViO8N8karwGAJDHEE0GjDiiKhSGxMJ0SaCBX6 Q4anzC1HMrRS1VEtbQjS//R5QIB99bwYm667UDHa12p8mRR2/RPUXkt1eOKX5moesg9LmV l1WITkY7YZMIhyks6Nz51tYZvgpSqoMjjH87lB3Y/dZKtVvlVjPxyyrxZbwgdjuzKIJf76 B5eTPncQOdC03CoE+NVBKluq7XWk/x2IqMGkQyU53BsgN4NEWCSrAejtN9KiNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ph74QVLhjWNDm8MlCOaE0Mopv9Ih21j1gDA6s+EhBvk=; b=vRYJS+H79KxWUNLncZghqXSHOld9EAspeg20OlrbjhogH97PekVa3r4hQQXSHKkZxhx7CS 2gUsRUddub5e90I1KYWKzzRTAAR4dz4Frtt8VScw1CElO78IgzOawK5A4MqBHJQno5Z6ca XIHi+ZeZtRTOQb0XPR9FaIWNRs3rmDmvQGbEAORjyj78JdcZzw/4xNO2evtqEX939glKJN VheZ95/4Wx7YAsypYtDT5TWt9x1Y5l0momzbHPytbMn78rDpjXJ2FsaDjroaxtzPfYtg07 kyeA+uI2RBq27gNL0J9notuBHBEJlbCVXyGvfaSBkp+ylh+5BozMW4qAlBdPJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjG2jjBzvnH; Mon, 24 Feb 2025 20:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKREP0027385; Mon, 24 Feb 2025 20:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRE7b027382; Mon, 24 Feb 2025 20:27:14 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:14 GMT Message-Id: <202502242027.51OKRE7b027382@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 75418cb41978 - stable/14 - LinuxKPI: 802.11: make struct ieee80211_tx_info a bit more packed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 75418cb419785947c409969efe2ee82c6a2ed38c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=75418cb419785947c409969efe2ee82c6a2ed38c commit 75418cb419785947c409969efe2ee82c6a2ed38c Author: Bjoern A. Zeeb AuthorDate: 2025-01-26 19:37:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: make struct ieee80211_tx_info a bit more packed Given I was looking at the struct make it more packed at the beginning at least. In fact it did not shrink but the tx_time_est got expanded. Sponsored by: The FreeBSD Foundation (cherry picked from commit 470aaf42c3c0661821a8744ae7c29b096adb4aa3) --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 2 +- sys/compat/linuxkpi/common/include/linux/nl80211.h | 2 +- sys/compat/linuxkpi/common/include/net/mac80211.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 20527a8174f5..ca1493e666c6 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -413,7 +413,7 @@ enum ieee80211_tx_info_flags { IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(18), IEEE80211_TX_CTL_LDPC = BIT(19), IEEE80211_TX_CTL_STBC = BIT(20), -}; +} __packed; enum ieee80211_tx_status_flags { IEEE80211_TX_STATUS_ACK_SIGNAL_VALID = BIT(0), diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 254ed6e13f5c..1babd23d65fe 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -133,7 +133,7 @@ enum nl80211_band { /* Keep this last. */ NUM_NL80211_BANDS -}; +} __packed; enum nl80211_chan_flags { /* XXX TODO */ diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 43df740b0bd0..f1b1ec97cbbc 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -879,11 +879,11 @@ struct ieee80211_prep_tx_info { /* XXX-BZ too big, over-reduce size to u8, and array sizes to minuimum to fit in skb->cb. */ /* Also warning: some sizes change by pointer size! This is 64bit only. */ struct ieee80211_tx_info { - enum ieee80211_tx_info_flags flags; + enum ieee80211_tx_info_flags flags; /* 32 bits */ /* TODO FIXME */ - u8 band; - u8 hw_queue; - bool tx_time_est; + enum nl80211_band band; /* 3 bits */ + uint16_t hw_queue:4, /* 4 bits */ + tx_time_est:10; /* 10 bits */ union { struct { struct ieee80211_tx_rate rates[4]; From nobody Mon Feb 24 20:27:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjR4Sgzz5pq0H; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjN2vhCz3nxL; Mon, 24 Feb 2025 20:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xvQjMCHmi6s2u4GUsamQ+G15qKDpbgnThzzRP+qS1HU=; b=ndNekVlsDdjVwtRe3+NZTaRE+IzKXukREFLRZG9Vff8QPA90yxOPGwT83SaXAH8r82lCes wHLq/yzLVe9qH2pC4JB1Zm+D14EazwbKCieGVw4SKL9hXb+5vRFsGP3GK0snFxjETmFtv2 OQkiKgLM2RDqx0/GlSKWKA4VZE0/Kw3NW2JNHOr5+8cqh+atF/yBXpSsiu9PCJv3WdJrGZ hxVXnocI+4Sx25XhyZJW34lqpmciRwhqFr2UCyvCZo5cZG98JT0iARG0jFQ6a6DZa5xZQw gTATu8k9nfMt3934xI8qdeg5nkVdcy7di8tF8w36nmZWxy3DcfVNjR8fXpbK7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428840; a=rsa-sha256; cv=none; b=Q1RKSA0VGKcI6hI+jMVlg4miAVK87gpj+ry6yS7kcVBp3GH+d+nDNIXiQf4aL+TY2mIWM/ OhRXnJAJsW/1CZbAXd1jL5kfAno5mZyyB53t/63cdrslgyBlg1CX4FLbV9qXA/5mf7whao hbb6xMgyu74x9tVvsQI5mRWQycdWwdvUnHtuDkZ2OOK/s4rhUtlVqFi9M+5RdErT4TLwUr 6wsn72Ppxl9nxbd0H9n1VSyT9/mGhRLeY9A1qDrWFmU0N94sC0zEsuUZxJiCv8gaPfOGEc QmGaLTkOs2uGWVdXjsgQaIE/xApR77R++E1KLV5nUzIJVZ3bhLWh8FwDId1ukQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xvQjMCHmi6s2u4GUsamQ+G15qKDpbgnThzzRP+qS1HU=; b=gblxJG1ZpQw2d4BXldH8gK8845Igu8McBw0Qp9rV8WSxTVhYtlAKlODkxPpXDe5sO7Xign qSMUFVXTvKSrWQa6Zi+sR81pt72zTtnPqERF1FSTCSX1C2GElFQlGxHb9GVLryF2YPj/8w ahNLWTD5sDFrNThaHCGOtuvmnkCreWES+6mjn0rvxj9U8mROQh1GfAZ7m/Mlf8CJtIS93k 4hpeKZCzftolnrW8rjUMqCsW5AJzU6CScxKbf9u82cCCwtHkHHBplabPAxAOz8i+qAfG6p kiBHKtKi5FZ/BrDtDeeg4NbXrkvakQqc0bFTsH0DoVl+UOF0Pq0c8JeRC5medA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjM70lGzwPy; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRJ9U027569; Mon, 24 Feb 2025 20:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRJ2o027566; Mon, 24 Feb 2025 20:27:19 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:19 GMT Message-Id: <202502242027.51OKRJ2o027566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5d6b85d086bc - stable/14 - LinuxKPI: 802.11: hardware crypto offload improvements List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5d6b85d086bc76730f052b6a69241fa6dc7c52c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5d6b85d086bc76730f052b6a69241fa6dc7c52c7 commit 5d6b85d086bc76730f052b6a69241fa6dc7c52c7 Author: Bjoern A. Zeeb AuthorDate: 2024-01-27 22:39:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: hardware crypto offload improvements Implement mac80211 functions ieee80211_iter_keys[_rcu](), and ieee80211_get_key_rx_seq() (*). Implement an internal function lkpi_sta_del_keys() to delete keys when we are leaving RUN (AUTHORIZED) state. Improve and make work (*) the net80211 vap function pointers (*iv_key_set)(), (*iv_key_delete)() implementations. Correct the logic in lkpi_80211_txq_tx_one() and factor most crypto related bits out into lkpi_hw_crypto_prepare() (*). (*) We are currently supporting CCMP only. I would hope we will not have to do full WEP/TKIP support anymore given both are deprecated. The entire logic remains behind the LKPI_80211_HW_CRYPTO pre-processor condition and with this commit in addition behind a tunable. The code is compiled in by default now but the tunable remains off until wider testing has shown no problems. I have seen one net80211 triggered panic on shutdown related to deleting keys which I cannot reproduce anymore and could have been fixed by 9763fec11b83; otherwise we will have to investigate as it shows again. The dedicated hw crypto tracing option can help in that case with debug kernels. Sponsored by: The FreeBSD Foundation Fixes: b35f6cd06612 (cherry picked from commit 11db70b6057e41b259dc2245cd893d5b19179fcc) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 81 ++-- sys/compat/linuxkpi/common/src/linux_80211.c | 492 ++++++++++++++++++--- sys/compat/linuxkpi/common/src/linux_80211.h | 3 +- .../linuxkpi/common/src/linux_80211_macops.c | 2 + 4 files changed, 489 insertions(+), 89 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 8d6d690b2f57..69956c90042c 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -555,6 +555,9 @@ enum ieee802111_key_flag { }; struct ieee80211_key_conf { +#if defined(__FreeBSD__) + const struct ieee80211_key *_k; /* backpointer to net80211 */ +#endif atomic64_t tx_pn; uint32_t cipher; uint8_t icv_len; /* __unused nowadays? */ @@ -1154,7 +1157,7 @@ void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *, struct ieee80211_vif *, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), - void *); + void *, bool); void linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, void *), @@ -1520,25 +1523,22 @@ ieee80211_iterate_interfaces(struct ieee80211_hw *hw, linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); } -static __inline void +static inline void ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), void *arg) { - - linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); + linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg, false); } -static __inline void +static inline void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), void *arg) { - - IMPROVE(); /* "rcu" */ - linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); + linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg, true); } static __inline void @@ -2094,33 +2094,6 @@ ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t) TODO(); } -static __inline void -ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid, - struct ieee80211_key_seq *seq) -{ - - KASSERT(keyconf != NULL && seq != NULL, ("%s: keyconf %p seq %p\n", - __func__, keyconf, seq)); - - TODO(); - switch (keyconf->cipher) { - case WLAN_CIPHER_SUITE_CCMP: - case WLAN_CIPHER_SUITE_CCMP_256: - memset(seq->ccmp.pn, 0xfa, sizeof(seq->ccmp.pn)); /* XXX TODO */ - break; - case WLAN_CIPHER_SUITE_AES_CMAC: - memset(seq->aes_cmac.pn, 0xfa, sizeof(seq->aes_cmac.pn)); /* XXX TODO */ - break; - case WLAN_CIPHER_SUITE_TKIP: - seq->tkip.iv32 = 0xfa; /* XXX TODO */ - seq->tkip.iv16 = 0xfa; /* XXX TODO */ - break; - default: - pr_debug("%s: unsupported cipher suite %d\n", __func__, keyconf->cipher); - break; - } -} - static __inline void ieee80211_sched_scan_results(struct ieee80211_hw *hw) { @@ -2466,6 +2439,44 @@ ieee80211_remove_key(struct ieee80211_key_conf *key) TODO(); } +static inline void +ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, int8_t tid, + struct ieee80211_key_seq *seq) +{ + const struct ieee80211_key *k; + const uint8_t *p; + + KASSERT(keyconf != NULL && seq != NULL, ("%s: keyconf %p seq %p\n", + __func__, keyconf, seq)); + KASSERT(tid <= IEEE80211_NUM_TIDS, ("%s: tid out of bounds %d\n", + __func__, tid)); + k = keyconf->_k; + KASSERT(k != NULL, ("%s: keyconf %p ieee80211_key is NULL\n", __func__, keyconf)); + + switch (keyconf->cipher) { + case WLAN_CIPHER_SUITE_CCMP: + case WLAN_CIPHER_SUITE_CCMP_256: + if (tid < 0) + p = (const uint8_t *)&k->wk_keyrsc[IEEE80211_NUM_TIDS]; /* IEEE80211_NONQOS_TID */ + else + p = (const uint8_t *)&k->wk_keyrsc[tid]; + memcpy(seq->ccmp.pn, p, sizeof(seq->ccmp.pn)); + break; + case WLAN_CIPHER_SUITE_AES_CMAC: + TODO(); + memset(seq->aes_cmac.pn, 0xfa, sizeof(seq->aes_cmac.pn)); /* XXX TODO */ + break; + case WLAN_CIPHER_SUITE_TKIP: + TODO(); + seq->tkip.iv32 = 0xfa; /* XXX TODO */ + seq->tkip.iv16 = 0xfa; /* XXX TODO */ + break; + default: + pr_debug("%s: unsupported cipher suite %d\n", __func__, keyconf->cipher); + break; + } +} + static __inline void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid, struct ieee80211_key_seq *seq) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b276f502be76..683de6e0d474 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -39,7 +39,12 @@ * We call the internal versions lxxx (e.g., hw -> lhw, sta -> lsta). */ -#include +/* + * TODO: + * - lots :) + * - HW_CRYPTO: we need a "keystore" and an ordered list for suspend/resume. + */ + #include #include #include @@ -72,12 +77,16 @@ #include "linux_80211.h" #define LKPI_80211_WME -/* #define LKPI_80211_HW_CRYPTO */ -/* #define LKPI_80211_VHT */ +#define LKPI_80211_HW_CRYPTO /* #define LKPI_80211_HT */ +/* #define LKPI_80211_VHT */ + #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) #define LKPI_80211_HT #endif +#if defined(LKPI_80211_HT) && !defined(LKPI_80211_HW_CRYPTO) +#define LKPI_80211_HW_CRYPTO +#endif static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); @@ -93,6 +102,12 @@ SYSCTL_DECL(_compat_linuxkpi); SYSCTL_NODE(_compat_linuxkpi, OID_AUTO, 80211, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "LinuxKPI 802.11 compatibility layer"); +#if defined(LKPI_80211_HW_CRYPTO) +static bool lkpi_hwcrypto = false; +SYSCTL_BOOL(_compat_linuxkpi_80211, OID_AUTO, hw_crypto, CTLFLAG_RDTUN, + &lkpi_hwcrypto, 0, "Enable LinuxKPI 802.11 hardware crypto offload"); +#endif + /* Keep public for as long as header files are using it too. */ int linuxkpi_debug_80211; @@ -439,7 +454,7 @@ lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, ieee80211_dump_node(NULL, ni); printf("\ttxq_task txq len %d mtx\n", mbufq_len(&lsta->txq)); printf("\tkc %p state %d added_to_drv %d in_mgd %d\n", - lsta->kc, lsta->state, lsta->added_to_drv, lsta->in_mgd); + &lsta->kc[0], lsta->state, lsta->added_to_drv, lsta->in_mgd); #endif } @@ -905,20 +920,173 @@ linuxkpi_ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) #ifdef LKPI_80211_HW_CRYPTO static int -_lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, - enum set_key_cmd cmd) +lkpi_sta_del_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct lkpi_sta *lsta) +{ + int error; + + if (!lkpi_hwcrypto) + return (0); + + lockdep_assert_wiphy(hw->wiphy); + ieee80211_ref_node(lsta->ni); + + error = 0; + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) { + struct ieee80211_key_conf *kc; + int err; + + if (lsta->kc[keyix] == NULL) + continue; + kc = lsta->kc[keyix]; + + err = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, + LSTA_TO_STA(lsta), kc); + if (err != 0) { + ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " + "sta %6D failed: %d\n", __func__, DISABLE_KEY, + "DISABLE", lsta->sta.addr, ":", err); + error++; + + /* + * If we free the key here we will never be able to get it + * removed from the driver/fw which will likely make us + * crash (firmware). + */ + continue; + } +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " + "sta %6D succeeded: keyidx %u hw_key_idx %u flags %#10x\n", + __func__, DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", + kc->keyidx, kc->hw_key_idx, kc->flags); +#endif + + lsta->kc[keyix] = NULL; + free(kc, M_LKPI80211); + } + ieee80211_free_node(lsta->ni); + return (error); +} + +static int +_lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) { struct ieee80211com *ic; struct lkpi_hw *lhw; struct ieee80211_hw *hw; struct lkpi_vif *lvif; + struct lkpi_sta *lsta; struct ieee80211_vif *vif; struct ieee80211_sta *sta; struct ieee80211_node *ni; struct ieee80211_key_conf *kc; + struct ieee80211_node_table *nt; int error; + bool islocked; - /* XXX TODO Check (k->wk_flags & IEEE80211_KEY_SWENCRYPT) and don't upload to driver/hw? */ + ic = vap->iv_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + + if (vap->iv_bss == NULL) { + ic_printf(ic, "%s: iv_bss %p for vap %p is NULL\n", + __func__, vap->iv_bss, vap); + return (0); + } + ni = ieee80211_ref_node(vap->iv_bss); + lsta = ni->ni_drv_data; + if (lsta == NULL) { + ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", + __func__, ni, ni->ni_bssid, ":"); + ieee80211_free_node(ni); + return (0); + } + sta = LSTA_TO_STA(lsta); + + if (lsta->kc[k->wk_keyix] == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: sta %6D and no key information, " + "keyidx %u wk_macaddr %6D; returning success\n", + __func__, sta->addr, ":", + k->wk_keyix, k->wk_macaddr, ":"); +#endif + ieee80211_free_node(ni); + return (1); + } + + /* This is inconsistent net80211 locking to be fixed one day. */ + nt = &ic->ic_sta; + islocked = IEEE80211_NODE_IS_LOCKED(nt); + if (islocked) + IEEE80211_NODE_UNLOCK(nt); + + wiphy_lock(hw->wiphy); + kc = lsta->kc[k->wk_keyix]; + /* Re-check under lock. */ + if (kc == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: sta %6D and key information vanished, " + "returning success\n", __func__, sta->addr, ":"); +#endif + error = 1; + goto out; + } + + error = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, sta, kc); + if (error != 0) { + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", + __func__, DISABLE_KEY, "DISABLE", sta->addr, ":", error); + error = 0; + goto out; + } + +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " + "keyidx %u hw_key_idx %u flags %#10x\n", __func__, + DISABLE_KEY, "DISABLE", sta->addr, ":", + kc->keyidx, kc->hw_key_idx, kc->flags); +#endif + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + error = 1; +out: + wiphy_unlock(hw->wiphy); + if (islocked) + IEEE80211_NODE_LOCK(nt); + ieee80211_free_node(ni); + return (error); +} + +static int +lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + + /* XXX-BZ one day we should replace this iterating over VIFs, or node list? */ + /* See also lkpi_sta_del_keys() these days. */ + return (_lkpi_iv_key_delete(vap, k)); +} + +static int +_lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct lkpi_vif *lvif; + struct lkpi_sta *lsta; + struct ieee80211_vif *vif; + struct ieee80211_sta *sta; + struct ieee80211_node *ni; + struct ieee80211_key_conf *kc; + uint32_t lcipher; + int error; ic = vap->iv_ic; lhw = ic->ic_softc; @@ -926,10 +1094,50 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - memset(&kc, 0, sizeof(kc)); - kc = malloc(sizeof(*kc) + k->wk_keylen, M_LKPI80211, M_WAITOK | M_ZERO); - kc->cipher = lkpi_net80211_to_l80211_cipher_suite( + if (vap->iv_bss == NULL) { + ic_printf(ic, "%s: iv_bss %p for vap %p is NULL\n", + __func__, vap->iv_bss, vap); + return (0); + } + ni = ieee80211_ref_node(vap->iv_bss); + lsta = ni->ni_drv_data; + if (lsta == NULL) { + ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", + __func__, ni, ni->ni_bssid, ":"); + ieee80211_free_node(ni); + return (0); + } + sta = LSTA_TO_STA(lsta); + + wiphy_lock(hw->wiphy); + if (lsta->kc[k->wk_keyix] != NULL) { + IMPROVE("Still in firmware? Del first. Can we assert this cannot happen?"); + ic_printf(ic, "%s: sta %6D found with key information\n", + __func__, sta->addr, ":"); + kc = lsta->kc[k->wk_keyix]; + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + kc = NULL; /* safeguard */ + } + + lcipher = lkpi_net80211_to_l80211_cipher_suite( k->wk_cipher->ic_cipher, k->wk_keylen); + switch (lcipher) { + case WLAN_CIPHER_SUITE_CCMP: + break; + case WLAN_CIPHER_SUITE_TKIP: + default: + ic_printf(ic, "%s: CIPHER SUITE %#x not supported\n", __func__, lcipher); + IMPROVE(); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); + return (0); + } + + kc = malloc(sizeof(*kc) + k->wk_keylen, M_LKPI80211, M_WAITOK | M_ZERO); + kc->_k = k; /* Save the pointer to net80211. */ + atomic64_set(&kc->tx_pn, k->wk_keytsc); + kc->cipher = lcipher; kc->keyidx = k->wk_keyix; #if 0 kc->hw_key_idx = /* set by hw and needs to be passed for TX */; @@ -938,6 +1146,11 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, kc->keylen = k->wk_keylen; memcpy(kc->key, k->wk_key, k->wk_keylen); + if (k->wk_flags & (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV)) + kc->flags |= IEEE80211_KEY_FLAG_PAIRWISE; + if (k->wk_flags & IEEE80211_KEY_GROUP) + kc->flags &= ~IEEE80211_KEY_FLAG_PAIRWISE; + switch (kc->cipher) { case WLAN_CIPHER_SUITE_CCMP: kc->iv_len = k->wk_cipher->ic_header; @@ -945,44 +1158,41 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, break; case WLAN_CIPHER_SUITE_TKIP: default: + /* currently UNREACH */ IMPROVE(); - return (0); + break; }; + lsta->kc[k->wk_keyix] = kc; - ni = vap->iv_bss; - sta = ieee80211_find_sta(vif, ni->ni_bssid); - if (sta != NULL) { - struct lkpi_sta *lsta; - - lsta = STA_TO_LSTA(sta); - lsta->kc = kc; - } - - error = lkpi_80211_mo_set_key(hw, cmd, vif, sta, kc); + error = lkpi_80211_mo_set_key(hw, SET_KEY, vif, sta, kc); if (error != 0) { - /* XXX-BZ leaking kc currently */ - ic_printf(ic, "%s: set_key failed: %d\n", __func__, error); + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", + __func__, SET_KEY, "SET", sta->addr, ":", error); + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); return (0); - } else { - ic_printf(ic, "%s: set_key succeeded: keyidx %u hw_key_idx %u " - "flags %#10x\n", __func__, - kc->keyidx, kc->hw_key_idx, kc->flags); - return (1); } -} -static int -lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) -{ +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " + "kc %p keyidx %u hw_key_idx %u flags %#010x\n", __func__, + SET_KEY, "SET", sta->addr, ":", + kc, kc->keyidx, kc->hw_key_idx, kc->flags); +#endif - /* XXX-BZ one day we should replace this iterating over VIFs, or node list? */ - return (_lkpi_iv_key_set_delete(vap, k, DISABLE_KEY)); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); + return (1); } + static int lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { - return (_lkpi_iv_key_set_delete(vap, k, SET_KEY)); + return (_lkpi_iv_key_set(vap, k)); } #endif @@ -2425,6 +2635,24 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + wiphy_lock(hw->wiphy); + error = lkpi_sta_del_keys(hw, vif, lsta); + wiphy_unlock(hw->wiphy); + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys " + "failed: %d\n", __func__, __LINE__, error); + /* + * Either drv/fw will crash or cleanup itself, + * otherwise net80211 will delete the keys (at a + * less appropriate time). + */ + /* goto out; */ + } + } +#endif + /* Update sta_state (ASSOC to AUTH). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " @@ -2563,6 +2791,24 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + wiphy_lock(hw->wiphy); + error = lkpi_sta_del_keys(hw, vif, lsta); + wiphy_unlock(hw->wiphy); + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys " + "failed: %d\n", __func__, __LINE__, error); + /* + * Either drv/fw will crash or cleanup itself, + * otherwise net80211 will delete the keys (at a + * less appropriate time). + */ + /* goto out; */ + } + } +#endif + /* Update sta_state (ASSOC to AUTH). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " @@ -3143,13 +3389,13 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif->iv_update_bss = vap->iv_update_bss; vap->iv_update_bss = lkpi_iv_update_bss; - /* Key management. */ - if (lhw->ops->set_key != NULL) { #ifdef LKPI_80211_HW_CRYPTO + /* Key management. */ + if (lkpi_hwcrypto && lhw->ops->set_key != NULL) { vap->iv_key_set = lkpi_iv_key_set; vap->iv_key_delete = lkpi_iv_key_delete; -#endif } +#endif #ifdef LKPI_80211_HT /* Stay with the iv_ampdu_rxmax,limit / iv_ampdu_density defaults until later. */ @@ -3161,6 +3407,15 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status, mac); +#ifdef LKPI_80211_HT + /* + * Modern chipset/fw/drv will do A-MPDU in drv/fw and fail + * to do so if they cannot do the crypto too. + */ + if (!lkpi_hwcrypto && ieee80211_hw_check(hw, AMPDU_AGGREGATION)) + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX; +#endif + if (hw->max_listen_interval == 0) hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); hw->conf.listen_interval = hw->max_listen_interval; @@ -3991,13 +4246,74 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, return (0); } +#ifdef LKPI_80211_HW_CRYPTO +static int +lkpi_hw_crypto_prepare(struct lkpi_sta *lsta, struct ieee80211_key *k, + struct sk_buff *skb) +{ + struct ieee80211_tx_info *info; + struct ieee80211_key_conf *kc; + struct ieee80211_hdr *hdr; + uint32_t hlen, hdrlen; + uint8_t *p; + + KASSERT(lsta != NULL, ("%s: lsta is NULL", __func__)); + KASSERT(k != NULL, ("%s: key is NULL", __func__)); + KASSERT(skb != NULL, ("%s: skb is NULL", __func__)); + + kc = lsta->kc[k->wk_keyix]; + + info = IEEE80211_SKB_CB(skb); + info->control.hw_key = kc; + + /* MUST NOT happen. KASSERT? */ + if (kc == NULL) { + ic_printf(lsta->ni->ni_ic, "%s: lsta %p k %p skb %p, " + "kc is NULL on hw crypto offload\n", __func__, lsta, k, skb); + return (ENXIO); + } + + + IMPROVE("the following should be WLAN_CIPHER_SUITE specific"); + /* We currently only support CCMP so we hardcode things here. */ + + hdr = (void *)skb->data; + + /* + * Check if we have anythig to do as requested by driver + * or if we are done? + */ + if ((kc->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) == 0 && + (kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV) == 0 && + /* MFP */ + !((kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) != 0 && + ieee80211_is_mgmt(hdr->frame_control))) + return (0); + + hlen = k->wk_cipher->ic_header; + if (skb_headroom(skb) < hlen) + return (ENOSPC); + + hdrlen = ieee80211_hdrlen(hdr->frame_control); + p = skb_push(skb, hlen); + memmove(p, p + hlen, hdrlen); + + /* If driver request space only we are done. */ + if ((kc->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) != 0) + return (0); + + p += hdrlen; + k->wk_cipher->ic_setiv(k, p); + + return (0); +} +#endif + static void lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) { struct ieee80211_node *ni; -#ifndef LKPI_80211_HW_CRYPTO struct ieee80211_frame *wh; -#endif struct ieee80211_key *k; struct sk_buff *skb; struct ieee80211com *ic; @@ -4012,6 +4328,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) struct ieee80211_hdr *hdr; struct lkpi_txq *ltxq; void *buf; + ieee80211_keyix keyix; uint8_t ac, tid; M_ASSERTPKTHDR(m); @@ -4022,20 +4339,30 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) ni = lsta->ni; k = NULL; -#ifndef LKPI_80211_HW_CRYPTO - /* Encrypt the frame if need be; XXX-BZ info->control.hw_key. */ + keyix = IEEE80211_KEYIX_NONE; wh = mtod(m, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { - /* Retrieve key for TX && do software encryption. */ - k = ieee80211_crypto_encap(ni, m); - if (k == NULL) { - ieee80211_free_node(ni); - m_freem(m); - return; + +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + k = ieee80211_crypto_get_txkey(ni, m); + if (k != NULL && lsta->kc[k->wk_keyix] != NULL) + keyix = k->wk_keyix; } - } #endif + /* Encrypt the frame if need be. */ + if (keyix == IEEE80211_KEYIX_NONE) { + /* Retrieve key for TX && do software encryption. */ + k = ieee80211_crypto_encap(ni, m); + if (k == NULL) { + ieee80211_free_node(ni); + m_freem(m); + return; + } + } + } + ic = ni->ni_ic; lhw = ic->ic_softc; hw = LHW_TO_HW(lhw); @@ -4146,7 +4473,19 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) sta = LSTA_TO_STA(lsta); #ifdef LKPI_80211_HW_CRYPTO - info->control.hw_key = lsta->kc; + if (lkpi_hwcrypto && keyix != IEEE80211_KEYIX_NONE) { + int error; + + error = lkpi_hw_crypto_prepare(lsta, k, skb); + if (error != 0) { + /* + * We only have to free the skb which will free the + * mbuf and release the reference on the ni. + */ + dev_kfree_skb(skb); + return; + } + } #endif IMPROVE(); @@ -5107,7 +5446,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) ic->ic_cryptocaps = 0; #ifdef LKPI_80211_HW_CRYPTO - if (hw->wiphy->n_cipher_suites > 0) { + if (lkpi_hwcrypto && hw->wiphy->n_cipher_suites > 0) { for (i = 0; i < hw->wiphy->n_cipher_suites; i++) ic->ic_cryptocaps |= lkpi_l80211_to_net80211_cyphers( hw->wiphy->cipher_suites[i]); @@ -5346,15 +5685,62 @@ linuxkpi_ieee80211_iterate_interfaces(struct ieee80211_hw *hw, LKPI_80211_LHW_LVIF_UNLOCK(lhw); } +static void +lkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + ieee80211_keyix keyix, struct lkpi_sta *lsta, + void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, + struct ieee80211_sta *, struct ieee80211_key_conf *, void *), + void *arg) +{ + if (!lsta->added_to_drv) + return; + + if (lsta->kc[keyix] == NULL) + return; + + iterfunc(hw, vif, LSTA_TO_STA(lsta), lsta->kc[keyix], arg); +} + void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), - void *arg) + void *arg, bool rcu) { + struct lkpi_sta *lsta; + struct lkpi_vif *lvif; - UNIMPLEMENTED; + lvif = VIF_TO_LVIF(vif); + + if (rcu) { + if (vif == NULL) { + TODO(); + } else { + IMPROVE("We do not actually match the RCU code"); + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); + keyix++) + lkpi_ieee80211_iterate_keys(hw, vif, + keyix, lsta, iterfunc, arg); + } + } + } else { + TODO("Used by suspend/resume; order of keys as installed to " + "firmware is important; we'll need to rewrite some code for that"); + lockdep_assert_wiphy(hw->wiphy); + + if (vif == NULL) { + TODO(); + } else { + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); + keyix++) + lkpi_ieee80211_iterate_keys(hw, vif, + keyix, lsta, iterfunc, arg); + } + } + } } void diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index bb1ecb45636f..40b11ebfef13 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -67,6 +67,7 @@ #define D80211_TRACEX (D80211_TRACE_TX|D80211_TRACE_RX) #define D80211_TRACEX_DUMP (D80211_TRACE_TX_DUMP|D80211_TRACE_RX_DUMP) #define D80211_TRACE_STA 0x00010000 +#define D80211_TRACE_HW_CRYPTO 0x00020000 #define D80211_TRACE_MO 0x00100000 #define D80211_TRACE_MODE 0x0f000000 #define D80211_TRACE_MODE_HT 0x01000000 @@ -151,7 +152,7 @@ struct lkpi_sta { struct mbufq txq; struct mtx txq_mtx; - struct ieee80211_key_conf *kc; + struct ieee80211_key_conf *kc[IEEE80211_WEP_NKID]; enum ieee80211_sta_state state; bool txq_ready; /* Can we run the taskq? */ bool added_to_drv; /* Driver knows; i.e. we called ...(). */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 7440d1d3c26c..1da3c582adb4 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -684,6 +684,8 @@ lkpi_80211_mo_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct lkpi_hw *lhw; int error; + lockdep_assert_wiphy(hw->wiphy); + lhw = HW_TO_LHW(hw); if (lhw->ops->set_key == NULL) { error = EOPNOTSUPP; From nobody Mon Feb 24 20:27:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjR2Smpz5ppwV; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjM6HYPz3p0b; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JiLsIinGYspe7z5iNSeV/JOhoMWOCgEyll4ph4ETRnA=; b=lxItJiH0sL9IeUxAFwmtYX9kmfKhHcsSijxpMK1pMxlxBGgIj6UhzAQbzzhpFWEKCF53e5 RVkafwH5dQ/lUWFvY8cKOI6eFV5ilzPQgdRbrRFpt/geSV8KswI3IUpuW1t7QEA7jLFV3U mVy80eJNCZ7Q6D/DhDMTKVst88cgsKSjsN0IBzdqrhJ1zKCj29VwI8yqSXJuMyPNM/orTb WWgPA1mu8K+dMy9MI1xcbX8fPmKZDwXrGAtYpJ9OqPpgA4ozv1y9/XHzqoHiyVsviPRThN Ie0IG5ZGRXaPTQ93JCV1X9jqH+Q3oKcfpG4sE4HsjgQXBRa1tallEk7m250m/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428839; a=rsa-sha256; cv=none; b=RkJKXAvVUYRUEeR/zi/JQkNrQV0vLw6N3nhr+3wVAkuniZHn1E4wd8TwIO2zWTTx9QyEhB O62tNVyS2H+CpZAA2niiMq+buRcFQYDd/RDeH93GxsllAPverbFbmcCPgNdLnRzRyZi1DK SNM/uQfujpxtFsCBYuvsVksmXYGxq17YOfwY7SHPPtebZH2uAhQr/s41zju5tDF496BPhz Ei1pZPT0AUgVi8OMsaoXYqfL/F9qZIb8NAn0PCbg1OmOqXOarkg/FcPaxKIf5KnOg4bKV+ 4QeiFSRZaYIdyYG74r5lQFHFVFlkXgceQKfoMHM8CdfS1f3nBdRb7Djz2Heb2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JiLsIinGYspe7z5iNSeV/JOhoMWOCgEyll4ph4ETRnA=; b=dVvb+d9YYsnIHonB15RIF14q7xfScxuOP6BwLqPVamolog/5aqaSaTPiHl9C+6yb8MR/HH Ea+QRQeqRSjkW61DT6YDYCsR5/I76pMuHJ0qGbmBJWI/zD43brVWIvDBH8SJ5Qn2RFcDja WtbX//0mSD4qQg89y4VZGfAXVG+6ONg0YfXsL7qO0eIeOYw/e3k0+xpW6DhhPgSnwLHtjx hNgRAPYN/U7jGBMh6juI+WtuOdtQoyYM0b4BaBXS/quWrO7/hmWjjXlSYMqwv6E9wFVEvK YZlz5kNOVDfhnwSci2hiVg37ZyDG8hGuMRKy9qvMcuKTB06hLvkJww5ZnmysLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjL6WhWzvrT; Mon, 24 Feb 2025 20:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRIam027533; Mon, 24 Feb 2025 20:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRIsJ027530; Mon, 24 Feb 2025 20:27:18 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:18 GMT Message-Id: <202502242027.51OKRIsJ027530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a960f6e71743 - stable/14 - LinuxKPI: 802.11: dump station_info using (*sta_statistics)() as sysctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a960f6e717438983da18a03786531c97a41253d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a960f6e717438983da18a03786531c97a41253d3 commit a960f6e717438983da18a03786531c97a41253d3 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: dump station_info using (*sta_statistics)() as sysctl Implement the mac80211 (*sta_statistics) to obtain station statistics. Fix up struct station_info for that. Add supporting funtions to decode station_info and rate_info_bw fields to make the output more usable to human beings. Add a per-VIF (VAP) sysctl to export that information. This is mostly used for now to see what the driver/fw thinks about its TX rate. We should later gather this information in different ways and pass it to net80211 to export it to user space so we can finally have nice station information (also for the non-AP side). Sponsored by: The FreeBSD Foundation (cherry picked from commit 408394185fe9be0c158189b7671bde316ac14ac9) --- sys/compat/linuxkpi/common/include/linux/nl80211.h | 1 + sys/compat/linuxkpi/common/include/net/cfg80211.h | 38 +++- sys/compat/linuxkpi/common/src/linux_80211.c | 221 ++++++++++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.h | 5 +- .../linuxkpi/common/src/linux_80211_macops.c | 30 +++ 5 files changed, 283 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 1babd23d65fe..80546e56f0c1 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -247,6 +247,7 @@ enum nl80211_ext_feature { NUM_NL80211_EXT_FEATURES }; +/* Keep in order with lkpi_nl80211_sta_info_to_str() */ enum nl80211_sta_info { /* XXX TODO */ NL80211_STA_INFO_BEACON_RX, diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index cf1e05dde7ea..338ffb82bd83 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -81,6 +81,9 @@ enum cfg80211_rate_info_flags { /* Max 8 bits as used in struct rate_info. */ }; +#define CFG80211_RATE_INFO_FLAGS_BITS \ + "\20\1MCS\2VHT_MCS\3SGI\5HE_MCS\10EHT_MCS" + extern const uint8_t rfc1042_header[6]; extern const uint8_t bridge_tunnel_header[6]; @@ -164,7 +167,7 @@ enum rate_info_bw { struct rate_info { uint8_t flags; /* enum cfg80211_rate_info_flags */ - uint8_t bw; + uint8_t bw; /* enum rate_info_bw */ uint16_t legacy; uint8_t mcs; uint8_t nss; @@ -546,18 +549,39 @@ struct station_del_parameters { }; struct station_info { - /* TODO FIXME */ - int assoc_req_ies_len, connected_time; - int generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets; - int filled, rx_beacon, rx_beacon_signal_avg, signal_avg; - int rx_duration, tx_duration, tx_failed, tx_retries; - int ack_signal, avg_ack_signal; + uint64_t filled; /* enum nl80211_sta_info */ + uint32_t connected_time; + uint32_t inactive_time; + + uint64_t rx_bytes; + uint32_t rx_packets; + uint32_t rx_dropped_misc; + + uint64_t rx_duration; + uint32_t rx_beacon; + uint8_t rx_beacon_signal_avg; + + int8_t signal; + int8_t signal_avg; + int8_t ack_signal; + int8_t avg_ack_signal; + + /* gap */ + int generation; + + uint64_t tx_bytes; + uint32_t tx_packets; + uint32_t tx_failed; + uint64_t tx_duration; + uint32_t tx_retries; int chains; uint8_t chain_signal[IEEE80211_MAX_CHAINS]; uint8_t chain_signal_avg[IEEE80211_MAX_CHAINS]; uint8_t *assoc_req_ies; + size_t assoc_req_ies_len; + struct rate_info rxrate; struct rate_info txrate; struct cfg80211_ibss_params bss_param; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 853d77fd4a96..b276f502be76 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -88,14 +89,14 @@ static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); /* -------------------------------------------------------------------------- */ -/* Keep public for as long as header files are using it too. */ -int linuxkpi_debug_80211; - -#ifdef LINUXKPI_DEBUG_80211 SYSCTL_DECL(_compat_linuxkpi); SYSCTL_NODE(_compat_linuxkpi, OID_AUTO, 80211, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "LinuxKPI 802.11 compatibility layer"); +/* Keep public for as long as header files are using it too. */ +int linuxkpi_debug_80211; + +#ifdef LINUXKPI_DEBUG_80211 SYSCTL_INT(_compat_linuxkpi_80211, OID_AUTO, debug, CTLFLAG_RWTUN, &linuxkpi_debug_80211, 0, "LinuxKPI 802.11 debug level"); @@ -154,6 +155,200 @@ static void lkpi_ieee80211_free_skb_mbuf(void *); static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool); #endif +static const char * +lkpi_rate_info_bw_to_str(enum rate_info_bw bw) +{ + + switch (bw) { + + case RATE_INFO_BW_20: + return ("20"); + break; + case RATE_INFO_BW_5: + return ("5"); + break; + case RATE_INFO_BW_10: + return ("10"); + break; + case RATE_INFO_BW_40: + return ("40"); + break; + case RATE_INFO_BW_80: + return ("80"); + break; + case RATE_INFO_BW_160: + return ("160"); + break; + case RATE_INFO_BW_HE_RU: + IMPROVE("nl80211_he_ru_alloc"); + return ("HE_RU"); + break; + case RATE_INFO_BW_320: + return ("320"); + break; + case RATE_INFO_BW_EHT_RU: + IMPROVE("nl80211_eht_ru_alloc"); + return ("EHT_RU"); + break; + default: + return ("?"); + break; + } +} + +static void +lkpi_nl80211_sta_info_to_str(struct sbuf *s, const char *prefix, + const uint64_t flags) +{ + int bit, i; + + sbuf_printf(s, "%s %#010jx", prefix, flags); + + i = 0; + for (bit = 0; bit < BITS_PER_TYPE(flags); bit++) { + + if ((flags & BIT_ULL(bit)) == 0) + continue; + +#define EXPAND_CASE(_flag) \ + case NL80211_STA_INFO_ ## _flag: \ + sbuf_printf(s, "%c%s", (i == 0) ? '<' : ',', #_flag); \ + i++; \ + break; + + switch (bit) { + EXPAND_CASE(BEACON_RX) + EXPAND_CASE(BEACON_SIGNAL_AVG) + EXPAND_CASE(BSS_PARAM) + EXPAND_CASE(CHAIN_SIGNAL) + EXPAND_CASE(CHAIN_SIGNAL_AVG) + EXPAND_CASE(CONNECTED_TIME) + EXPAND_CASE(INACTIVE_TIME) + EXPAND_CASE(SIGNAL) + EXPAND_CASE(SIGNAL_AVG) + EXPAND_CASE(STA_FLAGS) + EXPAND_CASE(RX_BITRATE) + EXPAND_CASE(RX_PACKETS) + EXPAND_CASE(RX_BYTES) + EXPAND_CASE(RX_DROP_MISC) + EXPAND_CASE(TX_BITRATE) + EXPAND_CASE(TX_PACKETS) + EXPAND_CASE(TX_BYTES) + EXPAND_CASE(TX_BYTES64) + EXPAND_CASE(RX_BYTES64) + EXPAND_CASE(TX_FAILED) + EXPAND_CASE(TX_RETRIES) + EXPAND_CASE(RX_DURATION) + EXPAND_CASE(TX_DURATION) + EXPAND_CASE(ACK_SIGNAL) + EXPAND_CASE(ACK_SIGNAL_AVG) + default: + sbuf_printf(s, "%c?%d", (i == 0) ? '<' : ',', bit); + break; + } + } +#undef EXPAND_CASE + if (i > 0) + sbuf_printf(s, ">"); + sbuf_printf(s, "\n"); +} + +static int +lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) +{ + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct station_info sinfo; + struct sbuf s; + int error; + + if (req->newptr) + return (EPERM); + + lvif = (struct lkpi_vif *)arg1; + vif = LVIF_TO_VIF(lvif); + vap = LVIF_TO_VAP(lvif); + lhw = vap->iv_ic->ic_softc; + hw = LHW_TO_HW(lhw); + + sbuf_new_for_sysctl(&s, NULL, 1024, req); + + wiphy_lock(hw->wiphy); + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + sta = LSTA_TO_STA(lsta); + + sbuf_putc(&s, '\n'); + sbuf_printf(&s, "lsta %p sta %p added_to_drv %d\n", lsta, sta, lsta->added_to_drv); + + memset(&sinfo, 0, sizeof(sinfo)); + error = lkpi_80211_mo_sta_statistics(hw, vif, sta, &sinfo); + if (error == EEXIST) /* Not added to driver. */ + continue; + if (error == ENOTSUPP) { + sbuf_printf(&s, " sta_statistics not supported\n"); + continue; + } + if (error != 0) { + sbuf_printf(&s, " sta_statistics failed: %d\n", error); + continue; + } + + lkpi_nl80211_sta_info_to_str(&s, " nl80211_sta_info (valid fields)", sinfo.filled); + sbuf_printf(&s, " connected_time %u inactive_time %u\n", + sinfo.connected_time, sinfo.inactive_time); + sbuf_printf(&s, " rx_bytes %ju rx_packets %u rx_dropped_misc %u\n", + (uintmax_t)sinfo.rx_bytes, sinfo.rx_packets, sinfo.rx_dropped_misc); + sbuf_printf(&s, " rx_duration %ju rx_beacon %u rx_beacon_signal_avg %d\n", + (uintmax_t)sinfo.rx_duration, sinfo.rx_beacon, (int8_t)sinfo.rx_beacon_signal_avg); + + sbuf_printf(&s, " tx_bytes %ju tx_packets %u tx_failed %u\n", + (uintmax_t)sinfo.tx_bytes, sinfo.tx_packets, sinfo.tx_failed); + sbuf_printf(&s, " tx_duration %ju tx_retries %u\n", + (uintmax_t)sinfo.tx_duration, sinfo.tx_retries); + + sbuf_printf(&s, " signal %d signal_avg %d ack_signal %d avg_ack_signal %d\n", + sinfo.signal, sinfo.signal_avg, sinfo.ack_signal, sinfo.avg_ack_signal); + + sbuf_printf(&s, " generation %d assoc_req_ies_len %zu chains %d\n", + sinfo.generation, sinfo.assoc_req_ies_len, sinfo.chains); + + for (int i = 0; i < sinfo.chains && i < IEEE80211_MAX_CHAINS; i++) { + sbuf_printf(&s, " chain[%d] signal %d signal_avg %d\n", + i, (int8_t)sinfo.chain_signal[i], (int8_t)sinfo.chain_signal_avg[i]); + } + + /* assoc_req_ies, bss_param, sta_flags */ + + sbuf_printf(&s, " rxrate: flags %b bw %u(%s) legacy %u kbit/s mcs %u nss %u\n", + sinfo.rxrate.flags, CFG80211_RATE_INFO_FLAGS_BITS, + sinfo.rxrate.bw, lkpi_rate_info_bw_to_str(sinfo.rxrate.bw), + sinfo.rxrate.legacy * 100, + sinfo.rxrate.mcs, sinfo.rxrate.nss); + sbuf_printf(&s, " he_dcm %u he_gi %u he_ru_alloc %u eht_gi %u\n", + sinfo.rxrate.he_dcm, sinfo.rxrate.he_gi, sinfo.rxrate.he_ru_alloc, + sinfo.rxrate.eht_gi); + sbuf_printf(&s, " txrate: flags %b bw %u(%s) legacy %u kbit/s mcs %u nss %u\n", + sinfo.txrate.flags, CFG80211_RATE_INFO_FLAGS_BITS, + sinfo.txrate.bw, lkpi_rate_info_bw_to_str(sinfo.txrate.bw), + sinfo.txrate.legacy * 100, + sinfo.txrate.mcs, sinfo.txrate.nss); + sbuf_printf(&s, " he_dcm %u he_gi %u he_ru_alloc %u eht_gi %u\n", + sinfo.txrate.he_dcm, sinfo.txrate.he_gi, sinfo.txrate.he_ru_alloc, + sinfo.txrate.eht_gi); + } + wiphy_unlock(hw->wiphy); + + sbuf_finish(&s); + sbuf_delete(&s); + + return (0); +} + #if defined(LKPI_80211_HT) static void lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *ht_rx_nss) @@ -2803,6 +2998,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], struct ieee80211_vif *vif; struct ieee80211_tx_queue_params txqp; enum ieee80211_bss_changed changed; + struct sysctl_oid *node; size_t len; int error, i; uint16_t ac; @@ -2976,6 +3172,20 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], hw->wiphy->rts_threshold = vap->iv_rtsthreshold; lkpi_80211_mo_set_rts_threshold(hw, vap->iv_rtsthreshold); /* any others? */ + + /* Add per-VIF/VAP sysctls. */ + sysctl_ctx_init(&lvif->sysctl_ctx); + + node = SYSCTL_ADD_NODE(&lvif->sysctl_ctx, + SYSCTL_CHILDREN(&sysctl___compat_linuxkpi_80211), + OID_AUTO, if_name(vap->iv_ifp), + CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, NULL, "VIF Information"); + + SYSCTL_ADD_PROC(&lvif->sysctl_ctx, + SYSCTL_CHILDREN(node), OID_AUTO, "dump_stas", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, lvif, 0, + lkpi_80211_dump_stas, "A", "Dump sta statistics of this vif"); + IMPROVE(); return (vap); @@ -3015,6 +3225,9 @@ lkpi_ic_vap_delete(struct ieee80211vap *vap) EVENTHANDLER_DEREGISTER(iflladdr_event, lvif->lvif_ifllevent); + /* Clear up per-VIF/VAP sysctls. */ + sysctl_ctx_free(&lvif->sysctl_ctx); + LKPI_80211_LHW_LVIF_LOCK(lhw); TAILQ_REMOVE(&lhw->lvif_head, lvif, lvif_entry); LKPI_80211_LHW_LVIF_UNLOCK(lhw); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 0c4c615d82e5..bb1ecb45636f 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -168,6 +168,8 @@ struct lkpi_vif { struct ieee80211vap iv_vap; eventhandler_tag lvif_ifllevent; + struct sysctl_ctx_list sysctl_ctx; + struct mtx mtx; struct wireless_dev wdev; @@ -442,6 +444,7 @@ int lkpi_80211_mo_set_key(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_key_conf *); int lkpi_80211_mo_ampdu_action(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_ampdu_params *); - +int lkpi_80211_mo_sta_statistics(struct ieee80211_hw *, struct ieee80211_vif *, + struct ieee80211_sta *, struct station_info *); #endif /* _LKPI_SRC_LINUX_80211_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index e60ccbdeb4ce..7440d1d3c26c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -718,3 +718,33 @@ lkpi_80211_mo_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, out: return (error); } + +int +lkpi_80211_mo_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, struct station_info *sinfo) +{ + struct lkpi_hw *lhw; + struct lkpi_sta *lsta; + int error; + + lhw = HW_TO_LHW(hw); + if (lhw->ops->sta_statistics == NULL) { + error = EOPNOTSUPP; + goto out; + } + + lsta = STA_TO_LSTA(sta); + if (!lsta->added_to_drv) { + error = EEXIST; + goto out; + } + + lockdep_assert_wiphy(hw->wiphy); + + LKPI_80211_TRACE_MO("hw %p vif %p sta %p sinfo %p", hw, vif, sta, sinfo); + lhw->ops->sta_statistics(hw, vif, sta, sinfo); + error = 0; + +out: + return (error); +} From nobody Mon Feb 24 20:27:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjS3WGYz5pprQ; Mon, 24 Feb 2025 20:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjR2SzYz3p6g; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Qc3d0P/j23XNMx2GL6tI20SLtNuFcob74vviFsPf5c=; b=uEKGaO83MxSGPfTtYA5/5IgN0eS6QJJvM310z7Xceej/S4wK5ntDR6FRtuPpy6ovyPPkyg ZYnRr6cR2b/L/5GFYTeaEUcBB6g6CybjugD0MRAu7s+URq809JHA2X6/V0YaAlmM9q8WYk ibQ+RbqZeF4WpfRKo1xp5r5Vd+dHVOU01HkvEfawXgSq2HG7qR76B+ieAcHCnN/8RN6534 XUnGm7tdAeb0Uok8oyETLUGZnojNMFNAULz5h002SMMLUClF1W09zWKPK4diV47UTZY4Gw Ri+RobCx1Z22qVuD03pQEYO31mvJOCXXfGNb6OtJll+2b/PKlpl1mpsF61Ontg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428843; a=rsa-sha256; cv=none; b=owQk8ycSRLdPJ9J70pgia4L5f3PoXvDRs1nQ5dWJ4nUO77BZ1t3v4E5tZ2ZckGoDvyYrwV nkdiUgmCjQDmVj6ubHsFK9bELsWEQWwrecVarYJwMvJwjLiGJFD2MODf5KZByf/PIFy18s ND6YPhYuEoEcHr0ARnv2YC0zdHpiueQcAQc6xef3BGsr6AWF9bItHDhT1tWYyPKzJiqH5N HF2CjRWpDKirXnGDuYs9EKa+49+2PElYPp/gLj+AcGIVm3QZPtp6t59PrgXSJReMIrA9Vb 9nJvXw4VF/UT0W8/HbFl6v7IM3VImEJZDP5o/UcO4yZhCUVQprJoSjoXQLA9MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Qc3d0P/j23XNMx2GL6tI20SLtNuFcob74vviFsPf5c=; b=PwKHyHOyQnYg92HRiwIsaZ3dl6ISChHcUG97h+p/dS0n/odUHiOlS6JbDxWOS4cJPDd/f3 4/J9Dc/zt7qYXaCUqICun/NS1aS3fwzWcbDuvMANQ4+CrCQdWxWMI7Ieke3maSflWA6m5L 2pCH8/Ug/l3ObNeWWkyhoo5ugmFgXxAiD8hG59in/xGs84RDuyXzkLRmNiN+b6U9bbHpTj cJGNK7jLYl5u5nXWYBhiJoIEgTXovzlQ9FHBZ/1sztJoiw/SWxTm6zFVj/AmGgcnYDAU3x 7jGFcqhz9C2GMSr7zdrQdc6Sg6pGfhb763agJ7uKD7xVPjCw7o0XkGmEoFtmEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjP0DHKzwMZ; Mon, 24 Feb 2025 20:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRKa0027605; Mon, 24 Feb 2025 20:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRKwf027602; Mon, 24 Feb 2025 20:27:20 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:20 GMT Message-Id: <202502242027.51OKRKwf027602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eaa2fca952b3 - stable/14 - LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f commit eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f Author: Bjoern A. Zeeb AuthorDate: 2025-02-19 12:04:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly Rather than just printing the cipher suite as uint32_t hex (or split into OUI and number) also print a short name. iwlwifi(4), for example, now prints on startup with HW_CRYPTO on: unsupported WLAN Cipher Suite 0x000fac | 8 (GCMP) unsupported WLAN Cipher Suite 0x000fac | 9 (GCMP_256) unsupported WLAN Cipher Suite 0x000fac | 6 (AES_CMAC) unsupported WLAN Cipher Suite 0x000fac | 11 (BIP_GMAC_128) unsupported WLAN Cipher Suite 0x000fac | 12 (BIP_GMAC_256) Likewise _lkpi_iv_key_set() would now print: iwlwifi0: _lkpi_iv_key_set: CIPHER SUITE 0xfac02 (TKIP) not supported Sponsored by: The FreeBSD Foundation (cherry picked from commit 12a511c844706917e49e24c8d1daa861288aea23) --- sys/compat/linuxkpi/common/src/linux_80211.c | 47 +++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 683de6e0d474..9de81f3f9b28 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -750,6 +750,38 @@ lkpi_opmode_to_vif_type(enum ieee80211_opmode opmode) } #ifdef LKPI_80211_HW_CRYPTO +static const char * +lkpi_cipher_suite_to_name(uint32_t wlan_cipher_suite) +{ + + switch (wlan_cipher_suite) { + case WLAN_CIPHER_SUITE_WEP40: + return ("WEP40"); + case WLAN_CIPHER_SUITE_TKIP: + return ("TKIP"); + case WLAN_CIPHER_SUITE_CCMP: + return ("CCMP"); + case WLAN_CIPHER_SUITE_WEP104: + return ("WEP104"); + case WLAN_CIPHER_SUITE_AES_CMAC: + return ("AES_CMAC"); + case WLAN_CIPHER_SUITE_GCMP: + return ("GCMP"); + case WLAN_CIPHER_SUITE_GCMP_256: + return ("GCMP_256"); + case WLAN_CIPHER_SUITE_CCMP_256: + return ("CCMP_256"); + case WLAN_CIPHER_SUITE_BIP_GMAC_128: + return ("BIP_GMAC_128"); + case WLAN_CIPHER_SUITE_BIP_GMAC_256: + return ("BIP_GMAC_256"); + case WLAN_CIPHER_SUITE_BIP_CMAC_256: + return ("BIP_CMAC_256"); + default: + return ("??"); + } +} + static uint32_t lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) { @@ -770,12 +802,16 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: case WLAN_CIPHER_SUITE_BIP_CMAC_256: - printf("%s: unsupported WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unsupported WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); break; default: - printf("%s: unknown WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unknown WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); } return (0); @@ -1127,7 +1163,8 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) break; case WLAN_CIPHER_SUITE_TKIP: default: - ic_printf(ic, "%s: CIPHER SUITE %#x not supported\n", __func__, lcipher); + ic_printf(ic, "%s: CIPHER SUITE %#x (%s) not supported\n", + __func__, lcipher, lkpi_cipher_suite_to_name(lcipher)); IMPROVE(); wiphy_unlock(hw->wiphy); ieee80211_free_node(ni); From nobody Mon Feb 24 20:27:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjR2LL8z5pq1v; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjM5wMKz3p45; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tsytHZVXSKjTm2pJe7S1LufKv2veD80VnVKRiKBOZ9E=; b=iSR107s4RD/d7a9LCtVwdiWwf9KZ47lrZjDSicTOEDI2dsgdsfw+luvbcP9jcpcusuGhAo R/FcLpncUXD9ZBj6MUve0yT48/HNOS511ZypQBR0TLDTEXf9wKqz6OuBOx+ouCb9hXCE0j LVZRANxYduw2uXdFT7rLpUO6rnNtywhtPt7COUkpeMdWnu4o+DsCsaEvf2eup6j595kZ/z Ih96fymF7yREamf6x2AG/1TANWCl4kx2MRfK4otAHtJby9LcJBHm7vvlk6EXKs3JkfD7ur ldyqb1CYZsXSy9WXyQD+zVyrNdBKu7mxmeap448lwSr47kkwAGwXgZChuYjjUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428839; a=rsa-sha256; cv=none; b=mmTWz0HsuaLDnJGUtCZVUDyr251Q01DgPHRfLArrJ0232QNuqNdeZZ2xcHyny9MWjgVmS4 3MMHkGxKbJg+0KZrVwxucrLn7xYyrtfPleQJghM6oZynBWvVTS6GdOHyMgI1/JcaLh+K1B znMEdof0fE808VLKeGArMNoCXhPoRusU9IES7zDjJLbgxKrGcpheP2qfMo0n99l/8xSUXw ri00Vpganr/0DBCTjxlThTWqz7vUO5+En5u8zzf+JSefg4nNK5Yw7Ew1LDBfwojhQVLjit dGs2VF6fHGjZZHUwxzoALDv6w1JbmV282sVPEwbQ3EQierAhhsaquWL5EvytAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tsytHZVXSKjTm2pJe7S1LufKv2veD80VnVKRiKBOZ9E=; b=hMj3kqo+keC5684egxg8F3Z7wSX33JQYDDkRZgWrUAzR3a1JAKi/USQZx6M7xEipDZkFUq HvD1aHhEO7XSDd23ZNKGy528yENWlNuySb5oOLgSYHK3AEdokhG7VViMr7c2MpBc8tL3Fu u85TWewz56QvlolAJqcAHu5QqtG52V1MSb8E9yb8Kb74qv5FcY3+j9sCSaJoMvVAYnTven NopEpJwnP23LFsqUwVU0VeGX1mDrPKsELQYKorv7epmTVjMW9Z0rETQYGR4mavDmH5NDC4 8ugme0ap52RdKh/fZhabT3lQ4f3RwgkJEQndGN+KCvmRie2ImQ+7ocrvPUdNFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjK4lvXzvrS; Mon, 24 Feb 2025 20:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRHgo027492; Mon, 24 Feb 2025 20:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRHd5027489; Mon, 24 Feb 2025 20:27:17 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:17 GMT Message-Id: <202502242027.51OKRHd5027489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b2999f02278d - stable/14 - LinuxKPI: 802.11/skb: add extra information for skb alloc failures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b2999f02278dd4f98fed4089d778639bc980a551 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b2999f02278dd4f98fed4089d778639bc980a551 commit b2999f02278dd4f98fed4089d778639bc980a551 Author: Bjoern A. Zeeb AuthorDate: 2024-12-27 21:26:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11/skb: add extra information for skb alloc failures rtw88 seems to have an skb leak still. Add a WARN_ONCE to __skb_queue_purge() just to make sure there is no glitch due to missing locking. Also add a rolling error reporting for skb allocation failures in LinuxKPI to gather some more information if possible about queue states. This is a corrected version of what was initially part of D48474. Sponsored by: The FreeBSD Foundation (cherry picked from commit bcf1d8ee355213eef4a125c0b8518f1cb4f35df4) (cherry picked from commit 1432e0f20ccde8eaa23d3d3e20fca2989cd344b6) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 2 ++ sys/compat/linuxkpi/common/src/linux_80211.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 341ed33ddfcd..43f35d8f065f 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -706,6 +706,8 @@ __skb_queue_purge(struct sk_buff_head *q) SKB_TRACE(q); while ((skb = __skb_dequeue(q)) != NULL) kfree_skb(skb); + WARN_ONCE(skb_queue_len(q) != 0, "%s: queue %p not empty: %u", + __func__, q, skb_queue_len(q)); } static inline void diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 7bb051a67ade..853d77fd4a96 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3855,7 +3855,22 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) */ skb = dev_alloc_skb(hw->extra_tx_headroom + m->m_pkthdr.len); if (skb == NULL) { - ic_printf(ic, "ERROR %s: skb alloc failed\n", __func__); + static uint8_t skb_alloc_failures = 0; + + if (skb_alloc_failures++ == 0) { + int tid; + + sta = LSTA_TO_STA(lsta); + ic_printf(ic, "ERROR %s: skb alloc failed %d + %d, lsta %p sta %p ni %p\n", + __func__, hw->extra_tx_headroom, m->m_pkthdr.len, lsta, sta, ni); + for (tid = 0; tid < nitems(sta->txq); tid++) { + if (sta->txq[tid] == NULL) + continue; + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); + ic_printf(ic, " tid %d ltxq %p seen_dequeue %d stopped %d skb_queue_len %u\n", + tid, ltxq, ltxq->seen_dequeue, ltxq->stopped, skb_queue_len(<xq->skbq)); + } + } ieee80211_free_node(ni); m_freem(m); return; From nobody Mon Feb 24 20:27:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjW1Cgqz5pq6S; Mon, 24 Feb 2025 20:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjS1VSHz3p0w; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e/3zdNWwUI8nWeMH035gduZc/Al/N1z73utxMFmpfPY=; b=TzlyLonBL0afI7dlCEK+tfGzs7MSQzFx/OLUGdyrHhN7LgMvIhxCx9RzU28TAagc1vBOzI R2CovYFYmbNSc57+5lajEZOSLWqP3sPAxqvsZlDxmbi51tE8zp7lckdjbX23nmVKjibYar z71/BiYMZp25hamazIAXmLxIh7GGkThbnVB51RbPjIHIir8eBFpr9FtARinpAsjz015DMe WPh5nuCQjsLbF1QQ/WE+oHu3Kfe+KIWgHrdfpjjyGPhzlWvFchalqR2GmzYo5DovRjgeZc 5AUXN5bQkhcuMa1O9orKOttP/vGSj0h62c/FRHWvb/prN8L35IUbcBlA+zYMRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428844; a=rsa-sha256; cv=none; b=eqDedOQBbprEExOFA86P791PhYNSPr48xssHlFUrTF2f3zbH0fTvg1jfm/9lxQt7wS96/a oQwgb2VLmym/Lg2RF7eoDZpUVJwWdW4DO8g8DkWG0f8DTiL5gk75ZCwUXNRu90NPk/eZ+K nmXc+XRFaSiK2f5EB7xK0RiqHPFGErv08kUph7ASinEZhXfxIQlIUw2tdXsRkNWNqNUeAV xmJVtAQuoC7SrZlbcdsg0B9+WGI2gNPNQrow1GgKS6HIqk5/D5o13Ex1dwjKhZNxko/vO4 EnLB2xiaNc175xQOpu72OVMY+oXMUT9wz1dhHdxMn3QPVLH02NF8Iq4WgNEACw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e/3zdNWwUI8nWeMH035gduZc/Al/N1z73utxMFmpfPY=; b=YYYcV3W4Jdh5IG87q9drho5njdWV3oiApl52Z9sofzyf4I4bePMPwybB1dFpR8nuNRJfbF Tgd6URCOTWwG0NYDTh2su/UjNYTtVgGqi44vl7NytaQ/Z5ewSaf4aw8dhDtR1eUigJSt/d rKFzB5+BabAW17tvOLnzn93q93tVrOZMm5cVzJ+6bFerCJIiXYOs/f5htMNA+FecG4g1Cu 5tdUl3dccq81Z/QRlirCxvUi7sJUWdKHocY6SoFf1J4M3LHFpIG+d2WQFNEhBYgZTnPW1z 5RAqfOfDoe49ZY2I4EAmyezvVrHL9/wB7/Vy0KInrhmiBG8lDNXGKOn4WTG7ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjR28WWzwYQ; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRNGT027677; Mon, 24 Feb 2025 20:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRNdc027674; Mon, 24 Feb 2025 20:27:23 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:23 GMT Message-Id: <202502242027.51OKRNdc027674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8feaeb95440b - stable/14 - net80211: crypto: ccmp: simplify and style(9) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8feaeb95440b851202d59f12d7bde0500109be5b Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8feaeb95440b851202d59f12d7bde0500109be5b commit 8feaeb95440b851202d59f12d7bde0500109be5b Author: Bjoern A. Zeeb AuthorDate: 2025-01-27 13:54:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:50 +0000 net80211: crypto: ccmp: simplify and style(9) Comply with style(9) and andd checks for booleaness when doing bit tests. If there is no need for double negated checks simplify them. This all makes the conditions a lot easier to read. Slip in a comment about MIC vs. MMIC. No functional changes. Sponsored by: The FreeBSD Foundation Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D49055 (cherry picked from commit 8dcdffdb086103e9ce36bfa82fc1179c88ebc31b) --- sys/net80211/ieee80211_crypto_ccmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 06028cf2a37c..404996b1cbca 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -242,7 +242,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) rxs = ieee80211_get_rx_params_ptr(m); - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP)) + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) != 0) goto finish; /* @@ -297,14 +297,15 @@ finish: /* * XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer. + * Well no as it's a MIC not MMIC but we re-use the same flag for now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP))) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) == 0) m_adj(m, -ccmp.ic_trailer); /* * Ok to update rsc now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) == 0) { /* * Do not go backwards in the IEEE80211_KEY_NOREPLAY cases * or in case hardware has checked but frames are arriving From nobody Mon Feb 24 20:27:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1sjT1qC7z5pq1y; Mon, 24 Feb 2025 20:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjS1V9Kz3nxk; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=avW8VBX5dyINalJWQF2GXTpYWOSNi2VE1Ib8c3bzkHo=; b=SFIjapJuOz+k43gQlAEse2YehxZpDBTz8eIwR68mrRbYl50f7ySQbkaMrpIbUitHRoG9W+ K32f4u+Pr9ZMdt84f1s1nRxcqRCFTRYMcVhbrOZs6AKQADIrYclj36GII+UH4j7sCOpykD js7i4mbVt7whcQTFg51gRFepiOMLpYdkAwHuN7qeAiAMHU3HSl1iz1/BPofnD6uSX/epT1 awyO3QRecDLCBJ84OYOGMy8nC+WI0bIDnK2Htb4IzkUDzFWk3gKSbHzyQzlQhNHcy/K/q4 ZaG/vuJjX37c4hSpEgpg7+r5Kdp1dApAqLLekJWgt2+5DR9oSFM2XYKYTz5P8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428844; a=rsa-sha256; cv=none; b=l/WUrGivHRvn6BgeK+cvelzZjI/usMZOiibYixm+WnNj+MAaFnbRMYLyg/vYKdGxd7WLhB 2zsIbtr+m/ZDKbPyLkflbMN6B+oOBpruNggQKKQR8BRlCGZf9rb2LpYFoQ9xnoSX4p1kqx mjCscdD8UjGFMMJ0U+3ecS3Qm+ynb0aJq4IYHB+dM3Pec4cR6d2D6sppLKfBzFT1KuTfFb k51R7dgpU+uBSR5nFdvDYQBKQAujxvFPkRNfKo5vkhk6qlnglHEVm44oRQWgkav17mvmIU xHEgWprHrgzLXO7jcSXYtBMGDm0K40NMvdofI1yG451U9kVyt6B2VK/wMkykJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=avW8VBX5dyINalJWQF2GXTpYWOSNi2VE1Ib8c3bzkHo=; b=V7I/mg5koaexIk3vm4jaMgL5UQlypnEOGgsj1BdaK8x6DgHYZBDNh0MylsFLuCt5kfCY66 PQ/NApHYRPpbmWTBhLoxBudtbRJGq7zD/KihsFXM7Fl9XRvnutSqar6UHnmMIO+3R9KQ0M Kz1jGhJda2E+KLmN7KZ/Ir8IO4eC20geHYSJwIu0rfs4on3TSM895J9E0T2cD6GHqQsoqD MWy4meajoqxfyCPU1AFqoWvf+/UzBn+TrO/kQuWdj8mLjgxDyqpYADsOpO9U9hBN08fF4X 92PHwpP2sQ/UWC6y2MJkDrknaKZwPWgE9KtRUXD4/ASFVnSO20ZQFwS+3XfTiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1sjQ2F9czwMb; Mon, 24 Feb 2025 20:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRMlP027641; Mon, 24 Feb 2025 20:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRMA6027638; Mon, 24 Feb 2025 20:27:22 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:22 GMT Message-Id: <202502242027.51OKRMA6027638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8468f05ff74d - stable/14 - LinuxKPI: 802.11: switch vif station list to a linux list List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8468f05ff74d84d9f4f9094bf42f7356a9ac6045 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8468f05ff74d84d9f4f9094bf42f7356a9ac6045 commit 8468f05ff74d84d9f4f9094bf42f7356a9ac6045 Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 23:39:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:50 +0000 LinuxKPI: 802.11: switch vif station list to a linux list We ran into problems with locking the VIF for the lsta tailq on and off. Switch from a native tailq to the LinuxKPI list. This allows us to implement the "rcu" part in linuxkpi_ieee80211_iterate_keys() which we could not before. Further using either rcu or the wiphy lock we no longer run into problems with the lock not being sleepable. The last case was rtw89 debugfs which was doing a sleepable alloc in the iterator callback of linuxkpi_ieee80211_iterate_stations_atomic(). Sponsored by: The FreeBSD Foundation (cherry picked from commit a8f735a66130aa737999fad9b3246159099dc9eb) --- sys/compat/linuxkpi/common/src/linux_80211.c | 60 ++++++++++++++-------------- sys/compat/linuxkpi/common/src/linux_80211.h | 9 ++++- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 9de81f3f9b28..0574d4a502de 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -74,6 +74,7 @@ #include #include +#include #include "linux_80211.h" #define LKPI_80211_WME @@ -294,7 +295,7 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&s, NULL, 1024, req); wiphy_lock(hw->wiphy); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry(lsta, &lvif->lsta_list, lsta_list) { sta = LSTA_TO_STA(lsta); sbuf_putc(&s, '\n'); @@ -463,12 +464,11 @@ lkpi_lsta_remove(struct lkpi_sta *lsta, struct lkpi_vif *lvif) { - LKPI_80211_LVIF_LOCK(lvif); - KASSERT(lsta->lsta_entry.tqe_prev != NULL, - ("%s: lsta %p lsta_entry.tqe_prev %p ni %p\n", __func__, - lsta, lsta->lsta_entry.tqe_prev, lsta->ni)); - TAILQ_REMOVE(&lvif->lsta_head, lsta, lsta_entry); - LKPI_80211_LVIF_UNLOCK(lvif); + wiphy_lock(lsta->hw->wiphy); + KASSERT(!list_empty(&lsta->lsta_list), + ("%s: lsta %p ni %p\n", __func__, lsta, lsta->ni)); + list_del_init(&lsta->lsta_list); + wiphy_unlock(lsta->hw->wiphy); } static struct lkpi_sta * @@ -488,6 +488,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], if (lsta == NULL) return (NULL); + lsta->hw = hw; lsta->added_to_drv = false; lsta->state = IEEE80211_STA_NOTEXIST; /* @@ -1773,10 +1774,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lsta->txq_ready = true; LKPI_80211_LSTA_TXQ_UNLOCK(lsta); - LKPI_80211_LVIF_LOCK(lvif); + wiphy_lock(hw->wiphy); /* Insert the [l]sta into the list of known stations. */ - TAILQ_INSERT_TAIL(&lvif->lsta_head, lsta, lsta_entry); - LKPI_80211_LVIF_UNLOCK(lvif); + list_add_tail(&lsta->lsta_list, &lvif->lsta_list); + wiphy_unlock(hw->wiphy); /* Add (or adjust) sta and change state (from NOTEXIST) to NONE. */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); @@ -3297,7 +3298,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif = malloc(len, M_80211_VAP, M_WAITOK | M_ZERO); mtx_init(&lvif->mtx, "lvif", NULL, MTX_DEF); - TAILQ_INIT(&lvif->lsta_head); + INIT_LIST_HEAD(&lvif->lsta_list); lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; vap = LVIF_TO_VAP(lvif); @@ -5751,11 +5752,12 @@ linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, lvif = VIF_TO_LVIF(vif); if (rcu) { + rcu_read_lock_held(); /* XXX-BZ is this correct? */ + if (vif == NULL) { TODO(); } else { - IMPROVE("We do not actually match the RCU code"); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) lkpi_ieee80211_iterate_keys(hw, vif, @@ -5770,7 +5772,7 @@ linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, if (vif == NULL) { TODO(); } else { - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry(lsta, &lvif->lsta_list, lsta_list) { for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) lkpi_ieee80211_iterate_keys(hw, vif, @@ -5831,14 +5833,14 @@ linuxkpi_ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw, LKPI_80211_LHW_LVIF_LOCK(lhw); TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) { - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { if (!lsta->added_to_drv) continue; sta = LSTA_TO_STA(lsta); iterfunc(arg, sta); } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); } LKPI_80211_LHW_LVIF_UNLOCK(lhw); } @@ -6605,14 +6607,14 @@ lkpi_find_lsta_by_ni(struct lkpi_vif *lvif, struct ieee80211_node *ni) { struct lkpi_sta *lsta, *temp; - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH_SAFE(lsta, &lvif->lsta_head, lsta_entry, temp) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { if (lsta->ni == ni) { - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (lsta); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (NULL); } @@ -6622,20 +6624,20 @@ struct ieee80211_sta * linuxkpi_ieee80211_find_sta(struct ieee80211_vif *vif, const u8 *peer) { struct lkpi_vif *lvif; - struct lkpi_sta *lsta, *temp; + struct lkpi_sta *lsta; struct ieee80211_sta *sta; lvif = VIF_TO_LVIF(vif); - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH_SAFE(lsta, &lvif->lsta_head, lsta_entry, temp) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { sta = LSTA_TO_STA(lsta); if (IEEE80211_ADDR_EQ(sta->addr, peer)) { - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (sta); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (NULL); } @@ -7175,8 +7177,8 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) #endif lvif->hw_queue_stopped[ac] = false; - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { struct ieee80211_sta *sta; sta = LSTA_TO_STA(lsta); @@ -7199,7 +7201,7 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); } } } diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 40b11ebfef13..b17e6072066c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -126,6 +126,8 @@ struct lkpi_radiotap_rx_hdr { (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)) +struct lkpi_hw; + struct lkpi_txq { TAILQ_ENTRY(lkpi_txq) txq_entry; @@ -142,8 +144,9 @@ struct lkpi_txq { struct lkpi_sta { - TAILQ_ENTRY(lkpi_sta) lsta_entry; + struct list_head lsta_list; struct ieee80211_node *ni; + struct ieee80211_hw *hw; /* back pointer f. locking. */ /* Deferred TX path. */ /* Eventually we might want to migrate this into net80211 entirely. */ @@ -164,6 +167,7 @@ struct lkpi_sta { #define STA_TO_LSTA(_sta) container_of(_sta, struct lkpi_sta, sta) #define LSTA_TO_STA(_lsta) (&(_lsta)->sta) +/* Either protected by wiphy lock or rcu for the list. */ struct lkpi_vif { TAILQ_ENTRY(lkpi_vif) lvif_entry; struct ieee80211vap iv_vap; @@ -179,7 +183,8 @@ struct lkpi_vif { enum ieee80211_state, int); struct ieee80211_node * (*iv_update_bss)(struct ieee80211vap *, struct ieee80211_node *); - TAILQ_HEAD(, lkpi_sta) lsta_head; + struct list_head lsta_list; + struct lkpi_sta *lvif_bss; bool lvif_bss_synched; bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */ From nobody Mon Feb 24 20:59:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1tQX1c96z5pspP; Mon, 24 Feb 2025 20:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1tQW728sz4Gtk; Mon, 24 Feb 2025 20:59:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740430772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nth2TyyBl6A1GbFd0UKTYHtBLOKEjkV+a3UYpq1222c=; b=qI9oS6P2vzyS9IQeLoGLXXbqaouAgn7o5RW6a6x/BbP22k1+Y4znnrZwkwyuMkpLvM2/NG vo3dHvKheTPE+8J/90dJGd0APHUK1a0dllH/aU/OqmoPezoNpEmHaij1l3G7ZvTK08iVrs h8lvV3hKSmdXSoW42QB8jiXzRbLfdEsIxMdLOw4sPQU773Wp6hU6OVKN2G0YPx7/ej57tJ 6X4PO0yLr/4VkPfd2c0wgW8xS1fpWCICwVJL+5T1E5Anttub89+g1yBpzH1XPYn0iwtCOq 9pcSIraxIcOpQH49DKCTGVg2tXgT0fbP5IUeOTgW8ZoX7eixNH/5UtDxc3ukbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740430772; a=rsa-sha256; cv=none; b=VBOJxgxuWLn9gWxiqmX/8ovu7Y7egR+Lh9CmD2lRXEXpqXBniqNOSEGt1YzgQ8fo+BMxq8 b+Sk1g9YP59r8t/1i/7ZX/5FeBqYoatEfqqycGw3j/uqR7jQrmWkxWgyuuGkZjpXGytiW8 JaSoN+vztKreGERTjkATQRkqMe85iFZexJ+5mdhH4ddpSZtrP7CAshUt0nmjpiEmERMGtX 5DAYaxs2gD+sd5kpnz12QzS2xOm2x1kcgFLECPS4CbMbnsInj6ZJtRz7dOZaLgLWMIywFl clVwfWJv1KSn0dhhgw1vzbQIZeRWXfFpqONSxZsDu6wlTg3c5tlVfwdHfLHnRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740430772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nth2TyyBl6A1GbFd0UKTYHtBLOKEjkV+a3UYpq1222c=; b=xURExbn+exS45FWqfkffEkY8qkKVxx91uThvZEQ8LV75oUtSJCcvJbqs1Od8YhHSt/6sAj R3HZIk2eydmgZq5wbAOtvRrUGC5Mx5e1Z5AzqFgIKqOlfMD2CnIccqmnuqHar6pg1aI9ct q+BJ6UbylRv3QsXz50Eb+3rKw/5PEFEK/uoo1hJwzBRqIJmtLg0dDl+wAhirVkOt4z0Koj voN0Mn6HZraRiBY6kNFnN6g7Hk1PSrtHFcPjysLwsW5AH5RxWVH7Saw8GlnGmAeHIRrcjY Z7x3EXg04WoVfurBQDP7xx60jMBBgEgYtj47Xkmndso9/n52wtgL5XJqYXNDdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1tQW6CKXzx01; Mon, 24 Feb 2025 20:59:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKxVgV083247; Mon, 24 Feb 2025 20:59:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKxVE9083244; Mon, 24 Feb 2025 20:59:31 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:59:31 GMT Message-Id: <202502242059.51OKxVE9083244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: b616d997cb48 - main - nfscl: Fix setting of mtime for the NFSv4.n client List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b616d997cb48eaafe13069eecd95f0495b2358eb Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b616d997cb48eaafe13069eecd95f0495b2358eb commit b616d997cb48eaafe13069eecd95f0495b2358eb Author: Rick Macklem AuthorDate: 2025-02-24 20:58:27 +0000 Commit: Rick Macklem CommitDate: 2025-02-24 20:58:27 +0000 nfscl: Fix setting of mtime for the NFSv4.n client It was reported on freebsd-fs@ that unrolling a tarball failed to set the correct modify time if delegations were being issued. This patch fixes the problem. This bug only affects NFSv4 mounts where delegations are being issued. Not running the nfscbd or disabling delegations on the NFSv4 server avoids the problem. Reported by: Peter Much Tested by: Peter Much MFC after: 3 days --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clstate.c | 7 +++++-- sys/fs/nfsclient/nfs_clvnops.c | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index b48d853b285e..a95d9245c098 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -626,7 +626,7 @@ int nfscl_renamedeleg(vnode_t, nfsv4stateid_t *, int *, vnode_t, nfsv4stateid_t *, int *, NFSPROC_T *); void nfscl_reclaimnode(vnode_t); void nfscl_newnode(vnode_t); -void nfscl_delegmodtime(vnode_t); +void nfscl_delegmodtime(struct vnode *, struct timespec *); void nfscl_deleggetmodtime(vnode_t, struct timespec *); int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, struct nfsmount *, NFSPROC_T *); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 7d1aab753628..adfb68f5d8f5 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5174,7 +5174,7 @@ nfscl_newnode(vnode_t vp) * to the local clock time. */ void -nfscl_delegmodtime(vnode_t vp) +nfscl_delegmodtime(struct vnode *vp, struct timespec *mtime) { struct nfsclclient *clp; struct nfscldeleg *dp; @@ -5198,7 +5198,10 @@ nfscl_delegmodtime(vnode_t vp) } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) { - nanotime(&dp->nfsdl_modtime); + if (mtime != NULL) + dp->nfsdl_modtime = *mtime; + else + nanotime(&dp->nfsdl_modtime); dp->nfsdl_flags |= NFSCLDL_MODTIMESET; } NFSUNLOCKCLSTATE(); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index bf24a161b94b..a0bb781e5e5d 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1120,7 +1120,7 @@ nfs_setattr(struct vop_setattr_args *ap) * Call nfscl_delegmodtime() to set the modify time * locally, as required. */ - nfscl_delegmodtime(vp); + nfscl_delegmodtime(vp, NULL); } else NFSUNLOCKNODE(np); /* @@ -1158,6 +1158,8 @@ nfs_setattr(struct vop_setattr_args *ap) NFSUNLOCKNODE(np); } } + if (vap->va_mtime.tv_sec != VNOVAL && error == 0) + nfscl_delegmodtime(vp, &vap->va_mtime); return (error); } From nobody Mon Feb 24 21:35:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1vCd4bxdz5nj0S; Mon, 24 Feb 2025 21:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1vCd2vnqz3QQR; Mon, 24 Feb 2025 21:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740432909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vn/pR57x1Xm10R4w3ySv/jKhVJOoLz2EEwXUhlIL/SI=; b=WOZq/otZVTgMBPcpvENt6xdcQLul+CkQ1q9XFL3uXE+fD58JAYaDRm9RlJVVGuPLl4JLZY 9xCK+7iEvNOGljGfOZqGp/hbVwGvftnzEVY/A4Fefk9EjMMuMMfjrDpqOs6IXelF+dEegM hKayCSnN6ucEdpv1zL5Qm1hqih+Y9eFVFBjlpomHlUCpHkICli7thHpO1lccQER5acDMAp UbvZ4xYr9qOnp3EJCw9adEgGLtHQQR1hb8zeRSdlUvGz8JE77hARDYwgTPgQZ/D26NbZKe V6yKkXjEDznPocJpjIUSbPW0JbLr/MKkYBbMmBL8LwRBfqBLJpwv2O7txDjLDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740432909; a=rsa-sha256; cv=none; b=WJNqZkQRSGn37LuZBZrqsxO3MyupJlFrMDsySYAOhlrLCmOy+HtWo2YIlAVMuprP7Yc63p 37s2U6h2rXin1Nu7LIiimCp2fZus7ssrP7SWOwNEOujo4Zfm0TWVNCoXI7Y/y9qnjG3Mqc 43bJkTNoYWDSpurl+VSvfEjn/nJxrkiwO9SU8zUZOsq67qYUjDsdHCwlTioCKiyZXkAWAC mpKR/D11SCTMPe1hbcsGk6QRAcV9oUbz8xlTnWEo/yyK/5NmTVDYpNQqt0AucLO++6Fm/x faASBitN40SDRyC4rZ/pXJBJj+cjTjr2WgknIsrtn2EuwcfpoK9NkTMKM2cECQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740432909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vn/pR57x1Xm10R4w3ySv/jKhVJOoLz2EEwXUhlIL/SI=; b=a8TlOGfUbyAVOMS4WaGxaE/fgkhxRv0ADGv6sjBXtwrIXp6wmu+EgxCZ0ujGiMCiJ0k2Ee jpHaNUjtd6W13EWAed/Xg2lTtEBdm5ByL5uzULs5Ms3uEMFFyvIuQN9YVEpf+S7BdLybYd OfeSabq5QwYqTFPmmbWsFN6UKnYr4n9+gurW0ZtefEP+CCXVGs+q2t1JPTL8DX3Agl2Zzm wD4pnNJE953kOnkpHG9BWGHSoqCORlIFbfpNAhqhtlpf6wOoZpPnRP8wGP/WGNZP13PYhp 8vU0OyLb6w3TgGRYrfrAkDfC1NLZPRGrMmktFfLzLlSIDPsqFnpBud1qaHGJ+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1vCd2LPBzy2y; Mon, 24 Feb 2025 21:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OLZ9hr057371; Mon, 24 Feb 2025 21:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OLZ9AS057368; Mon, 24 Feb 2025 21:35:09 GMT (envelope-from git) Date: Mon, 24 Feb 2025 21:35:09 GMT Message-Id: <202502242135.51OLZ9AS057368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b01495caac2e - main - umtx: Add a helper for unlocked umtxq_busy() calls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b01495caac2eca73463f4a889936a19e4c1c5909 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b01495caac2eca73463f4a889936a19e4c1c5909 commit b01495caac2eca73463f4a889936a19e4c1c5909 Author: Mark Johnston AuthorDate: 2025-02-24 20:36:48 +0000 Commit: Mark Johnston CommitDate: 2025-02-24 21:34:51 +0000 umtx: Add a helper for unlocked umtxq_busy() calls This seems like a natural complement to umtxq_unbusy_unlocked(). No functional change intended. Reviewed by: olce, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49124 --- sys/compat/linux/linux_futex.c | 12 +++--------- sys/kern/kern_umtx.c | 34 +++++++++++++++------------------- sys/sys/umtxvar.h | 1 + 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index ab2760859e16..37d0142bae8b 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -501,9 +501,7 @@ linux_futex_lock_pi(struct thread *td, bool try, struct linux_futex_args *args) if (error != 0) break; - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * Set the contested bit so that a release in user space knows @@ -642,9 +640,7 @@ linux_futex_wakeop(struct thread *td, struct linux_futex_args *args) umtx_key_release(&key); return (error); } - umtxq_lock(&key); - umtxq_busy(&key); - umtxq_unlock(&key); + umtxq_busy_unlocked(&key); error = futex_atomic_op(td, args->val3, args->uaddr2, &op_ret); umtxq_lock(&key); umtxq_unbusy(&key); @@ -701,9 +697,7 @@ linux_futex_requeue(struct thread *td, struct linux_futex_args *args) umtx_key_release(&key); return (error); } - umtxq_lock(&key); - umtxq_busy(&key); - umtxq_unlock(&key); + umtxq_busy_unlocked(&key); error = fueword32(args->uaddr, &uval); if (error != 0) error = EFAULT; diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index f9189024d629..dc6fee1f8f38 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -441,9 +441,16 @@ umtxq_unbusy(struct umtx_key *key) } void -umtxq_unbusy_unlocked(struct umtx_key *key) +umtxq_busy_unlocked(struct umtx_key *key) { + umtxq_lock(key); + umtxq_busy(key); + umtxq_unlock(key); +} +void +umtxq_unbusy_unlocked(struct umtx_key *key) +{ umtxq_lock(key); umtxq_unbusy(key); umtxq_unlock(key); @@ -2372,9 +2379,7 @@ do_lock_pi(struct thread *td, struct umutex *m, uint32_t flags, if (error != 0) break; - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * Set the contested bit so that a release in user space @@ -2540,9 +2545,7 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, su = (priv_check(td, PRIV_SCHED_RTPRIO) == 0); for (;;) { old_inherited_pri = uq->uq_inherited_pri; - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); rv = fueword32(&m->m_ceilings[0], &ceiling); if (rv == -1) { @@ -2727,9 +2730,8 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb) TYPE_PP_ROBUST_UMUTEX : TYPE_PP_UMUTEX, GET_SHARE(flags), &key)) != 0) return (error); - umtxq_lock(&key); - umtxq_busy(&key); - umtxq_unlock(&key); + umtxq_busy_unlocked(&key); + /* * For priority protected mutex, always set unlocked state * to UMUTEX_CONTESTED, so that userland always enters kernel @@ -2792,9 +2794,7 @@ do_set_ceiling(struct thread *td, struct umutex *m, uint32_t ceiling, &uq->uq_key)) != 0) return (error); for (;;) { - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); rv = fueword32(&m->m_ceilings[0], &save_ceiling); if (rv == -1) { @@ -3148,9 +3148,7 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, break; /* grab monitor lock */ - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * re-read the state, in case it changed between the try-lock above @@ -3341,9 +3339,7 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock, struct _umtx_time *timeo } /* grab monitor lock */ - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * Re-read the state, in case it changed between the diff --git a/sys/sys/umtxvar.h b/sys/sys/umtxvar.h index 647ee2a4650c..6165d37d9195 100644 --- a/sys/sys/umtxvar.h +++ b/sys/sys/umtxvar.h @@ -206,6 +206,7 @@ int umtx_key_get(const void *, int, int, struct umtx_key *); void umtx_key_release(struct umtx_key *); struct umtx_q *umtxq_alloc(void); void umtxq_busy(struct umtx_key *); +void umtxq_busy_unlocked(struct umtx_key *); int umtxq_count(struct umtx_key *); void umtxq_free(struct umtx_q *); struct umtxq_chain *umtxq_getchain(struct umtx_key *); From nobody Tue Feb 25 00:37:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1zGX6n7kz5p2MF; Tue, 25 Feb 2025 00:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGX5qXhz3Yk0; Tue, 25 Feb 2025 00:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCxx4Ubhqy0Kxr7kjyNqsZnVWXeeTIpbLnMOR4EtCJU=; b=rgGy6HehBmR4/pBSCJra7VyEOayvQqda2LGnAgOF3bZ+J/dFqZio7uEHHRBHBlsEYa2g8b JdKda6H+qlVoh5LdKA08s+gVaq1M5oI76CI4ERsrXpn6/pHgItQt6VdACrKu9rwH3AA4/Q E43ZlKXYXOVJirU++8Z0HzKPrCAzDXnWTkywWAv8/4dGHI+Rrf5/qunwrPP1cd8PBMEXy1 ctIRpTYE3oBHxtuwfDYBaSmWUtvTL4LI7bi6YveB2eu32AKTThk5wzxXzJsPPOosx6hWHp 3VUDr0b+fcLjnhC+jkYqa/Le/uP+4HPKQOc8copgvP00MBkdsRP9C7PWFpm9cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443876; a=rsa-sha256; cv=none; b=Rz0T0kF8nuf7cajVByTD1kBSHdtbBmB8aZHo2YRJG+kWLw9wSh9rcPlo/QRlu/xxFWbf6s nxGepBMTNL7TEvL+41UegEBfRCSbrFUowpfjmrMw0z8IHISxac0nimNT7VlvIDWjTpx7g0 Nsq/WFVCYAtqP7Mo5aKp0JnsBNz+j/T59oHZjiRArFBQTgZ0ovqMvR5cBYL67De+xXoTs5 kJf8AsmpCEe4u+fNvixev2VxHw1JKCS34T4ACspjYr9aKVjP9X/n9ZYk3SQU0pt3mc/Tnv l9kuTqF/MOaCwdNqjL8X/dJP8t+crorJH1jm24HsOusaMd7lOQKy0di2Cs5SnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCxx4Ubhqy0Kxr7kjyNqsZnVWXeeTIpbLnMOR4EtCJU=; b=nQphNk1uF01AGW4WyBBljtxpSJ7vw1aWgvzg4rURvH2ZZRBPE5WC4zHkvvDQ+vsVsOe2zq mwBUAISI0uvevn6CzmVfw7KmgRu4qytTayr5/G7KB7A8TrMGC170Jf8Ni9hfULNc82eqGW loVW75tDGxipHbhMV+TQSTWIj8iohMF+fe1vCOkKYRNks4Ve6m980I/3jtLwGaWQJlMmi/ +W10ryP1y+t6EtvfTWR/DKMigM28HaMxTZ8E5BtjfRd5qArw4eEtsEjF33kNr5om1x8DV0 g2WMUHLjPwN7wlapq6yYEwRU4SKJ57vslq6ue+h/UvYVJ++BG6QSuv+AWBOIMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1zGX52rPz13FZ; Tue, 25 Feb 2025 00:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0buqh096625; Tue, 25 Feb 2025 00:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0buNT096622; Tue, 25 Feb 2025 00:37:56 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:37:56 GMT Message-Id: <202502250037.51P0buNT096622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a241a911dc8635c3803f1a6620e1ab4692f6ecf Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1a241a911dc8635c3803f1a6620e1ab4692f6ecf commit 1a241a911dc8635c3803f1a6620e1ab4692f6ecf Author: Cy Schubert AuthorDate: 2024-12-12 20:03:09 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:37:46 +0000 ntpd: Use the ntpd -u option in preference to the rc su plumbing Using the rc plumbing to setuid(2) is preferred as it allows the user to use the -i option in ntpd_flags to chroot ntpd. Chrooting ntpd by default will be a 2025 project. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48191 (cherry picked from commit 521f66715afb312b356afafc68cbc044a436a753) --- libexec/rc/rc.d/ntpd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd index 76d83149ae1a..36df4ae08c96 100755 --- a/libexec/rc/rc.d/ntpd +++ b/libexec/rc/rc.d/ntpd @@ -98,7 +98,6 @@ ntpd_precmd() # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. if can_run_nonroot; then - _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || [ -n "${rc_flags}" ] && @@ -112,7 +111,13 @@ ntpd_precmd() fi # Set command_args based on the various config vars. - command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" + command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u ${ntpd_user:=ntpd:ntpd}" + + # Unset ntpd_user because rc.subr uses $${name}_user to determine + # whether to invoke su(1) to setuid() to $ntpd_user for us. We want + # ntpd to do the setuid() itself through the -u argument, above. + unset ntpd_user + if checkyesno ntpd_sync_on_start; then command_args="${command_args} -g" fi From nobody Tue Feb 25 00:37:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1zGZ0GGwz5p26D; Tue, 25 Feb 2025 00:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGY5SxKz3YpW; Tue, 25 Feb 2025 00:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMf3puub2H5cS9wiUlr9E2MKMFkoYhvBhNN6XVkWfmk=; b=Nm4G7Bz4FtjEQ6+V5TtyvJodurUGImOkSmn2c8EtXfQOZWihi2GaJFIEUyDf3vTz5nxLf3 AQlIOXLoGosE47CEYjRZGHc4AUvo4rZYSeriaLz4+vimMM1w9rjQX0m59iRkg7jch1feN8 VrE5oTA6N7gZ0+jCH2bhy+I7Ca/OhDHsmbZWdQyTaU/1g66/YjA/klm6EaSF8mVizzn1S6 Z0YYZZehZXt4ZTA023wkT1adZ0titChWBwNIyTw2xgZXo6ZiLSYXl2D7ZRDW4WNqbR1xvV cubu0fRKGujMD+kvXNRfayoinmwjSOiGvM+r9BdN16IXGPI6ix4xym1As4uP3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443877; a=rsa-sha256; cv=none; b=QMW8NY1SJP0uQCzFtW0zjwDgX61mQ0HeoOOSld3T8XYQn+dp6e24Gt1nVRB8gNlbVSUWg/ ULaSMZw/4dRtSwQdFA2VP3Bgpw45vt5VVFW+QRWpcqx3CQQ4tWvjB/zE/PdagD8YrOVg36 UUeSRgnrQYOUheG67aBkB8sZgVLI4ruWOz8kI40/LHPqzcGDJEc00fQvMPnRKoMpARnwvp 6v2khOdlVrfSg582o6c8cNnkuZMgEIPtMc0sruNzZUppmkBQquhCDb/RPGR7m6yAz+PpVE 8bXJD3ONZfyz3mYVzD173eMN9+vppaymHV2r/5gpQpKu9CORCtmBC6Qr/pNhfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMf3puub2H5cS9wiUlr9E2MKMFkoYhvBhNN6XVkWfmk=; b=AUYBCCeO/IYtn9FftfnYFom0wPsHu/Vsna8Xu0a0u/aDzyZed/JGN6jaxPII7gqIqdR2Wr IFyUHA+eVMZpQFln6trkRcvUdkARJkirJiWmdlEQCA7NGNIvxhY8IlyRFnOhcbX0EsRcra FAzWV6+5Mu4R0ZUHG+Tz45Hb8nzGH0OpRWVBzaWevUmQvJIadJZdsalI3OiWsu6iHddUXi n+4P4s5Wi6WSjL7L0LVrUQhMcHQXaw3tWu2ewUTxJDvjeIG8btVi2Fcb9qPr888WZLiuUr RrMp4L3h/u94L+DGYvyUCGWYG84QvZnGJxNWhsO9yAlYzsEw2S0axDc/xPETsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1zGY52Cwz13J2; Tue, 25 Feb 2025 00:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0bvCu096659; Tue, 25 Feb 2025 00:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0bvXb096656; Tue, 25 Feb 2025 00:37:57 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:37:57 GMT Message-Id: <202502250037.51P0bvXb096656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: b006133ca117 - stable/14 - shar: Handle special characters or white space in file names fed to shar List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b006133ca1176a89abd3f96bb87989a85342f6a8 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=b006133ca1176a89abd3f96bb87989a85342f6a8 commit b006133ca1176a89abd3f96bb87989a85342f6a8 Author: Cy Schubert AuthorDate: 2025-01-02 03:35:31 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:37:46 +0000 shar: Handle special characters or white space in file names fed to shar Obtained from: NetBSD hg commit 365370:124268924386 MFC after: 1 week (cherry picked from commit 1080f5315427b382221651b342227b4923106f83) --- usr.bin/shar/shar.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index 77ef3789c8b3..f7496716acba 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -64,14 +64,14 @@ echo "#" for i do - if [ -d $i ]; then - echo "echo c - $i" - echo "mkdir -p $i > /dev/null 2>&1" + if [ -d "$i" ]; then + echo "echo c - '$i'" + echo "mkdir -p '$i' > /dev/null 2>&1" else - md5sum=`echo -n $i | md5` - echo "echo x - $i" - echo "sed 's/^X//' >$i << '$md5sum'" - sed 's/^/X/' $i || exit + md5sum=`echo -n "$i" | md5` + echo "echo x - '$i'" + echo "sed 's/^X//' >'$i' << '$md5sum'" + sed 's/^/X/' "$i" || exit echo "$md5sum" fi done From nobody Tue Feb 25 00:37:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1zGb33cHz5p2C2; Tue, 25 Feb 2025 00:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGZ6ZGdz3YVk; Tue, 25 Feb 2025 00:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x/83Dcvl+Kni5M1oyRSR30QhjZRQbkuCm4xpU6KVH6A=; b=hd74yImCZ76rd8wzwZcqGS1xgKfAftQB7E6KacVic8t3SIO3ASUjr/yK6SOsZOqcE/lR4e JOjPGCQPku58hy4uWKVjGZMaohB+l27sqyrOMONKOU/oKLkt0fi3Wa7HJnL95TdZsLtnZ6 eRxwKZ/jO2knyyeDZTQh5bi8jiGUqhmXm6L2JjKDAQLYqlEVu2QlyZjbdqC4kdu+HcZrUZ AlPoGVEA3V/to2+XRzR5kV7GPV/W2BpQxZsnn6j5UP+pbOzC/Yz+fklM1l8nF0wMx/c9OR bYgGfWPSX8jNtJVYvJJKxE5tI6Cn4DkroVtCtk6hpO21oScwGusElkNVrStSCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443878; a=rsa-sha256; cv=none; b=Vh2tqlgH7r8w9UtpP1V4HzaXwo5BLwtOCCw+mj2LYwW/c74IKHwdOJD0Wfu3Bjy/IGCieV OoUAc6f3YOiYq+z1fT04IGEcRmorx1LEXZF/6G5I+Ttrga6OZPZpQ5SHRY96p3GdXQXOpY 49iejVQzHMCbxc7fy0ELUlrCguYe/0K7TJ03rde0MBJSjuSDlxH71ShSe2/QkHsGqB6Kb/ xShxPxKRdM6YNJGLnaHOHkCKKyIHDMhnK1Hx6LrdsIn/Kk8w1ETXsRK3niEjh14C9h4U8y 9tmwHIy7LVtKATrYUR6qjn4o5Wi5AaghJS3qBGWJhmNpseb4U75LvSCcq0NbRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x/83Dcvl+Kni5M1oyRSR30QhjZRQbkuCm4xpU6KVH6A=; b=WQc7MIPrTuWbAhchAMClr5BKBN3fUAMb9gKpZs3Y5T5CBDub6C/R6RwDBovYsaIKMi8Ybu X2egY2oJLtUVBid4JjZp5rCn6LryQJUl3AvqJxp9gfdoa41CAoZ9lL9SPqvD9Uo/LHnUHx RJojZkbvdvxVQPrxQIwhBzDX8dNkDkflOxxvlPLl7hSY9dPt4qlcTJtKL7JzADWeVz3fNZ SIuvyaV2xHA+xtMsY3UHx5b+x67ajsrD88GDXR+hO7DglAR3iz1F08i4Pj8SBhdLOKqKnR nxfaiKzv1twHpEVUo4S3D/AbSNhNAMkQuHC856ajBP8CAqICOgfKWXffvVuMkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1zGZ60Fnz13J3; Tue, 25 Feb 2025 00:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0bwqu096693; Tue, 25 Feb 2025 00:37:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0bwQt096690; Tue, 25 Feb 2025 00:37:58 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:37:58 GMT Message-Id: <202502250037.51P0bwQt096690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 6a4a1a238523 - stable/14 - shar: Make sure a sed failure in the generated archive results in failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a4a1a238523d5640f474fd2775163275ac466f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6a4a1a238523d5640f474fd2775163275ac466f4 commit 6a4a1a238523d5640f474fd2775163275ac466f4 Author: Cy Schubert AuthorDate: 2025-01-02 03:44:18 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:37:46 +0000 shar: Make sure a sed failure in the generated archive results in failure Obtained from: NetBSD hg commit 365369:21b92f0055b4 MFC after: 1 week (cherry picked from commit f0c8d2cd622a47e06c08620a10e13ad7519e9102) --- usr.bin/shar/shar.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index f7496716acba..97e7768da6c7 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -71,7 +71,7 @@ do md5sum=`echo -n "$i" | md5` echo "echo x - '$i'" echo "sed 's/^X//' >'$i' << '$md5sum'" - sed 's/^/X/' "$i" || exit + sed 's/^/X/' "$i" || exit 1 echo "$md5sum" fi done From nobody Tue Feb 25 00:38:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1zGw4yFQz5p2Fy; Tue, 25 Feb 2025 00:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGw1ndZz3ZBS; Tue, 25 Feb 2025 00:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tFgu9E+nNtRAVunjmL3NIXw2TBnlADHSoD3dACpZMOI=; b=T11wkvIlu9zENJwOvNC2fS6h3rxXnQ1Qlfw6/XC81h5udSoYRuyNQ/bo0TPlcwZA/oyGdG gA2hKI6Tn7znKUfu3S93Mw7FmnKX6t1Lxqk7vSWyXulTxbxBJpI3AxOrWjym5vn1f/CFyL fG/0NAyj3L3P8xLdKye1VgTiCTm55zQD/UVHuDeDSSZ4HSBhNVwIpdjehMhWv5SoBNnOt4 gl11eAr4u8rFxgOktzVWlbgl72l3F9sPYqY/SQ+I4pAH3iqD0bQ/aO+3PVnF94W7Wpl4hL SKdh8dfpS8gTC/wwOTscwtXJB9pLEGYs66mEa2flrUXm7YKw9Z5GriDRcnERJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443896; a=rsa-sha256; cv=none; b=KmT17ZQgANasdUo+y/0W7huF5d7vuzNXZ+GN78x6IlKKrDcBzMcD1X3dKhWT9sjgcUVqwx wvqt0xyXlKS+Ng9ywOuD7Uq+P5SDu8Azg76dJVhZvXSmTUM50586IXJ3zO8XCaIFXUFje1 3QbTfeSxPDeC69GKWvxBSb/JeFt9gIEg4yp/EMsmxFLTbL7XBtCr+Ornd9Wd0TbBttMQUN IQn7gaGAm5KAht4F+QE53ZXwKyrkzmHhL7rtGOBdSBF6H0ELI+fsXvZ/UdDFmVtqNp0FQR VGOo22yw9SR3JgkhdSsuWTMm3XhgQiFfTpHrU0EjCBVBwYBNc7V9XKaTp8syng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tFgu9E+nNtRAVunjmL3NIXw2TBnlADHSoD3dACpZMOI=; b=bbZX+TUDy/80CyZehuYgNyqt8d6MLpgLafysFCMWGrHSOI5MyMXjbP+b5EPNLAa5NdlHrj UoX0SMkKwXRRRucjn18PzFkfDDo02zJu1RHVw1bJMbx+MlcG18+GGSQqgcyTU4nxqYL8ed 2eHhsyXhKIqhUGLxcl9kR8jGPqYBF7CZHlhI1DSArSlJG7MVaBXSUNxCfJi9vrgeUHXw+l IrDWRB+WxsdrVqzsJoTffq9Cc6OCmZ5dy+hOhT1hgvVpwL0uH20psIRUklRv24NKnjVRda Y+h/D7or4NxFE/jI36Jt8m3zQNBQQepFMVR08HRjHIXqz6W0QU/pcZHsO1bVEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1zGw1Fc7z131B; Tue, 25 Feb 2025 00:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0cGWw096923; Tue, 25 Feb 2025 00:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0cG4u096920; Tue, 25 Feb 2025 00:38:16 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:38:16 GMT Message-Id: <202502250038.51P0cG4u096920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 92c834c6980d - stable/13 - ntpd: Use the ntpd -u option in preference to the rc su plumbing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 92c834c6980d5e86768509104242316a51c064dc Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=92c834c6980d5e86768509104242316a51c064dc commit 92c834c6980d5e86768509104242316a51c064dc Author: Cy Schubert AuthorDate: 2024-12-12 20:03:09 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:38:10 +0000 ntpd: Use the ntpd -u option in preference to the rc su plumbing Using the rc plumbing to setuid(2) is preferred as it allows the user to use the -i option in ntpd_flags to chroot ntpd. Chrooting ntpd by default will be a 2025 project. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48191 (cherry picked from commit 521f66715afb312b356afafc68cbc044a436a753) --- libexec/rc/rc.d/ntpd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd index 76d83149ae1a..36df4ae08c96 100755 --- a/libexec/rc/rc.d/ntpd +++ b/libexec/rc/rc.d/ntpd @@ -98,7 +98,6 @@ ntpd_precmd() # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. if can_run_nonroot; then - _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || [ -n "${rc_flags}" ] && @@ -112,7 +111,13 @@ ntpd_precmd() fi # Set command_args based on the various config vars. - command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" + command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u ${ntpd_user:=ntpd:ntpd}" + + # Unset ntpd_user because rc.subr uses $${name}_user to determine + # whether to invoke su(1) to setuid() to $ntpd_user for us. We want + # ntpd to do the setuid() itself through the -u argument, above. + unset ntpd_user + if checkyesno ntpd_sync_on_start; then command_args="${command_args} -g" fi From nobody Tue Feb 25 00:38:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1zGx5c23z5p2Y7; Tue, 25 Feb 2025 00:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGx2kH2z3ZLM; Tue, 25 Feb 2025 00:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmtopY/Nu1DT+ZM+8N82KSzB9+fYOom7yczaQ23dQys=; b=HdCho5juHBMRSgGq4nhIs7J+QLf+qcqVUsjc4R6ZLEsjrHMmhoQJHtylFBILA8DyXpJLoD xI+R9qQWwe968t0MvQP4l7wM6vM46TeexGaurTZs3LhjMnvDI/aaWAarGQT/E5VoBFCEJl ANElb20KUDvur3mhDsH5ZDW6YAAsQLDMu9DDyTIcclPp9o0pn7YPn3UipLZMjw/JxqcBJD Rbx6CufkscCk6jXB8LMvkFogBe19Tw3hImZHvD5rMdkKnp/HraSwKh4BVV6BbxESJt5uoO rZEMghLnMZSxv5i1PPphIC0mphC567l5hE+swlsMeOhPyLF1Qv2H6VaM2fQluA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443897; a=rsa-sha256; cv=none; b=HXG2OPP68NhUgsJbDDGhWmXzwWlMnkj2kQdZ+oN9Qm3m2j5ZCb+HMqwisw8sNQOacp0Zry FEWhQs+pMyQkF9vXZz+YAGjdUx5iQCpHx34zHYsfbRci5Wxfy/NKLUm9JtKQHEuaN/RNjC 32DX6bRWVI5TvMvpOzmEeD2G3Ut8Ip68TQruC6Tb9Z/9rMvaByLTE6zNPVoimm7AHdR2pU gcc7BNI/CTNh+3NxTIXTRL/LsSZLbzCsvlYbAlsGdQ/JWOHZMDY7U4fAyg7bE8Ma24mdo8 BwL2d+7USxafJznQSuspakAwXVQgVdUBWx2kgmk8GHh9IxFYCBoH9VvxGrFc1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmtopY/Nu1DT+ZM+8N82KSzB9+fYOom7yczaQ23dQys=; b=romaKPNaLPVuXqzA0+Mr00G5QtouNEm4ws1hHj/aKqWf6V2Clw3rwuTl3G6VUQ26388mov +qQuNvXqDEu22/Bw7cgLSrvlRdqqJnXlX0l1KzDHa6s1HsejOXay/1yzjyb5eRWVZsqSxP mnGe4GeODSMoBzDlozssETkPb9RxlaqoccuaiW2e13FTINjNGqsCxR9BK9sMGNgjqT5I2n 6c8Y4ZdI94/z936Q+4by95L6D7i5cjTrpT8K1HE1qXEdcCkyeXVGriiKQDVZ9fIZoTEgVl naBBRgZu0omErKByS4EYP434cTXnIoUV0do4ACg/5DKufOK0JGJCJGugzqrwTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1zGx24ZGz131C; Tue, 25 Feb 2025 00:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0cHFs096964; Tue, 25 Feb 2025 00:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0cHqv096961; Tue, 25 Feb 2025 00:38:17 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:38:17 GMT Message-Id: <202502250038.51P0cHqv096961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9b70262b0807 - stable/13 - shar: Handle special characters or white space in file names fed to shar List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b70262b08076ecde0262173e33d9cfc805b14b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9b70262b08076ecde0262173e33d9cfc805b14b5 commit 9b70262b08076ecde0262173e33d9cfc805b14b5 Author: Cy Schubert AuthorDate: 2025-01-02 03:35:31 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:38:10 +0000 shar: Handle special characters or white space in file names fed to shar Obtained from: NetBSD hg commit 365370:124268924386 MFC after: 1 week (cherry picked from commit 1080f5315427b382221651b342227b4923106f83) --- usr.bin/shar/shar.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index 77ef3789c8b3..f7496716acba 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -64,14 +64,14 @@ echo "#" for i do - if [ -d $i ]; then - echo "echo c - $i" - echo "mkdir -p $i > /dev/null 2>&1" + if [ -d "$i" ]; then + echo "echo c - '$i'" + echo "mkdir -p '$i' > /dev/null 2>&1" else - md5sum=`echo -n $i | md5` - echo "echo x - $i" - echo "sed 's/^X//' >$i << '$md5sum'" - sed 's/^/X/' $i || exit + md5sum=`echo -n "$i" | md5` + echo "echo x - '$i'" + echo "sed 's/^X//' >'$i' << '$md5sum'" + sed 's/^/X/' "$i" || exit echo "$md5sum" fi done From nobody Tue Feb 25 00:38:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1zGy6TwHz5p2Tp; Tue, 25 Feb 2025 00:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGy3Hdyz3ZSn; Tue, 25 Feb 2025 00:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bqYsKOJH43fZkpmzvTgAnIIXzzhByb1E78mHrdoTEZo=; b=I+IzH6Q/x1tbJunIIev1glK6A95nbo+mGAn8pGyySdz8vkt//lTreHUwWsTvvz83l1dudZ RnM+9dRrW8cdv+HiaATZTOnry5/eJqDsFsQLKCI5mx7FKRfGqH0/XKbSBnLQL1XG5MU/z8 a+H9GJiVu4IPz27RlOykZrZMRj2liWZvZgojWVf42WR184cSs0q4v758stRj4v9kU5qM7Y MI3P1gFRr/03Y/amnom+9QyqnDyUB0VYUsdWFIt1HVVSz2E8W2DpsL6X+lQd2hIMvXRokB nUgFhfiFGhaeSWRurcyPka6h55HzbOREU60OXTxWAGUngKGOeo7VtsKnFb2hzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443898; a=rsa-sha256; cv=none; b=qCtsK6qrx3ZtOd9f3miRmjW7b6HnmMkU9a+CoDeTZWatDobYYAS/UYTkTIfec9aOm6eOHN wOzy96wnZQwJENUNHAXeKjzk01UITVVSwjOxLsY5oGeuvF40kokM5mWy1e5AeHnVk8p4EP ukbpxkd6ZfKoQrEkVIwVsW/Pk7YYmjQ1eYlLek6auRsy6IuKrR6i6pVmkF1ZaLl2hR1ARQ mv4iVkt1wUa55wIn4IkO0+ZtInX7XizoxNiq9cmhTllXRJP8yxKMsqDrval3F2YPPc5ZLv K72l91S7iDYDuw2NkWBedGGLX2ye7CuYrLPLWlhkHtbro5/95lzYV5NPvVGfHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bqYsKOJH43fZkpmzvTgAnIIXzzhByb1E78mHrdoTEZo=; b=PrHfTNnXzPQejU6AadAu92KqdMKV8SZBhVRfl9z8jieDK2F6AMXPjqsy6cP46+mDEO+Ejt AfnKdwufuCCVj+l8xCatYFM0DPRBa6qJ8msyX0H296WVY8C2OfrMJ6ljRynTdtyej0U5WM jcFr/pA5RP6l+/ksa+dwl9itFbBfF6heUjQyM/OaZhPH+wEL7pdv2DNyIXVAMX0kws+Cqi PycqFGuYmbptJQkK9rBBzbD8WT4KyCIJbpdq+MkJ0RAkLU/Bo5/I43ZsPGY1R2j/2fgnB4 CT0SonlzqL2SDGCje4YDlDYoylIu41pfSiJHZwdrJHn4GjR45+3D+RyNbXO+KA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1zGy2qgdz13dF; Tue, 25 Feb 2025 00:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0cIT2096996; Tue, 25 Feb 2025 00:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0cIxr096993; Tue, 25 Feb 2025 00:38:18 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:38:18 GMT Message-Id: <202502250038.51P0cIxr096993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9b65c9cdbb94 - stable/13 - shar: Make sure a sed failure in the generated archive results in failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b65c9cdbb9419ea987a08b6aaa1e51e54bb52d0 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9b65c9cdbb9419ea987a08b6aaa1e51e54bb52d0 commit 9b65c9cdbb9419ea987a08b6aaa1e51e54bb52d0 Author: Cy Schubert AuthorDate: 2025-01-02 03:44:18 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:38:10 +0000 shar: Make sure a sed failure in the generated archive results in failure Obtained from: NetBSD hg commit 365369:21b92f0055b4 MFC after: 1 week (cherry picked from commit f0c8d2cd622a47e06c08620a10e13ad7519e9102) --- usr.bin/shar/shar.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index f7496716acba..97e7768da6c7 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -71,7 +71,7 @@ do md5sum=`echo -n "$i" | md5` echo "echo x - '$i'" echo "sed 's/^X//' >'$i' << '$md5sum'" - sed 's/^/X/' "$i" || exit + sed 's/^/X/' "$i" || exit 1 echo "$md5sum" fi done From nobody Tue Feb 25 02:03:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z218t1v8Cz5p9ll; Tue, 25 Feb 2025 02:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z218t17SLz3TkG; Tue, 25 Feb 2025 02:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740448990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pet6APQMnRSiEJ1dB1S/fVIS2waNkWSm1DobSiz9RUs=; b=eUiBXg23ENiTrZ9Xyoi1zr7aadtNe0gdY+uoqvLNqh1BqA2eFI/VlnKg2C4VtWCEz/tO7h eI02hpvbzytBnIxWd8eH5RHbSiCkoop7+PWbMLbjcOjkhBlKuIMDph7BBRWjxRW1M22387 Vwo3tmaz/r1rRmpPInVeRS9RdtUpU9kmb82a5yuOshwl6qA5REEM6YwitO3phWRhJmqbjt i9s86NWDuUr7ET1A70UK2vPDhZTh5DjubGNZN8WXPNNzyUTQtL2k+uBgB38Acrk8HVRyiI ojyTubXnBASrFZ2JTjOgb7lVxacWxExG5kDgQHPsKeW7qHo1aqCiFijeo9GMBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740448990; a=rsa-sha256; cv=none; b=qEG66b1fyb9CMZXUUozOK3RmuiWH2gN+zizUJrrg6gHOUfC9Ll5uAfhFtCNi0z7Y8REY0U mzrUYQm5JM59jbx+Vrd6ayQGumXvrQWEvSEF9W/ar/TYixi1MVm3qKWiOuapnDEsgHVpAM LQNJTk1w7KDGpQFIpcviKCButsUMaPX7AofOgYZiulE+15NhO/p6VbAIGhpTVuV0Gr6sFo 26iaGTfuYEBpHs37zsuxOr68zz9gKaMPjwLU7uvk/SC9Q/7Epoc7gi/HAKHJ0bl3YpG/XX XvSo9Z5EPB3p4hbuqrLjHoWqPvPTVscHkPHj14xE7HyphjgoHXd3LVUV3fQV1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740448990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pet6APQMnRSiEJ1dB1S/fVIS2waNkWSm1DobSiz9RUs=; b=nLpk/Re6s+MMN7kXj1/SwpojDzjlvhqdUurboxPvSZzwpZZKUG/0btT6RNZcmmcuwPl1Tx CAVe4zZj4PJ3dWuzARPbEE30qgTPVolxcJIkXavNMVXDtYfLTTMBwnpIhMFqvtXc9JZc6n j64p7XOyFhiPWNd6FXUntUFaLYmTmw7PSuBcdk8m9up4phJbfirtjtGuV3eQbzQ2AkLGOV 2ocJSz9AvTc52o5Eh/Qjn7v+oyJzsgHEXlMAKcGTquU52T3CpBO4dvPrugjIAXaKcc72+p miFQE9glucLOF7j+oG1aqiJDHgBykW7vApZ1zf1ZvEQ5ik96kHlbmArSLPq0yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z218t0btyz15ml; Tue, 25 Feb 2025 02:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P23ASY063993; Tue, 25 Feb 2025 02:03:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P23AmB063990; Tue, 25 Feb 2025 02:03:10 GMT (envelope-from git) Date: Tue, 25 Feb 2025 02:03:10 GMT Message-Id: <202502250203.51P23AmB063990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 29c7551cf797 - stable/14 - nfscl: Re-initialize session seq#s when server shrinks slot table List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 29c7551cf7970dbe6a869b766a2740864653f3ff Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=29c7551cf7970dbe6a869b766a2740864653f3ff commit 29c7551cf7970dbe6a869b766a2740864653f3ff Author: Rick Macklem AuthorDate: 2025-02-11 23:50:57 +0000 Commit: Rick Macklem CommitDate: 2025-02-25 02:01:19 +0000 nfscl: Re-initialize session seq#s when server shrinks slot table When a NFSv4.1/4.2 server reduces the size of the slot table for a session as indicated by a smaller value for sr_target_highest_slot in a Sequence reply, the sequence numbers for the slots no longer in use must be re-initialized. This is needed since the slot table may be grown again by the server later. The RFC did not make the need for the sequence numbers to be re-initialized when a shrink/grow of the slot table size happens, but this has now been confirmed as correct behaviour. The patch adds the code that does this re-initialization. I am not currently aware of a NFSv4.1/4.2 server where the session slots fail if this is not done, but there may be such a case. (cherry picked from commit b97a478896e9523245c2041b064121ccb1f70426) --- sys/fs/nfs/nfs_commonkrpc.c | 42 ++++++++++++++++++++++++++++++++++-------- sys/fs/nfs/nfs_commonsubs.c | 2 ++ 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index e5c658ce76d2..e35172ee2b34 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -123,6 +123,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_da SYSCTL_INT(_vfs_nfs, OID_AUTO, dsretries, CTLFLAG_RW, &nfs_dsretries, 0, "Number of retries for a DS RPC before failure"); +static void nfs_resetslots(struct nfsclsession *); static void nfs_down(struct nfsmount *, struct thread *, const char *, int, int); static void nfs_up(struct nfsmount *, struct thread *, const char *, @@ -670,7 +671,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, struct thread *td, struct ucred *cred, u_int32_t prog, u_int32_t vers, u_char *retsum, int toplevel, u_int64_t *xidp, struct nfsclsession *dssep) { - uint32_t retseq, retval, slotseq, *tl; + uint32_t retseq, retval, retval0, slotseq, *tl; int i = 0, j = 0, opcnt, set_sigset = 0, slot; int error = 0, usegssname = 0, secflavour = AUTH_SYS; int freeslot, maxslot, reterr, slotpos, timeo; @@ -1039,7 +1040,7 @@ tryagain: sep->nfsess_badslots |= (0x1ULL << nd->nd_slotid); mtx_unlock(&sep->nfsess_mtx); /* And free the slot. */ - nfsv4_freeslot(sep, nd->nd_slotid, false); + nfsv4_freeslot(sep, nd->nd_slotid, true); } if (stat == RPC_INTR) error = EINTR; @@ -1192,15 +1193,22 @@ tryagain: if (retseq != sep->nfsess_slotseq[slot]) printf("retseq diff 0x%x\n", retseq); - retval = fxdr_unsigned(uint32_t, *++tl); + retval0 = fxdr_unsigned(uint32_t,*tl++); + retval = fxdr_unsigned(uint32_t, *tl); if ((retval + 1) < sep->nfsess_foreslots - ) + ) { sep->nfsess_foreslots = (retval + 1); - else if ((retval + 1) > - sep->nfsess_foreslots) - sep->nfsess_foreslots = (retval - < 64) ? (retval + 1) : 64; + nfs_resetslots(sep); + } else if ((retval + 1) > + sep->nfsess_foreslots) { + if (retval0 > retval) + printf("Sess:highest > " + "target_highest\n"); + sep->nfsess_foreslots = + (retval < NFSV4_SLOTS) ? + (retval + 1) : NFSV4_SLOTS; + } } mtx_unlock(&sep->nfsess_mtx); @@ -1463,6 +1471,24 @@ nfsmout: return (error); } +/* + * Reset slots above nfsess_foreslots that are not busy. + */ +static void +nfs_resetslots(struct nfsclsession *sep) +{ + int i; + uint64_t bitval; + + bitval = (1 << sep->nfsess_foreslots); + for (i = sep->nfsess_foreslots; i < NFSV4_SLOTS; i++) { + if ((sep->nfsess_slots & bitval) == 0 && + (sep->nfsess_badslots & bitval) == 0) + sep->nfsess_slotseq[i] = 0; + bitval <<= 1; + } +} + /* * Mark all of an nfs mount's outstanding requests with R_SOFTTERM and * wait for all requests to complete. This is used by forced unmounts diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 9e10bba28c90..ffd6d3e50654 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -5051,6 +5051,8 @@ nfsv4_freeslot(struct nfsclsession *sep, int slot, bool resetseq) mtx_lock(&sep->nfsess_mtx); if (resetseq) sep->nfsess_slotseq[slot]--; + else if (slot > sep->nfsess_foreslots) + sep->nfsess_slotseq[slot] = 0; if ((bitval & sep->nfsess_slots) == 0) printf("freeing free slot!!\n"); sep->nfsess_slots &= ~bitval; From nobody Tue Feb 25 04:01:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z23nx72H2z5pNTP; Tue, 25 Feb 2025 04:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z23nx6YYmz3xRB; Tue, 25 Feb 2025 04:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkuC1e/HKSC5+NEbk0LpT3SsNxJqRT9VHJcMZ8VuqXY=; b=fWDWr4+umgvNerDZ6PsrxGNv8eJvrjcyfreuR6qovwJ0FGYoETNGrSrfcTP5b6dPO1n7NG K7DaAEZFaj8zaGClSxFHRj1UXQexZRvNo/oxJubNbSbCVkz7DWkDMfvA3QRr2yHo9T8rOS 95++X+aHAvkHStDfgwE66FabYRnCpPN4ySbwPM6na5Sqhqh34wee19yk9NJika+OQrmaef /Dqb16pmxEyFXy4MAtkpTVtAjdvqIBTpir44sBikck26uVEjJEuh0tNQwtgOo1cIzZ5YW1 BEcbLdlL3XC//Ced+dca13Y1JxXcBH8KUZWFBG0sDNi1MvuC/AOKl31PzEV+uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740456117; a=rsa-sha256; cv=none; b=lMPiDLHsZiN/ebZXvPjeiXma9wT0oYy/s/oyDWGJrOVIrroc61Vs0rj0nmMWJMQ43I3O32 GhcqPVpgd7vovjbNyiQU0drnDeUFk7+Agam7EpcjQQwIc9vhHvb9GMTMB89VnX38GZPuAa uPUXE31x0Qj+eBNUfWOoSXSjDNTdgQhXI9Fg5Gqhhyx6CqDgNljwICgI3hXkiBmnDjxT0M qSe7oXkHkV7orkZewP8bmHeeGz+NAUvG4t7KbsiLSJE9kriob+k+ezVrf25sYVH8A+JQ+e IR4K9b67wfop7WuyVhl9LKxXhtuWEGW8C21aT4BMAzhUhmCxd/MUARHYk9J3Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkuC1e/HKSC5+NEbk0LpT3SsNxJqRT9VHJcMZ8VuqXY=; b=DkoElDIuTfNND03zHX2fsBc+NYFVsCheO52NPPmGs4ON8+BN1agTOeJAOVyyHO6fhpWYBq 1TQQ15uGnjBGuuoAs4Q+teVDEAUQ4g84kfJR3+02PPmYos45bT0N4XDENMYQEd6k7aqIfJ gy9GyPdDbkWDbITXLmwn2JsigsAqzEWYnld6yyDm37e3sAu5CoY4glNdV9OpOhbBOFCZls Rr2FmhMON6EmPIrpJaDyAff91VrhT7CxQa3VO/J9C2gpOt6qtbAjSGa7jO4nlscqD4XzcZ msIeglv7AMOYYXhWJHgcrxx/yF/gE7ipqK6stGJDR7cAOVsRtcyWuLYjEVAyeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z23nx68mRz18qq; Tue, 25 Feb 2025 04:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P41vqD086297; Tue, 25 Feb 2025 04:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P41v1n086294; Tue, 25 Feb 2025 04:01:57 GMT (envelope-from git) Date: Tue, 25 Feb 2025 04:01:57 GMT Message-Id: <202502250401.51P41v1n086294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d8d8b9c9ca38 - stable/14 - tests: carp: Update test case unicast_v4 to catch PR 284872 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d8d8b9c9ca387217bf70b2db1038529d80af280b Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d8d8b9c9ca387217bf70b2db1038529d80af280b commit d8d8b9c9ca387217bf70b2db1038529d80af280b Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:32 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-25 04:01:22 +0000 tests: carp: Update test case unicast_v4 to catch PR 284872 In the current test case unicast_v4, host one acts as a router, but it uses if_bridge(4) to verify the reachability to CARP master. Unfortunately, if_bridge(4) brings the two CARP hosts into the same broadcast domain, thus with an unusual (undocumented) setup, one host is in unicast mode but another one in multicast, or two hosts are both in multicast mode, the test case can falsely report success. Fix that by propagating route via routed(8). PR 284872 shows that CARP(4) happens to send packets with multicast destination when the unicast peer address is in the range x.x.x.224 ~ x.x.x.239. Update the peer address in test case to catch that bug. PR: 284872 Reviewed by: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49076 (cherry picked from commit 93fbdef51a13b8facac3633f55804a59ca27f635) --- tests/sys/netinet/carp.sh | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index 8cea2f4cbf1b..e14bedb4f878 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -116,49 +116,53 @@ unicast_v4_head() unicast_v4_body() { carp_init - vnet_init_bridge - bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) - vnet_mkjail carp_uni_v4_one ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_uni_v4_one ${epair_one}a ${epair_two}a vnet_mkjail carp_uni_v4_two ${epair_one}b vnet_mkjail carp_uni_v4_three ${epair_two}b - jexec carp_uni_v4_one ifconfig ${bridge} 192.0.2.4/29 up jexec carp_uni_v4_one sysctl net.inet.ip.forwarding=1 - jexec carp_uni_v4_one ifconfig ${bridge} addm ${epair_one}a \ - addm ${epair_two}a - jexec carp_uni_v4_one ifconfig ${epair_one}a up - jexec carp_uni_v4_one ifconfig ${epair_two}a up - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.1/25 - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.129/25 + jexec carp_uni_v4_one ifconfig ${epair_one}a inet 198.51.100.1/25 + jexec carp_uni_v4_one ifconfig ${epair_two}a inet 198.51.100.129/25 + jexec carp_uni_v4_two sysctl net.inet.ip.forwarding=1 jexec carp_uni_v4_two ifconfig ${epair_one}b 198.51.100.2/25 up - jexec carp_uni_v4_two route add default 198.51.100.1 + jexec carp_uni_v4_two route add 198.51.100.224 198.51.100.1 + # A peer address x.x.x.224 to catch PR 284872 jexec carp_uni_v4_two ifconfig ${epair_one}b add vhid 1 \ - peer 198.51.100.130 192.0.2.1/29 + peer 198.51.100.224 192.0.2.1/32 - jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.130/25 up - jexec carp_uni_v4_three route add default 198.51.100.129 + jexec carp_uni_v4_three sysctl net.inet.ip.forwarding=1 + jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.224/25 up + jexec carp_uni_v4_three route add 198.51.100.2 198.51.100.129 jexec carp_uni_v4_three ifconfig ${epair_two}b add vhid 1 \ - peer 198.51.100.2 192.0.2.1/29 + peer 198.51.100.2 192.0.2.1/32 # Sanity check atf_check -s exit:0 -o ignore jexec carp_uni_v4_two \ - ping -c 1 198.51.100.130 + ping -c 1 198.51.100.224 wait_for_carp carp_uni_v4_two ${epair_one}b \ carp_uni_v4_three ${epair_two}b + # Setup RIPv2 route daemon + jexec carp_uni_v4_two routed -s -Pripv2 + jexec carp_uni_v4_three routed -s -Pripv2 + jexec carp_uni_v4_one routed -Pripv2 + + # XXX Wait for route propagation + sleep 3 + atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \ ping -c 3 192.0.2.1 # Check that we remain in unicast when tweaking settings atf_check -s exit:0 -o ignore \ jexec carp_uni_v4_two ifconfig ${epair_one}b vhid 1 advskew 2 - atf_check -s exit:0 -o match:"peer 198.51.100.130" \ + atf_check -s exit:0 -o match:"peer 198.51.100.224" \ jexec carp_uni_v4_two ifconfig ${epair_one}b } From nobody Tue Feb 25 04:01:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z23nz1ZQwz5pNLg; Tue, 25 Feb 2025 04:01:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z23nz0WKHz3xSh; Tue, 25 Feb 2025 04:01:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hZ0eM6Y0+f09esMEhkYYIy6kjFx9PIJMKn2+98V8OI=; b=axqK4tBBOW3KkdcGTtxGd6K8Y7q5MakuekFZeYPDq4viv3q1OmNqB/97WWV+GgVu7T9sqW nSHmGtqbGdZeSsB6dHE4yqVjRz9w11IIHxPOZqcr4vyWGD1cWEjYbcipAxoXsutlzzVkST feqmDf/0AZQtzlI13HmZ53SJMUvTqxj13NilsO709b6oFXKMfq9gStiW2qepgF5XjOozGk jleuG/x6KXtnFWtRPEjrJRx8cOI0KISOeNMMQNFgRVQBmQtNCgzr/xiTfEiJH0t3p1kYlG wb3iUFk9Q/g8DUN6gGLIiVLoEPoVLyCmk96xvlRlVhBldtzjj7PkZ0utIn4YaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740456119; a=rsa-sha256; cv=none; b=LiyFsW9i8j8Xwx4L/F9vo4Ad4boG/JbpEe1CL+yvgon3t7bpNA5edQwkg8LLAnWt8c3mSC xee8u4r59DHv4ZtFImLcFrSTI9VErxgUwEdoiPKuTWgHMYpJF/6fPY+PYHkxjA/hUnF00j WagIUnKtu3wmHesEQykyfrUBPIZGRyTRx6VGx/2qk1kkh87ODmqlqh/husFSEeYnYMgV6i eo89JYGTzUk+Um5OOD4CvTTd/vnSV8w5xjPz4ZjguSW7TDoPBJ+QUN/t/GuQ6k7qfLvURt HLMEWa+LzyquSuuf33S1uLNVFQ94IO0auvHpDkIK5azQpXiHB6dIkGPj6XAk/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hZ0eM6Y0+f09esMEhkYYIy6kjFx9PIJMKn2+98V8OI=; b=XQyrvz2zfrznzZfG0TeNlx/w7zk4pTnKpJBd/4ERPij82CbZ9wV9aKY+lBJEaaQtOGizvL U7QLxY/+vzy8yxsmhnZoHtudVSlYbGCBWkDLSYCZPd6+FBsl1mdpN0UIUmLhk9NO5NH6NJ fHogZstL1M08uB2007F+Af18r4TNYSbq1TssNJpac4VlC0DgwsruLuK0mzZqhju2dFKMDj UF5/M1e9sEqAHhDJcVO+8DZjsJLImPp6BaUOw/5zTFnqnwplVKlraGtEFS90hmVkOhAY3S cl3QtiBSA7UCY6nhzQKnEwNDjtXQgk56SEv75ZqYajWqZueBk5Dbnh1xagqHgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z23ny74w0z18Mp; Tue, 25 Feb 2025 04:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P41wIW086335; Tue, 25 Feb 2025 04:01:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P41wjT086332; Tue, 25 Feb 2025 04:01:58 GMT (envelope-from git) Date: Tue, 25 Feb 2025 04:01:58 GMT Message-Id: <202502250401.51P41wjT086332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: cad2df3e90d1 - stable/14 - carp: Fix checking IPv4 multicast address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cad2df3e90d19b083de11f940b20678716811459 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cad2df3e90d19b083de11f940b20678716811459 commit cad2df3e90d19b083de11f940b20678716811459 Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:33 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-25 04:01:22 +0000 carp: Fix checking IPv4 multicast address An IPv4 address stored in `struct in_addr` is in network byte order but `IN_MULTICAST` wants host order. PR: 284872 Reported by: Steven Perreau Reported by: Brett Merrick Reviewed by: Franco Fichtner , ae, kp, glebius Tested by: Steven Perreau Fixes: 137818006de5 carp: support unicast MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49053 (cherry picked from commit 1776633438f24df09cb9815650891bcef0152874) --- sys/netinet/ip_carp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index ddbc13e7c878..3223a76c7860 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -722,7 +722,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) sc = ifa->ifa_carp; CARP_LOCK(sc); if (ifa->ifa_addr->sa_family == AF_INET) { - multicast = IN_MULTICAST(sc->sc_carpaddr.s_addr); + multicast = IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr)); } else { multicast = IN6_IS_ADDR_MULTICAST(&sc->sc_carpaddr6); } @@ -988,7 +988,7 @@ carp_send_ad_locked(struct carp_softc *sc) m->m_pkthdr.rcvif = NULL; m->m_len = len; M_ALIGN(m, m->m_len); - if (IN_MULTICAST(sc->sc_carpaddr.s_addr)) + if (IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr))) m->m_flags |= M_MCAST; ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; From nobody Tue Feb 25 04:04:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z23rp5sMZz5pNSb; Tue, 25 Feb 2025 04:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z23rp5Jbxz41tw; Tue, 25 Feb 2025 04:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mDSDM/V/wO3EsZLMPOWz4giiaK1VXI6ZEFeKjBpnIx8=; b=U9zelaQ7i3XLwK4JXLtEjoiCIW6ttgiu/q4gl0F5iN0oP71kjNGpUytg1bTOS5+sOsFLFt RNEBOaSF9WCWE8zaTncF+fD6JY7sSlVYiQfupo+IT2Kens/drMhjrCIz0D10Y3+T03PGuA U9N8/3yXgTotSIpP+v1MbWMAKO89V94iARAx1+wQG6VtU3IkmVMSoTJsbjNQxk3jLKFSBe rQv5bVRwVXObbhB7DYueFcSwj3v9TEsOfQuKdiOrxQkaCEcZ01D+2A4e/MJVqzL77ZjMVM AAoxwx6F7e2b+mwULe47MU9lTQzD8ERoU/Yi4eEbFcNW3uPTfChBBbG3uO52Nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740456266; a=rsa-sha256; cv=none; b=jV+LoeYMRDOG1giJ4kX3vXXOBLchw6GSD1uIPAvwS+MrSEnm3wZ4As7VHLKMJ27cd93QRb LKd5LQ0k7bxHRhNGQ4VXfyFPhOf3Uj+59N3hxwm9DGy7ZFuLYtq5Qy+Hk6cjDhvbbISDlY OFqYoJxXweT00ASo3uknlNaFbIVzvucRMvt8bopfECnMp9A9FfSMR1cQ4YpzskC45vEOqE 9pGKxGwGscG+bcyAJ0tUo2rCM//6WOuGetOpAO0g469AqzedD5QHk6cf5NKovENX9dQ9iH BEgI2bWDCxU+Zqqey0UItvpQ/IJ5khBtwxuQ2FLG7dqWVva84E6K9Eug7hFQnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mDSDM/V/wO3EsZLMPOWz4giiaK1VXI6ZEFeKjBpnIx8=; b=cBxvEGpHve1yR6/ejLqab9npmcR+45SU2sgSBYN4Uj1Hzb+OW7ruvdHwxiLyFPly90M+jg +YZLS7GebbVJ0TUIqVsbUdnG2DPCglHwNqfFd4CaPPouHw9uZSEU9CjiWm6s8EghnnHC6s kxGjqN6NwdQyTqXnJFfhiVVJgEFJJOII/fSh9yxddPm3+gN5khgV/rZeIsuvXZdIICqBvp KKcMHd7VoaPVnm94EvxJEK/J9GdcblbqMebVarbjGBI0m5QpT+hAPwJfWXbIr+83kJNnde RiKuYBSO3hfkEGClQPbU+NkMFl8KF/P5/4yo5YOIafm+Q2sPuEXI/BH/b71P+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z23rp4mWrz18r6; Tue, 25 Feb 2025 04:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P44QeU091677; Tue, 25 Feb 2025 04:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P44Qdi091674; Tue, 25 Feb 2025 04:04:26 GMT (envelope-from git) Date: Tue, 25 Feb 2025 04:04:26 GMT Message-Id: <202502250404.51P44Qdi091674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: b3de60980210 - main - style: Recomend SPDX licenses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3de609802104234dca7449fc2b4f4106098d41b Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b3de609802104234dca7449fc2b4f4106098d41b commit b3de609802104234dca7449fc2b4f4106098d41b Author: Alexander Ziaee AuthorDate: 2025-02-25 03:48:12 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-25 03:48:24 +0000 style: Recomend SPDX licenses While here, take this opportunity to update the copyright and clean some mdoc errors. MFC after: 3 days Reviewed by: carlavilla, mhorne, imp Approved by: imp (srcmgr) Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D49051 --- share/man/man9/style.9 | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 0e766840c9ee..5542a9685c46 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -1,5 +1,5 @@ -.\"- -.\" Copyright (c) 1995-2022 The FreeBSD Project +.\" +.\" Copyright (c) 1995-2025 The FreeBSD Project .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -22,12 +22,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 3, 2024 +.Dd February 18, 2025 .Dt STYLE 9 .Os .Sh NAME .Nm style -.Nd "kernel source file style guide" +.Nd kernel source file style guide .Sh DESCRIPTION This file specifies the preferred style for kernel source files in the .Fx @@ -59,34 +59,24 @@ is silent on an issue. * them so they look like real paragraphs. */ .Ed +.Pp C++ comments may be used in C and C++ code. Single-line comments should be consistently either C or C++ within a file. Multi-line comments should also be consistently either C or C++, but may differ from single-line comments. .Pp -The copyright header should be a multi-line comment, with the first -line of the comment having a dash after the star like so: +The copyright header should be a multi-line comment like so: .Bd -literal -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 1984-2025 John Q. Public * - * Long, boring license goes here, but trimmed for brevity + * SPDX-License-Identifier: BSD-2-Clause */ .Ed .Pp -An automatic script collects license information from the tree for -all comments that start in the first column with -.Dq Li "/*-" . -If you desire to flag -.Xr indent 1 -to not reformat a comment that starts in the first column which is not a -license or copyright notice, change the dash to a star for those -comments. Comments starting in columns other than the first are never considered license statements. -Use the appropriate SPDX-License-Identifier line before the copyright. +Write the copyright lines before the appropriate SPDX-License-Identifier. If the copyright assertion contains the phrase .Dq Li "All Rights Reserved" that should be on the same line as the word @@ -132,11 +122,11 @@ Only add in front of foreign VCS IDs if the file is renamed. Add .Dq Li "From: " -and FreeBSD git hash with full path name if the file was derived -from another FreeBSD file and include relevant copyright info -from the original file. -.Bd -literal -.Ed +and the +.Fx +git hash with full path name if the file was derived from another +.Fx +file and include relevant copyright info from the original file. .Pp Leave one blank line before the header files. .Pp @@ -923,7 +913,8 @@ When using branch prediction hints, atypical error conditions should use (document the exceptions). Operations that almost always succeed use .Fn __predict_true . -Only use the annotation for the entire if statement, rather than individual clauses. +Only use the annotation for the entire if statement, +rather than individual clauses. Do not add these annotations without empirical evidence of the likelihood of the branch. .Sh FILES From nobody Tue Feb 25 07:20:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z28Bp3NRYz5pCLK; Tue, 25 Feb 2025 07:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z28Bp35mcz3C5q; Tue, 25 Feb 2025 07:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740468018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+AS9LMx1ko8P3g7YHAfb8ajV/SuOLeOtsyACVGlZD0E=; b=fNRIgobgsS/XmCswGnfOWHiBObgqwUDBIwmPJSIDMiENgN6zwN60HHtm/La4N10UrEcl1o SVth//4xapiqcxUTfxowSB6vrfiz2zeI+QaTHv9rvA7esaISOqPqwBwZL51mNkLA8P8kP2 lg8DYVSbywrzUvMyziPaG92SxHMg3ehNsFpr6r04NfHyjO3M2/u+BBKrs/3VxevBSIDEyv u72LsMC2Ijku5daOTeJdu42+KlZ73096lVmq4IgaZ3K11TDC4Itf9b26DbDfSxNuoPj9nD NcLIATKh2iKUapKSFbfWYgkT0GPfrB6My8SJcFKnc2D3Q7GgaZl6vOUkRBdB8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740468018; a=rsa-sha256; cv=none; b=wFtjZ/8dObWBKr+7Ok2M8WsSL6KRpWPLkCkrOsavQl5CAojRoSat8OkUSVZc6YHNAqt8iY 8J/02VOvOR3horFoOZjeqIuEllk22f2Kz1vEuP2TBvR72fATth/ndyXAIVQfifKw+5fc8x MfK3BoElbZuPAcib/Q5/OocWnP1Qq40DarhhPD1ryXyaoUIeGWGYz6YLMg+WZX/XuTAhwT /kQtdKYKgZS61fYdQ8jwETRqw6126iht2/YSiKqw9Lo6BjFdofeOY1EAuX59h+rIQ1ijsY edbHqs6gkAN8kTaP4sjdsERFJnZgdsAgAZZdptVNejNKbRuRdEDt8tuQM3GdJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740468018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+AS9LMx1ko8P3g7YHAfb8ajV/SuOLeOtsyACVGlZD0E=; b=kTbaZTlt1IrqX5Ean0QCPSxerQ7HkJ/H2HBLqW8q9EXxJ1z+kxY6rwMD9jiOHhG8zzVOis /FxtYfV7D6OVAtBPVctJBBv0EGfvYIseiRSbDyMok9B9Lv9rHyBMrAHQ7J3WGo/HrD4wn8 cIj72lKfgp71uYbh2Y5pgC+tMqL7OZnMeeCBGddn9YKn0GgMEa1X4FuFbj/GDUhO/eNF7a 8s4gi+5qnuPImDY/Zjnb2TVKnUHBEypXomJoe0zxgJOXd2cMYwlhAKtJG/pQpya30QfE8Y aRgwY4mFLGRs11iXcIRK7OzcmaG94X5lgfcucrrUjci+adKawkzZjkiJWj0kqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z28Bp2csTz21f; Tue, 25 Feb 2025 07:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P7KI6K056018; Tue, 25 Feb 2025 07:20:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P7KIP4056015; Tue, 25 Feb 2025 07:20:18 GMT (envelope-from git) Date: Tue, 25 Feb 2025 07:20:18 GMT Message-Id: <202502250720.51P7KIP4056015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d40daefca647 - main - libc/gen: split user-visible opendir()-like functions into separate source files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d40daefca64750c1076822bdbd3c409a9519f513 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d40daefca64750c1076822bdbd3c409a9519f513 commit d40daefca64750c1076822bdbd3c409a9519f513 Author: Konstantin Belousov AuthorDate: 2025-02-20 23:32:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-25 07:09:29 +0000 libc/gen: split user-visible opendir()-like functions into separate source files This allows, for instance, to interpose opendir() with an implementation that calls into fdopendir(), without causing multiple symbol definitions when libc is linked in statically. This is aligned with the quality of implementation principle that single object file from a static library should not provide more than one app-visible symbol. [The copyright for fopendir() was copied, it might be refined by the author] Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D49089 --- lib/libc/gen/Makefile.inc | 2 + lib/libc/gen/fdopendir.c | 56 ++++++ lib/libc/gen/opendir.c | 312 +---------------------------- lib/libc/gen/opendir2.c | 340 ++++++++++++++++++++++++++++++++ lib/libc/gen/telldir.h | 1 + libexec/rtld-elf/rtld-libc/Makefile.inc | 2 +- 6 files changed, 401 insertions(+), 312 deletions(-) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 42a359ccfb72..9b92e52cdfad 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -50,6 +50,7 @@ SRCS+= \ exec.c \ exect.c \ fdevname.c \ + fdopendir.c \ feature_present.c \ fmtcheck.c \ fmtmsg.c \ @@ -106,6 +107,7 @@ SRCS+= \ nlist.c \ nrand48.c \ opendir.c \ + opendir2.c \ pause.c \ pmadvise.c \ popen.c \ diff --git a/lib/libc/gen/fdopendir.c b/lib/libc/gen/fdopendir.c new file mode 100644 index 000000000000..67c0766b6d83 --- /dev/null +++ b/lib/libc/gen/fdopendir.c @@ -0,0 +1,56 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "gen-private.h" +#include "telldir.h" + +/* + * Open a directory with existing file descriptor. + */ +DIR * +fdopendir(int fd) +{ + + if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) + return (NULL); + return (__opendir_common(fd, DTF_HIDEW | DTF_NODUP, true)); +} diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index a47725578c33..956c92c321e8 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -43,8 +43,6 @@ #include "gen-private.h" #include "telldir.h" -static DIR * __opendir_common(int, int, bool); - /* * Open a directory. */ @@ -52,313 +50,5 @@ DIR * opendir(const char *name) { - return (__opendir2(name, DTF_HIDEW|DTF_NODUP)); -} - -/* - * Open a directory with existing file descriptor. - */ -DIR * -fdopendir(int fd) -{ - - if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) - return (NULL); - return (__opendir_common(fd, DTF_HIDEW|DTF_NODUP, true)); -} - -DIR * -__opendir2(const char *name, int flags) -{ - int fd; - DIR *dir; - int saved_errno; - - if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) - return (NULL); - if ((fd = _open(name, - O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) - return (NULL); - - dir = __opendir_common(fd, flags, false); - if (dir == NULL) { - saved_errno = errno; - _close(fd); - errno = saved_errno; - } - return (dir); -} - -static int -opendir_compar(const void *p1, const void *p2) -{ - - return (strcmp((*(const struct dirent * const *)p1)->d_name, - (*(const struct dirent * const *)p2)->d_name)); -} - -/* - * For a directory at the top of a unionfs stack, the entire directory's - * contents are read and cached locally until the next call to rewinddir(). - * For the fdopendir() case, the initial seek position must be preserved. - * For rewinddir(), the full directory should always be re-read from the - * beginning. - * - * If an error occurs, the existing buffer and state of 'dirp' is left - * unchanged. - */ -bool -_filldir(DIR *dirp, bool use_current_pos) -{ - struct dirent **dpv; - char *buf, *ddptr, *ddeptr; - off_t pos; - int fd2, incr, len, n, saved_errno, space; - - len = 0; - space = 0; - buf = NULL; - ddptr = NULL; - - /* - * Use the system page size if that is a multiple of DIRBLKSIZ. - * Hopefully this can be a big win someday by allowing page - * trades to user space to be done by _getdirentries(). - */ - incr = getpagesize(); - if ((incr % DIRBLKSIZ) != 0) - incr = DIRBLKSIZ; - - /* - * The strategy here is to read all the directory - * entries into a buffer, sort the buffer, and - * remove duplicate entries by setting the inode - * number to zero. - * - * We reopen the directory because _getdirentries() - * on a MNT_UNION mount modifies the open directory, - * making it refer to the lower directory after the - * upper directory's entries are exhausted. - * This would otherwise break software that uses - * the directory descriptor for fchdir or *at - * functions, such as fts.c. - */ - if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) - return (false); - - if (use_current_pos) { - pos = lseek(dirp->dd_fd, 0, SEEK_CUR); - if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { - saved_errno = errno; - _close(fd2); - errno = saved_errno; - return (false); - } - } - - do { - /* - * Always make at least DIRBLKSIZ bytes - * available to _getdirentries - */ - if (space < DIRBLKSIZ) { - space += incr; - len += incr; - buf = reallocf(buf, len); - if (buf == NULL) { - saved_errno = errno; - _close(fd2); - errno = saved_errno; - return (false); - } - ddptr = buf + (len - space); - } - - n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); - if (n > 0) { - ddptr += n; - space -= n; - } - if (n < 0) { - saved_errno = errno; - _close(fd2); - errno = saved_errno; - return (false); - } - } while (n > 0); - _close(fd2); - - ddeptr = ddptr; - - /* - * There is now a buffer full of (possibly) duplicate - * names. - */ - dirp->dd_buf = buf; - - /* - * Go round this loop twice... - * - * Scan through the buffer, counting entries. - * On the second pass, save pointers to each one. - * Then sort the pointers and remove duplicate names. - */ - for (dpv = NULL;;) { - n = 0; - ddptr = buf; - while (ddptr < ddeptr) { - struct dirent *dp; - - dp = (struct dirent *) ddptr; - if ((long)dp & 03L) - break; - if ((dp->d_reclen <= 0) || - (dp->d_reclen > (ddeptr + 1 - ddptr))) - break; - ddptr += dp->d_reclen; - if (dp->d_fileno) { - if (dpv) - dpv[n] = dp; - n++; - } - } - - if (dpv) { - struct dirent *xp; - - /* - * This sort must be stable. - */ - mergesort(dpv, n, sizeof(*dpv), opendir_compar); - - dpv[n] = NULL; - xp = NULL; - - /* - * Scan through the buffer in sort order, - * zapping the inode number of any - * duplicate names. - */ - for (n = 0; dpv[n]; n++) { - struct dirent *dp = dpv[n]; - - if ((xp == NULL) || - strcmp(dp->d_name, xp->d_name)) { - xp = dp; - } else { - dp->d_fileno = 0; - } - if (dp->d_type == DT_WHT && - (dirp->dd_flags & DTF_HIDEW)) - dp->d_fileno = 0; - } - - free(dpv); - break; - } else { - dpv = malloc((n+1) * sizeof(struct dirent *)); - if (dpv == NULL) - break; - } - } - - dirp->dd_len = len; - dirp->dd_size = ddptr - dirp->dd_buf; - return (true); -} - -static bool -is_unionstack(int fd) -{ - int unionstack; - - unionstack = _fcntl(fd, F_ISUNIONSTACK, 0); - if (unionstack != -1) - return (unionstack); - - /* - * Should not happen unless running on a kernel without the op, - * but no use rendering the system useless in such a case. - */ - return (0); -} - -/* - * Common routine for opendir(3), __opendir2(3) and fdopendir(3). - */ -static DIR * -__opendir_common(int fd, int flags, bool use_current_pos) -{ - DIR *dirp; - int incr; - int saved_errno; - bool unionstack; - - if ((dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) - return (NULL); - - dirp->dd_buf = NULL; - dirp->dd_fd = fd; - dirp->dd_flags = flags; - dirp->dd_loc = 0; - dirp->dd_lock = NULL; - dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); - LIST_INIT(&dirp->dd_td->td_locq); - dirp->dd_td->td_loccnt = 0; - dirp->dd_compat_de = NULL; - - /* - * Use the system page size if that is a multiple of DIRBLKSIZ. - * Hopefully this can be a big win someday by allowing page - * trades to user space to be done by _getdirentries(). - */ - incr = getpagesize(); - if ((incr % DIRBLKSIZ) != 0) - incr = DIRBLKSIZ; - - /* - * Determine whether this directory is the top of a union stack. - */ - unionstack = false; - if (flags & DTF_NODUP) { - unionstack = is_unionstack(fd); - } - - if (unionstack) { - if (!_filldir(dirp, use_current_pos)) - goto fail; - dirp->dd_flags |= __DTF_READALL; - } else { - dirp->dd_len = incr; - dirp->dd_buf = malloc(dirp->dd_len); - if (dirp->dd_buf == NULL) - goto fail; - if (use_current_pos) { - /* - * Read the first batch of directory entries - * to prime dd_seek. This also checks if the - * fd passed to fdopendir() is a directory. - */ - dirp->dd_size = _getdirentries(dirp->dd_fd, - dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); - if (dirp->dd_size < 0) { - if (errno == EINVAL) - errno = ENOTDIR; - goto fail; - } - dirp->dd_flags |= __DTF_SKIPREAD; - } else { - dirp->dd_size = 0; - dirp->dd_seek = 0; - } - } - - return (dirp); - -fail: - saved_errno = errno; - free(dirp->dd_buf); - free(dirp); - errno = saved_errno; - return (NULL); + return (__opendir2(name, DTF_HIDEW | DTF_NODUP)); } diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c new file mode 100644 index 000000000000..30a9030693e4 --- /dev/null +++ b/lib/libc/gen/opendir2.c @@ -0,0 +1,340 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "gen-private.h" +#include "telldir.h" + +DIR * +__opendir2(const char *name, int flags) +{ + int fd; + DIR *dir; + int saved_errno; + + if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) + return (NULL); + if ((fd = _open(name, + O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) + return (NULL); + + dir = __opendir_common(fd, flags, false); + if (dir == NULL) { + saved_errno = errno; + _close(fd); + errno = saved_errno; + } + return (dir); +} + +static int +opendir_compar(const void *p1, const void *p2) +{ + + return (strcmp((*(const struct dirent * const *)p1)->d_name, + (*(const struct dirent * const *)p2)->d_name)); +} + +/* + * For a directory at the top of a unionfs stack, the entire directory's + * contents are read and cached locally until the next call to rewinddir(). + * For the fdopendir() case, the initial seek position must be preserved. + * For rewinddir(), the full directory should always be re-read from the + * beginning. + * + * If an error occurs, the existing buffer and state of 'dirp' is left + * unchanged. + */ +bool +_filldir(DIR *dirp, bool use_current_pos) +{ + struct dirent **dpv; + char *buf, *ddptr, *ddeptr; + off_t pos; + int fd2, incr, len, n, saved_errno, space; + + len = 0; + space = 0; + buf = NULL; + ddptr = NULL; + + /* + * Use the system page size if that is a multiple of DIRBLKSIZ. + * Hopefully this can be a big win someday by allowing page + * trades to user space to be done by _getdirentries(). + */ + incr = getpagesize(); + if ((incr % DIRBLKSIZ) != 0) + incr = DIRBLKSIZ; + + /* + * The strategy here is to read all the directory + * entries into a buffer, sort the buffer, and + * remove duplicate entries by setting the inode + * number to zero. + * + * We reopen the directory because _getdirentries() + * on a MNT_UNION mount modifies the open directory, + * making it refer to the lower directory after the + * upper directory's entries are exhausted. + * This would otherwise break software that uses + * the directory descriptor for fchdir or *at + * functions, such as fts.c. + */ + if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) + return (false); + + if (use_current_pos) { + pos = lseek(dirp->dd_fd, 0, SEEK_CUR); + if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } + + do { + /* + * Always make at least DIRBLKSIZ bytes + * available to _getdirentries + */ + if (space < DIRBLKSIZ) { + space += incr; + len += incr; + buf = reallocf(buf, len); + if (buf == NULL) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + ddptr = buf + (len - space); + } + + n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); + if (n > 0) { + ddptr += n; + space -= n; + } + if (n < 0) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } while (n > 0); + _close(fd2); + + ddeptr = ddptr; + + /* + * There is now a buffer full of (possibly) duplicate + * names. + */ + dirp->dd_buf = buf; + + /* + * Go round this loop twice... + * + * Scan through the buffer, counting entries. + * On the second pass, save pointers to each one. + * Then sort the pointers and remove duplicate names. + */ + for (dpv = NULL;;) { + n = 0; + ddptr = buf; + while (ddptr < ddeptr) { + struct dirent *dp; + + dp = (struct dirent *) ddptr; + if ((long)dp & 03L) + break; + if ((dp->d_reclen <= 0) || + (dp->d_reclen > (ddeptr + 1 - ddptr))) + break; + ddptr += dp->d_reclen; + if (dp->d_fileno) { + if (dpv) + dpv[n] = dp; + n++; + } + } + + if (dpv) { + struct dirent *xp; + + /* + * This sort must be stable. + */ + mergesort(dpv, n, sizeof(*dpv), opendir_compar); + + dpv[n] = NULL; + xp = NULL; + + /* + * Scan through the buffer in sort order, + * zapping the inode number of any + * duplicate names. + */ + for (n = 0; dpv[n]; n++) { + struct dirent *dp = dpv[n]; + + if ((xp == NULL) || + strcmp(dp->d_name, xp->d_name)) { + xp = dp; + } else { + dp->d_fileno = 0; + } + if (dp->d_type == DT_WHT && + (dirp->dd_flags & DTF_HIDEW)) + dp->d_fileno = 0; + } + + free(dpv); + break; + } else { + dpv = malloc((n+1) * sizeof(struct dirent *)); + if (dpv == NULL) + break; + } + } + + dirp->dd_len = len; + dirp->dd_size = ddptr - dirp->dd_buf; + return (true); +} + +static bool +is_unionstack(int fd) +{ + int unionstack; + + unionstack = _fcntl(fd, F_ISUNIONSTACK, 0); + if (unionstack != -1) + return (unionstack); + + /* + * Should not happen unless running on a kernel without the op, + * but no use rendering the system useless in such a case. + */ + return (0); +} + +/* + * Common routine for opendir(3), __opendir2(3) and fdopendir(3). + */ +DIR * +__opendir_common(int fd, int flags, bool use_current_pos) +{ + DIR *dirp; + int incr; + int saved_errno; + bool unionstack; + + if ((dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) + return (NULL); + + dirp->dd_buf = NULL; + dirp->dd_fd = fd; + dirp->dd_flags = flags; + dirp->dd_loc = 0; + dirp->dd_lock = NULL; + dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); + LIST_INIT(&dirp->dd_td->td_locq); + dirp->dd_td->td_loccnt = 0; + dirp->dd_compat_de = NULL; + + /* + * Use the system page size if that is a multiple of DIRBLKSIZ. + * Hopefully this can be a big win someday by allowing page + * trades to user space to be done by _getdirentries(). + */ + incr = getpagesize(); + if ((incr % DIRBLKSIZ) != 0) + incr = DIRBLKSIZ; + + /* + * Determine whether this directory is the top of a union stack. + */ + unionstack = false; + if (flags & DTF_NODUP) { + unionstack = is_unionstack(fd); + } + + if (unionstack) { + if (!_filldir(dirp, use_current_pos)) + goto fail; + dirp->dd_flags |= __DTF_READALL; + } else { + dirp->dd_len = incr; + dirp->dd_buf = malloc(dirp->dd_len); + if (dirp->dd_buf == NULL) + goto fail; + if (use_current_pos) { + /* + * Read the first batch of directory entries + * to prime dd_seek. This also checks if the + * fd passed to fdopendir() is a directory. + */ + dirp->dd_size = _getdirentries(dirp->dd_fd, + dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); + if (dirp->dd_size < 0) { + if (errno == EINVAL) + errno = ENOTDIR; + goto fail; + } + dirp->dd_flags |= __DTF_SKIPREAD; + } else { + dirp->dd_size = 0; + dirp->dd_seek = 0; + } + } + + return (dirp); + +fail: + saved_errno = errno; + free(dirp->dd_buf); + free(dirp); + errno = saved_errno; + return (NULL); +} diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h index aafa6ac71b1e..6d113491e819 100644 --- a/lib/libc/gen/telldir.h +++ b/lib/libc/gen/telldir.h @@ -103,6 +103,7 @@ struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); void _fixtelldir(DIR *dirp, long oldseek, long oldloc); +DIR *__opendir_common(int, int, bool); #define RDU_SKIP 0x0001 #define RDU_SHORT 0x0002 diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 14f31f05829d..79d68a1e803c 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -17,7 +17,7 @@ CFLAGS+= -I${SRCTOP}/libexec/rtld-elf/rtld-libc # redirects all calls to interposed functions to use the non-interposed version # instead. .PATH: ${LIBC_SRCTOP}/gen -SRCS+= opendir.c closedir.c readdir.c telldir.c +SRCS+= fdopendir.c opendir.c opendir2.c closedir.c readdir.c telldir.c # Avoid further dependencies by providing simple implementations of libc # functions such as __error(), etc. From nobody Tue Feb 25 07:20:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z28Bq4ZT8z5pD1l; Tue, 25 Feb 2025 07:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z28Bq3YFWz3CKl; Tue, 25 Feb 2025 07:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740468019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U7daj8XbgpAjqDm9py65RIOYB//TbaJcbYXNCNEV6wY=; b=appdcqChe/SnDr3A/TPviU+SO+ZppvXOWp9EenOWXBYaapq9xXyFFI2L9iQXnrqTx93zhw dh77Wxzf/Be6F1Irer8DKJKR45BxCkLZGgsfwTIqmHP3cvtyaD1Od3ZCshCCXu9fwF7gsb QaSeOabKDSNVIBOdeK0Fl/FqWaDnDLBR6om9jRuiHZh7xXXdNNd4HoZLrrjQt1VY3zBkFX WLL+QV3R6wmpoxirhYOvMU1eqmEb5HeQv511yVDnKPCqqbJHEQqJgOG/g0/bxIeCO/gxn/ sOEFPklH/JmjEf52jG+hyB4dADnNhliZ7WnzEStJNFig0YSQzJSIjh02bTDNeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740468019; a=rsa-sha256; cv=none; b=kzLBs6pKA98UMfIOX3yutdybQLNTOJsWX1/KK6497mvTJotCmNZWgkUwOuC5ZKRpGlrroy PhPtnVxZR3UDGLZnlluKMZ/lRHmDkalDqSAKk8+el5FvAM4Vy6IDxZ9yiQJDJ7OVgDBm1T JzBPcQbGi73QcuXkcvtevSUgwIe8QU/UWJYxk/dwV95fEelIqWXtYw5USWx7629GV8oJIf RGHnNetCUPIZOiOiM1A15tRZH6DM8Wv8UgnF/fOaD2QBM54/W66IcFPljIc8UIw5TDY9vO WggvXkKHUfgznMxLuOBqIjl26NjVcZqr/Wn/E/TrASG3ysHw0Yl3Az+iW/Dytg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740468019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U7daj8XbgpAjqDm9py65RIOYB//TbaJcbYXNCNEV6wY=; b=Wt7MKDMVO5nzKkNYYUBPl3GILVPsdzD/oiPPfLQQZx2SImlRoqWYZer+sQUl/q6Nqg2IVA 8WR34eE6mVzD2SKYO37ed2MMESBXpv9Eid3i0gc+3KLgMkF1giDHpAyM9/osZyWqYzqwA8 jwJ5tKlKpP3oQn/o6KMdtm5M40LNdf57psuWRBxqcvvUHoNmQPBJXRXEQJU914JqdsgLYH rX60ximZizLDviBIeIRFOhaipqAzZOIhJJwgX5pBWl1m9Aemct8YCL7UbDqBlf+UTQZW2j kycO8ynm4h97Bq/PT4RaIjN0wUeentAy/7kHfJbpxU3ZnBngjLT+8XPkFHOOKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z28Bq38h8z2C2; Tue, 25 Feb 2025 07:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P7KJL3056051; Tue, 25 Feb 2025 07:20:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P7KJkI056048; Tue, 25 Feb 2025 07:20:19 GMT (envelope-from git) Date: Tue, 25 Feb 2025 07:20:19 GMT Message-Id: <202502250720.51P7KJkI056048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e59991206b14 - main - fts(3): be less strict when automount does its job under us walking autofs mount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e59991206b1463b7e85cc8aafde7f1dc03fcedcf Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e59991206b1463b7e85cc8aafde7f1dc03fcedcf commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf Author: Konstantin Belousov AuthorDate: 2025-02-21 13:07:43 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-25 07:09:29 +0000 fts(3): be less strict when automount does its job under us walking autofs mount Namely, allow the file id change if the resulting file belongs to automounted filesystem. If it is, remember the updated id. This allows the ids from the automounted volumes to change without restrictions, might be a further refinement would be to only allow such inconsistency once. PR: 284914 Reported and tested by: Lexi Winter Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D49094 --- lib/libc/gen/fts.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index 770a7b2cc322..bd193c7c6cfc 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) { int ret, oerrno, newfd; struct stat sb; + struct statfs sf; newfd = fd; if (ISSET(FTS_NOCHDIR)) @@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) goto bail; } if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) { - errno = ENOENT; /* disinformation */ - ret = -1; - goto bail; + if (_fstatfs(newfd, &sf) != 0 || + (sf.f_flags & MNT_AUTOMOUNTED) == 0) { + errno = ENOENT; /* disinformation */ + ret = -1; + goto bail; + } + /* autofs might did the mount under us, accept. */ + p->fts_dev = sb.st_dev; + p->fts_ino == sb.st_ino; } ret = fchdir(newfd); bail: From nobody Tue Feb 25 07:22:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z28Ft5TWkz5pDMD; Tue, 25 Feb 2025 07:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z28Ft1h4gz3GGg; Tue, 25 Feb 2025 07:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740468178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T4GKiYFoasKe40Vfg9pq2mVKrl88Yg3bgkCgnNjLv5I=; b=yrl4amxX1cPULjgFYIoeJJl/mswmo4q8UFcWveM9u+ovnNLTNaRPgaeHZcc9odqsRXpjSQ CJF8l88EH5QVoV+3Zyndq1MHAr8Y9ym6nRp24sILNq+KyHtTyREgYrhcMjVNoXe9dWfIgH obh2Bnpw5/T/5x6KDucirpeZ2A1yOkWY1kiZsLW4n8ILZNylwsqhCGhg1xj75yF04CSiKe CLVS94mh0+MVHdmPqP5zP9Mkxr8ClbaGOEutSWwutIXNjLisB1/EC1CYBk6KgIQYEPp61n xj5IWur3+KrgFWpgeYoeoIfdp4h97jLTzlywd/Y9vS3xKWkuCJy9jc2iN7BwIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740468178; a=rsa-sha256; cv=none; b=U0A9y/9ECPmKyNFPjpRyLypbeJQ/viu59Txpoa4WfOHGJD9GnB2H5cCT77kkvr5kR9aja6 tKfDyOPF4Wks8NaHC+a8ASqaUd7vb2RsIJV1yIHzPXh5C2Fdzonds9dc2IRCTWiHnLfsxo MWcq+gIG25icGPzrzg0jDizZnEds2Fek3nu/dJ/hoRssC1yUwjWb3YU1OfW7Ew1Wf0zYdv xDluw0uxKdqhf/sOcq4JWSMTKdnGA8PXA5DNQlOu/RqiR6H5ebCXtG6t1yoZa1xCz5YSDM Nsp0ksuksGxsfJax7el8yBScDEPaPVqN1B+ZkwTxVKdy5u45FxYgJNvLm8aBcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740468178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T4GKiYFoasKe40Vfg9pq2mVKrl88Yg3bgkCgnNjLv5I=; b=ICsPj5BPunEGoPqxeWK0mliPltQKfDA+eGKqMIWWpw3C1/DYpvulAgPksq+ZNr+a3AEK1R JDuqJGWt1cx8Ey1YyFyYuwSbAv/Xiog4pWtblCV2i8lfCuVe/lPn4LeJyeb/MUVP2m1O8Z CHJwwLuMLPCmDIFGFoxaco/hWQk7o3BPe5CHtB5jJmFOyou6KOcKMcAg43fQ+co9p/eygd rjraE0RAwHrpdRFbLhoiDsz8gOBVZOgPVMFCqeyDsLAYQXhfcLi2T5v3vMPQJGdiHw7w57 xP2LOUadBZD/IrV9CuQohyqXG4LJkFR3OdtZ3rMyCo1Vt8PnvjWGWRPliPIMsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z28Ft12pJz1Rc; Tue, 25 Feb 2025 07:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P7MwvB064436; Tue, 25 Feb 2025 07:22:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P7Mwnr064433; Tue, 25 Feb 2025 07:22:58 GMT (envelope-from git) Date: Tue, 25 Feb 2025 07:22:58 GMT Message-Id: <202502250722.51P7Mwnr064433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 93b4a5445658 - main - netgraph: prevent panic with INVARIANTS-enabled kernel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93b4a54456589e78dcd37f2db8333baff3f3f0b2 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=93b4a54456589e78dcd37f2db8333baff3f3f0b2 commit 93b4a54456589e78dcd37f2db8333baff3f3f0b2 Author: Eugene Grosbein AuthorDate: 2025-02-25 07:18:29 +0000 Commit: Eugene Grosbein CommitDate: 2025-02-25 07:22:53 +0000 netgraph: prevent panic with INVARIANTS-enabled kernel This change makes NG_ABI_VERSION depend on INVARIANTS in addition to NETGRAPH_DEBUG. PR: 257876 MFC-after: 2 weeks --- sys/netgraph/netgraph.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index e83f61d3f60b..10db352e0fa2 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -69,11 +69,20 @@ * modules. */ #define _NG_ABI_VERSION 12 -#ifdef NETGRAPH_DEBUG /*----------------------------------------------*/ -#define NG_ABI_VERSION (_NG_ABI_VERSION + 0x10000) -#else /* NETGRAPH_DEBUG */ /*----------------------------------------------*/ -#define NG_ABI_VERSION _NG_ABI_VERSION -#endif /* NETGRAPH_DEBUG */ /*----------------------------------------------*/ + +#ifdef NETGRAPH_DEBUG +#define _NG_ABI_PREFIX1 0x10000 +#else +#define _NG_ABI_PREFIX1 0 +#endif + +#ifdef INVARIANTS +#define _NG_ABI_PREFIX2 0x20000 +#else +#define _NG_ABI_PREFIX2 0 +#endif + +#define NG_ABI_VERSION (_NG_ABI_PREFIX1 + _NG_ABI_PREFIX2 + _NG_ABI_VERSION) /* * Forward references for the basic structures so we can From nobody Tue Feb 25 07:59:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z294X2JZHz5pHkg; Tue, 25 Feb 2025 07:59:56 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z294X1g7Gz3jgG; Tue, 25 Feb 2025 07:59:56 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740470396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mSEx2eb3TXQUSLjSzZ5tA+jkdfYsRKYHQy/PRC5AKC8=; b=CS8LX4ZpqJi5CdRr2AJcZYnIW7CeB11/OuR399HkSXavD3dCADk8K8b9Y1lso2AyxPuZS1 +lldBg54siIXB1vHlah7VCIhU9U26zc/L/UOOs5for0aTd5KpVU5bWASoIfHiJzzUs3Ygi pKof+eqJt5i08YKAkVenq3oxZHvG9myo5CYw1cX/dPCzV5VlpUEc3/Ad6ninGE5twd7J+Q uEFOKgspp98r3qgKy+f+0nhFeCbCQTwmFsq2l/3X4tNoB4soroKSL8yndNlBq2zdBAR/SC ndACKZNgttQ110Ay7Bc5s8Cza4QsQ0l32oQhKu+dCRG0tgmnpnzpJWGdX2sGTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740470396; a=rsa-sha256; cv=none; b=QgyoM0rB2gxxX/iyR51ONHoPEKPTVf4w85Lo+1Zk2FJoTKfP0btd4rIJiXOWSJZqUEQEAH uK3dMoiqUibns/mCQUod1mukOYLd8BLHCLz+4I0m+p1hvGzWxfJNWFqGLBaK7m6Zt3aDbi MAOCoiBTMwTbM6x895MTCp9bGh6QcmeMlhc1lnVmf2aMFZu5k7w3jjqYz8OX5ybvM/W8PC SmVtPl4SV52O5Gr9iLtimrti6JLAcn5omw01/B+qfuN6FBDVQZhbM0PlOQb+ssb2qtm1Wx 6Ox9p/n8llR8z623uWJmMhYFrRcCKVH8GRglz8W7BBuTla2GPj9HPppirHBKEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740470396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mSEx2eb3TXQUSLjSzZ5tA+jkdfYsRKYHQy/PRC5AKC8=; b=MGsv+58Lla1ijBu+EbLfKzanfmRFfVeFqHGvM/hFLbeYDG31BSE/uoRTNU60hBWZwZDbWH nMzpUv78aoohOhlxUhz5qHjTRIvNerCOXfKiLIyf0NsC6IlSQPnKZWbYgcRyGg9WSvU8+e SQn1keL2Et0VJ0eQSXwuewuN1MYzFXzGJE/kR5C2tf2bJAkmG8pGU+4iUDtn6ClCZBlmH6 PiKxZ8/548mBI58fqL6eCBBYWx/vY+325jFa+FccinrClWMnZa0eh4u+MftBFSzsKVUkfs n3Y1FOW8y7ARlRwxoABa9h1lPdTXB+1C3KZqLPUw4uL1Jxrnp5SwmzE/GEpWcQ== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z294V4TBTz1C6l; Tue, 25 Feb 2025 07:59:54 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: 93b4a5445658 - main - netgraph: prevent panic with INVARIANTS-enabled kernel From: Zhenlei Huang In-Reply-To: <202502250722.51P7Mwnr064433@gitrepo.freebsd.org> Date: Tue, 25 Feb 2025 15:59:47 +0800 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202502250722.51P7Mwnr064433@gitrepo.freebsd.org> To: Eugene Grosbein X-Mailer: Apple Mail (2.3696.120.41.1.10) > On Feb 25, 2025, at 3:22 PM, Eugene Grosbein = wrote: >=20 > The branch main has been updated by eugen: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D93b4a54456589e78dcd37f2db8333baf= f3f3f0b2 >=20 > commit 93b4a54456589e78dcd37f2db8333baff3f3f0b2 > Author: Eugene Grosbein > AuthorDate: 2025-02-25 07:18:29 +0000 > Commit: Eugene Grosbein > CommitDate: 2025-02-25 07:22:53 +0000 >=20 > netgraph: prevent panic with INVARIANTS-enabled kernel >=20 > This change makes NG_ABI_VERSION depend on INVARIANTS > in addition to NETGRAPH_DEBUG. >=20 > PR: 257876 Maybe a wrong PR ? The PR 257876 is about port math/deal.ii , I do not see any relationship = between it and netgraph(3) or netgraph(4). Best regards, Zhenlei > MFC-after: 2 weeks > --- > sys/netgraph/netgraph.h | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) >=20 > diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h > index e83f61d3f60b..10db352e0fa2 100644 > --- a/sys/netgraph/netgraph.h > +++ b/sys/netgraph/netgraph.h > @@ -69,11 +69,20 @@ > * modules. > */ > #define _NG_ABI_VERSION 12 > -#ifdef NETGRAPH_DEBUG = /*----------------------------------------------*/ > -#define NG_ABI_VERSION (_NG_ABI_VERSION + 0x10000) > -#else /* NETGRAPH_DEBUG */ = /*----------------------------------------------*/ > -#define NG_ABI_VERSION _NG_ABI_VERSION > -#endif /* NETGRAPH_DEBUG */ = /*----------------------------------------------*/ > + > +#ifdef NETGRAPH_DEBUG > +#define _NG_ABI_PREFIX1 0x10000 > +#else > +#define _NG_ABI_PREFIX1 0 > +#endif > + > +#ifdef INVARIANTS > +#define _NG_ABI_PREFIX2 0x20000 > +#else > +#define _NG_ABI_PREFIX2 0 > +#endif > + > +#define NG_ABI_VERSION (_NG_ABI_PREFIX1 + _NG_ABI_PREFIX2 + = _NG_ABI_VERSION) >=20 > /* > * Forward references for the basic structures so we can From eugen@freebsd.org Tue Feb 25 09:37:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2CF81Q6yz5pVwF for ; Tue, 25 Feb 2025 09:37:32 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from mail.rdtc.ru (ns3.rdtc.ru [62.231.190.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2CF71HjBz3ZV6 for ; Tue, 25 Feb 2025 09:37:31 +0000 (UTC) (envelope-from eugen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail.rdtc.ru (RDTC Post Office Server, from userid 1000) id CF3DE1D00C; Tue, 25 Feb 2025 16:37:13 +0700 (+07) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [62.231.161.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: egrosbein@rdtc.ru) by mail.rdtc.ru (RDTC Post Office Server) with ESMTPSA id 1AA001CFBB; Tue, 25 Feb 2025 16:37:07 +0700 (+07) X-Envelope-From: eugen@freebsd.org X-Envelope-To: zlei@FreeBSD.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.18.1/8.18.1) with ESMTPS id 51P9b33X054584 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 25 Feb 2025 16:37:04 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: git: 93b4a5445658 - main - netgraph: prevent panic with INVARIANTS-enabled kernel To: Zhenlei Huang References: <202502250722.51P7Mwnr064433@gitrepo.freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , "Herbert J. Skuhra" From: Eugene Grosbein Message-ID: Date: Tue, 25 Feb 2025 16:37:02 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.1 required=5.0 tests=DATE_IN_FUTURE_96_Q, NICE_REPLY_A,SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.0 X-Spam-Report: * 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) * 2.0 DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: date * -0.8 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on eg.sd.rdtc.ru X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:29072, ipnet:62.231.184.0/21, country:RU] X-Rspamd-Queue-Id: 4Z2CF71HjBz3ZV6 X-Spamd-Bar: ---- 25.02.2025 14:59, Zhenlei Huang wrote: >> commit 93b4a54456589e78dcd37f2db8333baff3f3f0b2 >> Author: Eugene Grosbein >> AuthorDate: 2025-02-25 07:18:29 +0000 >> Commit: Eugene Grosbein >> CommitDate: 2025-02-25 07:22:53 +0000 >> >> netgraph: prevent panic with INVARIANTS-enabled kernel >> >> This change makes NG_ABI_VERSION depend on INVARIANTS >> in addition to NETGRAPH_DEBUG. >> >> PR: 257876 > > Maybe a wrong PR ? > > The PR 257876 is about port math/deal.ii , I do not see any relationship between it and netgraph(3) or netgraph(4). Sorry, paste error. Right number is 214624. From nobody Tue Feb 25 10:04:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2Cr31tf6z5pY4f; Tue, 25 Feb 2025 10:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Cr318HZz3plD; Tue, 25 Feb 2025 10:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740477859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9EfajY7m508vlCQXzftJ2J9AAV5iu7VDe/r+x9aNNno=; b=G9ZsK9VsAOqINvSnJbIujyITQtdlKLang7KjutRlm4Bg6+lqoM4M7VwAz64Yxj6TPSpXTA GocCvJQL/op0NSJcHfClo/7f3E06jb1t7P1kusolOMU66EtEKqoen2PzwT+LXKj1sE8iEY 1jDVa0f3v8XlR2ooISlclbFGic/6Z/EMrZ3bGheDE8dMYHmpoA1+h7PoCzcS9KhyTb2AwD P2dgY1SX0C/V5CV+8E82QK3v696fhD8PuTtJMPZaVXhuVFyJ8N+K+w/AYz/Sw4yy1kMgg6 TBzxfEpXP8eB7yaHsN0GwLHsQRCrIMqPUlr3iiPlkY+A0/5aIMFSOYA/OEy0KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740477859; a=rsa-sha256; cv=none; b=BaGS3lM7srdUTx5KYt8D64TQE++Rs2E4qegYfxOe9csZG7UIEY2Jctsd64m9Hey5+L5xcC 4zqyXemJbcuYvJz4mxdtvL4bwwfrBLI2JS5RHg4MVoS/fMosFJ7GXZ4ZnuldchbQ6Xgb+1 EKV9UUiBkWp1FU+D5r1p7D56K2pww2AIlGCMfzbDbMno9pvQll2wrPsTMB4IDxnlI2wrmx XM004IMyMhCAXQBPn2Rv/vRw2BfnrPOS/iGb10CotltyMge/KVFzf93Q2YAOCa47ViVD+7 kRM8p5ryZLwNY2Nl0J+UKMzJUZ3PbsDujorzoCVxYLOPMzSzUSANiv/S0N75lA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740477859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9EfajY7m508vlCQXzftJ2J9AAV5iu7VDe/r+x9aNNno=; b=TizRA4ywX8bVpfnJ2X9NRxa2PKnG4ohO0ZVy8Jmq3xcqh/dlYE+rmVOBsm21Kj7g+wPFH0 vk/og+fAfRm/m4Y1lh4DwX44TD72iWyXicpMx5hztv/1fV+C/QTUQW5MBZnjmr7I15f+8M OHGSqjbKM0EsxUp7xYrRSi5mU+OtW8J1ZcFQj8+r569oUFlwVdej+LMGIWwfPQ33Fbvo6S WkhE+VhBZ/FwIB7vZPDlGQiovh9FtL6s0Au1ISV/s80SJZnYKuYQNWpjceEx+sT1koRPCo SLE1w1Sdki3aHkkXCO335Pj/7sIU4H+pF+rDTRiX8M02lbcP0Cw/kJsB6mWrXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2Cr30JyYz6Pm; Tue, 25 Feb 2025 10:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PA4IkB064237; Tue, 25 Feb 2025 10:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PA4I6h064234; Tue, 25 Feb 2025 10:04:18 GMT (envelope-from git) Date: Tue, 25 Feb 2025 10:04:18 GMT Message-Id: <202502251004.51PA4I6h064234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9bdb3272f753 - main - pf tests: remove stray debug log line List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bdb3272f75346e53e67007fbf84fad6e9815e11 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9bdb3272f75346e53e67007fbf84fad6e9815e11 commit 9bdb3272f75346e53e67007fbf84fad6e9815e11 Author: Kristof Provost AuthorDate: 2025-02-21 12:54:58 +0000 Commit: Kristof Provost CommitDate: 2025-02-25 08:32:33 +0000 pf tests: remove stray debug log line Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/nat64.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 68d9191cacb9..6227da01fccf 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -501,7 +501,6 @@ table_range_cleanup() table_common_body() { pool_type=$1 -echo pool_type=${pool_type} pft_init From nobody Tue Feb 25 10:04:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2Cr41jgLz5pY4l; Tue, 25 Feb 2025 10:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Cr40XYqz3pnj; Tue, 25 Feb 2025 10:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740477860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f3XPLXM9DOiYC7VuFf0GfDOIZPPiM9xdstSfbeJ89U=; b=Cy4iMJZ+mdBWB1Jua6BbircowZXclNCa48HupgSVBDOQPHfDpgRlzs1dwcRladcuohlEgh JqI4nj0EbpgKDT/fHuNlTTdhLMPa5Rq3IhwvttlT9Z90J3URhamOMpeUOpshmdz+TdG32z +aKXT0t62+CUqUiQq+jfV87cTRzM3Cd4rasJfUNt0bPPoWPnTZYh+DPKZ6zvmypiz3CzYl oKEGWJzdc8SAT1cJgLtKRLEzLkfzz3ekq7Jy1cG76CHOyCdwUA4XFKxHQb/C2jDijcYj+r gizCad17/mKHETze1KVg4RUBL2v3Jsipo1vvBajFawA/SVv0ym5PjFpfZmNYjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740477860; a=rsa-sha256; cv=none; b=dWIFljhMKP+r5VVi4twd1v7hDOd9cTh5eTEC6dyi+F8fDyEe1kUrT5lxod5fbYXQAlpiSG oJNETW0rtfLQZfKZ7ql8MbEh/+8+THJ377e7B7Vgeq+4G2KKH16OvTc3idyBV5RKROCLlI ngNACFzKpbz+SKTK/Lt041m5nCTrvYVUEfWaDWAX3bRPSxRPSVarnQgjGQhEemX3Gilwyz Mjgm2DTaGFcVsVETSzTK1nMl9cwSyDILzMhdnhvmscGfdVlWJJ42qakd0UItRonga2D8zL BpoabDFUdy7Wr7XA5FOxm67IjazSSRD5ts7WOXnfCdQZoMlBh1SROS4VpsSNPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740477860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f3XPLXM9DOiYC7VuFf0GfDOIZPPiM9xdstSfbeJ89U=; b=CVSIvH3xZWtINP556/V8EY69CmmIaUw6zaTQBQ01dwVC45jdecRKbh8BTMpe5692NxvvJm oI4yR2IqkLJdRjB/2vJJbOeKATUqvxupZQlmCOYlJQ368ooJtxP+JIRZ/NtunJ/3Yf3EVA o77vzFPoqDFsNSzsnsK44VQpqtxhLAyed0YKJ0dGF0uEREqchcgygPdN0h/JbDudH7rfor ubyTCyh7+0EncwZnfZepKcrrrub18qyzR6T4WpAzTpGqVI8KbO1p77y/3Q6fJIz7Oa9W5m +vaohHP+Uxgz3Wb7nmHtkteybrf3H2ypxl6/rtj6qXPbTuswDwwEldJO6+3HuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2Cr403Nqz6jK; Tue, 25 Feb 2025 10:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PA4Jj5064270; Tue, 25 Feb 2025 10:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PA4Jb3064267; Tue, 25 Feb 2025 10:04:19 GMT (envelope-from git) Date: Tue, 25 Feb 2025 10:04:19 GMT Message-Id: <202502251004.51PA4Jb3064267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 41265f65a549 - main - pf: cope with IPv6 gateways for an IPv4 route in nat64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41265f65a549d919363e322a39cbf3ce034c5de9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=41265f65a549d919363e322a39cbf3ce034c5de9 commit 41265f65a549d919363e322a39cbf3ce034c5de9 Author: Kristof Provost AuthorDate: 2025-02-21 15:49:45 +0000 Commit: Kristof Provost CommitDate: 2025-02-25 08:32:34 +0000 pf: cope with IPv6 gateways for an IPv4 route in nat64 It's possible for an IPv4 next hop to be specified as an IPv6 address. This broke pf's route lookup in pf_route(), which is required for nat64. Handle this case just like ip_tryforward(): use the struct sockaddr from the struct nhop_object, and mark a struct route to indicate if_output() has to use the gateway. Add a test case for this. PR: 284946 Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D49095 --- sys/netpfil/pf/pf.c | 40 +++++++++++++++------------- tests/sys/netpfil/pf/nat64.sh | 62 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 19 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 15d9697c0040..f3c9ea7a2fb1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -337,7 +337,7 @@ static int pf_dummynet(struct pf_pdesc *, struct pf_kstate *, struct pf_krule *, struct mbuf **); static int pf_dummynet_route(struct pf_pdesc *, struct pf_kstate *, struct pf_krule *, - struct ifnet *, struct sockaddr *, struct mbuf **); + struct ifnet *, const struct sockaddr *, struct mbuf **); static int pf_test_eth_rule(int, struct pfi_kkif *, struct mbuf **); static int pf_test_rule(struct pf_krule **, struct pf_kstate **, @@ -8665,7 +8665,9 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, struct pf_kstate *s, struct pf_pdesc *pd, struct inpcb *inp) { struct mbuf *m0, *m1, *md; - struct sockaddr_in dst; + struct route ro; + const struct sockaddr *gw = &ro.ro_dst; + struct sockaddr_in *dst; struct ip *ip; struct ifnet *ifp = NULL; int error = 0; @@ -8754,11 +8756,11 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, ip = mtod(m0, struct ip *); - bzero(&dst, sizeof(dst)); - dst.sin_family = AF_INET; - dst.sin_len = sizeof(dst); - dst.sin_addr = ip->ip_dst; - dst.sin_addr.s_addr = pd->act.rt_addr.v4.s_addr; + bzero(&ro, sizeof(ro)); + dst = (struct sockaddr_in *)&ro.ro_dst; + dst->sin_family = AF_INET; + dst->sin_len = sizeof(struct sockaddr_in); + dst->sin_addr.s_addr = pd->act.rt_addr.v4.s_addr; if (s != NULL){ if (ifp == NULL && (pd->af != pd->naf)) { @@ -8769,10 +8771,12 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, ifp = nh->nh_ifp; /* Use the gateway if needed. */ - if (nh->nh_flags & NHF_GATEWAY) - dst.sin_addr = nh->gw4_sa.sin_addr; - else - dst.sin_addr = ip->ip_dst; + if (nh->nh_flags & NHF_GATEWAY) { + gw = &nh->gw_sa; + ro.ro_flags |= RT_HAS_GW; + } else { + dst->sin_addr = ip->ip_dst; + } /* * Bind to the correct interface if we're @@ -8873,9 +8877,9 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, m_clrprotoflags(m0); /* Avoid confusing lower layers. */ md = m0; - error = pf_dummynet_route(pd, s, r, ifp, sintosa(&dst), &md); + error = pf_dummynet_route(pd, s, r, ifp, gw, &md); if (md != NULL) { - error = (*ifp->if_output)(ifp, md, sintosa(&dst), NULL); + error = (*ifp->if_output)(ifp, md, gw, &ro); SDT_PROBE2(pf, ip, route_to, output, ifp, error); } goto done; @@ -8915,10 +8919,9 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, md = m0; pd->pf_mtag = pf_find_mtag(md); error = pf_dummynet_route(pd, s, r, ifp, - sintosa(&dst), &md); + gw, &md); if (md != NULL) { - error = (*ifp->if_output)(ifp, md, - sintosa(&dst), NULL); + error = (*ifp->if_output)(ifp, md, gw, &ro); SDT_PROBE2(pf, ip, route_to, output, ifp, error); } } else @@ -9038,7 +9041,6 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, bzero(&dst, sizeof(dst)); dst.sin6_family = AF_INET6; dst.sin6_len = sizeof(dst); - dst.sin6_addr = ip6->ip6_dst; PF_ACPY((struct pf_addr *)&dst.sin6_addr, &pd->act.rt_addr, AF_INET6); if (s != NULL) { @@ -9442,7 +9444,7 @@ pf_dummynet(struct pf_pdesc *pd, struct pf_kstate *s, static int pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, - struct pf_krule *r, struct ifnet *ifp, struct sockaddr *sa, + struct pf_krule *r, struct ifnet *ifp, const struct sockaddr *sa, struct mbuf **m0) { struct ip_fw_args dnflow; @@ -9473,7 +9475,7 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, MPASS(sa != NULL); - switch (pd->naf) { + switch (sa->sa_family) { case AF_INET: memcpy(&pd->pf_mtag->dst, sa, sizeof(struct sockaddr_in)); diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 6227da01fccf..94c6c5fd8c8f 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -799,6 +799,67 @@ reply_to_cleanup() pft_cleanup } +atf_test_case "v6_gateway" "cleanup" +v6_gateway_head() +{ + atf_set descr 'nat64 when the IPv4 gateway is given by an IPv6 address' + atf_set require.user root +} + +v6_gateway_body() +{ + pft_init + + epair_wan_two=$(vnet_mkepair) + epair_wan_one=$(vnet_mkepair) + epair_lan=$(vnet_mkepair) + + ifconfig ${epair_lan}a inet6 2001:db8::2/64 up no_dad + route -6 add default 2001:db8::1 + + vnet_mkjail rtr ${epair_lan}b ${epair_wan_one}a + jexec rtr ifconfig ${epair_lan}b inet6 2001:db8::1/64 up no_dad + jexec rtr ifconfig ${epair_wan_one}a 192.0.2.1/24 up + jexec rtr ifconfig ${epair_wan_one}a inet6 -ifdisabled + jexec rtr route add default -inet6 fe80::1%${epair_wan_one}a + #jexec rtr route add default 192.0.2.2 + + vnet_mkjail wan_one ${epair_wan_one}b ${epair_wan_two}a + jexec wan_one ifconfig ${epair_wan_one}b 192.0.2.2/24 up + jexec wan_one ifconfig ${epair_wan_one}b inet6 fe80::1/64 + jexec wan_one ifconfig ${epair_wan_two}a 198.51.100.2/24 up + jexec wan_one route add default 192.0.2.1 + jexec wan_one sysctl net.inet.ip.forwarding=1 + + vnet_mkjail wan_two ${epair_wan_two}b + jexec wan_two ifconfig ${epair_wan_two}b 198.51.100.1/24 up + jexec wan_two route add default 198.51.100.2 + + # Sanity checks + atf_check -s exit:0 -o ignore \ + ping6 -c 1 2001:db8::1 + atf_check -s exit:0 -o ignore \ + jexec rtr ping -c 1 192.0.2.2 + atf_check -s exit:0 -o ignore \ + jexec rtr ping -c 1 198.51.100.1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "pass in on ${epair_lan}b inet6 from any to 64:ff9b::/96 af-to inet from (${epair_wan_one}a)" + + atf_check -s exit:0 -o ignore \ + ping6 -c 3 64:ff9b::192.0.2.2 + atf_check -s exit:0 -o ignore \ + ping6 -c 3 64:ff9b::198.51.100.1 +} + +v6_gateway_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "icmp_echo" @@ -818,4 +879,5 @@ atf_init_test_cases() atf_add_test_case "gateway6" atf_add_test_case "route_to" atf_add_test_case "reply_to" + atf_add_test_case "v6_gateway" } From nobody Tue Feb 25 11:48:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G7s4LzHz5pjnW; Tue, 25 Feb 2025 11:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G7s2rqbz3kK9; Tue, 25 Feb 2025 11:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h/jyf3EV2ZXeGS3uNuhE4qsAzp6ADMqX34ZYeSnnjsw=; b=Tn6cGg861hZ20ZcsboKzbWMtK8QSNDBPPGse2DaDdoZIn9W7Lp2e0zsaGLaEQnUtav8lMs kcBRnUOUpciiq7sSXoLoHQW0iHz7NZyaTOeTCPlghTbSTYhKMK+LpVpIp5uVVo+191pOg2 V7JkmmUEdau+iZys5kOxqWchrGWFl/Mu6DlaxYNq8c40/1ftJAp8rZVU282w+8aKEr+VHu JaBCVrr9TrCWiI156UVWLxkYfViARLH5xD8RLhB+NB6F5/NAqAc470ZYclIdoCIbsqgRsK /+4JQ59uJjKGhyFA1yihUqcd220e+2UCnaphb4vrYxIQogpdMM34VmWPaAwMsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484089; a=rsa-sha256; cv=none; b=rec+QrV2NKV3nUBOm2vraB0pfK739B26FEX+5R025mkLASIe8j3p+dqrbaTB4oYTEP0vuB dTNB+wZ4ZVgqEwsqfCdSO2TVQJL72Yrmr7zRfAuX2Yw696QG80e/3UulAea3uFLtr72CO5 uouL1QblKN5sh0dO3jsEeJOGCPOrPnPCa8wZBhlTOZmleIzZFD+B3GOyfMcqFYRLTyAGrv VqQmHWvdjDLMULxDf9j4uUb12Q8dzBhqvtD1mG3RBhO4O2ymHo1tQ+xvrifMMiovccBVFr 4oaGTp5vlBMMLMq78XNrYxsnP7h4q/BLrHAZ+0YAwUAyuykuqgbgxCFtfTagOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h/jyf3EV2ZXeGS3uNuhE4qsAzp6ADMqX34ZYeSnnjsw=; b=k9dEWc4WjEgF2P8uFSH3djJWY40Vmj5Z4y6RdJgW5seF8rgw5M2OK5BsNWVMUvVZpBbtPB nUeVMVkR71jmuSICmYI/QZstCoq/K2UPcD2N4VVFJwQ7D6/qXw+b75tV0NP9pmNskteWaZ TXqidnTq770m1y5osw4OG9RKrUiFdIpNKtrx+nkdajrpktc/eIXdQS8loxwyXxbbUPrWqu Dx3quAozH8XbiICel4rcH8hD0Qax5hSqgR4aqSucCxsOc35C8DAIx5ldZsLglzjkSGJBUO 2idqN8LLfV+ErpkzbgcHQRlPUxlI08552OGdK6ZU0E/zPVVdbaOE/F0Qu+dPxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G7s1zFhz8pg; Tue, 25 Feb 2025 11:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBm9Vw050732; Tue, 25 Feb 2025 11:48:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBm9x1050729; Tue, 25 Feb 2025 11:48:09 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:09 GMT Message-Id: <202502251148.51PBm9x1050729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 164651f16c86 - main - sound: Do not return an error from chn_notify() if the children list is empty List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 164651f16c860049a4ad2098206def8ca7a39b4a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=164651f16c860049a4ad2098206def8ca7a39b4a commit 164651f16c860049a4ad2098206def8ca7a39b4a Author: Christos Margiolis AuthorDate: 2025-02-25 11:42:59 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:42:59 +0000 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 --- 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; From nobody Tue Feb 25 11:48:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G7t4fnRz5pjfs; Tue, 25 Feb 2025 11:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G7t2bhwz3kBD; Tue, 25 Feb 2025 11:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KjLazXzMtYF9p7u911ChYKzTLktmpeC/Qx3JemQ5L94=; b=oLinL3FjzNfX+OWwvg225asxOMDPsHJr6aSrwrRLrTgGvw5TWit8ybVrKv1YUVq5qIQ801 2iqU6Yx1HIF1hpPyDy6CW0WRLzGaGquWj0glqcBZAxHV9p50KJL/RZ7eVM1Pv3sGNz4kPh TB8RHUJiUoMkNsWSk4HWGiUdBDwB7YMDG8QYd+pOh6zo1UO/nRlDqgdlpDvmICyaR0nHos yjDRpmdC8rrube8sXEKwN1eEN/cvHd1UuDABaUxcInHoBqS1wiP9rzZTxuDSxqadD7Iawm PnHFxNdNUd5yNvM/sUBjKStgREHesNcuBRxyc8svZmCEBnh3YkccVDjBuuiYdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484090; a=rsa-sha256; cv=none; b=MuKj/L91INajmYXeP4oeWF7mnzLGnZqa49O+Ox6stH6TOwOshZjtJGB7Hj0mGIbwXHVz6r h3JipUDBceX37szXMaaIWWFZHkllArEiD+gyfeSsjOYGjiBhXEcL/m19zzH5RTBekojUjy mJIck+f55o78s4YrZlJpHLSSudFtILqb6McRCLBcKaLvgy0gOSMys1fstrnkO8LJJrSCH7 b0Zh+nNm6FwvaTOIeYh8mAXjw/YrN0F19w1bSjfNvx9HCaUrA4DRS7cWd+ouETSPtUCc5Y LNTWWdWbIrULaCV49suNDdUyIOFgI80Ai6RLvlRhaA5gpB2O4EE9Vx6RySKWnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KjLazXzMtYF9p7u911ChYKzTLktmpeC/Qx3JemQ5L94=; b=K+ofEBiVRAM4NKDyIKjEanCVXQELDpM1J0PfwIO7BA7NLjKz0UyhlXO/3uPBJ83cWOJCq1 1NqRuumoK+if2iTxyE1tof4PIAmPLOC1dOGJ1SskVloRrX0hNVfFzhFK/tPyNQTgEfACnk Q4+AH81SYG3TJ7PF4x/X1g2f4y4E6cHraa8ZlQj9z780OQslIONOzrVogzPAMLo80weP0a uVVrvv9/fBiUkqXxfIvTSChLGFm9Ba5D6m30IYlB0/ciwevEJxf/IX3pjHnjMbMx94DbN2 kD25sfFKTEd2LSx7sCbI7imhPuHmlB7gu3D38wUGP152A2EPgcmB9AsaKxBh0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G7t1zCDz94H; Tue, 25 Feb 2025 11:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmAU8050766; Tue, 25 Feb 2025 11:48:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmAve050763; Tue, 25 Feb 2025 11:48:10 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:10 GMT Message-Id: <202502251148.51PBmAve050763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 405b1e50926d - main - sound: Do not fail from vchan_destroy() if children list is empty List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 405b1e50926d4162fb9503644073c0184a8b37d9 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=405b1e50926d4162fb9503644073c0184a8b37d9 commit 405b1e50926d4162fb9503644073c0184a8b37d9 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:11 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:11 +0000 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 --- 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); From nobody Tue Feb 25 11:48:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G7w0GNTz5pjlp; Tue, 25 Feb 2025 11:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G7v3VJyz3k8r; Tue, 25 Feb 2025 11:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5w7Cteon3nt8/sS7tP/Yd6BlAdG3wdid6898FEpqGM=; b=FPr/PRRxvFMgKlkI9W5vKuz670ayAK0zca5BMPJ4Njz2pwXuFHkkQuLvsaW3tuWajWJIXt 2V/7pC70G7pEJPg3AeGuk6oGQy3O5VCDLCyU0xPG6uBC1SF50CXx66XQPtEMprTjXNEYeW rfL8w0HvXr3Ac5zz5pGR8QMXKFTVm0/YBLCgS8NDC7/bfaKuQkE2y1kxRlXflENubuLp9M whNc0Q0F1d6CdHqlvhqVKICIfCrv9/DTjprpXIzNWzi1til16ALB4UAjkxUz2fe1TW9nAb z1E/wTzEAHhgKuvg3TrlPTQfuNTumkERzKhhNaFE9L7kuNrWDzHDmUPF8JgBVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484091; a=rsa-sha256; cv=none; b=ArBElE6BINy4/8IyY0DfGPMV6ExZ6T3+BZw4Hi0cpgKH2U6VgCFNQ2efGZtvy2wP8cjrpP e5pujb/9ktiJUukEXE0Wk1lDzdGsEeTmdS6WNbdvZhFHg7N35glUONQcVa+kId0gTT+B5k jY2BHsMIkKnJBH3CLls/nQ+VXROE2WLSraVDy263u1i2JuJ0ujmAUACms6WqO119T3v40x bS9LkIys/zYkGo0LOE/eUfWuYZPQ9AUdvpwflGc6r7c9/JxOlhzptbRgg4CzKnaR0acGFc K8gJSD8CsGLHjy7TvPVfIKdFTa3LWL8nkArweyevdC8or0qTFzr3eWX3VsLWoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5w7Cteon3nt8/sS7tP/Yd6BlAdG3wdid6898FEpqGM=; b=RvhrigeCSMS2xIxkUGU5GGLl0b1gBBDRO7muz4CTk9EcLJiE/2SUVGQuh8DsdlVk2ndUvG Y/Cir7XemKDFazTPZ9/LpURK8+MmcD5rA2acjpOkkohUtwCYw3k7Sg0yPqSP/x2UopsGwG vl0CDGCfu2JatHytrCOkOfH62vWb69XQoFz3UoKIzCsI69b3B+zF61QYz6VsKs3qB8BLU+ 8S7UHP039/BiwOW4ZeWV1JsSaB+Nsc+ksu+p9h7R8aTYx0WGMQXUSceq1DIudaWDogVgSz xobnxenTKjhjJeKNclvfTZAh4yESZHvSEAepqqWpcOc2SPsAAd+e9fwU56N6cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G7v34pcz94J; Tue, 25 Feb 2025 11:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmBK7050798; Tue, 25 Feb 2025 11:48:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmB6K050795; Tue, 25 Feb 2025 11:48:11 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:11 GMT Message-Id: <202502251148.51PBmB6K050795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 2546ab1b3632 - main - sound: Call vchan_destroy() on vchan_create() failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2546ab1b3632a9ebfe88d9d5dc55700e653bff5d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2546ab1b3632a9ebfe88d9d5dc55700e653bff5d commit 2546ab1b3632a9ebfe88d9d5dc55700e653bff5d Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:19 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:19 +0000 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 --- 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); } From nobody Tue Feb 25 11:48:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G7w6g04z5pjjQ; Tue, 25 Feb 2025 11:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G7w4Svxz3kKS; Tue, 25 Feb 2025 11:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O4as4I/KhcACbui5SzxUTRQEPwlvCjuflmUIouFOaaQ=; b=O2CZ7f/ncO0wwXxmq3hcWqWVK1gQknSY5uvisiFNka25p00BZh5j1sYsQds0hHXk/sbX/+ mXoQmR0mZSq+sw4meT5DZIxGNMVZ+jHZVs9pmPdhb0pftFJhOTHeeFkdq2mV877LsE8vmH NFEKK0kDdyilzVkPDddw/91wid9zHdrDcYdCfENzZk/eXRmC/LkLnFVZc5iOzbMWhiwOcE s5opgTYUt+ErejpOa3dFFS4egomkL6TysYbIHhAAI7whB+3bGzl0zjKnYBtB0tOQ3PWG/R UO7lUipqSuPUkshHWbpbLcMz1YbR9XKMXsrxDrlu+VLHDI5nHh4FbQMI/QYVEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484092; a=rsa-sha256; cv=none; b=xwqSnt8N78m/KCXJAHLW700Cyz8p7tfMFV220BOKDKp+fAm+RKUFsmGlNp0+a16vYdiYtB Ko21JE8PN3CkR3qQRmjwXTEoRpQRflWozKRQJ84HxBYyg8nCTDkidmQ/29iWv50EoCUPMm pOUQCP89PSRYOwzVau8+QJkOwAMNnTHfJoU+tU0S7vokUAqzke1yDLkLrCy1n7IV7+N0AF q+sOntvsLwj0FIsWUeoOzf3ZtJZsi+/3aCYIKJlmc5C9RpJm5j55NaVCdyPArLZf1RgvgP Ubn/e5+y9F4j19ADt7fw0Id/B3wggJaSj8oHXJhjusgF8i9HCywZS5qo5448zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O4as4I/KhcACbui5SzxUTRQEPwlvCjuflmUIouFOaaQ=; b=MYRogRr0TDaYPMYCyU4CVRYhy1mrmqyYFjBPbyc+teRirAJsZXUDkg0GINEvzO20A3sI3K 3vpVzimE9egcHF0KZYsJ8iCJbqhD14qD/aWa+bIR7QYTPgVUDN6Nf4QAls/tGzec/R4aaU 24IH9PlsmuEmNMG3AgPm1jHt0JsEZaer5AO6VLCiEZD+cBWXFoYKuL/OgbRSd7QuDcwrZ4 PeGtwT1WnSOXpQPQVyQPdC1qodzKzBoEflrM86vTJ9l6C0luSRf6aasICmT+kKUXqpHvnk +8m6O4h402AULXXLX1g9f2wkEHk334DRyLYxs+I8y8ZtZ7I0wb2oiIFEezommQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G7w40Mhz9R2; Tue, 25 Feb 2025 11:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmCq9050830; Tue, 25 Feb 2025 11:48:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmCbQ050827; Tue, 25 Feb 2025 11:48:12 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:12 GMT Message-Id: <202502251148.51PBmCbQ050827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: e89ee05b7cf1 - main - sound: Initialize channels with sane default rate and format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e89ee05b7cf1a54d0d6ed56e4d451fdd9a10db43 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e89ee05b7cf1a54d0d6ed56e4d451fdd9a10db43 commit e89ee05b7cf1a54d0d6ed56e4d451fdd9a10db43 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:26 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:26 +0000 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 --- 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; From nobody Tue Feb 25 11:48:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G7z0WXKz5pjnd; Tue, 25 Feb 2025 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G7y1z5mz3kSp; Tue, 25 Feb 2025 11:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nY4SzJdaVFuGM1HDUu4TbMxLxp8jfKq6YLRKI0lTGdw=; b=RzKyq0uVumF4owCRnciVp3DubKypYYzZfuScqnTXe1+VjsHa6xZ+0xxY1N9pO9lU/aa2U5 g4GheaAVKhCpJ6CCQ8EAjKura4/6qMSIBGUtNEG3uONGoLB0bFnOK+5tdYjzq+bMMrkx+6 cUeOADab5eh6RaKVh+Qy7MWFQ3kQqSDtDBMHP39lngdELb51AV/IppDbLWxpBXq8pyoFgW /uj9XR+HLRU77Jcrh26zu/xih0ICt5sIboNI3dGe+qz4G1rjTYDYtsjZonAXD+R4PnQVyQ Phk1I+80cKou/k2bIC3kYufbUiuKK9wLWkflsbiD1882OU5w6RMYaj8AeEgUIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484094; a=rsa-sha256; cv=none; b=K5yLYA5Yh8y3igWNJRCbY64AhFoWq3GZLIH5nHrQ+s/NFJ2vB9AsGKIl0bY4XMuYgKYiC6 tfDIF+6DsbDYsENOaq/qiQ5Z+TEFp/z/HPNYqaiRc1OIYabZyAcCRSNg1fp/KlW44ldrHM aAQQCU1Ojzh0obo14h02Et5o2ea5pUiiNjw8ursl1LyCE7guN71CDQac586xwlYfGozujO wC1B/BoMn7mpKKlRgX4I8Q46g8kLQBf53k3k8imTCjSs9CanEGwD+SBrcDH0uvtmkapH8h +hsviIflYO8u2ZFikGpm8ZCNtPWEpuSWf46gYPs24GLt/GXOsVAvk9cJEJ938w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nY4SzJdaVFuGM1HDUu4TbMxLxp8jfKq6YLRKI0lTGdw=; b=GJHT1zzdbEdOuqh4QNd08ZLH2LayqYhSPSEZeOmdHw46uMNvtGPN7q6LCniVqFnY5mnoC7 FFiflGb7WgmJhzBeAXoyQs3w6eq8Jbme6Ak9hRWwYNGCfBxjB2HmULRbjsIcdzbncyA7vt BiVhCk0eQgRC9WsqTqI9XFp05untnjzPLZk77ZWJH/VtQizNDbBjiVE92etRzHfKet7cTa VDhL8mdnRBUJWjjdj8c3rVWD0B5GNClzO+nIt2WnSO4GojVjNEgT4zAFLTrZEPGqk4o49l FoGUb3Rs0yurWrCyd71l3P3mkVAEi+2RJvYMSqSHS1dMx4lMBm18k7ZRvOw6WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G7x55mmz91r; Tue, 25 Feb 2025 11:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmDB8050868; Tue, 25 Feb 2025 11:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmD45050865; Tue, 25 Feb 2025 11:48:13 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:13 GMT Message-Id: <202502251148.51PBmD45050865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: d39be38a3533 - main - sound: Report actual vchanrate and vchanformat in sysctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d39be38a353323d05744eeb3e08267108e55b9b1 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d39be38a353323d05744eeb3e08267108e55b9b1 commit d39be38a353323d05744eeb3e08267108e55b9b1 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:33 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:33 +0000 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 --- 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); From nobody Tue Feb 25 11:48:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G8145Dfz5pjnf; Tue, 25 Feb 2025 11:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G800DYdz3kFH; Tue, 25 Feb 2025 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVNIKQ6BgLfoVRHWC7ltZ8XzbpI1gKHwT2wDQRdhX+g=; b=CBP+kupPXD50ahFgQ7f3HBZvHRgRALuRAC5LKNEIV0qTjW6lKlXO40EKIr8ZwLRU3x5pok hAkP8wUSOsEz0kvUK8SAeGWBRnLwkDTl51ab75Vkk5xw0kYAeQMdVJAmtLDLYrtEa+X0PH UUsf2X3uvuqPexbH7j1L6ZENQIl90ev3pBvSH88bUmgJjwefGwsz5a2hlHw1lYvSjLmlzl CZBr3Zy8UsTU3rDWAzdC5vQ1dJ1HgdBRzTgAvUrSXv0TOT9C4qbwvM4C+/B01KaHg9N0jD wvDfd6D8wCpQ0rnecmXhKDATRaqw7SHZi4NWG6ULSbX/tFVhOVYFThZBY15xWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484096; a=rsa-sha256; cv=none; b=Oey8eFl3Uy2ZMv1Rv6ymv86LAYqzsfnhnPKmOH8HwrRHCmI/CUGzaf7HNBdVgKx3/i4cbL 3hB+fg62lBNWok5uDyNp8KZ+z5Y/QZo8CZu9Fvg3AWYibcPCveaT8A7EYNIZRIb+nu5u02 UP9m0QJTRjmaFhkRxsVT7x7GwpMYE5HLmpzy7nQu4wHFAu2bZrNUGsn+lamJ0+zqAzAkEC L3WL0XHc2vliFPGPvIf/4FBusThdEaJm3kLd/b8k0MMSLgYj/UwGahBYxIX7FQ2HKpUUoo F5aYW73j1jnuyPMttgyZaaNbJ3P77erbyMBQOQ8KyGmSJuWvAyf4Y+UzvFD7cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVNIKQ6BgLfoVRHWC7ltZ8XzbpI1gKHwT2wDQRdhX+g=; b=hRBN7/MemjIxikFetYL7MmDkLdxHccNdcgeLJzwSv3aTh0A9yCfyHQqYRWu9tfj2E0bny5 KhwBD5SdSOTJwkePgsZoyd3cPsWIXGpmhvNopsHxqM78d6HQdkgkaCSrNLttOKiPYn+dZw rqMb+7QVUKOvKUgoYQZr6qXvqc8IoyVN6UEhXP+tJeL7Q5OvoJy10rpyRmO3sr5xdPtO1B wLLTaUSoMpwqbyCrxAv9tPjjEJF5ceCCdqNdGhYlYeT2mwnMWpptrcY7NaCQFUv0vZIczL v41Osrq4bJyfefKn++MGtblk+wurIdsBiBqumS7YxGoOFzOrMOgWn/cNeMHC/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G7z6LjMz8ph; Tue, 25 Feb 2025 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmFmT050933; Tue, 25 Feb 2025 11:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmFrh050930; Tue, 25 Feb 2025 11:48:15 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:15 GMT Message-Id: <202502251148.51PBmFrh050930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: b50f53cf872e - main - sound: Cache vchanmode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b50f53cf872eca6b9a174a51fa183e8c2f88d97c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b50f53cf872eca6b9a174a51fa183e8c2f88d97c commit b50f53cf872eca6b9a174a51fa183e8c2f88d97c Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:46 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:46 +0000 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 --- 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 0452a58dfcbf..92d6e79600d1 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); From nobody Tue Feb 25 11:48:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G815GpNz5pjb1; Tue, 25 Feb 2025 11:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G7z19cvz3kF9; Tue, 25 Feb 2025 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A3UMUNLZMYNTG7b3TvwpVpWiMVszgTvCA9OzcHBGDQs=; b=kmBqqG4KPg1ihsFWX5XXamf1liBcFAm6Pvqdw9wG/IzRvB2+sQ2d/qf89WKqsOIYR6U+YK ZNBgASeWJ2t+i/HGnhrBh3yzu1ZZOaYnFYUsqDKc4rO8hG/vbIi/jvnAJ2y7Xmq3W1xczW sij1lp4cYTn4mtR9FVxuZoiHeek1dYrhEdee02aKDtLEjYdebqv84uB8T7sWBIagPV8e0O W5oW6z28gyXXsvbvdic6tfViqrRJIuvrsH0dxXjhdFUDZT/3rgJpzvEdfrST3XvHZmwJ8O 6b93lZkWSxQmo6HJe8GeoKIP33MzKpehTN8r6s2cXrwT2xzflv9GqsFbwI58cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484095; a=rsa-sha256; cv=none; b=jTP55hzen88OCKCgh2Gv0+HagqgqAjztNTHvZjGsJjrPhCokywS/Bj4uXDDqdtNjw63MFF QSQSYY331OYvGYMKv5VKV4+pg/Sbd3+5pqArRb9BePikqJ606m6Jr4/GlEVmBq1KPmOjBl Zsd1sPH0qbN6ULvrNaxAdhFJEdIgBNOXeyQV8BLgWGRQKMViSTCerg6qpqCeUl00p1+4X0 VpJKsE/d++4nIVBz7mfKaNH1V5x2OSftQPYpymVL4w6CrjPfQMhEQm5Bg7sohJ4e1GA+2u bpvZPviUOE1yxqpKD9b0DXF4b12rO23uRRmwXHlu8ZGaZ1Wb5gG07a6qY2RcrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A3UMUNLZMYNTG7b3TvwpVpWiMVszgTvCA9OzcHBGDQs=; b=coIiHL6I5delfeFhxzLKvNXYNZ+XKKf/1IaKGyykDBCP1AeY1Rhnxyya+w2L5e7mMwJLmX OJCUV6zHcgAVDQwrgG+85Dm+zyA2sy32qAnKPtn0CQw2jErbI0Q3La5mReMir7UR0wK1Yn tPdcYSaCBg8Yv+ZlMzVwpNkNpxlOyNvOhjrq/VgfrmF0MYSVQWnwyr5idNIjC+hj79Y5N1 sJriEto8D4VxIeDNYdxICf1YrHG7EQrqTdxpS4ZmhLQtvo4Jiwv8L6aafKMjigKp02lrWX IpaAQKJTEwUrXEIVBr5z6O2m9caPgyuvI/RxTt9W7ltt8dwsZM6yYbB3tlKh4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G7y5Qfrz810; Tue, 25 Feb 2025 11:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmEwj050901; Tue, 25 Feb 2025 11:48:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmEaZ050898; Tue, 25 Feb 2025 11:48:14 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:14 GMT Message-Id: <202502251148.51PBmEaZ050898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 02d4eeabfd73 - main - sound: Allocate vchans on-demand List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02d4eeabfd73e6a827f5d42601e99aad92060b04 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=02d4eeabfd73e6a827f5d42601e99aad92060b04 commit 02d4eeabfd73e6a827f5d42601e99aad92060b04 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:39 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:39 +0000 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 --- 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 769f562fe91e..e25ffe264ae8 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 @@ -360,14 +360,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. @@ -434,11 +432,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) { + CHN_LOCK(c); + err = chn_reset(c, c->format, c->speed); + CHN_UNLOCK(c); + if (err != 0) + goto fail; + } + PCM_LOCK(d); CHN_INSERT_SORT_ASCEND(d, c, channels.pcm); + if ((c->flags & CHN_F_VIRTUAL) == 0) + CHN_INSERT_SORT_ASCEND(d, c, channels.pcm.primary); switch (c->type) { case PCMDIR_PLAY: @@ -1332,6 +1342,8 @@ chn_kill(struct pcm_channel *c) PCM_LOCK(d); CHN_REMOVE(d, c, channels.pcm); + if ((c->flags & CHN_F_VIRTUAL) == 0) + CHN_REMOVE(d, c, channels.pcm.primary); switch (c->type) { case PCMDIR_PLAY: diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 6eaad8cc2c0b..31c617a6df78 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -160,6 +160,9 @@ struct pcm_channel { struct { SLIST_ENTRY(pcm_channel) link; } opened; + struct { + SLIST_ENTRY(pcm_channel) link; + } primary; } pcm; } channels; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index dcbdd581c82a..88e0580c5c45 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -37,6 +37,7 @@ #endif #include +#include #include #include #include @@ -158,6 +159,81 @@ dsp_unlock_chans(struct dsp_cdevpriv *priv, uint32_t prio) CHN_UNLOCK(priv->wrch); } +static int +dsp_chn_alloc(struct snddev_info *d, struct pcm_channel **ch, int direction, + int flags, struct thread *td) +{ + struct pcm_channel *c; + char *comm; + pid_t pid; + int err; + bool vdir_enabled; + + KASSERT(d != NULL && ch != NULL && + (direction == PCMDIR_PLAY || direction == PCMDIR_REC), + ("%s(): invalid d=%p ch=%p direction=%d", + __func__, d, ch, direction)); + PCM_BUSYASSERT(d); + + pid = td->td_proc->p_pid; + comm = td->td_proc->p_comm; + + vdir_enabled = (direction == PCMDIR_PLAY && d->flags & SD_F_PVCHANS) || + (direction == PCMDIR_REC && d->flags & SD_F_RVCHANS); + + *ch = NULL; + CHN_FOREACH(c, d, channels.pcm.primary) { + CHN_LOCK(c); + if (c->direction != direction) { + CHN_UNLOCK(c); + continue; + } + /* Find an available primary channel to use. */ + if ((c->flags & CHN_F_BUSY) == 0 || + (vdir_enabled && (c->flags & CHN_F_HAS_VCHAN))) + break; + CHN_UNLOCK(c); + } + if (c == NULL) + return (EBUSY); + + /* + * We can have the following cases: + * - vchans are enabled, add a new vchan to the primary channel. + * - vchans are disabled, use the primary channel directly. + */ + if (vdir_enabled && ((c->flags & CHN_F_BUSY) == 0 || + c->flags & CHN_F_HAS_VCHAN)) { + err = vchan_create(c, ch); + CHN_UNLOCK(c); + if (err != 0) + return (err); + CHN_LOCK(*ch); + } else if ((c->flags & CHN_F_BUSY) == 0) { + *ch = c; + } else { + CHN_UNLOCK(c); + return (ENODEV); + } + + (*ch)->flags |= CHN_F_BUSY; + if (flags & O_NONBLOCK) + (*ch)->flags |= CHN_F_NBIO; + if (flags & O_EXCL) + (*ch)->flags |= CHN_F_EXCLUSIVE; + (*ch)->pid = pid; + strlcpy((*ch)->comm, (comm != NULL) ? comm : CHN_COMM_UNKNOWN, + sizeof((*ch)->comm)); + + if ((err = chn_reset(*ch, (*ch)->format, (*ch)->speed)) != 0) + return (err); + chn_vpc_reset(*ch, SND_VOL_C_PCM, 0); + + CHN_UNLOCK(*ch); + + return (0); +} + #define DSP_F_VALID(x) ((x) & (FREAD | FWRITE)) #define DSP_F_DUPLEX(x) (((x) & (FREAD | FWRITE)) == (FREAD | FWRITE)) #define DSP_F_SIMPLEX(x) (!DSP_F_DUPLEX(x)) @@ -168,7 +244,7 @@ static void dsp_close(void *data) { struct dsp_cdevpriv *priv = data; - struct pcm_channel *rdch, *wrch; + struct pcm_channel *rdch, *wrch, *parent; struct snddev_info *d; int sg_ids; @@ -214,12 +290,20 @@ dsp_close(void *data) if (sg_ids != 0) free_unr(pcmsg_unrhdr, sg_ids); - CHN_LOCK(rdch); - chn_abort(rdch); /* won't sleep */ - rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | - CHN_F_DEAD | CHN_F_EXCLUSIVE); - chn_reset(rdch, 0, 0); - chn_release(rdch); + if (rdch->flags & CHN_F_VIRTUAL) { + parent = rdch->parentchannel; + CHN_LOCK(parent); + CHN_LOCK(rdch); + vchan_destroy(rdch); + CHN_UNLOCK(parent); + } else { + CHN_LOCK(rdch); + chn_abort(rdch); /* won't sleep */ + rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | + CHN_F_DEAD | CHN_F_EXCLUSIVE); + chn_reset(rdch, 0, 0); + chn_release(rdch); + } } if (wrch != NULL) { /* @@ -231,12 +315,20 @@ dsp_close(void *data) if (sg_ids != 0) free_unr(pcmsg_unrhdr, sg_ids); - CHN_LOCK(wrch); - chn_flush(wrch); /* may sleep */ - wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | - CHN_F_DEAD | CHN_F_EXCLUSIVE); - chn_reset(wrch, 0, 0); - chn_release(wrch); + if (wrch->flags & CHN_F_VIRTUAL) { + parent = wrch->parentchannel; + CHN_LOCK(parent); + CHN_LOCK(wrch); + vchan_destroy(wrch); + CHN_UNLOCK(parent); + } else { + CHN_LOCK(wrch); + chn_flush(wrch); /* may sleep */ + wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | + CHN_F_DEAD | CHN_F_EXCLUSIVE); + chn_reset(wrch, 0, 0); + chn_release(wrch); + } } PCM_LOCK(d); } @@ -254,10 +346,9 @@ static int dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { struct dsp_cdevpriv *priv; - struct pcm_channel *rdch, *wrch, *ch; + struct pcm_channel *ch; struct snddev_info *d; - uint32_t fmt, spd; - int error, rderror, wrerror, dir; + int error, dir; /* Kind of impossible.. */ if (i_dev == NULL || td == NULL) @@ -267,11 +358,11 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (!DSP_REGISTERED(d)) return (EBADF); + if (PCM_CHANCOUNT(d) >= PCM_MAXCHANS) + return (ENOMEM); + priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); priv->sc = d; - priv->rdch = NULL; - priv->wrch = NULL; - priv->volch = NULL; error = devfs_set_cdevpriv(priv, dsp_close); if (error != 0) @@ -334,98 +425,30 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_ACQUIRE(d); PCM_UNLOCK(d); - fmt = SND_FORMAT(AFMT_U8, 1, 0); - spd = DSP_DEFAULT_SPEED; - - rdch = NULL; - wrch = NULL; - rderror = 0; - wrerror = 0; - - if (DSP_F_READ(flags)) { - /* open for read */ - rderror = pcm_chnalloc(d, &rdch, PCMDIR_REC, - td->td_proc->p_pid, td->td_proc->p_comm); - - if (rderror == 0 && chn_reset(rdch, fmt, spd) != 0) - rderror = ENXIO; - - if (rderror != 0) { - if (rdch != NULL) - chn_release(rdch); - if (!DSP_F_DUPLEX(flags)) { - PCM_RELEASE_QUICK(d); - PCM_GIANT_EXIT(d); - return (rderror); - } - rdch = NULL; - } else { - if (flags & O_NONBLOCK) - rdch->flags |= CHN_F_NBIO; - if (flags & O_EXCL) - rdch->flags |= CHN_F_EXCLUSIVE; - chn_vpc_reset(rdch, SND_VOL_C_PCM, 0); - CHN_UNLOCK(rdch); - } - } - if (DSP_F_WRITE(flags)) { - /* open for write */ - wrerror = pcm_chnalloc(d, &wrch, PCMDIR_PLAY, - td->td_proc->p_pid, td->td_proc->p_comm); - - if (wrerror == 0 && chn_reset(wrch, fmt, spd) != 0) - wrerror = ENXIO; - - if (wrerror != 0) { - if (wrch != NULL) - chn_release(wrch); - if (!DSP_F_DUPLEX(flags)) { - if (rdch != NULL) { - /* - * Lock, and release previously created - * record channel - */ - CHN_LOCK(rdch); - chn_release(rdch); - } - PCM_RELEASE_QUICK(d); - PCM_GIANT_EXIT(d); - return (wrerror); - } - wrch = NULL; - } else { - if (flags & O_NONBLOCK) - wrch->flags |= CHN_F_NBIO; - if (flags & O_EXCL) - wrch->flags |= CHN_F_EXCLUSIVE; - chn_vpc_reset(wrch, SND_VOL_C_PCM, 0); - CHN_UNLOCK(wrch); + error = dsp_chn_alloc(d, &priv->wrch, PCMDIR_PLAY, flags, td); + if (error != 0) { + PCM_RELEASE_QUICK(d); + PCM_GIANT_EXIT(d); + return (error); } + PCM_LOCK(d); + CHN_INSERT_HEAD(d, priv->wrch, channels.pcm.opened); + PCM_UNLOCK(d); } - - PCM_LOCK(d); - - if (wrch == NULL && rdch == NULL) { - PCM_RELEASE(d); + if (DSP_F_READ(flags)) { + error = dsp_chn_alloc(d, &priv->rdch, PCMDIR_REC, flags, td); + if (error != 0) { + PCM_RELEASE_QUICK(d); + PCM_GIANT_EXIT(d); + return (error); + } + PCM_LOCK(d); + CHN_INSERT_HEAD(d, priv->rdch, channels.pcm.opened); PCM_UNLOCK(d); - PCM_GIANT_EXIT(d); - if (wrerror != 0) - return (wrerror); - if (rderror != 0) - return (rderror); - return (EINVAL); } - if (rdch != NULL) - CHN_INSERT_HEAD(d, rdch, channels.pcm.opened); - if (wrch != NULL) - CHN_INSERT_HEAD(d, wrch, channels.pcm.opened); - priv->rdch = rdch; - priv->wrch = wrch; - - PCM_RELEASE(d); - PCM_UNLOCK(d); + PCM_RELEASE_QUICK(d); PCM_GIANT_LEAVE(d); return (0); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 2d57852e036d..c0934dde7718 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -107,62 +107,6 @@ snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep); } -int -pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, - pid_t pid, char *comm) -{ - struct pcm_channel *c; - int err, vchancount; - bool retry; - - KASSERT(d != NULL && ch != NULL && - (direction == PCMDIR_PLAY || direction == PCMDIR_REC), - ("%s(): invalid d=%p ch=%p direction=%d pid=%d", - __func__, d, ch, direction, pid)); - PCM_BUSYASSERT(d); - - *ch = NULL; - vchancount = (direction == PCMDIR_PLAY) ? d->pvchancount : - d->rvchancount; - retry = false; - -retry_chnalloc: - /* Scan for a free channel. */ - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction != direction) { - CHN_UNLOCK(c); - continue; - } - if (!(c->flags & CHN_F_BUSY)) { - c->flags |= CHN_F_BUSY; - c->pid = pid; - strlcpy(c->comm, (comm != NULL) ? comm : - CHN_COMM_UNKNOWN, sizeof(c->comm)); - *ch = c; - - return (0); - } - CHN_UNLOCK(c); - } - /* Maybe next time... */ - if (retry) - return (EBUSY); - - /* No channel available. We also cannot create more VCHANs. */ - if (!(vchancount > 0 && vchancount < snd_maxautovchans)) - return (ENOTSUP); - - /* Increase the VCHAN count and try to get the new channel. */ - err = vchan_setnew(d, direction, vchancount + 1); - if (err == 0) { - retry = true; - goto retry_chnalloc; - } - - return (err); -} - static int sysctl_hw_snd_default_unit(SYSCTL_HANDLER_ARGS) { @@ -472,6 +416,7 @@ pcm_init(device_t dev, void *devinfo) CHN_INIT(d, channels.pcm); CHN_INIT(d, channels.pcm.busy); CHN_INIT(d, channels.pcm.opened); + CHN_INIT(d, channels.pcm.primary); } int @@ -491,7 +436,10 @@ pcm_register(device_t dev, char *str) if (d->playcount > 0 || d->reccount > 0) d->flags |= SD_F_AUTOVCHAN; - vchan_setmaxauto(d, snd_maxautovchans); + if (d->playcount > 0) + d->flags |= SD_F_PVCHANS; + if (d->reccount > 0) + d->flags |= SD_F_RVCHANS; strlcpy(d->status, str, SND_STATUSLEN); sndstat_register(dev, d->status); @@ -733,9 +681,7 @@ sound_global_init(void) if (snd_unit < 0) snd_unit = -1; - if (snd_maxautovchans < 0 || - snd_maxautovchans > SND_MAXVCHANS) - snd_maxautovchans = 0; + snd_vchans_enable = true; if (chn_latency < CHN_LATENCY_MIN || chn_latency > CHN_LATENCY_MAX) @@ -759,11 +705,11 @@ sound_global_init(void) feeder_rate_round = FEEDRATE_ROUNDHZ; if (bootverbose) - printf("%s: snd_unit=%d snd_maxautovchans=%d " + printf("%s: snd_unit=%d snd_vchans_enable=%d " "latency=%d " "feeder_rate_min=%d feeder_rate_max=%d " "feeder_rate_round=%d\n", - __func__, snd_unit, snd_maxautovchans, + __func__, snd_unit, snd_vchans_enable, chn_latency, feeder_rate_min, feeder_rate_max, feeder_rate_round); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 019fe67ac892..0452a58dfcbf 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -99,8 +99,6 @@ struct snd_mixer; #define SOUND_PREFVER SOUND_MODVER #define SOUND_MAXVER SOUND_MODVER -#define SND_MAXVCHANS 256 - #define SD_F_SIMPLEX 0x00000001 #define SD_F_AUTOVCHAN 0x00000002 #define SD_F_SOFTPCMVOL 0x00000004 @@ -113,6 +111,8 @@ struct snd_mixer; #define SD_F_EQ_ENABLED 0x00000200 /* EQ enabled */ #define SD_F_EQ_BYPASSED 0x00000400 /* EQ bypassed */ #define SD_F_EQ_PC 0x00000800 /* EQ per-channel */ +#define SD_F_PVCHANS 0x00001000 /* Playback vchans enabled */ +#define SD_F_RVCHANS 0x00002000 /* Recording vchans enabled */ #define SD_F_EQ_DEFAULT (SD_F_EQ | SD_F_EQ_ENABLED) #define SD_F_EQ_MASK (SD_F_EQ | SD_F_EQ_ENABLED | \ @@ -134,12 +134,15 @@ struct snd_mixer; "\012EQ_ENABLED" \ "\013EQ_BYPASSED" \ "\014EQ_PC" \ + "\015PVCHANS" \ + "\016RVCHANS" \ "\035PRIO_RD" \ "\036PRIO_WR" #define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL) #define PCM_REGISTERED(x) (PCM_ALIVE(x) && ((x)->flags & SD_F_REGISTERED)) +#define PCM_MAXCHANS 10000 #define PCM_CHANCOUNT(d) \ (d->playcount + d->pvchancount + d->reccount + d->rvchancount) @@ -168,9 +171,6 @@ extern struct unrhdr *pcmsg_unrhdr; SYSCTL_DECL(_hw_snd); -int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, - pid_t pid, char *comm); - int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo); unsigned int pcm_getbuffersize(device_t dev, unsigned int minbufsz, unsigned int deflt, unsigned int maxbufsz); void pcm_init(device_t dev, void *devinfo); @@ -224,6 +224,9 @@ struct snddev_info { struct { SLIST_HEAD(, pcm_channel) head; } opened; + struct { + SLIST_HEAD(, pcm_channel) head; + } primary; } pcm; } channels; unsigned playcount, reccount, pvchancount, rvchancount; diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index b0caec3acfec..297120199fe7 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -61,7 +61,7 @@ struct vchan_info { int trigger; }; -int snd_maxautovchans = 16; +bool snd_vchans_enable = true; static void * vchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, @@ -277,7 +277,7 @@ vchan_getparentchannel(struct snddev_info *d, *ch = NULL; break; } - } else if (c->flags & CHN_F_HAS_VCHAN) { + } else { /* No way!! */ if (*ch != NULL) { CHN_UNLOCK(c); @@ -299,8 +299,7 @@ static int sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) { struct snddev_info *d; - int direction, vchancount; - int err, cnt; + int err, enabled, flag; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) @@ -311,43 +310,44 @@ sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: - direction = PCMDIR_PLAY; - vchancount = d->pvchancount; - cnt = d->playcount; + /* Exit if we do not support this direction. */ + if (d->playcount < 1) { + PCM_UNLOCK(d); + return (ENODEV); + } + flag = SD_F_PVCHANS; break; case VCHAN_REC: - direction = PCMDIR_REC; - vchancount = d->rvchancount; - cnt = d->reccount; + if (d->reccount < 1) { + PCM_UNLOCK(d); + return (ENODEV); + } + flag = SD_F_RVCHANS; break; default: PCM_UNLOCK(d); return (EINVAL); - break; } - if (cnt < 1) { - PCM_UNLOCK(d); - return (ENODEV); - } + enabled = (d->flags & flag) != 0; PCM_ACQUIRE(d); PCM_UNLOCK(d); - cnt = vchancount; - err = sysctl_handle_int(oidp, &cnt, 0, req); - - if (err == 0 && req->newptr != NULL && vchancount != cnt) { - if (cnt < 0) - cnt = 0; - if (cnt > SND_MAXVCHANS) - cnt = SND_MAXVCHANS; - err = vchan_setnew(d, direction, cnt); + err = sysctl_handle_int(oidp, &enabled, 0, req); + if (err != 0 || req->newptr == NULL) { + PCM_RELEASE_QUICK(d); + return (err); } + if (enabled <= 0) + d->flags &= ~flag; + else + d->flags |= flag; + PCM_RELEASE_QUICK(d); - return err; + return (0); } static int @@ -368,15 +368,22 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: + if ((d->flags & SD_F_PVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_PLAY; break; case VCHAN_REC: + if ((d->flags & SD_F_RVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_REC; break; default: PCM_UNLOCK(d); return (EINVAL); - break; } PCM_ACQUIRE(d); @@ -450,7 +457,7 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) struct snddev_info *d; struct pcm_channel *c, *ch; struct pcmchan_caps *caps; - int *vchanrate, vchancount, direction, ret, newspd, restart; + int *vchanrate, direction, ret, newspd, restart; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) @@ -461,24 +468,24 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: + if ((d->flags & SD_F_PVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_PLAY; - vchancount = d->pvchancount; vchanrate = &d->pvchanrate; break; case VCHAN_REC: + if ((d->flags & SD_F_RVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_REC; - vchancount = d->rvchancount; vchanrate = &d->rvchanrate; break; default: PCM_UNLOCK(d); return (EINVAL); - break; - } - - if (vchancount < 1) { - PCM_UNLOCK(d); - return (EINVAL); } PCM_ACQUIRE(d); @@ -555,7 +562,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) struct snddev_info *d; struct pcm_channel *c, *ch; uint32_t newfmt; - int *vchanformat, vchancount, direction, ret, restart; + int *vchanformat, direction, ret, restart; char fmtstr[AFMTSTR_LEN]; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); @@ -567,24 +574,24 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: + if ((d->flags & SD_F_PVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_PLAY; - vchancount = d->pvchancount; vchanformat = &d->pvchanformat; break; case VCHAN_REC: + if ((d->flags & SD_F_RVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_REC; - vchancount = d->rvchancount; vchanformat = &d->rvchanformat; break; default: PCM_UNLOCK(d); return (EINVAL); - break; - } - - if (vchancount < 1) { - PCM_UNLOCK(d); - return (EINVAL); } PCM_ACQUIRE(d); @@ -660,7 +667,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) "play.vchanrate" : "rec.vchanrate" int -vchan_create(struct pcm_channel *parent) +vchan_create(struct pcm_channel *parent, struct pcm_channel **child) { struct snddev_info *d; struct pcm_channel *ch; @@ -676,9 +683,6 @@ vchan_create(struct pcm_channel *parent) PCM_BUSYASSERT(d); CHN_LOCKASSERT(parent); - if (!(parent->flags & CHN_F_BUSY)) - return (EBUSY); - if (!(parent->direction == PCMDIR_PLAY || parent->direction == PCMDIR_REC)) return (EINVAL); @@ -713,10 +717,12 @@ vchan_create(struct pcm_channel *parent) */ CHN_INSERT_SORT_DESCEND(parent, ch, children); + *child = ch; + if (parent->flags & CHN_F_HAS_VCHAN) return (0); - parent->flags |= CHN_F_HAS_VCHAN; + parent->flags |= CHN_F_HAS_VCHAN | CHN_F_BUSY; parent_caps = chn_getcaps(parent); if (parent_caps == NULL) { @@ -807,6 +813,7 @@ vchan_create(struct pcm_channel *parent) fail: CHN_LOCK(ch); vchan_destroy(ch); + *child = NULL; return (ret); } @@ -878,166 +885,40 @@ vchan_sync(struct pcm_channel *c) return (ret); } -int -vchan_setnew(struct snddev_info *d, int direction, int newcnt) -{ - struct pcm_channel *c, *ch, *nch; - struct pcmchan_caps *caps; - int i, err, vcnt; - - PCM_BUSYASSERT(d); - - if ((direction == PCMDIR_PLAY && d->playcount < 1) || - (direction == PCMDIR_REC && d->reccount < 1)) - return (ENODEV); - - if (!(d->flags & SD_F_AUTOVCHAN)) - return (EINVAL); - - if (newcnt < 0 || newcnt > SND_MAXVCHANS) - return (E2BIG); - - if (direction == PCMDIR_PLAY) - vcnt = d->pvchancount; - else if (direction == PCMDIR_REC) - vcnt = d->rvchancount; - else - return (EINVAL); - - if (newcnt > vcnt) { - /* add new vchans - find a parent channel first */ - ch = NULL; - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction == direction && - ((c->flags & CHN_F_HAS_VCHAN) || (vcnt == 0 && - !(c->flags & (CHN_F_BUSY | CHN_F_VIRTUAL))))) { - /* - * Reuse hw channel with vchans already - * created. - */ - if (c->flags & CHN_F_HAS_VCHAN) { - ch = c; - break; - } - /* - * No vchans ever created, look for - * channels with supported formats. - */ - caps = chn_getcaps(c); - if (caps == NULL) { - CHN_UNLOCK(c); - continue; - } - for (i = 0; caps->fmtlist[i] != 0; i++) { - if (caps->fmtlist[i] & AFMT_CONVERTIBLE) - break; - } - if (caps->fmtlist[i] != 0) { - ch = c; - break; - } - } - CHN_UNLOCK(c); - } - if (ch == NULL) - return (EBUSY); - ch->flags |= CHN_F_BUSY; - err = 0; - while (err == 0 && newcnt > vcnt) { - err = vchan_create(ch); - if (err == 0) - vcnt++; - else if (err == E2BIG && newcnt > vcnt) - device_printf(d->dev, - "%s: err=%d Maximum channel reached.\n", - __func__, err); - } - if (vcnt == 0) - ch->flags &= ~CHN_F_BUSY; - CHN_UNLOCK(ch); - if (err != 0) - return (err); - } else if (newcnt < vcnt) { - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction != direction || - CHN_EMPTY(c, children) || - !(c->flags & CHN_F_HAS_VCHAN)) { - CHN_UNLOCK(c); - continue; - } - CHN_FOREACH_SAFE(ch, c, nch, children) { - CHN_LOCK(ch); - if (vcnt == 1 && ch->flags & CHN_F_BUSY) { - CHN_UNLOCK(ch); - break; - } - if (!(ch->flags & CHN_F_BUSY)) { - err = vchan_destroy(ch); - if (err == 0) - vcnt--; - } else - CHN_UNLOCK(ch); - if (vcnt == newcnt) - break; - } - CHN_UNLOCK(c); - break; - } - } - - return (0); *** 122 LINES SKIPPED *** From nobody Tue Feb 25 11:48:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G84529Qz5pjgH; Tue, 25 Feb 2025 11:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G843JL9z3kJ8; Tue, 25 Feb 2025 11:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9o0wnGJOg6A0zBpS1GkIfnRYika9fje5gjQK5iru+SQ=; b=r2Y6dJ97kL+Wu3oZONac30lxGZ9tSW/rpaNnU/QQSgYbNCcj3DAbbV+caCXCqWZGTtp2jA 6lMxKZ1MmHmIRvtpPTr43Q80EGqGRjKDZ1bV8tgy/WGHu4N3Gz+mzhCAzwGMyLnFARC0Ey rYLSMlIrT9LYDwuWhcOF3XUDktl+eayx9UgdzPuyVWpW5oUyNpSTU4429IVsInq79wLhWX G0wKdu5b7oZaeGUZnaYJxG+t/TGLWbK8wh86N3SUv777mHwH/dC+Gc0qEYKrb18a5VBcMp eoc7U8JBxgNQArcX6D+D+YNBy6Orzv+c7EEJ4z7xaMDSz6mWKJgmrjOp9MMPWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484100; a=rsa-sha256; cv=none; b=L3NKA6Nhc0NlLXTJqy4ceWUYUQooqD/ixJR1+ujp45OAXaAJwVxQd8IMGOob4ZuUHmzgzK GREGSKt8ChCexJ2HaM6fqLZXKp4IrAppNN7NZVeXFEaDruJgIPIWdVzqmjggIQSfc+UW15 1R8ZFvoaD9R5/5YugnV1J4/5awtbfrWIhywvSQZHknbM131xtFSJZ3ShO5tPb7sU8hKQSc wdbbmnd8k4ZZgjHVw+kZrr2WC7SQG4FAveMj2W7xxVmjY7ECiHGxTCnVGHbjmqx6TAwr5G O1eoN43i3qrk0S2ZU/9FR8u+XYJEHVGyvIBjT6eQVnJ8ElriNBBijjCpFQumTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9o0wnGJOg6A0zBpS1GkIfnRYika9fje5gjQK5iru+SQ=; b=B2zLKPR9xpXWRgbJhfK8wS19oNDQteblMLnOhwIfFKJyZNVpbvfMP7UCqJjuSmCR1DjIS/ a0+GqlFXAR9Kbsv/UA9aW6YFcZa7fIWpSwVp7aSoCsNH/iIFx+q0kJ9Qx+mhlJefMjabts QAIrSE6yF2G2knudkRkbUzFw1GSh+YzmGzsU4nGt6I2zFpyxvMihtuH+74lRkg4mwL7prC LtJ7QVI1w7DdQxug5bILCI2PT7jWBpcCMrhWt3lOzRndfmOuRsDzGk/mChxZgZ6oNFqb0i ubs1Z1kH/uCnhUHxV4mxEZcN89lenKZEwIRqOnfSVvV7K13VUzszqoLRbfS9EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G842n4gz8pk; Tue, 25 Feb 2025 11:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmKOo051068; Tue, 25 Feb 2025 11:48:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmKTC051065; Tue, 25 Feb 2025 11:48:20 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:20 GMT Message-Id: <202502251148.51PBmKTC051065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 40616b7e41ff - main - sound: Return if the new speed/format is the same as the current one List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40616b7e41ff96b6d7522445b00f27f26d593a85 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=40616b7e41ff96b6d7522445b00f27f26d593a85 commit 40616b7e41ff96b6d7522445b00f27f26d593a85 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:12 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:12 +0000 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 --- 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) From nobody Tue Feb 25 11:48:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G830cR1z5pjjf; Tue, 25 Feb 2025 11:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G810Lpnz3kCZ; Tue, 25 Feb 2025 11:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=usbJ3hZEpsCAZvXOFF+9lRTdOnuugQiqHWgBiSnzFPc=; b=lN4Bto58Ch6ZtyZ2IovvDQ37kRNSONm9eLth2CoqB/W4Gz4vfN5S8AmFqJO3HCn6/1UaV1 QDbM9dPkPMFBG7o/35Us7Y5Hj8k1RxpNrSDH/8VJBZ2mhbIOdfkyhgj5fWdEq17kxDpEXI pFQkcpVnkYbqfi9vTKq9h+sKNplt+NHyqimO9fjuu6EUnSPgdgvGVoe+oQHL6DfGqyKy+9 C8ShPrjxQ3FUrtrQbB45DjtxNumYaVDirml7V0S8VNdvTYkDcHsANvdJE5jYcnJn/znvFE zcvqFwI1XoMYTvx4rgz0kf88XwTWZGtd4wHNLAy/24Z9HoLrKRCsMbnhWHZIig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484097; a=rsa-sha256; cv=none; b=wEMUFCexuyf98WMEmHSh9deoP75fyKEjz2GWjoDcp+DYHgpQ0tqNVoYaz3Mq0hUWQ1y5kT kTmUrK1WJOCiYo9NjyaPH09u1d08NxwHHFlfsQ1VLXb6u7lOF8E0KoZrsKJD2QpsDdwugr TPqZMkmmZW2SxlYEhdUq7ck0EHRJ3wP+MUH224ysg25JsoJ8ecubEeJB4V1Sek3ngFSl/I LXizeEDxBcZbKRng0qCJhOPwag/1bQfNa9GKLJTu2lZU8RPk5Gi5yRlhDZrkwgbc5ygiVL lBzvICp2Iml/reOISIVEaC/VmFWeM3gIL///awMXMEIgAxTg0QmOC9CdkI2G5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=usbJ3hZEpsCAZvXOFF+9lRTdOnuugQiqHWgBiSnzFPc=; b=woYb3U+5IM2awBMCKLEMoOPjQXyNXDvlLD9RjgqRbIeLyrbMi99vSGZgTCHVwof1rzzmIy TkfILsf85AsFa1qaFzvHRFqmaIe49dUxa7kZW7n2kmXzlH3ifKciMzxK3JGEozxQ0Jyr6c yJaEvgz01vM8K36BMs1RcCrfnzWSIllo4Nj73n49eMYbrPjwqa+AmnbU3PQH2btBYvb5jL ArFkBO/TuchS3oJhnfw11gXFOJIiO/NqRRq8ba6+ZkMaJLK5pUUsmwzjGN1GpjvYsj7htP Npcio2GT58P9BVvR7l6lfV5Xd9clwsLRXjpQNsUvvezn29XCTQ9tBT14lxEkbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G8074Ndz9Np; Tue, 25 Feb 2025 11:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmGiJ050965; Tue, 25 Feb 2025 11:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmGpS050962; Tue, 25 Feb 2025 11:48:16 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:16 GMT Message-Id: <202502251148.51PBmGpS050962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 1cbafcd13796 - main - sound: Handle multiple primary channel cases in vchan sysctls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cbafcd13796934a7896064cdb23fd4e37d58821 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1cbafcd13796934a7896064cdb23fd4e37d58821 commit 1cbafcd13796934a7896064cdb23fd4e37d58821 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:52 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:52 +0000 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 --- 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); + return (EINVAL); + } + + CHN_FOREACH(c, d, channels.pcm.primary) { CHN_LOCK(c); - if (dflags == (c->flags & CHN_F_VCHAN_DYNAMIC) || + if (c->direction != direction || + dflags == (c->flags & CHN_F_VCHAN_DYNAMIC) || (c->flags & CHN_F_PASSTHROUGH)) { CHN_UNLOCK(c); - PCM_RELEASE_QUICK(d); - return (0); + continue; } c->flags &= ~CHN_F_VCHAN_DYNAMIC; c->flags |= dflags; @@ -492,19 +440,6 @@ sysctl_dev_pcm_vchanrate(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)); - newspd = *vchanrate; ret = sysctl_handle_int(oidp, &newspd, 0, req); @@ -518,39 +453,45 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) return (EINVAL); } - CHN_LOCK(c); - - if (newspd != c->speed && VCHAN_ACCESSIBLE(c)) { - if (CHN_STARTED(c)) { - chn_abort(c); - restart = 1; - } else - restart = 0; - - if (feeder_rate_round) { - caps = chn_getcaps(c); - RANGE(newspd, caps->minspeed, caps->maxspeed); - newspd = CHANNEL_SETSPEED(c->methods, - c->devinfo, newspd); + CHN_FOREACH(c, d, channels.pcm.primary) { + CHN_LOCK(c); + if (c->direction != direction) { + CHN_UNLOCK(c); + continue; } - ret = chn_reset(c, c->format, newspd); - if (ret == 0) { - if (restart != 0) { - CHN_FOREACH(ch, c, children.busy) { - CHN_LOCK(ch); - if (VCHAN_SYNC_REQUIRED(ch)) - vchan_sync(ch); - CHN_UNLOCK(ch); + if (newspd != c->speed && VCHAN_ACCESSIBLE(c)) { + if (CHN_STARTED(c)) { + chn_abort(c); + restart = 1; + } else + restart = 0; + + if (feeder_rate_round) { + caps = chn_getcaps(c); + RANGE(newspd, caps->minspeed, caps->maxspeed); + newspd = CHANNEL_SETSPEED(c->methods, + c->devinfo, newspd); + } + + ret = chn_reset(c, c->format, newspd); + if (ret == 0) { + if (restart != 0) { + CHN_FOREACH(ch, c, children.busy) { + CHN_LOCK(ch); + if (VCHAN_SYNC_REQUIRED(ch)) + vchan_sync(ch); + CHN_UNLOCK(ch); + } + c->flags |= CHN_F_DIRTY; + ret = chn_start(c, 1); } - c->flags |= CHN_F_DIRTY; - ret = chn_start(c, 1); } } - } - *vchanrate = c->speed; + *vchanrate = c->speed; - CHN_UNLOCK(c); + CHN_UNLOCK(c); + } PCM_RELEASE_QUICK(d); @@ -598,19 +539,6 @@ sysctl_dev_pcm_vchanformat(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)); - bzero(fmtstr, sizeof(fmtstr)); if (snd_afmt2str(*vchanformat, fmtstr, sizeof(fmtstr)) != *vchanformat) @@ -628,32 +556,37 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) return (EINVAL); } - CHN_LOCK(c); - - if (newfmt != c->format && VCHAN_ACCESSIBLE(c)) { - if (CHN_STARTED(c)) { - chn_abort(c); - restart = 1; - } else - restart = 0; - - ret = chn_reset(c, newfmt, c->speed); - if (ret == 0) { - if (restart != 0) { - CHN_FOREACH(ch, c, children.busy) { - CHN_LOCK(ch); - if (VCHAN_SYNC_REQUIRED(ch)) - vchan_sync(ch); - CHN_UNLOCK(ch); + CHN_FOREACH(c, d, channels.pcm.primary) { + CHN_LOCK(c); + if (c->direction != direction) { + CHN_UNLOCK(c); + continue; + } + if (newfmt != c->format && VCHAN_ACCESSIBLE(c)) { + if (CHN_STARTED(c)) { + chn_abort(c); + restart = 1; + } else + restart = 0; + + ret = chn_reset(c, newfmt, c->speed); + if (ret == 0) { + if (restart != 0) { + CHN_FOREACH(ch, c, children.busy) { + CHN_LOCK(ch); + if (VCHAN_SYNC_REQUIRED(ch)) + vchan_sync(ch); + CHN_UNLOCK(ch); + } + c->flags |= CHN_F_DIRTY; + ret = chn_start(c, 1); } - c->flags |= CHN_F_DIRTY; - ret = chn_start(c, 1); } } - } - *vchanformat = c->format; + *vchanformat = c->format; - CHN_UNLOCK(c); + CHN_UNLOCK(c); + } PCM_RELEASE_QUICK(d); From nobody Tue Feb 25 11:48:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G8401pYz5pjm3; Tue, 25 Feb 2025 11:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G832Snqz3kNk; Tue, 25 Feb 2025 11:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNEvXzD0NbYvN4FtLjVHLRfmlVbF55k9rPrjy9qqQD4=; b=fEbWzGyK2shhLwwAEPnwRGop4cn/j3qCUt7vZfVpFfHyU8LO63ShkFbCiO36ubhq2+NkFa QZ2sIrmMGJZQ25xQCoLkgh0akOptSwEvPQam/bLb6Z0pOZZk1HVJ4sBdrjFyFocm02I8jp tYZRLhF3x/t6uc689xz8R53Cu8v/stSuE3izsPev9qkg5INiriUBEqav3IENac3/78Qz1Y 7N86jMRid3lzqaTnn/WiWt4tKzIienLJSHdq/Pwr/T2MUsP2jkr3KLlybRl9HFvUmB0lZO BSZDRz7jQqPzC/8UIWQKoWMmNMs2y5Dfd8TaF3Q5cRv9Om3dLnghpGnkApTxkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484099; a=rsa-sha256; cv=none; b=a3xet1aLOukrCM++ryOLYCpV0eCOo6FEaMEVKje/KSzVlChACT6ZUAVpLwFawV+dlfu6qY 5hAGrLKrz8ux9lYg+zbw9IvTLutjfNua+uGVw4i3Dr6yZjXiqqdjHvvuch9GdutAz1wkxm xQubYWo2nbp9dEBEf1fS0/cQeOYQ1h8lRQuAAfNv2InmGtXgfu3deZkLvqfqK+gCbIl3s7 T4TVRux+0GInpx0hvzgM6q3+8s7PaJA1Plsi+mvA1R/rstLV3sA9nmtxPH9YoNuw26HvBd 9b1uEMaoYk+kgEWMCf3gEBJQqnqkkQnMIe0r5OrG66PCQhVnG7TqYJTPia1lnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNEvXzD0NbYvN4FtLjVHLRfmlVbF55k9rPrjy9qqQD4=; b=ymioF/z4jPQ/Phrut5uf7hw9Cgb+PhW6cUFN4kkTihECKkz42cga44IJMMGXiVht8ueWuJ 9NSZNzUGVspuCoIfPyR9qiT8+jqD7wvwTvEjoa6CsrhV96E9xaNdSrKQpE1k0Ii+y/nfvZ UCsOzvZpLQoewetHUjdQ3eNGSDCFoON1UpTnjbCmaTtg+test+whDtalX7nme/rs58g7rI l3KDAi1ATs1ibklQbT0vobm13wan9D39yYZTz7UR7qV13hR83FETXScen1dr0OjBW8Tg4O bKx7PmsAcDnYjW3L72ubOvpLegcfwzT55UayKa2ONa4MdHQKZCAZ3SXKxm601w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G831svZz9Cr; Tue, 25 Feb 2025 11:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmJ8E051033; Tue, 25 Feb 2025 11:48:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmJhD051030; Tue, 25 Feb 2025 11:48:19 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:19 GMT Message-Id: <202502251148.51PBmJhD051030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 4e1b75bebf41 - main - sound: Get rid of redundant variables in chn_setspeed() and chn_setformat() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e1b75bebf41b6e446d72c755fa420836341ade2 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4e1b75bebf41b6e446d72c755fa420836341ade2 commit 4e1b75bebf41b6e446d72c755fa420836341ade2 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:05 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:05 +0000 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 --- 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, From nobody Tue Feb 25 11:48:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G832Zytz5pjL5; Tue, 25 Feb 2025 11:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G821Yx3z3kWk; Tue, 25 Feb 2025 11:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DO6Bkdz9vwFhMnRelSru/o2aV4xhSOCpjq2Jml2dW1o=; b=P2NyTetfJTgPCEo+Sy0EjhJY0GN0RNXkkcoaRT0X4pV5mW1fxXur9i3SftgK5BllKhCNo8 9PnHwT37+xjkvP6+2obvWWWKc+pug28JrykWdjjKLnu3GYkJHSxXhJB/TMqRRUE4kvNbxx sYLkMtI+D+KxtyuD6dmoqSdaBZ748WxUYvocZbhZ6z18mDyqFjBZP5NU2j0gphotdIqSqg LpUFkaf1t72Yvt8/IY6Zl8t5AiF9Xc1NdXbV/tbn6+YAKY2ELlHMgr5ukEuylOiB2bfpLp ov9PYEvkpM6KUuO5a8iQBSPK2lRckc6pAAriZdno1+J815KHPb/3GFAwZVb/Hg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484098; a=rsa-sha256; cv=none; b=tu1uQjzXtg7BSb01C8mN9NDG6NcXfx2KPdWJ4VuwBfAPQRcHyH1FrV40Ya5pU9CaWaw3ON 0ml+aJ7DzOaUPewisTWHflN+QshhTJZvbNmfLJ74MXWA1j+seXsPzoEEC3f8vBwnJgQQcN d8ioTrDJbOq9BqykalZZ8OWOMjGa0HUR5ZjKyzFrY6oCqVLBN0xsSaxQBTrCS4aJxp3ygz /f/ayt99/mmOy823S6osnT74MvOfAbVs/fuUPua7BYC36c/YWZv/HpG+sg1BcyzdT8IAPB VpGxwmhGKl1m2nrBANWBQW4jGzu1uawbU73J7a1crUeZjtnTdMBqzt0GXHoMyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DO6Bkdz9vwFhMnRelSru/o2aV4xhSOCpjq2Jml2dW1o=; b=gMZabYOGPCK8a02BRWiW8/q+kfpjh4WoaDhQOlY6kFhIi8FBW/1teDxC6lDnRR4fTn7Mg/ e3YGGJdAdGWH6NhHvqR1ueCsKAcXQZ98setMS51X9hBLqK9ZcmOwtJ28eQJUk663y+fBX7 zEX6OZedHn0iZz6BamgOc6felbnDYuxJOxWHiYArbIsrqKdprRPlTH22NBiZd+Z4FdtF8E oKtBhSMZYdvGaEoiYbWHda7U576GovlyIjF2/TAjxAxz5XeIfv6/FM+AVXP9odrwbUwi3L UsXcYyAIuXdQ8AYgBkfwgPcyNQyHToCQxxxlTnCLPl6iOuBgRRrGR+rI+cl6bA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G820tFqz8pj; Tue, 25 Feb 2025 11:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmIUB050997; Tue, 25 Feb 2025 11:48:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmIqQ050994; Tue, 25 Feb 2025 11:48:18 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:18 GMT Message-Id: <202502251148.51PBmIqQ050994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 6524d2a5affd - main - sound: Remove SNDBUF_LOCKASSERT() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6524d2a5affd02623e6909fff0ca03ba21882a0c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6524d2a5affd02623e6909fff0ca03ba21882a0c commit 6524d2a5affd02623e6909fff0ca03ba21882a0c Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:59 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:43:59 +0000 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 --- 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) - #define SNDBUF_F_MANAGED 0x00000008 #define SNDBUF_NAMELEN 48 From nobody Tue Feb 25 11:48:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G863kf8z5pjm4; Tue, 25 Feb 2025 11:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G854DVhz3kJS; Tue, 25 Feb 2025 11:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xvHD2fz0l5IoZqtn1YkatmKLn670i6xESby0sDWTQFg=; b=FivsYuw15EPMRvlcBRZb69+cTLRCPu7HTaTf2u5er947+M8VPu/EMqHs+DDYhuOgcLXriq Zw8h27uqB1a59DUjEaAueKwPY7EL2/VONpXK/XqaZ6gZV4nCMBCFq9UDucJl4Bu1xDTamc RTxXifW7A3SU7bBD6vmKkhV1wTn6I6hXmz30QpdQkR3isyuJZ4Ah8wQ3VplIaCkXbPhUiO hSHvcnSw5UGtZe613AIWab7oTxrQkCLla9QbrpEZT17zW138BmHghewx6k4AATbaRUV57N x40s+D+9dTtW2evu9DgRwVLxF8zZ4dZZlCgVjHV/PMRd3FNFgCFlH8yCISTjJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484101; a=rsa-sha256; cv=none; b=TLDQniowAYtvRBLui2gsF/6nkvlrvZ0xH1SQ1b/0rMheYtbJ0/F6gDEkhY/nZZnnmHZpDM YeLPMdoY5Sy/N/kUiNhl7mIIS+Ucgjed74rF9zrGVcSyCR8JKvzUas3jExYZIFYq1OflDk ms1TXF+/cwxZrYsqDHykpl4o4hnqxTWvctH38m8zNdyg8j/4//0SgN7djB5qd4JD2TkkBC 7m7XTtjWM6q7YTxlaY/O+knASYpD63iczDpoKmJmCglM0uxArrwjybzWZcLAalRxhchdq4 IOoQcvXQcv1RB8IfXnUDPCgi8Mo5oddSQQbFSqVRrvDMD79YJiivbv+CCIdXOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xvHD2fz0l5IoZqtn1YkatmKLn670i6xESby0sDWTQFg=; b=qRUqEvCC9Bw3xmBXT8DcR6zgIZ4oDENv2Bn+YTTMxorTQykJ/eGoTcGum0PsBqW0LXlQ1n 27tmmBhVHj91Wkx/t0MVapviOmnKUt33syY0CfpxX0hQoz5Mx7QzTxI5ruNb2jtemYA7D3 kNu1VW7brBhUlySr0iI0UntW95dyNf6pMlFOt2DOXcbaFjdns4Yy2wXkecDqX0XRlGZGh0 qYg5K/XoPYll4anjwkAMuXCXScibKEvonj/5nDdMU1nCN9Ub2mzoDxFi8n+HC29gkO6bhM /LHJHe7dVK9r9b/e69/SM1HBMRm2HJOX8yPc0WJft5W9Wg63YpHjtKWSkmIZxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G853nw1z94K; Tue, 25 Feb 2025 11:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmLCu051101; Tue, 25 Feb 2025 11:48:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmLBe051098; Tue, 25 Feb 2025 11:48:21 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:21 GMT Message-Id: <202502251148.51PBmLBe051098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 352aa9ad1d77 - main - snd_uaudio: Remove undefined functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 352aa9ad1d77a8ea8e4afef66691dc1a06344618 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=352aa9ad1d77a8ea8e4afef66691dc1a06344618 commit 352aa9ad1d77a8ea8e4afef66691dc1a06344618 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:18 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:18 +0000 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 --- 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_t uaudio_mixer_setrecsrc(struct uaudio_softc *, struct snd_mixer *, uint32_t src); -int uaudio_get_vendor(device_t dev); -int uaudio_get_product(device_t dev); -int uaudio_get_release(device_t dev); - #endif /* _UAUDIO_H_ */ From nobody Tue Feb 25 11:48:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G872xTTz5pjm5; Tue, 25 Feb 2025 11:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G8654LTz3kZ2; Tue, 25 Feb 2025 11:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DxA0Vi/aHMmz6l3M2U9N6TKBeXiqZ3jT/nMDr6UHrqc=; b=V84J91ZDHCud+J6l9HLBjISwbzmZpD2NM+3/2dzBdywktCpllNS3PIdwCijsI6V0+v9GbJ 62Y58QytKWC9+H89vzUCTybQWOWs5SmFVWo9WcQMJnCK3QnOaouBeUQBf9d6kxlKJVAS1m Q6ZGKdSjN5QKzmiGIsC3SiioJqWqUbl/IsMThh8JyAU6hQJTQz/LmzVzeop5WDHSgdNYZN 8GU/HFdEErf2xlUTTi0MleEo6NGx5Gw/90rZ5IEuFfLmuDfcbwbHh1kCRlO1x8JUkOKqdz 30dZQqainxulAJjGF+hXwh0WopTbRf7SK9MfknfcB9Bm24tk/S1b+pFVwRr3uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484102; a=rsa-sha256; cv=none; b=CaFnM9A6SQlE1Q2lV+weEYP5gHG+zPycFDJGm+NWs6zlRZ9WxPbsfUZblaRiZpXWXgSrDu Hf+KG9LwFl4S0EEcdKzoCC9qziMfGjv3Ay3yY3xAnvW5cr5rmj6pn1JgyZWlVbdypNT78D 1P40f8zJN0sPoYAjdsN3QCfosXy0bILnEGCrRjydkXWGXCJIyrg8fJm22T7x7y7SZi3m0t d+9KIfViDD2PX24KtDlN8XdjV3HY0jxAgx6bBslrTE+GZQ5ku1SIEFSyFDm+oWpBDFITEM r1QEp6CcQHUwwHdezBjnu7rEOIcXWef+pFNvyt5nVV2y6ZwZrP0Rqg9kmunPHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DxA0Vi/aHMmz6l3M2U9N6TKBeXiqZ3jT/nMDr6UHrqc=; b=GrdQgjkBrlMhk53GVk2kto5F03DdUrfu3pGDXR8n6LnYWJOrUZa0+1E//zZ4vW36ljy88Z Cp6F4h1XVmakUbF0kbOteepWilf2jQurw1ripLyGmZbBpNVR0qlSyNuJBLnehZXRacL3EI 9lu/h93yntW9ZrYmMbgkuPyrCRE6UC4pTaUZuWLKCiafemchJbu93oeFXgh92G4AO9a0pN GCDy0s/IXgYhw8eYjhfhdzCeZ7lWVn7N1kQ8kjbfcIJxhVQ4hUqdfkGN0cMCp+F+2o/anH BFna8H/jiOJmdbpE5feft8dY+gWoWatUWZnsDnHgNDXzacoP6p/CK/h6ROH6AQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G864dJ6z94L; Tue, 25 Feb 2025 11:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmM0p051137; Tue, 25 Feb 2025 11:48:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmMcO051134; Tue, 25 Feb 2025 11:48:22 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:22 GMT Message-Id: <202502251148.51PBmMcO051134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: fd906e47b18f - main - sound: Simplify locking during device creation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd906e47b18f53b09524647bf8431dc6170b8dfd Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=fd906e47b18f53b09524647bf8431dc6170b8dfd commit fd906e47b18f53b09524647bf8431dc6170b8dfd Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:24 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:24 +0000 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 --- 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 c0934dde7718..3e76626f5c57 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); @@ -388,7 +389,6 @@ pcm_init(device_t dev, void *devinfo) 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), @@ -428,8 +428,6 @@ pcm_register(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; @@ -442,17 +440,10 @@ pcm_register(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: @@ -466,6 +457,8 @@ pcm_register(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)); } From nobody Tue Feb 25 11:48:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G891Ywrz5pjwc; Tue, 25 Feb 2025 11:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G886hyNz3kcR; Tue, 25 Feb 2025 11:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LXMUmlVqvfRKWrKgE1QzxvjVPK2/UymSMQOSFPlHEDI=; b=M336k4nD4VAA/EbNwYU4+MJhxxwC+P2OgmeEJtRvCppgve6kQARA0SynMcQKl/rBGc5vrV d49n72OE4RlWUmx22EK3USXVgRjDabDe//fercLhQsCVD3toWTfnRKDv/vHbuADkdRgEDj FWFEX4pq2vXjIn698TBtvUj+CCLM7lIQSgYnaReIMsDZSNVEAYUuDGfylDuZJpJVbx3Mqz BMqJFhrnhrNm8ACBCZQ+JbgPadxkrdVDFEtCLQ9bt1I11YHqoYNtYu/FAY2MDpba8nKsxw vbun8VIkLQbot3rSbcITuq+Oo96Fc4iwzLZeGGNG1fLDi9Gl+Qc2hhbLTsaALg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484104; a=rsa-sha256; cv=none; b=cbXkrMgHtLHk6ycdNYTn0cMN0vj4SkYInzJUmlXj66HfowuHFNs9iFykSDet2TCmEspw+p BX41fgOJsnyV4NjBQkpTPAPGwe8tYEfsxEFxu65c5yiX67BZmiZtcIOFZUm3mmOdo3Uw2B B+U6eHBmtQvDd3f/WElgKblfW+qDMdYthui7yDjtbdsagqqbzClRTN9N4Md7cHQWct5Q5g GMp5bj2f+J/h+ospUu1l4kYwihSqa6BpY4K2L8+UJ930+YMd8WM2PrC9C5IYXuPxWgr5+A PCAPL/EKdmZgOH+bkN+mgIv/eEI+5B2R6RkdOcge45QRUgtEL+rNO+BuN0Qtgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LXMUmlVqvfRKWrKgE1QzxvjVPK2/UymSMQOSFPlHEDI=; b=pW/nfPz2NO8sLgoAnUSu+5PYAXO32JYN4mr4ot/ZjehpjX+O6/nfN+nUuh9KIPUpcrzViL Y7Hsui3av4MIRoqT+0r/OkP2AOzpwyN0SDCt9JYHtPY7jY2El0Q99rCQ3q2z37+911iEwA 8vuoXNoCfl6i4ZArYf0U9iFFCklaqAo2Bat7xr9IlYPseztu2AMq2TlfOfUYkp5kE/G3Vx N3AKtpuApqayy6+jkQPmTNBRkgGX25RWOqkhhpDPC0yzI4BBlXr6JZjoNJOCU8vV2rMhts a96rrqOIKB4LJD8PzUI5DR27e75NmDNa+2Sfzed4NGOiKWSDwgRiA2b4Whc96g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G886CFgz811; Tue, 25 Feb 2025 11:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmORf051207; Tue, 25 Feb 2025 11:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmOfZ051204; Tue, 25 Feb 2025 11:48:24 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:24 GMT Message-Id: <202502251148.51PBmOfZ051204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: bc7e65e95015 - main - sound: Call chn_kill() in chn_init() failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc7e65e950154572d8c9a04dc033075bf37aae40 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bc7e65e950154572d8c9a04dc033075bf37aae40 commit bc7e65e950154572d8c9a04dc033075bf37aae40 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:37 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:37 +0000 sound: Call chn_kill() in chn_init() failure Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48966 --- 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); From nobody Tue Feb 25 11:48:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G8823Gbz5pjr9; Tue, 25 Feb 2025 11:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G8763n0z3kPY; Tue, 25 Feb 2025 11:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b/7+6OF8Y20GGsenMe+eFvbWbhgt5gSzNQ/gOdRa1nE=; b=EG4v+8KivFMMqpXNYzo9P4JMjReXVuOjbar6hRxDsSKE5zFs6uOCxrq6/p86xYHlOXEryC jF9A2gmR3pOpJVY06b8dbZJGbHF7POaRi7ZGbVMLc1h13OJnQPkTAeue+EqLCQiwtxJrAG M9s9YsIlm12HBq2AF5SliYM3CHENc8ylanWQc3uvZmalbVrtapOmIOQC2z+PB7T3zQejFv qSA7axyyyq4aO8MewUk9sSeghEwN2HzroDRQPPmtOjfaOn+cJy5dOaactVXV2jbPR5CtBW e3Yz4pygA0DqWWnxrpX9cdrwReeYONy1lPqOtsaZ+HaFUE3ux6PBbrP/qfGoYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484103; a=rsa-sha256; cv=none; b=TLQYCHWpw9dFgYnz7whDVxBKIAkh2GgZHk3XDFFm3BQZcllglP+qeFSWr3FdEpNJddPOIR Ur6gWeh30e+Tmi0oxcgGDH8ZI4yQ2M/ZvoDZK3GGPWax+bbeU5N9Kn+NEBjPRCTKiAMfcY DgxEVj9uhCZFl9y2lWJG8XxGMxY25Kv821sMk/pTcZ9rkJ0DjO63s50xHMdr22/6j5xhaO Scx9Ha9ZQum4YSIycLW0ojEU+hoJQGY9As/fOB3lj2t6t4ZhAIGuKH1NipImbKw4TxFLbV aVP0DrFY1runRCeNlotbU3QuqlP3NvBfIsWSX+Mc2YuBuL63SGO7dECw+poadA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b/7+6OF8Y20GGsenMe+eFvbWbhgt5gSzNQ/gOdRa1nE=; b=ngoo7Y+zBa/PawOeKU/H30tJ6G7ny+VLzHenP/maxa9WJCnBu5YYxHkeQLXS/1mvquNGIJ cpUq18PLTVWbK6k25jikFbo2aFll6ph+BiymxcKjWJNcBxr/ziOB/VgWCklIT2dMJJ6dBJ ex372dlQdGls7sOg5rtby8SXXzTxyNIL63jwLDw6NB9A09FWO5SHr35ZbYebZwChK0T8Rk WwZH8gCaKUqj9//Jy/rNC0T+2pTTbe28zLZ3fzt1kseug4+rP6yOAPgIfyaSBPoAbauIh5 fGJ8Ki75Ah15eP2fGrUd3t+7vzlWqgy/YnZBjpZRKvnMjt5GxW3g/tOZAFWDAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G875Z1xz94M; Tue, 25 Feb 2025 11:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmNou051170; Tue, 25 Feb 2025 11:48:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmNnu051167; Tue, 25 Feb 2025 11:48:23 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:23 GMT Message-Id: <202502251148.51PBmNnu051167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 2868776c9c6f - main - sound: Update comment and channel insertion in vchan_create() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2868776c9c6f5313a5676786f642b766f103d780 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2868776c9c6f5313a5676786f642b766f103d780 commit 2868776c9c6f5313a5676786f642b766f103d780 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:30 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:30 +0000 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 --- 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; From nobody Tue Feb 25 11:48:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G8B5Vgmz5pjwj; Tue, 25 Feb 2025 11:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G8B0tpnz3klx; Tue, 25 Feb 2025 11:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FxmoDP4W5230XQd8fYQrpF4DZZ5AI5QHJ07zFeoGzao=; b=ieOv/ZEPjz6b2JFVWgNpvyuIADYFk3jeotpubLNs2CcrToODpQWfkqoDTM3WBpQBgXO9FH zzsb5FXdLah7Y2RzCd3rrFH4bf8I7H06RLCdUi/lcYGEBN7KxPLdwNvdm7bf2M05q4TvUB qKTPB+9I/AKuFlhaCNN1WXaqQgLl7hQgy9MhjKY6pwbcf+uM2/dmopMubClYPK0AoNexSj kb3rO90ULhpbUmmrT4u8oAU1QQrW4O/48mgQXvvBg7KYH5lbBAF9nQWQhJf3+bZCImN/OE Pe7zjLtSnPKsaxHEo+R2g+iXCVOW/nHhbtz2VQj/pNDd2LPsknKY/XiWOvTqcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484106; a=rsa-sha256; cv=none; b=HFdh/VupeE3FFC9s10ctt5EiUwy/pUdqkRf+ftP6TvLiTRitqcEjJI+Arreqt561VH6OQu xAZZZFxFL443Iif8Rigla4fyJlBfROq+FZRFAGh/Nv/vZRh0WtUlh+Ttoih9E9iClvgBKt cEI2sp94pHyIfiuozeeDwRp8nwLUb/IVGClnrkOiSY9niaXsCtFNus2Xb8gJAAivl7Kue0 YsbHYt6iOGQhUMi+svziWVOiQb8o1gGUNIgUN8EgAg1XjLQK39UDanHsdccMkvpibhuqpo SBQEy/J+HEtIYIoHGW3HcJ/+lOlcQbuV3fTc3VFDxNDMtpHogELmliibbI6H0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FxmoDP4W5230XQd8fYQrpF4DZZ5AI5QHJ07zFeoGzao=; b=odD3Ol9TAKhIii8LOS1x0/KkuAekXPYTGxxCdbvSe45InVqLJUgsyHt3197MYGUelFicPF d9c3CNn4gwzaPEb8hfBUAoxLPprZ4K4idn1+5jXOQZr+WM3k0VGenHVMkcKU/cDQ5dxHS/ OpphhXWhbyJkSQ8K8StOyR/TFQ3pOc3du1VfLzTqIEOnZNMx/RewAIXLqC5/j5Jx/VVfAR /lcp4TZZX/UGJMgG/dcIb882qineS5nZzZOiEniTsuwzdCa4btbX/SX0uB1+B1lExOB9Ff +u8k64W/TxXWTEqdwsssB0QeHk14HNalx0gdJW+miihM5v/w4BefReMyFgwKiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G8B043kz94N; Tue, 25 Feb 2025 11:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmPl3051242; Tue, 25 Feb 2025 11:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmPNo051239; Tue, 25 Feb 2025 11:48:25 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:25 GMT Message-Id: <202502251148.51PBmPNo051239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: cfdee707fb18 - main - snd_uaudio.4: Move non-uaudio-specific BUGS paragraph to pcm.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cfdee707fb18a0fde4bed4e85414f8803461249d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cfdee707fb18a0fde4bed4e85414f8803461249d commit cfdee707fb18a0fde4bed4e85414f8803461249d Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:43 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:43 +0000 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 --- 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 e25ffe264ae8..518c37b54f1d 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 @@ -673,3 +673,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 hmp@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. From nobody Tue Feb 25 11:48:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2G8C2dDnz5pjrK; Tue, 25 Feb 2025 11:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2G8C1VMYz3kmB; Tue, 25 Feb 2025 11:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSzTaushSYAyfOZMusASMoyG6vpALdn018w1FcL1tjk=; b=e6oeWKWc+S945O0pjykasVL1QJRDx5cRJK7gHUEPbgMRspqzpJZTw/U8LlfB4AjPn/Obi6 ZBQyPlDDbuZywJynumXYgyBqgU7+72Wdakax3WsnxjrmqEZ21Tt6x9n28+NaJXwxi2mA6F Vb9hJ7iK1sn61fjqb7qS2MlQPXoix3mT+OUSsnQ+7N3vssmtxG6JS/AWZwzInOKOx8tw1Z Dw4h7BnqE+zJVHecl5fm80HLw7nwsvPfiFMXQ7J9bRbJ1zuQig4oAngQt2EJ24ReHx9HIv n2TQ28D1UIa1cfWNHE89qYQwRFaFJ6+ZMrv9JEBRBctawWDAQlcE1fMXU5mH1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484107; a=rsa-sha256; cv=none; b=CtGBjjEV+7JJGjewpJqhQmBw4OsKOJv3jEI3LeCoUUERjNQERU3CIInaSf3XjGSq36NJAe E8Xbxrc00xWxAbdPOz4MYTGk1VvcXBkXV2eH9jv0Z/JekgL7lh8ZV7XeR7IhA4IwEtf4Lo IgJTDzgLFVCNiB7Kl57jRDF6NIDx//2lJ4tth7Dh8YYFI9kKzqxPXbb8IOKPk1KlEyoZAX pSpRQ73pFysK5XYnQ2vRdYqM13rJc3BwIlP7QR4t7H1Nz2PPtojJrFHsXQwdtyKg9nHOGI Lo+HLqmYP1fIGgp1zaT8O+Zkkq53iuw1LCNGztOYpYOaSvi2z2jsm2fVLOwWAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSzTaushSYAyfOZMusASMoyG6vpALdn018w1FcL1tjk=; b=bBybChxFjsxw3T1fH5ff3l7+OL8efVMKWKmVUD48VudaZ4PAiZycqKISsgs7mk3aqSxaK6 DuvSKD5Bb84UQWtiGoX1ThhSjmfHDeoN2k4Tnekpee6r1LsKCp1cQqcFoRZCYOz7nIbQTC leePe+rrydYl1uN95wUdNyeZiaTdrrWZYANL9xVb1FkqCYGTaSevnN1Owmaw8W6p0Zf76v wlGhlZr5EsTLKOo2gNRbTeCDXQMJgE7icck9kLPjlyalKKo6Wxk5wfVqh0dyAWsXyRUMz3 22rzzyckiDM0p6HJZfgqKqzyE+ScwNTU62PExsqrLdrEf+MbU6NXIQ9JW2aRDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2G8C0y4zz8pl; Tue, 25 Feb 2025 11:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBmRLs051275; Tue, 25 Feb 2025 11:48:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBmR84051272; Tue, 25 Feb 2025 11:48:27 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:48:27 GMT Message-Id: <202502251148.51PBmR84051272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f121de8fbcbc - main - mixer(3): Do not skip devices with no volume control List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f121de8fbcbc8aa82f9fb59039c502406b7c88b6 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f121de8fbcbc8aa82f9fb59039c502406b7c88b6 commit f121de8fbcbc8aa82f9fb59039c502406b7c88b6 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:49 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:44:49 +0000 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 --- 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); From nobody Tue Feb 25 11:54:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2GH66NFxz5pjwZ; Tue, 25 Feb 2025 11:54:26 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2GH64dCdz3vkX; Tue, 25 Feb 2025 11:54:26 +0000 (UTC) (envelope-from christos@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=g9IOjDed+bs1ZaMrUKuPZRlOFJsXfubdJTsTBGzlriU=; b=ceV9wAvpjdkKv4Jcr0vyNq752X92KfNYhMdJ60UYQ5qDMMgohhpRKfR6TODschtRxGyLj1 9JoAxTQE9k1Ym//tpW78ee4+Xp84syoVi3RvB4rdlzjSz4l9b9qTkrFlCuVb7wYlflfm7G jhLF6pcbrlOUDgdm/dEvi/NJ4q0ynjAbfqp2BAbyNs32w6sHKnv4ZxuXrOKCZC3lmiY68y jve8nxWEJqHlDX1KtW0X+fECGTom9NfctWFC8bgClIRVSribSsjZ5hxfDcNS5GV97cWqfr F0wmRHdXBos0sm3Lsrzr2+/chTcvlmBjti4IPMmJj235vmg2BPwQC0rZHQZ3mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484466; a=rsa-sha256; cv=none; b=PcOTG2Jjed4xflgRjnm+2JPMIWHWwNAg0AngFLpZPdsxUT6fqWYcYIL6k/9RmW33pjNGOX BBoBivvOZt1shUvOQbTKySOMjY2/WUvxk493u76TvZL02rQYmVZhy6Vrv8yQeQH7pbUO4x ZEt3Fg2MJFPDXHrMTPD2Vq/2WISmmRS0ftoICnQC6eSniaVxD6hnfXI3sHQ3vTLJjs1lAb RPWNHztjXlzGuN5ZTG0PW/Oz+wt/VKMDaOnhQ7t7PJHm+nDKd/TayfCIIzARjA9/08obfA y0ObxBnucLx3MawFl6pNmSs6pq8EN9J0YyaQhg1/q4tQamdcugIj1x5qfnEQEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=g9IOjDed+bs1ZaMrUKuPZRlOFJsXfubdJTsTBGzlriU=; b=jwFA0CLPe8J3Sp4O0jwZnt96namwIUIPKti3Z4+LM1zu1n0mJCpatE7EsNCt1ARjG9XUee puP6ZXhSP57gGqqp5VU1DgmdGQzUeO9oKyhuFoUq7PrRHqSgqvfhXhXWmajYzozTJhkzTH MUwaXwTg1mLeb0DNr9ufTUG8fXdmc1KrjW3m0/eD1st7oiYYjYRjQ0eI06tkTx+Hu18kTt +kUZHWv7rPNqBgcYn4k50YtvfukpWctXgooYC84gKkXA4AJIcVxsYJhPn4JDBVVrTj45+3 2bZ8bN6uYFTi1QxP7JgV20KzKnFBmPrsp7hLTuGFitsQqm5+iiiBuZWvtvwN5Q== Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) (Authenticated sender: christos/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z2GH6173Fz3BX; Tue, 25 Feb 2025 11:54:26 +0000 (UTC) (envelope-from christos@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=mail; bh=nR9/Tla7mTwEfJc tYYMPqysE4Fmv3XnZcBxQXJ5txgY=; h=in-reply-to:references:subject:cc:to: from:date; d=margiolis.net; b=RouBSHxmCTKYZNrDShYPvpRMfSSu0RZlNdv/Qrvb Is/KN5r169juKocbOll9e0mRZrpP1hpa5s7ciBpmVL35/LifzKHIvfxSbMqzQtRiQft9Qc gzbwc/7EBFrshNblCxw+qsYgFOCD/BTOI31cjCpEUco/3Fs18W9u1c9e9Fxh0= Received: from pleb (public-gprs368599.centertel.pl [37.47.71.24]) by margiolis.net (OpenSMTPD) with ESMTPSA id c765c465 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 25 Feb 2025 11:54:22 +0000 (UTC) Date: Tue, 25 Feb 2025 13:54:19 +0200 From: Christos Margiolis To: src-committers@freebsd.org Cc: dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2868776c9c6f - main - sound: Update comment and channel insertion in vchan_create() Message-ID: <5c6vlgmnxtmfmscsegx265wrxwjgrd7tqi6nhztqpxz4zmyvof@qrhioyjpx5hz> References: <202502251148.51PBmNnu051167@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202502251148.51PBmNnu051167@gitrepo.freebsd.org> Christos Margiolis wrote: > The branch main has been updated by christos: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2868776c9c6f5313a5676786f642b766f103d780 > > commit 2868776c9c6f5313a5676786f642b766f103d780 > Author: Christos Margiolis > AuthorDate: 2025-02-25 11:44:30 +0000 > Commit: Christos Margiolis > CommitDate: 2025-02-25 11:44:30 +0000 > > 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"). Forgot to fill the FILLME. Sorry. Christos From nobody Tue Feb 25 11:58:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2GNN0wsLz5pkfH; Tue, 25 Feb 2025 11:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2GNN0RQ5z41KQ; Tue, 25 Feb 2025 11:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1XIRy47ptex23QvUgf9agNVkHjjXDo63ZeLDutXFwDQ=; b=s7LzuWdMPPuwf3kmDucJxPlM3fTux1CloDVR+Hz/STdaIiqZ3ALxzGg99ZX3ZwYujgbScZ w7Z7zzkSacYqGDxCeiKgpuTgiNaSHtIkwR5be7VW+YL7yxe9gGt1b8ufSBet66qHbBX+xU VhPTdZFo/Up5WWataR48rR0ZrkafxBUhRMjIpaG45ZehqO48g6AID+ZjbrqzTE3zidOUEj IaLGzgVRKOyYMWDQFV2PSSdZyDcKAhzFNJ5sbb6aY3vrN7znL/q3AIB8QqN8hMJiBQX/dI CKC5E3cAKCO4P+X4rvlxabNTgNiaw9zEVK01kMgVAuQjOuq6bKD+IaJL1GywRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740484740; a=rsa-sha256; cv=none; b=TJxFXaMJ98JzK3PxlPquUrzw4ydS9uxaYOo/im3q+FEbpA0cg+GF2pmTFGPmWmpw5Gitaz QvFX2VH5LK2l8BUdLPBAg/5XiHhzek3U/9aXlzn+N3KB4nVu/EMgbtUPUO6NTya3UMuM2T lOepRqsa3Rpn8ikCL1T9ARI55ST40Kasa+3nLzA4QIaCPPdhbSrfiUumPGqhmbayE5/8v8 8jhbZ8T7XNhERqVmqgkejGcKecgg7cuKyiT8y2cvQOLz7G1zZK6EtCXupJpJTVuNU1uXYh 4y/zwlVIhnCsLr7mMaFtIjNDthJUbaolxdCQ9Ga5Dfj/LrUQLMCURxbYbuFtjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740484740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1XIRy47ptex23QvUgf9agNVkHjjXDo63ZeLDutXFwDQ=; b=L2rdCHj/+l9LBgzaRIDduDaqqgCbLcOWpE+duQvbtvo8pgR1zycSRV+US8NWXnmYqUP7X3 K4sTRh8it+pM7os0nu1u/Pw2oQFhR81a1CgDulCq45WMhwOUFSmbhGnTThwxLiQhFDFptq VezI5lAXCHN/yuE/bxhdkeHt0kIzkX01E2SL8PmgYc5DbAF2/5Tl4Afa5ob4ssA2necnO9 mJzg4AfYNfHSYYaxItDQ+pK7S5KoUfyBgy7V62o+p5VN9pej6CeWm2HaetMRQYodB7EDM9 Kb40WLQ5V2YILIUL8HJELArDq18dWDhQSI7FsHoe5zgw3RmjRArrR0qsMKaWXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2GNN02Ftz92c; Tue, 25 Feb 2025 11:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PBwxLF069941; Tue, 25 Feb 2025 11:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PBwxbO069938; Tue, 25 Feb 2025 11:58:59 GMT (envelope-from git) Date: Tue, 25 Feb 2025 11:58:59 GMT Message-Id: <202502251158.51PBwxbO069938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 3b60c193fc8e - main - RELNOTES: Add 02d4eeabfd73 note List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b60c193fc8e0d4fdc6cf8683afbb7c9b3b5f6ca Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3b60c193fc8e0d4fdc6cf8683afbb7c9b3b5f6ca commit 3b60c193fc8e0d4fdc6cf8683afbb7c9b3b5f6ca Author: Christos Margiolis AuthorDate: 2025-02-25 11:58:25 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 11:58:25 +0000 RELNOTES: Add 02d4eeabfd73 note Sponsored by: The FreeBSD Foundation --- RELNOTES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index 96e2d24bf833..7b5eac0d8730 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. +02d4eeabfd73: + 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. + 7e7f88001d7d: The definition of pf's struct pfr_tstats and struct pfr_astats has changed, breaking ABI compatibility for 32-bit powerpc (including From nobody Tue Feb 25 12:17:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2Gnj3LT8z5pm9M; Tue, 25 Feb 2025 12:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnj2WLKz47DN; Tue, 25 Feb 2025 12:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=du57E3SgrsQBZ9jVZjMIVlmI8dg91mOIaLLDlvDVgXg=; b=Tu6k1ND0i2daCWjO3Ayg0LusWPX8bSbvpNXZSK9p0qCWiK7KwgNKzjI8LCYz3OWnPqLqyw y74lBM0BFR7AU7ilPMVgt1TNR5Gz7jt0HBsOHa32l4p9jWKajs16juRVw1ZHclPjQGsL97 +c+FWXfe7c/GmAj9hUru8l4nG7/QUJ1iFK8eLc3UXa6vlfblDDt+nKAT4pi9JDBBkWc3NR Pe4le/mwq6IJtsw0Ggk2sxso4cyPp1p7AmWVHG8RpNi6zJYlfuwT9MLKip+jdW6EeWN85n +cgaSdrJF+5EsQseld+7cHGO+fevhfCsYmKWL++FIwGr3cHHJzVOCNVQmbDiIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485849; a=rsa-sha256; cv=none; b=pxt8yFYf0n5INjIjr7TbuS+9BmsVU1Nswvmba6pQ/fSbuUJ58fgcBKudCQMsVSoIKP0SU7 QkoKmw8qXgkrFXHIrBOovsR8lImyifr30tY48HrRKxHzVH/ND4FVROgrGwFpukaWFZE0sl 2c6KpTZVnIpNyOSUCSRQ3f8nS3r78pkdu51/N9WdJpARt6wR9lFYbUzFWfRt9QWnTfiEZZ RDYd3C2142s2pClxKTJC7DIzvxYVhoe2bFBOjc2pjzS8lkSYbKPAZdC1WhgtQc22aF6MI2 fnLDCn7FcAvRGkck8LrNQJAOqtiB24D9usHb8ghYtn2/dbvUEm2kDR8r+QTkHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=du57E3SgrsQBZ9jVZjMIVlmI8dg91mOIaLLDlvDVgXg=; b=XCTSSXDU1k9l0eNS2GGPYHZulEgRLRQoqAMEoieEEObfeEi/QbxO0ZmS9DUMDS1poJSV5D dfJqC6ICsXn8XjCRllUVTdT6yJnM3lcyiLcIe+ETYLRmd6TiTiuAlmpKG3ZcIpk+jebqbW pRZakJ7UWCQSUpsO80eQRROCM1EKKrQJc3vMySnxuUqbiPv70EXSL14vih9x6/7M5oyHD8 ZaT4yEyVI+LVUNcxmUEIO9v+kCp7f2C5eeHyJk6y2PlUdJkXRXM/AUPDu3siIybtooh6ny dIeXoOvOsuhSINVQvuK6ZxouKNo2j2wIxPtw1oEL3FWRZvugyylX9O20LrsbNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2Gnj258Yz9YX; Tue, 25 Feb 2025 12:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHT3p007975; Tue, 25 Feb 2025 12:17:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHTOw007972; Tue, 25 Feb 2025 12:17:29 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:29 GMT Message-Id: <202502251217.51PCHTOw007972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 999e714432ac - stable/14 - snd_hda: Fix typo (s/owerflow/overflow) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 999e714432ace973ab548ddc2c2b0e9c7db3388a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=999e714432ace973ab548ddc2c2b0e9c7db3388a commit 999e714432ace973ab548ddc2c2b0e9c7db3388a Author: Christos Margiolis AuthorDate: 2025-02-18 19:35:52 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:14 +0000 snd_hda: Fix typo (s/owerflow/overflow) Sponsored by: The FreeBSD Foundation MFC after: 1 week (cherry picked from commit d4176fdb1370f5dcf2c40c153e6bd1ad0c4a2f85) --- sys/dev/sound/pci/hda/hdaa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index c0eb1864f145..3220ef69776b 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -3218,7 +3218,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo *devinfo) continue; } KASSERT(cnt < max, - ("%s: Associations owerflow (%d of %d)", + ("%s: Associations overflow (%d of %d)", __func__, cnt, max)); type = w->wclass.pin.config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK; From nobody Tue Feb 25 12:17:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2Gnk6Lvmz5pm5f; Tue, 25 Feb 2025 12:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnk3YbDz47M8; Tue, 25 Feb 2025 12:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YRazfyBpbqOXyhmOJBegINdYwsXPpWA4v2xr7i1IWeQ=; b=r88oWgm05VP+0zw08/XEt6jgdvlmjim9bBZ7yRhaIHbWS1y5pc2J+rHXCamzG56A0EBbM7 1alP7cvFduADLmXP3GmWZXtGfbsEJzlCLB5nluRXqdC/EWLXmQaCFNgryt20Oir19SwzXH TIdKR/kTMhGx02KntD7otsl11VD/0CjIDWxO5lKMUWb1NY5mGsXf13zveKUnDq9scvyiab 5xOAcldwdQ3wR05RYzsy6mzb1TymQSYescGuT0iJEBFVm4Dka/YeNozErl5nz1PoY9ENZN ABorvMRQxNTisdL62pC19hv3ePExKt07frg5zwjrEgfdf/CkA3IZFDYRYSdrng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485850; a=rsa-sha256; cv=none; b=NU1uQMi1587JxXuOE8jz82KOmGr+ys9shv/E+zedEjEzQAWlP5L1bYjNStUXWv1msHkr4j C24lkvZdO6hJ2jD+YcRFLAA7YeYm57EwluLCekK6G63vuSKQ1rscGufiKqwgRizn034kUQ bND+fPm08iQTbrG4pwGHCPk9sId9qMai/HeaoMd8elQqQC50C2WbpnwRcjN7vbcQB6Sqw9 eJW3aPaIXmk+TUK4521u2BBOqmxl0GpSM1nnuoTxWYamTt+shH+R/nuvs8gq+OJ17OyNXY TTEbh6XnC+Weq4mB8aKFDHNTRs61H7RJDQr7gFhAuhUJMjZJ0L+DEOzy3g09MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YRazfyBpbqOXyhmOJBegINdYwsXPpWA4v2xr7i1IWeQ=; b=hL5RGbaxOPRdksqrlobg9+fPmgnhpI6pb1YSNjXd8d9+MM68BcuX+gmAdtw7vxGT5dZN7p LIUJANDe58bLEmpi5ELJlnzoh9kXmn/SRwL968uDbvxXED4KP5mPxY+6U4KbqMKbP0N9+N Zy5LCeqAndlzuu27IpXznmM9b/a9kaWhS1mG/DppMWMO+XohddBgEuofheJ5QcYJ0FN3Sj 8t7R8nC181su0IzatFegFz3EGEid4aWAUg1FNu5JhX0h2Ue0edQmSAfg611gtQiuklt9Ys BaRkrlDl4W89XZKcVu0iWS1veF37VTn4IHd3KtH5TxFtqvGnxt8pRitkpPwXKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2Gnk33lhz9pL; Tue, 25 Feb 2025 12:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHUJZ008008; Tue, 25 Feb 2025 12:17:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHUwq008005; Tue, 25 Feb 2025 12:17:30 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:30 GMT Message-Id: <202502251217.51PCHUwq008005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 47a067308ec9 - stable/14 - sound tests: Fix downshift calculation in pcm_read_write test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 47a067308ec97358ef07b7a5fb660e2d5fcc023e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=47a067308ec97358ef07b7a5fb660e2d5fcc023e commit 47a067308ec97358ef07b7a5fb660e2d5fcc023e Author: Florian Walpen AuthorDate: 2025-02-18 19:35:54 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:14 +0000 sound tests: Fix downshift calculation in pcm_read_write test In some situations the feeders in the sound module lower the pcm sample resolution through a downshift of the sample value. The pcm_read_write test implements this operation with an arithmetic division to avoid implementation defined or architecture specific behavior. Due to different rounding, the test produced marginally different sample values, which made the test fail on 32 bit architectures. Correct this. Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") MFC after: 1 week Reviewed by: christos, markj Differential revision: https://reviews.freebsd.org/D48926 (cherry picked from commit 6672831bda883756d7f4598bb4b119f99eb1e7d2) --- tests/sys/sound/pcm_read_write.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/sys/sound/pcm_read_write.c b/tests/sys/sound/pcm_read_write.c index 7ef310a35c25..cfd89eec7c19 100644 --- a/tests/sys/sound/pcm_read_write.c +++ b/tests/sys/sound/pcm_read_write.c @@ -81,13 +81,21 @@ static struct afmt_test_data { static intpcm_t local_normalize(intpcm_t value, int val_bits, int norm_bits) { + int32_t divisor; + intpcm_t remainder; + /* Avoid undefined or implementation defined behavior. */ if (val_bits < norm_bits) /* Multiply instead of left shift (value may be negative). */ return (value * (1 << (norm_bits - val_bits))); - else if (val_bits > norm_bits) + else if (val_bits > norm_bits) { + divisor = (1 << (val_bits - norm_bits)); + /* Positive remainder, to discard lowest bits from value. */ + remainder = value % divisor; + remainder = (remainder + divisor) % divisor; /* Divide instead of right shift (value may be negative). */ - return (value / (1 << (val_bits - norm_bits))); + return ((value - remainder) / divisor); + } return value; } @@ -103,8 +111,7 @@ local_calc_limit(intpcm_t value, int val_bits) * behavior here. */ if (sizeof(intpcm32_t) == (32 / 8) && val_bits == 32) - /* Divide instead of right shift (value may be negative). */ - return (value / (1 << 8)); + return (local_normalize(value, 32, 24)); return value; } From nobody Tue Feb 25 12:17:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2Gnl6zK9z5plng; Tue, 25 Feb 2025 12:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnl4Zx1z47VL; Tue, 25 Feb 2025 12:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUxV6F03l42dfBgAwaIf3HdmgO+YYmnLH9OYbxV3fTA=; b=sQPrhBRbF9qsR6vuDpL2ROGuW7GS9iNuUoutAbyp/34RE7wuXUULlxdSDRyUb/hraginas IWUYK9LM3e2snZKviNlGeN2JSDpHaI4MRsEPrB/zIDPjVZsIcDftiWmVWcPbosvlJlSii8 Rd2SM0gFk6HedJqhh10YnZC1qLI4jlaIeKXLA5CoiMMZGCTz2Y3KuT7Tslwkq423BCo2FS yBGlHYZ1tQ+0692VEGdE7wF25B5tc7aSmKQf54BsFlFLzJtGHgpIWodvgUPRNxNui/smvt j2jlY9I1eEOAsq3Ot68TUSij55VVq3j9PIBaHxzZNoIz1OVVjoI9sznZAmv+PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485851; a=rsa-sha256; cv=none; b=nqgPLvpnxP2qDLlbbHiSMHfoXykWdRrf71Nm7oxrX0U7jGW+FNCsAp77YwID04ENHQ7jov PJWOUIV7anSy8Yd+FSbLSVFwuxOkLIgqgggiDxH0X3GpdQqNXfliQ0tMu9i27pxRwGIcE8 G3fCJK0fbCOnNC6lyl7nfURhFek1fpIhte2Z1vQFxxkLBv0hFTARf7cWeBa/ke9yAg2XeR OYeW0yRFVGm3OddWH9gse2w8Mrj+6yDSIBCiDZpmtigojcCu2C0XYbsn6Kls0ZXKwRQc/d epVAMuwygC6Zlrz3lOHbgH9fk3/2V6qTSM3ClTriov/E8OeVr6Ad3aUEBHvpyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUxV6F03l42dfBgAwaIf3HdmgO+YYmnLH9OYbxV3fTA=; b=l5t3sqyE2sfUBlj8Tkqzgi72si7qoEIBcd+y675sNZ1m+ksKPL+6nurY5ck/JXmY/ZziIj UlGgdGMoI0BxDmalrszhF4FDPyczRAb+Ug1nIgHOj0/dfnGjyuQ/LHm2gH2U+AgKzNCGDp cXt9gZ4vq3SDOBIg7E9vL4Juo3kR/96m+2v+s6nUsf/NEP/xEyVxQ2nyLfY6VPK2ZM3yuF qOlL+V/TtnYBy23Tw9dqVpS/4ZHgKhus5HYElQ8LRiBvN9xUJlzsKGrrugcP14RCP/zNEE dTIsdyYKHgz/skbHaFDlbe/+FwvZ9Fqds/x4gRZFlrOE9EPb6oypam1pKJROFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2Gnl3zX9z9vn; Tue, 25 Feb 2025 12:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHV7D008042; Tue, 25 Feb 2025 12:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHVVN008039; Tue, 25 Feb 2025 12:17:31 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:31 GMT Message-Id: <202502251217.51PCHVVN008039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 1be7ae1a79a7 - stable/14 - snd_hda: Define ALC898 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1be7ae1a79a751a81920ea747ce134de35388bfd Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1be7ae1a79a751a81920ea747ce134de35388bfd commit 1be7ae1a79a751a81920ea747ce134de35388bfd Author: Christos Margiolis AuthorDate: 2025-02-18 19:36:42 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:15 +0000 snd_hda: Define ALC898 PR: 207996 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D48940 (cherry picked from commit c23d53490eb3ac5568050ca9a58534ac04846281) --- sys/dev/sound/pci/hda/hdac.h | 1 + sys/dev/sound/pci/hda/hdacc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index f0e72f091a85..40b697b05e78 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -608,6 +608,7 @@ #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC897 HDA_CODEC_CONSTRUCT(REALTEK, 0x0897) +#define HDA_CODEC_ALC898 HDA_CODEC_CONSTRUCT(REALTEK, 0x0898) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) #define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) #define HDA_CODEC_ALCS1200A HDA_CODEC_CONSTRUCT(REALTEK, 0x0b00) diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c index a3a7b5950994..989e9dbe1060 100644 --- a/sys/dev/sound/pci/hda/hdacc.c +++ b/sys/dev/sound/pci/hda/hdacc.c @@ -147,6 +147,7 @@ static const struct { { HDA_CODEC_ALC889, 0, "Realtek ALC889" }, { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC897, 0, "Realtek ALC897" }, + { HDA_CODEC_ALC898, 0, "Realtek ALC898" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, { HDA_CODEC_ALCS1200A, 0, "Realtek ALCS1200A" }, From nobody Tue Feb 25 12:17:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2Gnm6p9Pz5pm5j; Tue, 25 Feb 2025 12:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnm5S58z47MG; Tue, 25 Feb 2025 12:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghb0wIBlps8DlYg0OxAXu+s+WpDnPtvdST66icCwRGU=; b=Q2ZuFohNNKP9Lwf9weJOsbWuOwG8wYy4INAD7d+tVLeRX82s23qn7ftQXmW+kvJYwhueBO /r1O2aNpKKBL18LCCAZZUM3Q56ANIhqHkijJc5uzVv4kIy9c4ubksfbUCK5hmbmlNeGlQe 8xd5bjQVxVcAHVYMOYKncXudA8OyljhDaYleC/kwlE5OCqDoxbva0uO6noyfFipfSg/W91 EjYyLZ0e0xfAz5qQAEAMAOULXCZQFSquXbam0JGjjGKL3/tql8ccN11WVFel9V5hctD8BU cHnJ2dEFsK/ywBGsmtH2K3EQcHbpkJ0MoUb5aDM48F0EArfXrCU+l72wr4EXvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485852; a=rsa-sha256; cv=none; b=tX1RzknDm1Cj/Ghr1RAsIG+5mzln23ySQO0HxXHuHhd82WctJxOICg7OPR+XPqh1JBPQrp rrr9X6LvZs5aj1BBAMa/2PXFWuWhNOI/CIIkEqu4r2XcwNBmQLUUDr+vnEaAL7HKbtfP1C nytsc9GCfGpow9CcT9BmFk8GNfe+5e2Olu2l8LNGdDcR2sTkrnh2IAzLS/6cxEKMK+NxeL kWziXGA49FyJ/bhPHMnoYZ6TyorsOWs1ea6ihxWQuv18EtPFc+0KXHLhU7AU09maW1I8k4 +AWR4JpZ+VCOh2pKDWSBWFL3FIK71kXxiwzHmCPdPJ0KBOrlforbQi5fFTvarQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghb0wIBlps8DlYg0OxAXu+s+WpDnPtvdST66icCwRGU=; b=MTDFQJTrQZ21bamC3NZvNC7ZuhccpeDw/vO7A4rbdjwieM3ZTrsdVFw9tXFaKrXOmI+w8z IqOx+aWXV/Sw+yukzBkSQSFUzAaRBfbVhMXKUZJc3xsN7r2Af+v9TY8JE2uTMhhgIO6qOp b8ZoneavTFyb+gRwkm6Jn5DMX/F3eEEirOONjHe/MxPJ0uTzhjzC/B0x3JLr5MPe9m/J1D guUOdnnQ3JhGdlO3dzV5OlKjq4baurYrJZ1EEpxqL5WAqMENnbD3zx0LlTEGMJq2zA2xRz 13uaP2eq+saDjXTYbF5aPvjd4T951KLNZZaP2T6JNoWs9PRYnx5FKfl6hEPRcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2Gnm4xxBz9xF; Tue, 25 Feb 2025 12:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHWCJ008076; Tue, 25 Feb 2025 12:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHWsK008073; Tue, 25 Feb 2025 12:17:32 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:32 GMT Message-Id: <202502251217.51PCHWsK008073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 0611b649eb20 - stable/14 - sound: Bail out early if a format is not supported List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0611b649eb20b258b31af7356b53a40f772529d1 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0611b649eb20b258b31af7356b53a40f772529d1 commit 0611b649eb20b258b31af7356b53a40f772529d1 Author: Christos Margiolis AuthorDate: 2025-02-18 19:36:48 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:15 +0000 sound: Bail out early if a format is not supported If a format is unsupported, the feeder_build_* functions will fail anyway, so bail out early to avoid unnecessary computation. This is also needed by a series of upcoming patches to the feeder framework. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48031 (cherry picked from commit 18457e7e25c55b8834e886fd925ec3b11b79d1b6) --- sys/dev/sound/pcm/feeder_chain.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 588bae2ff281..1c4ddca6cdd5 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -718,6 +718,17 @@ feeder_chain(struct pcm_channel *c) c->format = cdesc.target.afmt; c->speed = cdesc.target.rate; } else { + /* + * Bail out early if we do not support either of those formats. + */ + if ((cdesc.origin.afmt & AFMT_CONVERTIBLE) == 0 || + (cdesc.target.afmt & AFMT_CONVERTIBLE) == 0) { + device_printf(c->dev, + "%s(): unsupported formats: in=0x%08x, out=0x%08x\n", + __func__, cdesc.origin.afmt, cdesc.target.afmt); + return (ENODEV); + } + /* hwfmt is not convertible, so 'dummy' it. */ if (hwfmt & AFMT_PASSTHROUGH) cdesc.dummy = 1; From nobody Tue Feb 25 13:10:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2Hyg1Y2sz5prPX; Tue, 25 Feb 2025 13:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Hyg1643z3dd2; Tue, 25 Feb 2025 13:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740489019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5T/CfwqOmtUuO8cneYhsQmvM1lQJWQ5KngzJ6EH5bqo=; b=CTxEk0cqjmsXKbAdlPR1BH4+r1U+ULFvxlZa29lj9FGwlF7UZlk9nU/JT6lWoh50rPxfpY FG3ukh86mhf/Dh0lvnwvqJoQEcc5eDKS3uB7ENQM/nDxpO+F4cU0wZQLoXiEuOTYID6NmZ abJsryREUI0hxH4VGEjvYbmFRD9+wsbHqaFrMk5HTvto8DSFZXj4h/L9DbdkuiFF4s7aeb w6M/M+Pszg9e4Tw858jHaCNs/CN6/dSk5GHdKspaFEx2XN6ndDLhxZTuG9GrOG3Ku+MjCl QVYF73N4kZ59qSnW691ebQiS5jc6vNsMEkC82436qJgcD8cYkOVG3Ys+rtKMBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740489019; a=rsa-sha256; cv=none; b=NZTM5KjHgZ4tXQ8631myYCALZ7EVeqAtHyIVlaJzUz9hRRrSg/O+MeTn5oesP1+wqwJoh+ nO1Y2QYrKB01H6oWPpct4ksbQDAF/6rGgkrTyJmcfG6k54syOxdRoVJ2RJb9RqkxJlLoPT duv1CMxyloHxYjLH2UIl+g8D6npmJ1ZrQUCWYDecxDZWl77iI0IirVzKvMhhg6ZVlpzxIu MQRqYF1LoymZFPRQ2vTzviHhDkiqDsM4xJVy8wBY3LeaT6YEfwKiQwiOGzAWirFqd5Z4NF PI5Z4OrGsGzLR/MoieOzd5e/SIQg8GZBgyLnIXXluAeyrWHEn4lslaPtqTGrKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740489019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5T/CfwqOmtUuO8cneYhsQmvM1lQJWQ5KngzJ6EH5bqo=; b=NCTFQZuVuC+Cx3MspxCC8WNWUzYImvhh6o9JAgEftZljEXXFty93jXqMVVk274HfKMJQ7p rPppuBbW2SMzNxui8eixq8nLufb95rYduj9j12Lpt502tQJKVAfGBTQ/pl87pW7IYmXLwA YcEmmDvmYpOkz6GlBTzLap47vynr1+05lY5Izvs7MvaBfAJYaC4WJsPv+a1ZRXbHiPhUQR +deBg66Zrov+8+e3X9GV94mDu+rj6vVduhXZ6ZxTko0eT9eeqaeBgsr/nktX+jknPldrmG K6BXJWGgCz1e1vxcuxe2lgZJyoog28abRiiYY7AULoiDgApDpjGLCbXqkRO5nQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2Hyg0SrSzCD3; Tue, 25 Feb 2025 13:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PDAI5Q011263; Tue, 25 Feb 2025 13:10:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PDAICC011260; Tue, 25 Feb 2025 13:10:18 GMT (envelope-from git) Date: Tue, 25 Feb 2025 13:10:18 GMT Message-Id: <202502251310.51PDAICC011260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 085c0641a2ea - main - bsd.mkopt.mk: Avoid warning from makeman List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 085c0641a2ea0dee2c58b5bc6e62790a164ebd52 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=085c0641a2ea0dee2c58b5bc6e62790a164ebd52 commit 085c0641a2ea0dee2c58b5bc6e62790a164ebd52 Author: Ed Maste AuthorDate: 2025-02-24 14:51:31 +0000 Commit: Ed Maste CommitDate: 2025-02-25 13:10:07 +0000 bsd.mkopt.mk: Avoid warning from makeman Setting WITHOUT_X where X is a __REQUIRED_OPTION produces a warning. This occurred during makeman's `make showconfig` invocatation, but the warning serves no purpose there, and clutters makeman's output. Skip the warning for the showconfig target used by makeman. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49123 --- share/mk/bsd.mkopt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk index 043a41212064..f93101544bf7 100644 --- a/share/mk/bsd.mkopt.mk +++ b/share/mk/bsd.mkopt.mk @@ -67,7 +67,7 @@ MK_${var}:= yes # step towards removing the options entirely. # .for var in ${__REQUIRED_OPTIONS} -.if defined(WITHOUT_${var}) +.if defined(WITHOUT_${var}) && !make(showconfig) .warning WITHOUT_${var} option ignored: it is no longer supported .endif MK_${var}:= yes From nobody Tue Feb 25 13:33:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2JTF3Tcnz5psxf; Tue, 25 Feb 2025 13:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2JTF2snSz3t3k; Tue, 25 Feb 2025 13:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740490401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bw8qQOKtyKxT/egx8mCAZjxcBHDdMnyS4h+qPhynEE=; b=n9EazGtLSBKXppNt7ROgJ1kTnvfZ2KIlEeYLhy/6UdLLlZGa7tdhIQbpC6ex7mAlM/eXE+ BTOWYAZ4Rtqd9yeqbod2Eu4DDtghMWtLYEAoh9+VW9ACQHGIlgqDgBd13K3h9UCGMIA5FH ETp53YWsWIs/wmKKnJnCRT3M28kn66myQaqBAjNMj3SJY1rnU7/ot3hGQqYh1XLDsq8s/x dHedRgMhx0og+AO63yZckoN3GGNAF9SILgKbrj4ebUTi6w2cA2fHnpFTfF209ahqn8XEDi gKVVV86B2KOdkqMOjiquDj6EdF35eWbFSriMPTlDJMtZvIVhthSF9G34z/LG/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740490401; a=rsa-sha256; cv=none; b=dyuwb0j0JsTGiL7tCCfUx4rHaHfpFrAVjraRl13aQ9TMaPx/yYbgkNtjWD3RxhM+i10QBb LYqYx95eDpiy/iiUfbm8s5lnr+Nufs19Ud52ZFYs3Xu6dJamJ15cIniV76CyeZppgPdvr0 PCEYQ9t/ekBwKB6PiyFhmWq9clsDHYMLcFhY0BB88V5jxiBfCWekPsoIG8wNO4bsnnZxAu eqEWgWDokCK5El4uayAVSHfKu/1YrikxfEE9nVp5YGN0uZl67rq5NTYLXBagQBQWDtzIPn Zq0kcvicVOre+OZSm5qWXzGgzWO9NSgjDYw1sN+4aIsSkR2/EAkznEizSLJiCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740490401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bw8qQOKtyKxT/egx8mCAZjxcBHDdMnyS4h+qPhynEE=; b=IDOd3IaRzeSs/8pkThSSwlYvrLMBEtKg15wa9zG1tsCmEM6kQx0d8whY6ZoP3iLrDd4irx onWpps2UhXHw1n0DizhK+F5r03a+K5f6ezcIUEX4QEJquIn/1jblJsNuE3ee5yjuVL7fez TxxfTm0PyaXcErwmDtdILqknGbaRribC7j/eyofyu+OS8B5c8dXn2HCtg22UHy1yNqUwWi 6yiCs3dkDYeDV1tlUg2NEDzYxHCb9Wifz/wKkprzWPa/LAvVSsc5GMKjcgpywYTH49Kzl/ J+azp2OOqJ9B/cJWQOBmYEZO5MPAty+tIpSOxDBxl4nffhxtA7kHuVvlP8KmNw== Received: from [IPV6:2601:5c0:4200:b830:7494:dfe3:4196:8949] (unknown [IPv6:2601:5c0:4200:b830:7494:dfe3:4196:8949]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z2JTF0hssz4tr; Tue, 25 Feb 2025 13:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 25 Feb 2025 08:33:20 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 93b4a5445658 - main - netgraph: prevent panic with INVARIANTS-enabled kernel Content-Language: en-US To: Eugene Grosbein , Zhenlei Huang Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , "Herbert J. Skuhra" References: <202502250722.51P7Mwnr064433@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/25/25 04:37, Eugene Grosbein wrote: > 25.02.2025 14:59, Zhenlei Huang wrote: > >>> commit 93b4a54456589e78dcd37f2db8333baff3f3f0b2 >>> Author: Eugene Grosbein >>> AuthorDate: 2025-02-25 07:18:29 +0000 >>> Commit: Eugene Grosbein >>> CommitDate: 2025-02-25 07:22:53 +0000 >>> >>> netgraph: prevent panic with INVARIANTS-enabled kernel >>> >>> This change makes NG_ABI_VERSION depend on INVARIANTS >>> in addition to NETGRAPH_DEBUG. >>> >>> PR: 257876 >> >> Maybe a wrong PR ? >> >> The PR 257876 is about port math/deal.ii , I do not see any relationship between it and netgraph(3) or netgraph(4). > > Sorry, paste error. Right number is 214624. The best way to probably rectify this is to go add a comment in PR 257876 saying that the commit in comment N (7 in this case) is for PR 214624. Then if someone in the future tries to look up the bug from the commit message that gives them the note in the right place to find the right PR. (We should perhaps codify this as the way to deal with PR mismatches in commit logs) -- John Baldwin From nobody Tue Feb 25 14:58:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2LMt5ZCSz5q264; Tue, 25 Feb 2025 14:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2LMt4yTDz3Rmv; Tue, 25 Feb 2025 14:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740495530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XnMItXFVTfi46rEY3EthXH52VdZxP+3MLZSKsYV4YPE=; b=PTCKDt5BN0IUR2q94nJfymo0A91vVlOLzR9sx9ELheqqKp2kIKwzF1CJe3HT4Las/Y0hJU bX3F+WEG7Ng2gWkZN2j7pLPQ6zH9B2nyhJO9gRFy4Gj8kjRl+Iw2Bo/BRPXlU1UxtPqGKM iITM3ZSXDTG9KaSb6FmSnfSNABYyKV3RAgCeW5S/LpiYp5/iPV0xcvzKd0iEz2wA00wkPM tb8VyAYez99pkdKgEs89kqwUZArx2CAUIMHQp+B7rUVAGm59j8bHQnUwPKme0VEgxP32b8 IZ1dd7RUwN2DQc0Y/qbI9jzaS0Yi83TVcxB9o+M4ZYaElFMjlNGgCRBT2wOlOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740495530; a=rsa-sha256; cv=none; b=gL5tm5mNU+QqPSZddWPSmQdO1NGTXC8+SbUonjUGUe5X/ORfvJbOLTzjyXBhNIKQPsPA9g 3+HVTGP1K2zP9GmG14yLAoVXQwH0lO9FwOdrnvlLDRnVqp2XWCwxt823QR0dzORkGzZW76 DCyNKLENjq0Q5j+ZhFYNHXfXhz3w5OYgUE7iQMIIx5SsXi06Zh6kPPu4DTNQsTVEgEFQnS 9uJZblcM4hrkSTuau2fivz1ZjEc8WP2im3Z6jqouTy04L/f2yGNas4MulKL/9raR+PZg8A QKCVqx2stE+MC82ZhbwjKH87QKC0veq3loF+Cf5iAOmK/CZutBHhm+7OPfyj0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740495530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XnMItXFVTfi46rEY3EthXH52VdZxP+3MLZSKsYV4YPE=; b=hC1jYDgUAEUhCke9+f987J5rI7H0MZHlW8t6wFvxQZQIdiMyGSlETvQVDbeq3a78R5ahQy uXsFqgMK/TUTUJbzIHktg45rsFob1M7s3GfUSwkO2qEfPa4Mw3btzZMf0gEHmmQM75H/EF x7GiKFD6/SWFvyenVY8EW9A7thXdwDxw4kfKRSipZJxsdB+1dYqznexSlBO6LYqLImQawR JyWsSGwPOLY9jjhKyuQJSRo8Yf7rPokywGcQMmeUQmcQqfZOTTB4JnBDlTd7Br1VqE6VXf yvFkO/hNQ/LZkJYtgqNTUNWcwAD4KIydQdeE4gUlbJ1mmVQVupsKSpd3dbIJKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2LMt4FxBzWg1; Tue, 25 Feb 2025 14:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PEwovr006835; Tue, 25 Feb 2025 14:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PEwolL006832; Tue, 25 Feb 2025 14:58:50 GMT (envelope-from git) Date: Tue, 25 Feb 2025 14:58:50 GMT Message-Id: <202502251458.51PEwolL006832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c040011f072d - main - ifdi: fix signature mismatch for null_priv_ioctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c040011f072d192ef73439087ea986e498975234 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c040011f072d192ef73439087ea986e498975234 commit c040011f072d192ef73439087ea986e498975234 Author: SHENGYI HONG AuthorDate: 2025-02-23 17:10:43 +0000 Commit: John Baldwin CommitDate: 2025-02-25 14:21:51 +0000 ifdi: fix signature mismatch for null_priv_ioctl Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D49110 --- sys/net/ifdi_if.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m index d52bf66bd110..f4a3db5092ab 100644 --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -107,7 +107,7 @@ CODE { } static int - null_priv_ioctl(if_ctx_t _ctx __unused, u_long command, caddr_t *data __unused) + null_priv_ioctl(if_ctx_t _ctx __unused, u_long command, caddr_t data __unused) { return (ENOTSUP); } From nobody Tue Feb 25 15:37:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2MD34J1Rz5q51s; Tue, 25 Feb 2025 15:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2MD33jDjz3p4S; Tue, 25 Feb 2025 15:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740497827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eq6KmCJIeBTd8rDD6WgL6PdNTcwGR32M2h38PAVExfo=; b=nlsrsUSLVpPcTuW7IsCieimtiB5uJROhVsbiaMcPNpXVwNcU7+j8SXLvxWaXsEpx76aXDg fZqkUnZT59pE0dKey+liCbsFraqLL105txIUSAofY3ouoPykkcIczAL58VY75Cjo0O0uAF VZQWTX64RXBHwkj9ANLKhdMqhL6eHaCC8YujaJM7obif0MRJKJo2visxt91LBiTLxAxGvp t6LA+DOwB7XQ2h8slCg2TuzEV0jyBAnj2KXc5qpWvh3jldd3sY9x7j5XzLmaQIlI4BB/79 ZXeHmDNYdiufZcLkQjEgcgc5sTeF+3kUv1q9L7O2jGXVzZDtqCpjVz5d5Wwpfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740497827; a=rsa-sha256; cv=none; b=YkcGt3/9XlaN+TT8T6peHaHHO7KAFjpGeNJoTSQUEwo0FtOLcCWax0Qj+1dNKaW84U98Kt FVZIkHbobkvbNubTs55KfA/mR3AOGxPg6E5+EPC9bceAVGoZMbuzysTAhZbA4ovGf79AxV 4mp+KwLL0+Fft8A9E/mRNx2pxkhgutJpoJ4tk4srG+slcbe+UD7pooWtkASZ0D5rj2IJxI X4a9+skS3a9cY8vgG96veSkc4VAK8uW8j6DOe9L4roquNT77zJz5TkFSTlj2Q+KMyCAmay YQds5ehq9WrL+URkyYdPPkX1vTiQo8HrseUyEc75hLHjP8xdU8jCB0T9xhRcQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740497827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eq6KmCJIeBTd8rDD6WgL6PdNTcwGR32M2h38PAVExfo=; b=eYevGVe/aaj8UpdFW5BHIf4t00QJiHGa2N52diL27BRIPJ1sagljk83TtflvgZfvRKeX6Y q9YUNxEms7ZtqgnTSZOgMHOFKO6pUWHa3U0uqLY8d7BdHn7XJhtL21NQljx1g4krUUHsAe 0OAkxkoG9ItbWCXVPkW+I2GCRpV9QPO2zbJUkfogGbh+OmvCKV7lE7JAkUJemksV1IOPv1 Q4RzzJJTQHvd7ywAB12w3Q8ilYJ1612m7OfJWeFXT7ymWK5aaHoXHHL8EzgbNwAaPj26Ms db8uBohU+55Z2YSGtzimkM2bAux++KAdI3Yy/suOb/fp+RABra5IWXEOHGuxQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2MD33JldzZ3s; Tue, 25 Feb 2025 15:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PFb72V081865; Tue, 25 Feb 2025 15:37:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PFb7MY081862; Tue, 25 Feb 2025 15:37:07 GMT (envelope-from git) Date: Tue, 25 Feb 2025 15:37:07 GMT Message-Id: <202502251537.51PFb7MY081862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 601925180df4 - main - libpmc: add more alderlake models List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 601925180df4d165f4c2c4dc91a49da7b9f3438b Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=601925180df4d165f4c2c4dc91a49da7b9f3438b commit 601925180df4d165f4c2c4dc91a49da7b9f3438b Author: acazuc AuthorDate: 2025-02-25 15:23:37 +0000 Commit: Mitchell Horne CommitDate: 2025-02-25 15:35:26 +0000 libpmc: add more alderlake models According to [1], the CPU models 6-{b7,ba,bf} are also alderlake-family models. This patch adds them to the mapfile.csv. [1] https://github.com/torvalds/linux/blob/master/tools/perf/pmu-events/arch/x86/mapfile.csv#L2 Reviewed by: mhorne MFC after: 3 days Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D49126 --- lib/libpmc/pmu-events/arch/x86/mapfile.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libpmc/pmu-events/arch/x86/mapfile.csv b/lib/libpmc/pmu-events/arch/x86/mapfile.csv index e09007e0e353..7a9fe8c59cb2 100644 --- a/lib/libpmc/pmu-events/arch/x86/mapfile.csv +++ b/lib/libpmc/pmu-events/arch/x86/mapfile.csv @@ -45,6 +45,9 @@ GenuineIntel-6-86,v1,tremontx,core GenuineIntel-6-96,v1,elkhartlake,core GenuineIntel-6-97,v1,alderlake,core GenuineIntel-6-9A,v1,alderlake,core +GenuineIntel-6-B7,v1,alderlake,core +GenuineIntel-6-BA,v1,alderlake,core +GenuineIntel-6-BF,v1,alderlake,core GenuineIntel-6-8F,v1,sapphirerapids,core AuthenticAMD-23-[012][0-9A-F],v2,amdzen1,core AuthenticAMD-23-[[:xdigit:]]+,v1,amdzen2,core From nobody Tue Feb 25 16:48:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2NpB4f5Cz5qBf3; Tue, 25 Feb 2025 16:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2NpB3y6Rz3QwF; Tue, 25 Feb 2025 16:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740502098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiSU14r71Q5XUroEcCU21G93G+cgtVgy8kxjydR6OI4=; b=c8CaLpUOy8LMeQlumn611xann+NQ6CaRjNEdoq9rMuzc//uAeYGmuj1eqiPGdimsxDgQfR vMVW0OU5OP9jIbrIJUVFH0Jn70sRULrgbYT3UgoyTw/fcsoapA9BtdwYtmfC20HwoNtY05 cVTNRBGWJlF8B79oakDMYRxGrUYwFidScEb7xb/fPz9jCjK7rjdobrDkLYsdf/88hmHEWM TpJqNS5rtspPm4g7MHRh7HgtVKopTBpNMv3tUuyygAM5AUPg+j8nHRQjWHjXBmrXLEfYCo fPIgYZwxtnKwptSuLwhWvEfmvwXJR4B2numz8r6vIwPjuX/m19+aZPVePDbRdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740502098; a=rsa-sha256; cv=none; b=UY56jgJFXvDsAzqKIxNxJZZIomZk5TYeHhfYTh0mHacyId3k6P+WrFI2a/J014kfqceRzc pQAwAGuDrl67UYB2qg1njnzeP6MaUBWOfmtgFL4BeZPMABWG6YHyBRfMcwdguRxx62tJwj wdIQGFHRfveJuCbMTNkWW665P6NWGaR6rzTzcTMgLnAQ0Fhk9An+adcOYcDIqphnD3+Gpf /OlE0AumITTBS0yVj2VgjGrauYzdwQElb8puRJ7RpDej8PXTimcT3qYlJngFyjdTGJKPv3 BEuVdGP15ngdFCIVtQ2veWjJdiANVCn3ZReN/1V0EvspyHwyDSL2uPdHxr2adQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740502098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiSU14r71Q5XUroEcCU21G93G+cgtVgy8kxjydR6OI4=; b=pLDngdlGsgBcEpKmemVWIIyFAamFeMJTN7f5IX+bmSeQ6qnyWKIT5o7UPVWF6DDENSpDEW 7NK1nENb1EByozqCpeCqJDBlETPIwvDpKHInznTQ6M+MFLynBM0NgPMULewjkPrD4bKoND EgeIxFm9S91G5KgtwW8sVTpiiwJa7KLJNNxeV03YuRIDKhFmYviKKlK/ICCzu2GDCAm3Xw PvMblocIMi5fRg+vAMftMsKiJ6RGrble4W2cs6hZ7ImSq0rYopynP+7UNe1PluW8rK4DWi J/zlctkmXdQWBzXfusp+G55/ZxLSVeSiUbVYD73gmxKx92G8+Btvo8xDWEzywg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2NpB38LmzZqB; Tue, 25 Feb 2025 16:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PGmIBo013176; Tue, 25 Feb 2025 16:48:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PGmISF013173; Tue, 25 Feb 2025 16:48:18 GMT (envelope-from git) Date: Tue, 25 Feb 2025 16:48:18 GMT Message-Id: <202502251648.51PGmISF013173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: dc95228d9847 - main - nvme: Fix hotplug on one of the amazon platforms List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc95228d98474aba940e3885164912b419c5579d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dc95228d98474aba940e3885164912b419c5579d commit dc95228d98474aba940e3885164912b419c5579d Author: Warner Losh AuthorDate: 2025-02-25 16:29:14 +0000 Commit: Warner Losh CommitDate: 2025-02-25 16:36:53 +0000 nvme: Fix hotplug on one of the amazon platforms Amazon EC2 m7i cloud instances use PCI hotplug rather than ACPI hotplug. The card is removed and detach is called to remove the drive from the system. The hardware is no longer present at this point, but the bridge doesn't translate the now-missing hardware reads to all ff's leading us to conclude the hardware is there and we need to do a proper shutdown of it. Fix this oversight by asking the bridge if the device is still present as well. We need both tests since some systems one cane remove the card w/o a hotplug event and we want to fail-safe in those cases. Convert gone to a bool while I'm here and update a comment about shutting down the controller and why that's important. Tested by: cperciva Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 98a9e62f851b..c47e7ece5a04 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1612,7 +1612,8 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) void nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) { - int gone, i; + int i; + bool gone; ctrlr->is_dying = true; @@ -1622,10 +1623,16 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) goto noadminq; /* - * Check whether it is a hot unplug or a clean driver detach. - * If device is not there any more, skip any shutdown commands. + * Check whether it is a hot unplug or a clean driver detach. If device + * is not there any more, skip any shutdown commands. Some hotplug + * bridges will return zeros instead of ff's when the device is + * departing, so ask the bridge if the device is gone. Some systems can + * remove the drive w/o the bridge knowing its gone (they don't really + * do hotplug), so failsafe with detecting all ff's (impossible with + * this hardware) as the device being gone. */ - gone = (nvme_mmio_read_4(ctrlr, csts) == NVME_GONE); + gone = bus_child_present(dev) == 0 || + (nvme_mmio_read_4(ctrlr, csts) == NVME_GONE); if (gone) nvme_ctrlr_fail(ctrlr, true); else @@ -1653,17 +1660,17 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) nvme_admin_qpair_destroy(&ctrlr->adminq); /* - * Notify the controller of a shutdown, even though this is due to - * a driver unload, not a system shutdown (this path is not invoked - * during shutdown). This ensures the controller receives a - * shutdown notification in case the system is shutdown before - * reloading the driver. + * Notify the controller of a shutdown, even though this is due to a + * driver unload, not a system shutdown (this path is not invoked uring + * shutdown). This ensures the controller receives a shutdown + * notification in case the system is shutdown before reloading the + * driver. Some NVMe drives need this to flush their cache to stable + * media and consider it a safe shutdown in SMART stats. */ - if (!gone) + if (!gone) { nvme_ctrlr_shutdown(ctrlr); - - if (!gone) nvme_ctrlr_disable(ctrlr); + } noadminq: if (ctrlr->taskqueue) From nobody Tue Feb 25 19:26:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2SJm2G5cz5njs8; Tue, 25 Feb 2025 19:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2SJl1ZPpz44k7; Tue, 25 Feb 2025 19:26:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740511591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Td6VhVmD4I3rSben+7gnN/MaoazpvjPNfZuWAepreDU=; b=OjXwcHd+W+BcqSEGGRryj1wjtCSTw6PF8WIUECC6HAIpk0rpcXQNdNSOhOn1y/0MY8lTTO 9Akc1IySTfyvfNj7RZWZ8MEOLspRAEVS+0FntyjjUjjXlrWjsPprmRI5/dVuOROi2BFxNg p7gCvhUnYlvHhNnZPEcogwcptQoVgHzT29d9GyE1XvO8XK6iuKn+SU5TgepGG4aS5IIOQS AoPoCRt46tiGQyTRYCPuNdPQkD5OvYgiEakTMc1uLoCSBMr8vKYqoJ1vrK0S+jx9wDrSEL wZu4c/wywxEU3GIm8Y2pEFRkpeNwUuffl0FDe/FixhOZWScuPXZMTB6PLA+ZtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740511591; a=rsa-sha256; cv=none; b=Pi5X0gfGxyksqW4xX01QAIahu9cYpaf3/T2p3W+4B2q2PwKAtn02CXD0MYVkl8r1up4TEn adDUOsXovK8d6ZOiHSagrYmTarVXL5JJ9a9Qw9ZN+oY8N7H4z0dA5Kz5IOjJ1WH8C/Q+Zm LiFFmV9zFc2f2wJjvJcIpQCWbGVZCrf+N/daHTXSQYhSEi298uMoI0Tlky1k3N9DzudAFi rO91Z0Ck9PB6asexLuN6N8G64U5Q+5ERD2fQtcOUdnVtmO1qXWXtfWzqxtPqT566HTBh0E kCqykGTlooHqr2MKtr/nM7qpZGTUUWT1dQaIQYqz/Cx7qkJe7nqNhLafM5Jr6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740511591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Td6VhVmD4I3rSben+7gnN/MaoazpvjPNfZuWAepreDU=; b=TTEcL3ey2KM2Ip3e0kAPyxtZisWPOSnaxf9IzLPKVqIR+WHBdl5+VyYaGxEqTpZgO8HOnn hiVf8kf/2+DmzJqVi63J9RnLgMV4dkAev6mkKE2jV0eYNP6A0GldKw7UGpFN4dirsDVPph Za94G4fpx1ATNP4geuj4zQmk3PNYfytABYNZaiEy/j4XB37Cea8gwUiRERL2LUOu0XvzpJ pE5wKkybZzGHAniAbxdPYCkSXcGA5lj3AgqJ3GpagNiaiHYSnGLe6X6yN2QlxvtM1KERZ9 aimRqNjZVHSezfZpa63RTnEMieRyEWBIiK/51VfpKqbGiugAk4dcbKu12Nd3OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2SJl18w1zg98; Tue, 25 Feb 2025 19:26:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PJQVqG011526; Tue, 25 Feb 2025 19:26:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PJQVQm011523; Tue, 25 Feb 2025 19:26:31 GMT (envelope-from git) Date: Tue, 25 Feb 2025 19:26:31 GMT Message-Id: <202502251926.51PJQVQm011523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 709348c21351 - main - ifconfig: fix reporting optics on most 100g interfaces List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 709348c21351a783ff0025519d1f7cf884771077 Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=709348c21351a783ff0025519d1f7cf884771077 commit 709348c21351a783ff0025519d1f7cf884771077 Author: Andrew Gallatin AuthorDate: 2025-02-25 19:17:14 +0000 Commit: Andrew Gallatin CommitDate: 2025-02-25 19:26:07 +0000 ifconfig: fix reporting optics on most 100g interfaces This fixes a bug where optics on 100G and faster NICs were not properly reported. The problem is that we pull the string from the correct table in ifconfig_sfp_physical_spec only when sfp_eth_1040g contains the SFP_ETH_1040G_EXTENDED bit. However, we were never saving that bit when it was encountered. This change records that bit into sfp_eth_1040g, allowing us to later select the appropriate ID string. This should cause most 100G interfaces to stop being identified as "unknown" in the "plugged" output of ifconfig -v, and to start being identified as what they really are. Example output from a Chelsio T6 with SR4 optics in one port and DR1 optics in another: Before: plugged: QSFP28 Unknown (MPO 1x12 Parallel Optic) plugged: QSFP28 Unknown (LC) After: plugged: QSFP28 100GBASE-SR4 or 25GBASE-SR (MPO 1x12 Parallel Optic) plugged: QSFP28 100GBASE-DR (LC) Reviewed by: kbowling, np Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49127 MFC after: 7 days --- lib/libifconfig/libifconfig_sfp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libifconfig/libifconfig_sfp.c b/lib/libifconfig/libifconfig_sfp.c index 17f130606765..8292135d3e47 100644 --- a/lib/libifconfig/libifconfig_sfp.c +++ b/lib/libifconfig/libifconfig_sfp.c @@ -181,6 +181,7 @@ get_qsfp_info(struct i2c_info *ii, struct ifconfig_sfp_info *sfp) if (code & SFF_8636_EXT_COMPLIANCE) { read_i2c(ii, SFF_8436_BASE, SFF_8436_OPTIONS_START, 1, &sfp->sfp_eth_ext); + sfp->sfp_eth_1040g = code; } else { /* Check 10/40G Ethernet class only */ sfp->sfp_eth_1040g = From nobody Tue Feb 25 19:35:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2SW65gyWz5njqx; Tue, 25 Feb 2025 19:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2SW65DMQz4DlY; Tue, 25 Feb 2025 19:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740512130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sSUIGaYJbDhuNt25KjaNiv4PdCincmgpT62zFjXipfk=; b=xkBHM7hrEvIC5QaWeEu4RID7ryxJ8Ettz9y26azPW0GVJCaewdIYX68oDJvoXN7yjIUcVA gU4sRatJkfxCNhBvjSPMmwT1YyWlA9Aaby4YdnC6zF/BcFccV7iaZ5fxI6ZBqGOKfPDaUc QRUXACwDKE1NrNkXuYM3OmoU/m1pLMrwZUyRstcZerAtEYs78IhOnDtot55BQVOqlbO4nn c2m3taNaLXAhRgU9/u+7keLS2d5X9DfKWCIVWpheU7Rbzcc8ssm0RECwMyi97S01Jp7NmD gcCgK3IB+kAIvjd7svma1Zs8rOZv8QHaBzY1J8R9rifL5Bn5jIaBl7HWAYGM8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740512130; a=rsa-sha256; cv=none; b=BSsg7QCyyLIyIF8dRrJNgWUZQtQfLdupVkf7erihhXShZ111C9lygUu+z5Zs4wQugiGxb3 B61Fs4F5Tz3T+spAPL2Wk5WUH48x2BoYd0+55MM8PcpPTwD/h0JhOYsuLKVJEEDJIZaBzV z7LqFea2QkFHj7IgujX1X77LajF7W9dPhfpDdobijHQ5mLojB2UFiZYQWXCXQhwACI+PmY AS6qm2N1sKaZzUWQKmLWEg5cjAMl2XFpTyf5rLQsyP7F6bJtejUOxsgKI3VWF/Vb5LFgEu oJO5RRgR1dxtZNb/yLY4LGbnkb3O1dVh6ggPwhMyUSyiDoWMjJjrTxelwova6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740512130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sSUIGaYJbDhuNt25KjaNiv4PdCincmgpT62zFjXipfk=; b=L0UC4PBHsgX6plSM4U5/HM2nLHyEjkuEqNygZtbYl7QGlmpMSTN86y8p1wBk0ysE7Vruid 44TGhU8/Jfhow1B6fQqU66qeUr31iXffou7T5HBVasXzrAGyXebiG3FiWd3qiDAcpQWYAS WL43c1IwDywW1ave6HMR27mkFhnsrd/kXprxcTzA8TcAlsIyi+2kAxi21lIOsOmZzMo1wx UCYabh3UJz98s3PJ9t+NLsIPXgfnjVmbNXUzguVncum618TWHk3M/OrOADDnERiLxYr0zN Xp+JLFh4wiR62FV+yHj0EN+Xk9vNqQDsUeJY+hXkVyq2nWvO4WZUIe5GaLRqxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2SW64kmGzgsF; Tue, 25 Feb 2025 19:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PJZUZl029260; Tue, 25 Feb 2025 19:35:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PJZURu029257; Tue, 25 Feb 2025 19:35:30 GMT (envelope-from git) Date: Tue, 25 Feb 2025 19:35:30 GMT Message-Id: <202502251935.51PJZURu029257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: e19d84979a18 - main - cxgbe(4): Block most access to the hardware as soon as the adapter stops. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e19d84979a183deb37ce6d7e385c3ccf02a3c8c7 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=e19d84979a183deb37ce6d7e385c3ccf02a3c8c7 commit e19d84979a183deb37ce6d7e385c3ccf02a3c8c7 Author: Navdeep Parhar AuthorDate: 2025-02-12 00:29:46 +0000 Commit: Navdeep Parhar CommitDate: 2025-02-25 19:33:40 +0000 cxgbe(4): Block most access to the hardware as soon as the adapter stops. Add a new hw_all_ok() routine and use it to avoid hardware access in the public control interfaces (ifnet ioctls, ifmedia calls, etc.). Continue to use hw_off_limits() in the private ioctls/sysctls and other debug code. Retire adapter_stopped() as it's of no use by itself. This fixes problems where ifnet slow-path operations would enter a synch_op just before set_adapter_hwstatus(false) and touch the hardware when it's not safe to do so. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 10 ++++++---- sys/dev/cxgbe/t4_clip.c | 2 +- sys/dev/cxgbe/t4_filter.c | 8 ++++---- sys/dev/cxgbe/t4_main.c | 40 ++++++++++++++++++++-------------------- sys/dev/cxgbe/tom/t4_tom_l2t.c | 2 +- 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 8d10a07e0933..3bf4f666ce7d 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1118,7 +1118,7 @@ forwarding_intr_to_fwq(struct adapter *sc) return (sc->intr_count == 1); } -/* Works reliably inside a sync_op or with reg_lock held. */ +/* Works reliably inside a synch_op or with reg_lock held. */ static inline bool hw_off_limits(struct adapter *sc) { @@ -1127,12 +1127,14 @@ hw_off_limits(struct adapter *sc) return (__predict_false(off_limits != 0)); } +/* Works reliably inside a synch_op or with reg_lock held. */ static inline bool -adapter_stopped(struct adapter *sc) +hw_all_ok(struct adapter *sc) { - const int stopped = atomic_load_int(&sc->error_flags) & ADAP_STOPPED; + const int not_ok = atomic_load_int(&sc->error_flags) & + (ADAP_STOPPED | HW_OFF_LIMITS); - return (__predict_false(stopped != 0)); + return (__predict_true(not_ok == 0)); } static inline int diff --git a/sys/dev/cxgbe/t4_clip.c b/sys/dev/cxgbe/t4_clip.c index 24f049f9dc06..e462a064847f 100644 --- a/sys/dev/cxgbe/t4_clip.c +++ b/sys/dev/cxgbe/t4_clip.c @@ -576,7 +576,7 @@ update_hw_clip_table(struct adapter *sc) rc = begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4clip"); if (rc != 0) return (rc); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) goto done; /* with rc = 0, we don't want to reschedule. */ while (!TAILQ_EMPTY(&sc->clip_pending)) { ce = TAILQ_FIRST(&sc->clip_pending); diff --git a/sys/dev/cxgbe/t4_filter.c b/sys/dev/cxgbe/t4_filter.c index 359aae6df24e..8d4552116d96 100644 --- a/sys/dev/cxgbe/t4_filter.c +++ b/sys/dev/cxgbe/t4_filter.c @@ -520,7 +520,7 @@ set_filter_mode(struct adapter *sc, uint32_t mode) if (rc) return (rc); - if (hw_off_limits(sc)) { + if (!hw_all_ok(sc)) { rc = ENXIO; goto done; } @@ -571,7 +571,7 @@ set_filter_mask(struct adapter *sc, uint32_t mode) if (rc) return (rc); - if (hw_off_limits(sc)) { + if (!hw_all_ok(sc)) { rc = ENXIO; goto done; } @@ -602,7 +602,7 @@ get_filter_hits(struct adapter *sc, uint32_t tid) tcb_addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + tid * TCB_SIZE; mtx_lock(&sc->reg_lock); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) hits = 0; else if (is_t4(sc)) { uint64_t t; @@ -976,7 +976,7 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc) return (rc); - if (hw_off_limits(sc)) { + if (!hw_all_ok(sc)) { rc = ENXIO; goto done; } diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 51ba6d94b5fa..6ee839151db0 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1133,7 +1133,7 @@ t4_calibration(void *arg) sc = (struct adapter *)arg; - KASSERT((hw_off_limits(sc) == 0), ("hw_off_limits at t4_calibration")); + KASSERT(hw_all_ok(sc), ("!hw_all_ok at t4_calibration")); hw = t4_read_reg64(sc, A_SGE_TIMESTAMP_LO); sbt = sbinuptime(); @@ -2864,7 +2864,7 @@ cxgbe_ioctl(if_t ifp, unsigned long cmd, caddr_t data) if_setmtu(ifp, mtu); if (vi->flags & VI_INIT_DONE) { t4_update_fl_bufsize(ifp); - if (!hw_off_limits(sc) && + if (hw_all_ok(sc) && if_getdrvflags(ifp) & IFF_DRV_RUNNING) rc = update_mac_settings(ifp, XGMAC_MTU); } @@ -2876,7 +2876,7 @@ cxgbe_ioctl(if_t ifp, unsigned long cmd, caddr_t data) if (rc) return (rc); - if (hw_off_limits(sc)) { + if (!hw_all_ok(sc)) { rc = ENXIO; goto fail; } @@ -2904,7 +2904,7 @@ cxgbe_ioctl(if_t ifp, unsigned long cmd, caddr_t data) rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4multi"); if (rc) return (rc); - if (!hw_off_limits(sc) && if_getdrvflags(ifp) & IFF_DRV_RUNNING) + if (hw_all_ok(sc) && if_getdrvflags(ifp) & IFF_DRV_RUNNING) rc = update_mac_settings(ifp, XGMAC_MCADDRS); end_synchronized_op(sc, 0); break; @@ -3079,7 +3079,7 @@ fail: rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4i2c"); if (rc) return (rc); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) rc = ENXIO; else rc = -t4_i2c_rd(sc, sc->mbox, pi->port_id, i2c.dev_addr, @@ -3356,7 +3356,7 @@ cxgbe_media_change(if_t ifp) if (IFM_OPTIONS(ifm->ifm_media) & IFM_ETH_TXPAUSE) lc->requested_fc |= PAUSE_TX; } - if (pi->up_vis > 0 && !hw_off_limits(sc)) { + if (pi->up_vis > 0 && hw_all_ok(sc)) { fixup_link_config(pi); rc = apply_link_config(pi); } @@ -3524,7 +3524,7 @@ cxgbe_media_status(if_t ifp, struct ifmediareq *ifmr) return; PORT_LOCK(pi); - if (pi->up_vis == 0 && !hw_off_limits(sc)) { + if (pi->up_vis == 0 && hw_all_ok(sc)) { /* * If all the interfaces are administratively down the firmware * does not report transceiver changes. Refresh port info here @@ -8272,7 +8272,7 @@ sysctl_btphy(SYSCTL_HANDLER_ARGS) rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4btt"); if (rc) return (rc); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) rc = ENXIO; else { /* XXX: magic numbers */ @@ -8329,7 +8329,7 @@ sysctl_tx_vm_wr(SYSCTL_HANDLER_ARGS) "t4txvm"); if (rc) return (rc); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) rc = ENXIO; else if (if_getdrvflags(vi->ifp) & IFF_DRV_RUNNING) { /* @@ -8543,7 +8543,7 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARGS) "t4PAUSE"); if (rc) return (rc); - if (!hw_off_limits(sc)) { + if (hw_all_ok(sc)) { PORT_LOCK(pi); lc->requested_fc = n; fixup_link_config(pi); @@ -8639,7 +8639,7 @@ sysctl_requested_fec(SYSCTL_HANDLER_ARGS) lc->requested_fec = n & (M_FW_PORT_CAP32_FEC | FEC_MODULE); } - if (!hw_off_limits(sc)) { + if (hw_all_ok(sc)) { fixup_link_config(pi); if (pi->up_vis > 0) { rc = apply_link_config(pi); @@ -8677,7 +8677,7 @@ sysctl_module_fec(SYSCTL_HANDLER_ARGS) rc = EBUSY; goto done; } - if (hw_off_limits(sc)) { + if (!hw_all_ok(sc)) { rc = ENXIO; goto done; } @@ -8743,7 +8743,7 @@ sysctl_autoneg(SYSCTL_HANDLER_ARGS) goto done; } lc->requested_aneg = val; - if (!hw_off_limits(sc)) { + if (hw_all_ok(sc)) { fixup_link_config(pi); if (pi->up_vis > 0) rc = apply_link_config(pi); @@ -8778,7 +8778,7 @@ sysctl_force_fec(SYSCTL_HANDLER_ARGS) return (rc); PORT_LOCK(pi); lc->force_fec = val; - if (!hw_off_limits(sc)) { + if (hw_all_ok(sc)) { fixup_link_config(pi); if (pi->up_vis > 0) rc = apply_link_config(pi); @@ -8818,7 +8818,7 @@ sysctl_temperature(SYSCTL_HANDLER_ARGS) rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4temp"); if (rc) return (rc); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) rc = ENXIO; else { param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | @@ -8849,7 +8849,7 @@ sysctl_vdd(SYSCTL_HANDLER_ARGS) "t4vdd"); if (rc) return (rc); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) rc = ENXIO; else { param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | @@ -8886,7 +8886,7 @@ sysctl_reset_sensor(SYSCTL_HANDLER_ARGS) rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4srst"); if (rc) return (rc); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) rc = ENXIO; else { param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | @@ -8912,7 +8912,7 @@ sysctl_loadavg(SYSCTL_HANDLER_ARGS) rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4lavg"); if (rc) return (rc); - if (hw_off_limits(sc)) + if (hw_all_ok(sc)) rc = ENXIO; else { param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | @@ -12366,7 +12366,7 @@ toe_capability(struct vi_info *vi, bool enable) if (!is_offload(sc)) return (ENODEV); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) return (ENXIO); if (enable) { @@ -12629,7 +12629,7 @@ ktls_capability(struct adapter *sc, bool enable) return (ENODEV); if (!is_t6(sc)) return (0); - if (hw_off_limits(sc)) + if (!hw_all_ok(sc)) return (ENXIO); if (enable) { diff --git a/sys/dev/cxgbe/tom/t4_tom_l2t.c b/sys/dev/cxgbe/tom/t4_tom_l2t.c index 909abe793835..3fd0d5ca41d4 100644 --- a/sys/dev/cxgbe/tom/t4_tom_l2t.c +++ b/sys/dev/cxgbe/tom/t4_tom_l2t.c @@ -289,7 +289,7 @@ again: mtx_unlock(&e->lock); goto again; } - if (adapter_stopped(sc)) + if (!hw_all_ok(sc)) free(wr, M_CXGBE); else arpq_enqueue(e, wr); From nobody Tue Feb 25 20:48:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2V6q4l8Wz5ns4R; Tue, 25 Feb 2025 20:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2V6q2jNVz3rbd; Tue, 25 Feb 2025 20:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740516483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nfm0AxljYN/miwcaIMe74e9N5EiHoX967UJAcNq39oE=; b=I7kUW1PsuHld7mTQVTgB8xFUiusQPOGSsra92rwTCclYGoO2WehKT5m8/Mk7BPv3u0sgOF qFFMkoTak6NzJWEjowUiAOCzIeHm65uinsR25NOclyEoBRCYjS4asrxQl5nuHyz0So9q6M HY6e7VoxQG/qkB+uChtrPLVPtdIUbYwe1YznvZ1m93irKHivyOaV8xHBumik1mNzIvg89L 0LZqAkNXlE8MFLOMlxdxdoYDZs7gb6lIm9m9QHs9OxPvSQ6vPZqH+EpcNe68542HO31H/u b/wOvC4JIxMk0oAVGUcE71XiuDKUF6Fh1rhFzqlkx9HACcmN1rzGmecBih6SlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740516483; a=rsa-sha256; cv=none; b=AEx+TDhR+NctCq2wKq02rnJDDpGdEvXfRzDC57STu2wTKjacxwHfb1dtFrAgDH4XOOMBLk ffdV33CCxrhxRphRXYSs5gAzetpjRJaeYO3YiJW8vJ1a8iElSSPmn+F3PY2+vBvEgUh7U4 UR2OQkGdbWORXvK0gm1c78UnSJPEWuIsQU3xwzN9AE3wXs/V4SWCDVlTmqskSdCHjs+MYQ kd9DrN1flL0Oheh2hy2DBAadDe1ztGkg6IsVs+SGd7udN5TTOKu2J+pnbrdUAt/D+1Q6Qg RzPuo+0sPos8TABjdI776tnLsKsq/P9Lo7Hep6az3k6WV1EtWeD+QnUvrKVaow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740516483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nfm0AxljYN/miwcaIMe74e9N5EiHoX967UJAcNq39oE=; b=vr4lt8vroN4QCjxOz3G9KdrMYPQIbv3Vt2Sj6u0jU4kaYBk+vzyNrQu0u8VTujJkuQgWU1 QdC5oCgcpGgKGGwDXVfvU29CIGMFGnHnNs6rVkEhHDfHnexAr6POgSAsVsYu3ZQJ2OhxZt 3/SwfNXvB5KrizaUjXj1YZ+2MPPOHiV2BU5/cBtns6YGjM0u0vnN36iFnhMTJzB+aHN6Gh rxoiT3nmidtoGOdUhbCNvlr2Emu4btDuD9LPwEvJnFNK8Ojgw4AALEee2y+t3D9pgVqGE/ z06wtJqCZV65A1jq5nvcSN+WmckAAW/rzsnS0rS0w2xGxnVT9G2QvudRjPiGKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2V6q2Frkzjqy; Tue, 25 Feb 2025 20:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PKm3Jw061273; Tue, 25 Feb 2025 20:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PKm3IN061270; Tue, 25 Feb 2025 20:48:03 GMT (envelope-from git) Date: Tue, 25 Feb 2025 20:48:03 GMT Message-Id: <202502252048.51PKm3IN061270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 163c30c79398 - main - tcp rack: remove dead code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 163c30c79398331106d1237af767a5aed54371a9 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=163c30c79398331106d1237af767a5aed54371a9 commit 163c30c79398331106d1237af767a5aed54371a9 Author: Peter Lei AuthorDate: 2025-02-25 20:33:32 +0000 Commit: Michael Tuexen CommitDate: 2025-02-25 20:33:32 +0000 tcp rack: remove dead code Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/rack.c | 25 +------------------------ sys/netinet/tcp_stacks/tcp_rack.h | 32 -------------------------------- 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 902845ad34f6..ab80ed9f4060 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -212,7 +212,6 @@ static uint32_t rack_highest_sack_thresh_seen = 0; static uint32_t rack_highest_move_thresh_seen = 0; static uint32_t rack_merge_out_sacks_on_attack = 0; static int32_t rack_enable_hw_pacing = 0; /* Due to CCSP keep it off by default */ -static int32_t rack_hw_pace_extra_slots = 0; /* 2 extra MSS time betweens */ static int32_t rack_hw_rate_caps = 0; /* 1; */ static int32_t rack_hw_rate_cap_per = 0; /* 0 -- off */ static int32_t rack_hw_rate_min = 0; /* 1500000;*/ @@ -263,7 +262,7 @@ static int32_t rack_enobuf_hw_max = 12000; /* 12 ms in usecs */ static int32_t rack_enobuf_hw_min = 10000; /* 10 ms in usecs */ static int32_t rack_hw_rwnd_factor = 2; /* How many max_segs the rwnd must be before we hold off sending */ static int32_t rack_hw_check_queue = 0; /* Do we always pre-check queue depth of a hw queue */ -static int32_t rack_full_buffer_discount = 10; + /* * Currently regular tcp has a rto_min of 30ms * the backoff goes 12 times so that ends up @@ -356,8 +355,6 @@ static int32_t rack_timely_dec_clear = 6; /* Do we clear decrement count at a va static int32_t rack_timely_max_push_rise = 3; /* One round of pushing */ static int32_t rack_timely_max_push_drop = 3; /* Three round of pushing */ static int32_t rack_timely_min_segs = 4; /* 4 segment minimum */ -static int32_t rack_use_max_for_nobackoff = 0; -static int32_t rack_timely_int_timely_only = 0; /* do interim timely's only use the timely algo (no b/w changes)? */ static int32_t rack_timely_no_stopping = 0; static int32_t rack_down_raise_thresh = 100; static int32_t rack_req_segs = 1; @@ -1054,11 +1051,6 @@ rack_init_sysctls(void) OID_AUTO, "no_timely", CTLFLAG_RW, &rack_timely_off, 0, "Do we not use timely in DGP?"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_pacing), - OID_AUTO, "fullbufdisc", CTLFLAG_RW, - &rack_full_buffer_discount, 10, - "What percentage b/w reduction over the GP estimate for a full buffer (default=0 off)?"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_pacing), OID_AUTO, "fillcw", CTLFLAG_RW, @@ -1201,11 +1193,6 @@ rack_init_sysctls(void) OID_AUTO, "up_only", CTLFLAG_RW, &rack_hw_up_only, 0, "Do we allow hw pacing to lower the rate selected?"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_hw_pacing), - OID_AUTO, "extra_mss_precise", CTLFLAG_RW, - &rack_hw_pace_extra_slots, 0, - "If the rates between software and hardware match precisely how many extra time_betweens do we get?"); rack_timely = SYSCTL_ADD_NODE(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), OID_AUTO, @@ -1299,16 +1286,6 @@ rack_init_sysctls(void) OID_AUTO, "min_segs", CTLFLAG_RW, &rack_timely_min_segs, 4, "Rack timely when setting the cwnd what is the min num segments"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_timely), - OID_AUTO, "noback_max", CTLFLAG_RW, - &rack_use_max_for_nobackoff, 0, - "Rack timely when deciding if to backoff on a loss, do we use under max rtt else min"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_timely), - OID_AUTO, "interim_timely_only", CTLFLAG_RW, - &rack_timely_int_timely_only, 0, - "Rack timely when doing interim timely's do we only do timely (no b/w consideration)"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_timely), OID_AUTO, "nonstop", CTLFLAG_RW, diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index d7f36a520045..a6cb0a81bb81 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -435,7 +435,6 @@ struct rack_control { uint32_t rc_rcvtime; /* When we last received data */ uint32_t rc_num_split_allocs; /* num split map entries allocated */ uint32_t rc_split_limit; /* Limit from control var can be set by socket opt */ - uint32_t rack_avg_rec_sends; uint32_t rc_last_output_to; uint32_t rc_went_idle_time; @@ -462,7 +461,6 @@ struct rack_control { uint32_t rc_agg_early; uint32_t rc_agg_delayed; uint32_t rc_tlp_rxt_last_time; - uint32_t rc_saved_cwnd; uint64_t rc_gp_output_ts; /* chg*/ uint64_t rc_gp_cumack_ts; /* chg*/ struct timeval act_rcv_time; @@ -540,8 +538,6 @@ struct rack_control { uint32_t rc_min_to; /* Socket option value Lock(a) */ uint32_t rc_pkt_delay; /* Socket option value Lock(a) */ uint32_t persist_lost_ends; - uint32_t input_pkt; - uint32_t saved_input_pkt; uint32_t cleared_app_ack_seq; uint32_t last_rcv_tstmp_for_rtt; uint32_t last_time_of_arm_rcv; @@ -572,11 +568,9 @@ struct rack_control { uint8_t rc_tlp_cwnd_reduce; /* Socket option value Lock(a) */ uint8_t rc_prr_sendalot;/* Socket option value Lock(a) */ uint8_t rc_rate_sample_method; - uint8_t full_dgp_in_rec; /* Flag to say if we do full DGP in recovery */ uint8_t client_suggested_maxseg; /* Not sure what to do with this yet */ uint8_t use_gp_not_last; uint8_t pacing_method; /* If pace_always, what type of pacing */ - uint8_t already_had_a_excess; }; #endif @@ -584,27 +578,6 @@ struct rack_control { #define RACK_DGP_PACING 0x01 #define RACK_REG_PACING 0x02 -/* DGP with no buffer level mitigations */ -#define DGP_LEVEL0 0 - -/* - * DGP with buffer level mitigation where BL:4 caps fillcw and BL:5 - * turns off fillcw. - */ -#define DGP_LEVEL1 1 - -/* - * DGP with buffer level mitigation where BL:3 caps fillcw and BL:4 turns off fillcw - * and BL:5 reduces by 10% - */ -#define DGP_LEVEL2 2 - -/* - * DGP with buffer level mitigation where BL:2 caps fillcw and BL:3 turns off - * fillcw BL:4 reduces by 10% and BL:5 reduces by 20% - */ -#define DGP_LEVEL3 3 - /* Hybrid pacing log defines */ #define HYBRID_LOG_NO_ROOM 0 /* No room for the clients request */ #define HYBRID_LOG_TURNED_OFF 1 /* Turned off hybrid pacing */ @@ -623,12 +596,7 @@ struct rack_control { #define HYBRID_LOG_EXTEND 14 /* We extended the end */ #define HYBRID_LOG_SENT_LOST 15 /* A closing sent/lost report */ -#define LOST_ZERO 1 /* Zero it out */ -#define LOST_ADD 2 /* Add to it */ -#define LOST_SUB 3 /* Sub from it */ - #define RACK_TIMELY_CNT_BOOST 5 /* At 5th increase boost */ -#define RACK_MINRTT_FILTER_TIM 10 /* Seconds */ #define RACK_HYSTART_OFF 0 #define RACK_HYSTART_ON 1 /* hystart++ on */ From nobody Tue Feb 25 20:48:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2V6r6v4nz5ns4S; Tue, 25 Feb 2025 20:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2V6r3bmLz3rkd; Tue, 25 Feb 2025 20:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740516484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kuNDdzYCNGQiAJOeleQ0C1eNOJRpDoD3RU5iyJwAaGA=; b=uTDeLayyqP91Q9ZDsiofXLFQ8i8JXIz/zEArIpgtdxvJC+y3zVtTn4+qmB6FEhRhWCB5LL NJ75C9bcQ+sZ76681AeOIFTpPuQn0BkqDkz/Wg7YH29TY2IAMx3rNmn2FQsH/Q+t6iWuQn M7H7r9TIeBEFNIbmrypHBn1LxjO+TIJMbxUnZlah5y58ZwhPyCZ4bkqMtJnI8BOwgdIou0 euPlTZzhNcaL8J1eUsuiTubfe/68x/gmSDlemy9cUyFbWMF9NaJHB5PEnmesb0ABMG06PI RH4AOLB0AOJw3B/pXCLedxDbdCJ0ap98ofrF65pPhiNcyfDafNPMP3VecDBr2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740516484; a=rsa-sha256; cv=none; b=RzLX4CJwLQT785I2t+6UFbbHOCKaupTBI7+ABJ57wzrRKIvJVYx724FlUJkhVj/E4qtMRw NKc6uu7dD3L8nv+prZ6BKGtwaUMcNmeo15IoZhZBaBgieYFnG+VV9b46QKP7oRhQjckFxP WgJxjnzLCe23F7hBJb9o8Oxf7hum934o4jrw39McXjdmBV+ZfYn/JUbnjYM2eBOdb1ZbnS xYYztHAB2YZ/NnRU2KgIRKI0lfHyWXng+fOhhfN+RPhNEbw1Cm6H7NXGm1T8WacUSwvL/1 pNzo37ZsdGcilHepaRP+A79g6cm2JMK7JKHe1vBbA9GQ2i901tTO5FF4tMJ2cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740516484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kuNDdzYCNGQiAJOeleQ0C1eNOJRpDoD3RU5iyJwAaGA=; b=s3IIHiWMdu98efN7QTaDgt9YbdQXcIuF3ax3w1VQykc+8ODq5uwMNePrgy9mBXW6fzYeBc pgcWdgJPfmpLrYEa0QJkS+m267a5f+1iE1y42mPlNd1UuTd04zJnXri7mt7QeTFRN/v0Kr KsyESI1qMaEZhFHqZpadGvoRkKLyQwEMKuzxD+Zb9KKH/ePhQ8Aqr/TwDzDt7sFoZ0UE3z g0CcQ8xcr7dR1b4NoEyhPIwUehCcYiSluTOWy9Rgx0/eZInkn858j7LyjbH7cR/lUt3HKb 2/2e0Juoh8ct4cfIGDKwKEFT0o/lCwdc8i5sM6WvYOhj5Tw4w1r9Yf1esMEFcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2V6r3BP4zjcX; Tue, 25 Feb 2025 20:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PKm4ui061308; Tue, 25 Feb 2025 20:48:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PKm4YX061305; Tue, 25 Feb 2025 20:48:04 GMT (envelope-from git) Date: Tue, 25 Feb 2025 20:48:04 GMT Message-Id: <202502252048.51PKm4YX061305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 0e58542fd246 - main - tcp: remove unused field from struct tcpcb List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e58542fd246242bc64bd03d8b2f28cf981c062b Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0e58542fd246242bc64bd03d8b2f28cf981c062b commit 0e58542fd246242bc64bd03d8b2f28cf981c062b Author: Peter Lei AuthorDate: 2025-02-25 20:37:48 +0000 Commit: Michael Tuexen CommitDate: 2025-02-25 20:37:48 +0000 tcp: remove unused field from struct tcpcb Reviewed by: tuexen Sponsored by: Netflix, Inc. --- sys/netinet/tcp_var.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index e65e44840bd8..31663ed48f81 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -452,7 +452,6 @@ struct tcpcb { tcp_seq gput_seq; /* Outbound measurement seq */ tcp_seq gput_ack; /* Inbound measurement ack */ int32_t t_stats_gput_prev; /* XXXLAS: Prev gput measurement */ - uint32_t t_maxpeakrate; /* max peak rate set by user, bytes/s */ uint32_t t_sndtlppack; /* tail loss probe packets sent */ uint64_t t_sndtlpbyte; /* total tail loss probe bytes sent */ uint64_t t_sndbytes; /* total bytes sent */ From nobody Tue Feb 25 20:48:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2V6s73f8z5ns1l; Tue, 25 Feb 2025 20:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2V6s4ndbz3rrx; Tue, 25 Feb 2025 20:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740516485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c5QI2ZHGeICscofNDIGXisyHaG7AJedKdQAdlCkiick=; b=XrTIxVzRtoA6BUfT+SW6zMIG+jLB8Tckj3wmfrlw7dr/atdSKZHgewEU5o+1nrbQY02tiB DgbKE74A2tr47Xpi0p99fk4xdT3SrOi8P6p0W6IC4s1aqXmG2oGfIsHLjfoIDvmKxrWFO0 OYhZJGNIb/SlYVuJm8/5Cq0e3Zf+EwLYD/+4rgOu+jjS47iurv+qcgIMzxSOw9Re2qNYgi IMesxVwYyz+5GFq0aXyPuFbiX0Y5lVINNE5LRGKYU/hxgX9+wmUPrK0ucG5AmvO7PCgE5Z y0c9+1/6BVVjyNp4Eu8Au2jNtcx49gcPnwHXV1zkAwPe6Y73ASbSmEKMtwIn+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740516485; a=rsa-sha256; cv=none; b=CfC9tmnvCFEky9q4ZDbIz8mo02HsUuOxHMZvTxjXnZyIag9dZRcnQVMlYtbj2k4ZT66cPz ovzKIWSYGI4hHdwhs3ayuxcEHtfkM+y+E73Zud0RlHk3ZieE22Im+ciUfgrruaYm+izmeK vYLlJAdSQzAIJKNj3rq8qK4XG/H/0Pvob5uICNyTeYtp5bQO12kkSl0kdoPSL1Vx7JarTN lR26Va8Yhn0+WrMlL8NNaqv27WQFx8nvYCR6OjkEZplloM66ldd4kIt1g9pwsVZnAMuIC/ A5FL9IpxPl3p/mazbNHVocHei2b5ZSTv/DI8N3dT0NYYN3BWZOJQE84pIcPTOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740516485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c5QI2ZHGeICscofNDIGXisyHaG7AJedKdQAdlCkiick=; b=Wsg6XcoVNn8QDQyElejL9DuJVhnI84eDo+uvrLgZZfW4ICXxIuNe3FwN+htSbtjljWa9cb BUDKIfXX/eqR6D+jnmOJuV5ie/GNBjZ/Bl03fGYcBha/NYj2lv7/VUnv55xNZKGEQvWkTS 5musSwoNvydc7+87JL+o0x2udDNEK8RGizTVmntf+Dsw/tMKLw6gsSxi0wxiunuEYn5jXD 7O/UnB9FwiMCXUM5HPvB+jJoNhYkcZ5hcQgpE+g4MUQRvyyVmEFFYse5+HEVu23GUqnvgt r5u27Q5+bLh/UkZXu7XVY6iubR6vvQxYEko4tl/i5stepU6/KebHRx3+nttYRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2V6s4Kd2zjkc; Tue, 25 Feb 2025 20:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PKm5lx061344; Tue, 25 Feb 2025 20:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PKm5DO061341; Tue, 25 Feb 2025 20:48:05 GMT (envelope-from git) Date: Tue, 25 Feb 2025 20:48:05 GMT Message-Id: <202502252048.51PKm5DO061341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 6f27541d948f - main - tcp rack: cleanup accounting conditional checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f27541d948fa0126f9262f8cc5326b1c4befcc7 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6f27541d948fa0126f9262f8cc5326b1c4befcc7 commit 6f27541d948fa0126f9262f8cc5326b1c4befcc7 Author: Peter Lei AuthorDate: 2025-02-25 20:45:40 +0000 Commit: Michael Tuexen CommitDate: 2025-02-25 20:45:40 +0000 tcp rack: cleanup accounting conditional checks No functional change intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/rack.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index ab80ed9f4060..5a9171abeaf5 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -18970,11 +18970,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_DATA] += cnt_thru; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_DATA] += (crtsc - ts_val); - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[CNT_OF_MSS_OUT] += ((len + segsiz - 1) / segsiz); } sched_unpin(); @@ -19525,11 +19521,7 @@ again: crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_DATA] += cnt_thru; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_DATA] += (crtsc - ts_val); - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[CNT_OF_MSS_OUT] += ((tot_len + segsiz - 1) / segsiz); } sched_unpin(); @@ -19860,8 +19852,6 @@ rack_output(struct tcpcb *tp) crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_BLOCKED] += (crtsc - ts_val); - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_BLOCKED]++; } sched_unpin(); @@ -21070,19 +21060,13 @@ just_return_nolock: crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_DATA]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_DATA] += (crtsc - ts_val); - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[CNT_OF_MSS_OUT] += ((tot_len_this_send + segsiz - 1) / segsiz); } } else { crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_LIMITED]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_LIMITED] += (crtsc - ts_val); } } @@ -21329,8 +21313,6 @@ send: crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_FAIL]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_FAIL] += (crtsc - ts_val); } sched_unpin(); @@ -22348,8 +22330,6 @@ nomore: crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_FAIL]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_FAIL] += (crtsc - ts_val); } sched_unpin(); @@ -22403,8 +22383,6 @@ nomore: crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_FAIL]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_FAIL] += (crtsc - ts_val); } sched_unpin(); @@ -22428,8 +22406,6 @@ nomore: crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_FAIL]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_FAIL] += (crtsc - ts_val); } sched_unpin(); @@ -22580,18 +22556,12 @@ skip_all_send: if (tot_len_this_send) { if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_DATA]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_DATA] += crtsc; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[CNT_OF_MSS_OUT] += ((tot_len_this_send + segsiz - 1) /segsiz); } } else { if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_ACK]++; - } - if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_proc_time[SND_OUT_ACK] += crtsc; } } From nobody Wed Feb 26 02:11:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2dJZ5f34z5pQT2; Wed, 26 Feb 2025 02:11:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2dJZ46FPz49TL; Wed, 26 Feb 2025 02:11:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KzFm21/gEPeNJGIgJomqLzCUroGGml7VmGiIkk/4FVk=; b=IhoDrkBenYMXRVzShQ11X35YNt1vYbXAPFUm2RlqYtAdzLfbXSMpp4aQL1iFCh9kgW9E7P 2CoxwNmieaGyN0dGX9QsV4dcu14JGFxGxx9u355Up7Oon8Q/X8Dc5FKp1fIBJhXo77gr8n sNaTPCwDlrbCHv/DfY4TROOxk7cks+N25UzUoyEqF95+q4flLPJpBk5tphn05Bpq7sMKsK 5UJ4SJUq17zEsFJy16bUV2eF9UquP/9bI+7+m/zHPVnBy0f7JCTzi3BGcwaDBvasSd9iho f/CUdobuzrNSvJTcHt1Uv3aOxM+OCXgCLe4AcKMQKdvIQ1+BE2zslJMDCcK0Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740535918; a=rsa-sha256; cv=none; b=VeE+/5u0SOZ2PDAKn+BwO/St6YRrZzodD8TljztgtzRXwNqUhMU5F+m2ftHzWhfp34Q4QW FBzpD3KJZMj1E2phhKjp5RdidvyArZ6lJThlZ5bw/2WFg83JegSCw7a++MK9ZwnLyZhn0V rVcM6Ve3rJA5qHZsPZY1tgLYJHblT/MaOL8xxDtC4pKXWfRCek4j4fi2jeIzqxOgTrPg3/ ewLuXsWYFe/plbJvjJJXL0GFK5tXZLCDUP0GXBY3GShJcrjZ7wKWoIVLEpHfkdCaSIqHrg Ga0QSHo5He8hUD4zYIPt6S2BKlSzYcgQhO8walBxWVUwThwYA/5asVcVipH0YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KzFm21/gEPeNJGIgJomqLzCUroGGml7VmGiIkk/4FVk=; b=DB4z3Q3AChadCDqipWNmIni+O3pai037KeK0CJgX77gFyYx9zZgcguqw7GEEzNLkHlpv+e KURxXanSk0HmiINZEhrycxulE9aUKT0K6US08augfWe58UCUD5yb/GRgZlz4WB0IAGQQko +4j7e83PZQz5Rn5dZufN+RFFEMEDW/CWk41Rzs2kYd63zVfVRfqYalcyhwb2veB27vkA+e LAvrpQQOOBWPzhP9uEYn5qxyawWHXUu8j00udQXkyyEQVVNLPu0I5xGXHTAX/fPGoiXvJk iF0YvecHicMqPD3bVwTMEucefxQCJA6hMrM8ym/v0sVH8A8+84zLWsAs0CHLIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2dJZ3dPpzsjr; Wed, 26 Feb 2025 02:11:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51Q2Bw5S073103; Wed, 26 Feb 2025 02:11:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51Q2BwbT073100; Wed, 26 Feb 2025 02:11:58 GMT (envelope-from git) Date: Wed, 26 Feb 2025 02:11:58 GMT Message-Id: <202502260211.51Q2BwbT073100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3f8cfb8a3a3b - main - iwlwifi: bring in some of the rs code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f8cfb8a3a3b9fbe6d4aebde81aee80f8e89e2ea Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3f8cfb8a3a3b9fbe6d4aebde81aee80f8e89e2ea commit 3f8cfb8a3a3b9fbe6d4aebde81aee80f8e89e2ea Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 11:00:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:10:55 +0000 iwlwifi: bring in some of the rs code Bring in code to call into rs-fw.c functionality for firmware supported rate select. Anything before AX200 (firmware matching iwlwiif-[0-9]*.ucode) will still need further implementation, and so does iwl_mvm_rs_tx_status(). These bits marked with compat.linuxkpi.80211.debug TODO()s for now. Implement some lindebugfs bits to gather more statistical information. Sponsored by: The FreeBSD Foundation Obtained from: bz_wifi_11n branch (partially) MFC after: 3 days --- sys/contrib/dev/iwlwifi/mvm/rs.c | 133 +++++++++++++++++++++++++++++++++++---- sys/contrib/dev/iwlwifi/mvm/rs.h | 9 ++- 2 files changed, 128 insertions(+), 14 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/mvm/rs.c b/sys/contrib/dev/iwlwifi/mvm/rs.c index 981686e66920..f460624871ee 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rs.c +++ b/sys/contrib/dev/iwlwifi/mvm/rs.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2021 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -33,42 +33,123 @@ * This file is left as a wrapper to make mvm compile and we will only * deal with it on a need basis. Most newer chipsets do this in firmware. */ +#include +#include /* LinuxKPI 802.11 TODO() calls. */ -#include - +#include "rs.h" #include "mvm.h" #ifdef CONFIG_IWLWIFI_DEBUGFS +/* + * Fill struct iwl_mvm_frame_stats. + * Deal with various RATE_MCS_*_MSK. See rx.c, fw/api/rs.h, et al. + * XXX-BZ consider calling iwl_new_rate_from_v1() in rx.c so we can also + * use this in rxmq.c. + */ void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg) { - + uint8_t nss; + + spin_lock_bh(&mvm->drv_stats_lock); + mvm->drv_rx_stats.success_frames++; + + if (rate & RATE_MCS_HT_MSK_V1) { + mvm->drv_rx_stats.ht_frames++; + nss = 1 + ((rate & RATE_HT_MCS_NSS_MSK_V1) >> RATE_HT_MCS_NSS_POS_V1); + } else if (rate & RATE_MCS_VHT_MSK_V1) { + mvm->drv_rx_stats.vht_frames++; + nss = 1 + FIELD_GET(RATE_MCS_NSS_MSK, rate); + } else { + mvm->drv_rx_stats.legacy_frames++; + nss = 0; + } + + switch (rate & RATE_MCS_CHAN_WIDTH_MSK_V1) { + case RATE_MCS_CHAN_WIDTH_20: + mvm->drv_rx_stats.bw_20_frames++; + break; + case RATE_MCS_CHAN_WIDTH_40: + mvm->drv_rx_stats.bw_40_frames++; + break; + case RATE_MCS_CHAN_WIDTH_80: + mvm->drv_rx_stats.bw_80_frames++; + break; + case RATE_MCS_CHAN_WIDTH_160: + mvm->drv_rx_stats.bw_160_frames++; + break; + } + + if ((rate & RATE_MCS_CCK_MSK_V1) == 0 && + (rate & RATE_MCS_SGI_MSK_V1) != 0) + mvm->drv_rx_stats.sgi_frames++; + else + mvm->drv_rx_stats.ngi_frames++; + + switch (nss) { + case 1: + mvm->drv_rx_stats.siso_frames++; + break; + case 2: + mvm->drv_rx_stats.mimo2_frames++; + break; + } + + if (agg) + mvm->drv_rx_stats.agg_frames++; + + /* ampdu_count? */ + /* fail_frames? */ + + mvm->drv_rx_stats.last_rates[mvm->drv_rx_stats.last_frame_idx] = rate; + mvm->drv_rx_stats.last_frame_idx++; + mvm->drv_rx_stats.last_frame_idx %= + ARRAY_SIZE(mvm->drv_rx_stats.last_rates); + + spin_unlock_bh(&mvm->drv_stats_lock); } void iwl_mvm_reset_frame_stats(struct iwl_mvm *mvm) { - + /* Apply same locking rx.c does; debugfs seems to read unloked? */ + spin_lock_bh(&mvm->drv_stats_lock); + memset(&mvm->drv_rx_stats, 0, sizeof(mvm->drv_rx_stats)); + spin_unlock_bh(&mvm->drv_stats_lock); } #endif int iwl_mvm_rate_control_register(void) { - + TODO("This likely has to call into net80211 unless we gain compat code in LinuxKPI"); return (0); } -int -iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *sta, bool enable) +void +iwl_mvm_rate_control_unregister(void) { + TODO("This likely has to call into net80211 unless we gain compat code in LinuxKPI"); +} - return (0); +int +iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, bool enable) +{ + if (iwl_mvm_has_tlc_offload(mvm)) + return (rs_fw_tx_protection(mvm, mvmsta, enable)); + else { + TODO(); + return (0); + } } -void -iwl_mvm_rate_control_unregister(void) +static void +iwl_mvm_rs_sw_rate_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_bss_conf *link_conf, struct ieee80211_link_sta *link_sta, + enum nl80211_band band) { + TODO(); } void @@ -77,18 +158,28 @@ iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf, struct ieee80211_link_sta *link_sta, enum nl80211_band band) { + if (iwl_mvm_has_tlc_offload(mvm)) + iwl_mvm_rs_fw_rate_init(mvm, vif, sta, link_conf, link_sta, band); + else + iwl_mvm_rs_sw_rate_init(mvm, vif, sta, link_conf, link_sta, band); } void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, int tid, struct ieee80211_tx_info *ba_info, bool t) { + TODO(); } void -rs_update_last_rssi(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, +rs_update_last_rssi(struct iwl_mvm *mvm __unused, struct iwl_mvm_sta *mvmsta, struct ieee80211_rx_status *rx_status) { + struct iwl_lq_sta *lq_sta; + int i; + + if (mvmsta == NULL || rx_status == NULL) + return; /* * Assumption based on mvm/sta.h is that this should update @@ -96,12 +187,28 @@ rs_update_last_rssi(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, * access in that struct so nowhere to put rssi information. * So the only thing would be if this is required internally * to functions in this file. + * The "FW" version accesses more fields. We assume they + * are the same for now. */ + + lq_sta = &mvmsta->deflink.lq_sta.rs_drv; + + lq_sta->pers.last_rssi = S8_MIN; + lq_sta->pers.chains = rx_status->chains; + + for (i = 0; i < nitems(lq_sta->pers.chain_signal); i++) { + if ((rx_status->chains & BIT(i)) == 0) + continue; + + lq_sta->pers.chain_signal[i] = rx_status->chain_signal[i]; + if (rx_status->chain_signal[i] > lq_sta->pers.last_rssi) + lq_sta->pers.last_rssi = rx_status->chain_signal[i]; + } } int rs_pretty_print_rate_v1(char *buf, int bufsz, const u32 rate) { - + TODO(); return (0); } diff --git a/sys/contrib/dev/iwlwifi/mvm/rs.h b/sys/contrib/dev/iwlwifi/mvm/rs.h index a9b10b841f95..71c0744f017c 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rs.h +++ b/sys/contrib/dev/iwlwifi/mvm/rs.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2021 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -69,6 +69,13 @@ struct iwl_lq_sta { struct { spinlock_t lock; uint16_t max_agg_bufsize; + /* + * Based on the assumption that these are in "FW" too and + * there is a f() to set last_rssi add them here too. + */ + uint8_t chains; + uint8_t chain_signal[IEEE80211_MAX_CHAINS]; + uint8_t last_rssi; } pers; }; From nobody Wed Feb 26 02:11:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2dJc0mMxz5pQKZ; Wed, 26 Feb 2025 02:12:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2dJb4dz8z49fq; Wed, 26 Feb 2025 02:11:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=edbYgmB0E3yT8xqMjNnP1TCgjZcV+fwsBUgkYjB1zSE=; b=svZqSremGhXBZaKhtvFzyAis7/Coqg4Vq2N+SosBJBYD0s39e4s6ZGBxo8Tut5nVrovqHP P+YCp5fyzTMaPMjwdW08AA55+2q8s5y/1XkcCBPR2OamUjwyzWP5CErdSREVaEsnvNgifK /KV8KaiG/I0zfJG7or4ml5xCJy9zl31C80cBpi1JIMDxPaiy4DJ58t0MjV+2yecQCxUmmN GKA0UHPAo8EwGrj0Bu7CbzENOUcjGY5zPMrPC6q0jJKPDwmqOc2UV9c7X3IK4aP2LWDaX9 OzRBYmcRXgxXjvW8TRI/79kFWTRKM/Rf0Wrcp1QjyF46GgZVc0d2kkDfdXHZzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740535919; a=rsa-sha256; cv=none; b=GV9IRqrgDPbd3ChZ9l6iLioo+awvcxVMVolpkc7cuGvLqsx4sMt56fnSKIqWfxiGLkKfDv nsBUdDLN5AhMMs+mDrhKN6czJuMOP+vXsZrqQ/Hea+z9VnuLS3k2R6CTEhTezG/4nBZU7a LHSZ+dONWHV0rfozc99fZQha1M9T8bb8h9wgX6psq015VsZESu7yK2YlZ3auE1rHJc1A/K KLBdQJz66/+lF9fATKQkG33lc9dOMtNHg6eAUZtXk0IkpTB6j8ltEGSyrEvl484flf04DO gob28oxZ5rbJ0Fn/racmRSRg6NRXuC0/8rftmVwQ4gJ2yofMUuFjV23CENjwmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=edbYgmB0E3yT8xqMjNnP1TCgjZcV+fwsBUgkYjB1zSE=; b=BDn+Kb5lO5GvvTL70kccRL2GEQrG1oDv4h+d6tKl6TGTyP6fVXYhwto6cikST0SDBRxGVC SZlGzG3xpWjwPpZ0gtFqOW6NEe0FQGyWFTO0NFSTe3Mqa8dRIi/I6GGKxlgS/MhfL2OAiy QNvxMCTtQ68KiDWrtdSgZvnYrjJyI1DVP83STyTtaOx99/j/skkTLDh2L4euRFW32kCUJJ DCClweswHOgQLGMm0hKhCnXcLEJtI4LzVV4Zx8gu4KlSsFaOP1g9cSuC+ankZ89tHTkSv6 egdHnMyYCMuNk8OindFYz/j++w4vXATrJWBTRPMzXZMXGDvRuyTNgmmTdyBwqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2dJb49wZzt4Y; Wed, 26 Feb 2025 02:11:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51Q2BxWk073670; Wed, 26 Feb 2025 02:11:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51Q2Bx3B073649; Wed, 26 Feb 2025 02:11:59 GMT (envelope-from git) Date: Wed, 26 Feb 2025 02:11:59 GMT Message-Id: <202502260211.51Q2Bx3B073649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 75d23d882389 - main - LinuxKPI: 802.11: compile in HT compat code by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75d23d882389e1bb011bda37022aaa17c068cbf8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=75d23d882389e1bb011bda37022aaa17c068cbf8 commit 75d23d882389e1bb011bda37022aaa17c068cbf8 Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 01:12:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:10:55 +0000 LinuxKPI: 802.11: compile in HT compat code by default Compile in the HT compat code by default even though no one will make use of it yet. Sponsored by: The FreeBSD Foundation MFC after: 3 days Tested with: iwlwifi AX210 (NOHT, HT20 and HT40) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 63f6f5a182b5..1c9f8bc63292 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -79,7 +79,7 @@ #define LKPI_80211_WME #define LKPI_80211_HW_CRYPTO -/* #define LKPI_80211_HT */ +#define LKPI_80211_HT /* #define LKPI_80211_VHT */ #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) From nobody Wed Feb 26 02:12:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2dJf3ly2z5pQfY; Wed, 26 Feb 2025 02:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2dJd6f9Sz49jF; Wed, 26 Feb 2025 02:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcPlzZEZmOb6boXCaGGvGB7R7wzJdRyN5BY+HAyPQ+Q=; b=TlehpRy0o8zYcI4qGXJ+Ox6iWn4Q1rCn7ui/Jx30H4jnfNMAlbGqZAeux06QJFpkTy7Oks r2UZBo0eqx1BEJQd+1yH36hnvRRAEQw3JbD1AWFOZt9CWRrvOJCe2AYMyBGXhDqY1b3P4y J7Okd1dx1dECOpDsQpaaSSuYyHXIDGQaVxjiO/1Mmr7l844R7Q4fDkMC+fZEolL5yEKb2a DoXe3eCnfsya+t93i7TPPkvC8Rwn+8xuuSDIMcVL0Wk1dwWPvKpDpaH2vBTkvzVpWsV3hr gU7eO31YJ4PyzJ1JsZ+N18WgwgnpRZCOD9TObf9N1gJ5SxNmtxHKENyIqa3dLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740535922; a=rsa-sha256; cv=none; b=rHwa9qnhrUQvoECziLfWO+y/K+ETiyeoeeJlQmHYFqGVdkxl0SFi1mgV4wBJJw655Io3Zq 9p4oXAgoTyxpAWGzESGTqVYqpL+P25zq+KbdiFCy05TvoHx0Njncn/zPYGcmD1pCAalBwK Ef0wpcTcALQdCz1FjrHQxQg5Dz1xDzh8gIYAwbhnwFsit/8UQvS6iwDU0MWGN5tmxlEi71 jf5ohPCOtntNTbz2ullCRInBqGEzz0NvfLIhH6lF/ncYggrRcsNd4QZDl32fDMhe1MjwbS znjMjAHtqZiYAHuq4VMKCCg2eNvOp8S/g51O+oR7uODbKRy+7PB/Jvm5my1Ocg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcPlzZEZmOb6boXCaGGvGB7R7wzJdRyN5BY+HAyPQ+Q=; b=m8qDvF7FHQ5HytYTKOygAkN/kzBNDY/pbqA5efu4Vx1cORNNx3xqh3B+7m1TBc3vPDUbHn sj3YREp44F5zFx7L1wuRN4CDKLfBGhuSM2SJmQlP/SlINxlZh+pg08oBqilCcdSI9re+AD fJtPTl7GBTqIqXtQbfLKYrClSl+DaBw7puMoxLkx5ke9Z6bInUHJmMFgJDfSnJK+JIQftz TLZ31QfFfLY54r5HMtO/EidDRebjdUsl83OlpWDvlRc57HXtrZt0YN0Qb+luM5YhYuWMXP s+FNIuPNEm2760QI6g3kakpPEix1WQyq3uhBrNt7n0IWgtTS9jheqkNVtYxdSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2dJd68krztJ1; Wed, 26 Feb 2025 02:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51Q2C1AW074099; Wed, 26 Feb 2025 02:12:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51Q2C1cV074096; Wed, 26 Feb 2025 02:12:01 GMT (envelope-from git) Date: Wed, 26 Feb 2025 02:12:01 GMT Message-Id: <202502260212.51Q2C1cV074096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2c44f1ff6935 - main - LinuxKPI: 802.11: compile in VHT compat code by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c44f1ff6935e93f7774e526f2f1ab0a2812eab5 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2c44f1ff6935e93f7774e526f2f1ab0a2812eab5 commit 2c44f1ff6935e93f7774e526f2f1ab0a2812eab5 Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 02:27:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:10:55 +0000 LinuxKPI: 802.11: compile in VHT compat code by default Compile in the VHT compat code by default even though no one will make use of it yet. Sponsored by: The FreeBSD Foundation MFC after: 3 days Tested with: iwlwifi AX210 (NOHT, HT20, HT40, VHT20, VHT40, VHT80) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 410ec0679d44..894d0db39677 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -80,7 +80,7 @@ #define LKPI_80211_WME #define LKPI_80211_HW_CRYPTO #define LKPI_80211_HT -/* #define LKPI_80211_VHT */ +#define LKPI_80211_VHT #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) #define LKPI_80211_HT From nobody Wed Feb 26 02:12:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2dJd3G3qz5pQKd; Wed, 26 Feb 2025 02:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2dJc5pnHz49GP; Wed, 26 Feb 2025 02:12:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ETYBgEgiGcOXOJK+ZgrazZG78U4RJvkejslkJ+PUIU=; b=dSWZo2tHadvYaGjq3Mn67CZ9eJs2vQYsH3UNxRN/Y7uIb3sHwGsvCWRj+l3xJXWTWEpVyn WHmDROShhyDkEDw7InLn6tD+Y5D3aEFc99mEhHRTqV5+QqvKKa3UMkJKIE2/Un5HlJyurP UHDz74MsqwMbFdS99IS8zGPCYkEH6Kh77SQjgd8q/v7BBPk88qkxBq6v+6B49wFS2mVnm/ xlEDbYlz1VvepF3m+zvsJB9UsAXY6+r1l099cEZFpWFJ4QbQmH5dxGVRh1kiaHMDIy+4sQ FkiPQo5z0alBJLEcLdZwl19M+VI3395C9Pp1/wYLPyTpqKAifwcbw9Ob3B6hXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740535920; a=rsa-sha256; cv=none; b=pM/j3ylkHn7aVeOJnzdOhpurPbIn/iWujOd/dn+PZfGH/F7X7vQKZTFQWV9Z5DOAqJeanp aoW2or+F781X3RYUl/NhJhSuAWC9ifFTPeQvvAvBh8ZF2yL/2d40OLC36ugN+0EXDpd1tI XtqlZPKWN+YsHaO8Oy5FuKoDBNJSRVzKys1crLlBeV/EuDF8vfzSL3Gyazpdc2PHte626T FrxtiE6/P9IPXJBfe3EVkMYIvZlykwrqEDB3uUu0fuWA92dv5mX9PGL73oqV6hpTPlrIj+ O5K46I2I/VHWWgQc+BvmdBkIHnYHrDTWyYtXo/x6yTeAkiTzpPUHAuOCB/7pww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740535920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ETYBgEgiGcOXOJK+ZgrazZG78U4RJvkejslkJ+PUIU=; b=VqAPPgt0klrjgDoWzLPfwpx7FTw222bbSjuJDOMVqjmVPrqoH74sapNggANiXNtdOpHQpe IgfBUKJjNswLZXzzGxqKiWoB3eJ1WkjjgiMqhQ+iuLM7K/LaA9xH7RjfSK1MwTSdQDceP4 yHZ9oZ1mPrKhTJga7RKdg2ZlNw60LfJzCSSTCHWewPH9683v3EQ/hi0gzzp5UhOysKFqvD MAaValS3RQbCtSHhd5ku+hLzFBzJ5ZCVrnUICRzPZ1eOqihK1MrxwUj7PfBlpDRJpbQ4XW QVE4lgjtoQRfJ4F3Lf3RqBaKtlGkGS6FVblLeOX7NeGNZp0UTvex80B76LJJEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2dJc5CYQzt4b; Wed, 26 Feb 2025 02:12:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51Q2C0dT074062; Wed, 26 Feb 2025 02:12:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51Q2C0ZB074059; Wed, 26 Feb 2025 02:12:00 GMT (envelope-from git) Date: Wed, 26 Feb 2025 02:12:00 GMT Message-Id: <202502260212.51Q2C0ZB074059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3e022a91c91c - main - LinuxKPI: 802.11: ensure to select the correct channel width List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e022a91c91cf1b967d7de7b6fe81c6632fe1207 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3e022a91c91cf1b967d7de7b6fe81c6632fe1207 commit 3e022a91c91cf1b967d7de7b6fe81c6632fe1207 Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 01:57:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:10:55 +0000 LinuxKPI: 802.11: ensure to select the correct channel width If HT is enabled but not using CHW=40 set CHW=20 to make sure we do not get stuck on any other value. If VHT and the VHT Operation element Channel Width field is 0 (use 20/40) do not update the bandwidth but stick with what HT selected. This is better than disabling VHT alltogether for 20/40 and allows us to work on VHT20 and VHT40 APs it seems. We will have to do more work to can align with the chanctx or deal with Operating Mode Notification Action frames in LinuxKPI or net80211. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 1c9f8bc63292..410ec0679d44 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -401,6 +401,8 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0) sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + else + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; /* * 802.11n-2009 20.6 Parameters for HT MCSs gives the mandatory/ @@ -450,6 +452,13 @@ lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) sta->deflink.vht_cap.cap = ni->ni_vhtcap; sta->deflink.vht_cap.vht_mcs = ni->ni_vht_mcsinfo; + /* + * If VHT20/40 are selected do not update the bandwidth + * from HT but stya on VHT. + */ + if (ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_USE_HT) + goto skip_bw; + width = (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); switch (width) { #if 0 @@ -467,7 +476,7 @@ lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) #endif sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; } - +skip_bw: rx_nss = 0; rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; From nobody Wed Feb 26 02:23:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2dZG6qjKz5pRx5; Wed, 26 Feb 2025 02:23:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2dZG6NQ5z3NLn; Wed, 26 Feb 2025 02:23:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740536630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hWeI3t+aDvNY7pBXSMz9lxI57twPQwfQ5OYw0R0TgBY=; b=oBjiie9+5K5gMmaXUeWvGM1ZVo5DrPbFy/h7MEdidh+OK55mw2zzhnWTcaaJqiyy8QQ17F RxNGB2Ypv8gjduiQtMCoOPBME91/h1gwYV/+Lk871Rp5jcxVZi+y0m+0GriMz4rDaenL2Y FTHgm+fy3ghRISX8PD0z3lNRvVGVTMGeMpY76NpjplGjmMuaDuCUVjmomsY3QfimpJ0mcL 2spESHS7eDqg/VKppSKVRQkpDqN1nQ/qFybyIcTzncApI+0akNDvE6nO+99UTm7woroHbM M7jUJHhZgNV2S353uF+6+98NBojbDnEMBi0jLMmoFtiDvwTCW6CEfpFxWpI86A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740536630; a=rsa-sha256; cv=none; b=yi9Q0wU5HVJxC+gYdiEoa6M/MradNnSDjsUKDscASdBgWsXMpydn+4SyEBtDZq/s0C3/mH NxLhv3tw8ogpgWeiGl1jpJ+4Ua49rez9+FsqqiK13zNzR35T1UnGRGeqFNFakeiT9WQ32z v/a7WvdTw9qsMLD02WAby39RMgMzJTnjdt8plV7YdfjUU/OzedrnIZ/DeU8xppdKmi8JWz o20ecC2GsFE7gSa1YwdgMRdvzckJ5aZpdTqXwRWOu7+c2v+CCnBVUD/9D6bRHIGi2f7F8t pzPC17wgcf5GcPfbPAgvcPGl7XxS1T/MOrm88/1It3dGP14axcL8IRMgsJIN4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740536630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hWeI3t+aDvNY7pBXSMz9lxI57twPQwfQ5OYw0R0TgBY=; b=UFYr24p6GElY9qE6Qb6wLDkg06rA/3MwmuIzShueZM3RpfbZGxVYTnCGAQLimfciEMiuIK js85KiAJ3vzNdhFfrkJ/Kmn3MXpKebpYzlKUr7fuPhwtMGspY0n/zoegT89WZzw8CDHVIF Cgx+FE+HGJTm2hTF+8b86DD8xhGqJRIk424ph5NuwwS91fFwaohge07AnMtFBUQFj4sg+H vPbO2QWNGVa3rYYXJS/8N/e1jpDrhbPxRAcNBb52a7SJJIF8V7tpGc5WNkS8t1g8UD6yfW u4/gKVZz/NET3q1HAQ3gzmCk+fIlnMtb2z6UccNrlpaU6FUpqiKWsBGx+7MMzQ== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z2dZG4yP4zMY5; Wed, 26 Feb 2025 02:23:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 9CC59A64805; Wed, 26 Feb 2025 02:23:47 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E65562D029E0; Wed, 26 Feb 2025 02:23:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id KVMaVZViNVFH; Wed, 26 Feb 2025 02:23:47 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:da44:89ff:fedd:d5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id BF74E2D029D8; Wed, 26 Feb 2025 02:23:47 +0000 (UTC) Date: Wed, 26 Feb 2025 02:23:46 +0000 (UTC) From: "Bjoern A. Zeeb" To: Michael Tuexen cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 0e58542fd246 - main - tcp: remove unused field from struct tcpcb In-Reply-To: <202502252048.51PKm4YX061305@gitrepo.freebsd.org> Message-ID: References: <202502252048.51PKm4YX061305@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Tue, 25 Feb 2025, Michael Tuexen wrote: > The branch main has been updated by tuexen: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0e58542fd246242bc64bd03d8b2f28cf981c062b > > commit 0e58542fd246242bc64bd03d8b2f28cf981c062b > Author: Peter Lei > AuthorDate: 2025-02-25 20:37:48 +0000 > Commit: Michael Tuexen > CommitDate: 2025-02-25 20:37:48 +0000 > > tcp: remove unused field from struct tcpcb > > Reviewed by: tuexen > Sponsored by: Netflix, Inc. > --- > sys/netinet/tcp_var.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h > index e65e44840bd8..31663ed48f81 100644 > --- a/sys/netinet/tcp_var.h > +++ b/sys/netinet/tcp_var.h > @@ -452,7 +452,6 @@ struct tcpcb { > tcp_seq gput_seq; /* Outbound measurement seq */ > tcp_seq gput_ack; /* Inbound measurement ack */ > int32_t t_stats_gput_prev; /* XXXLAS: Prev gput measurement */ > - uint32_t t_maxpeakrate; /* max peak rate set by user, bytes/s */ Is the tcpcb no longer KBI relevant these days? In the old days we'd simply make this a spare and not move all offsets below around. > uint32_t t_sndtlppack; /* tail loss probe packets sent */ > uint64_t t_sndtlpbyte; /* total tail loss probe bytes sent */ > uint64_t t_sndbytes; /* total bytes sent */ > -- Bjoern A. Zeeb r15:7 From nobody Wed Feb 26 05:27:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2jfP11ZRz5pJx0; Wed, 26 Feb 2025 05:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2jfM5Fhnz3wFZ; Wed, 26 Feb 2025 05:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740547659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S29OIn/zb5+nFOQb6XDP5z+yyX5Fl5B21koqCpab4go=; b=R70GdxaQLGeaZWlfXtaSNx12HQyX6fvbQG7RCtmdjH0W/fQm/UdgZUDyc7blDd+7zcK7hY Y+7kvGZm/KRDSuM45aOlGb1R2ewWVJMJlV9PWUaur4fmpdntpKoviGpQ7diDgk7zLDXNBT t6eQmCOxNKITL4g20yCngJjerNfqGWmhAHgPB+xnqEfTZx96yAJ2kX+p+fnWqOufxiYuks DjiUllB82b4MN1gjU0sFelpjkk+GZvxt0Xtfm8U1I84J09Oy3vfQ8rrC8h6CkOWgnZ1+1+ ucDUzlIZq47RbThmZpRpbtywzUwJy05rB7p5WZPbGHe5m4+j99524m0L3TZmqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740547659; a=rsa-sha256; cv=none; b=CpSfh3l3OW9+UlSSEqB8bl9ec03tC4vBQ18PoJ/nA+ciMusaU81/yRR5Yi0osuuXEim8oc dJFtVZy/0Powi/WO02GJl98EiU/KJAFJI563C9ZFM2dsBS53QfeuFAK0SR2RidYSuXWRtu BzXav1MdRWU9D0v+B5Yqs7cQfVQoHQtcMO8m1ne3pTgiR7DX08aa5yIBwH7f+bxJYa8YHK sMC5rj/EJW51CZFb4rRMYrK5+YK/u7r/WB54MA4f1FtGpSUAMU+FHNbuFU4D4iJ+Iir98S k2EUsCRtfNT1vjdxE1CHEyOU/s8VZ0yZqjzxKhuxQk84/bu0hdPCxsq2TKc4pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740547659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S29OIn/zb5+nFOQb6XDP5z+yyX5Fl5B21koqCpab4go=; b=OOjwtwJ5L6crCH7aB0tleBIdrg21gVUNRBnWuqxiQ9CsRbnzgEdu1dyKCKfb1N3+cuNXCU AqMdUDQJfXiYBfytvlRLUBcEYFwOm/kOlbS0kNY371SbM1J6P3XHg3ySJtxjvvJ3u3PPQI 6/Z69wiA6KIQOKbZZ32n042Vlwl6vSGp4LahzZfMnEWx5avhs8NWFeaCd8WI/6q/4+0XaK nzVTx8zf3iQfGj9f5QGYUkq0cbvFgPyyOLDYPJPrnzND7vdamosxDgJ5JIBbpuAkf7Mi9Y 2CzUwfZrUnSpfKWV7a/eB1RPuCV8nbW35sENuP+Nu4GoLL7uKBQILYffdm5fvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2jfM1yWRzyc9; Wed, 26 Feb 2025 05:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51Q5Rdlj032644; Wed, 26 Feb 2025 05:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51Q5RdNt032641; Wed, 26 Feb 2025 05:27:39 GMT (envelope-from git) Date: Wed, 26 Feb 2025 05:27:39 GMT Message-Id: <202502260527.51Q5RdNt032641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8c108dccd7f8 - main - acpidump: do not use pointer arithmetic to check for overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c108dccd7f878ad44aaef1f5bfb5622666bd09a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8c108dccd7f878ad44aaef1f5bfb5622666bd09a commit 8c108dccd7f878ad44aaef1f5bfb5622666bd09a Author: Konstantin Belousov AuthorDate: 2025-02-26 05:24:30 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-26 05:27:32 +0000 acpidump: do not use pointer arithmetic to check for overflow Pointer arithmetic overflow is UB. Convert to unsigned uintptr_t and do the check there. PR: 204945 Reported by: David Binderman Sponsored by: The FreeBSD Foundation MFC after: 1 week --- 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 c9e2d5745d50..a8a3c953d72d 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; From nobody Wed Feb 26 09:06:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2pVv5XhJz5phdD; Wed, 26 Feb 2025 09:06:31 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Certum Domain Validation CA SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2pVv3KXTz3bCR; Wed, 26 Feb 2025 09:06:31 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1101:be00:9dcd:4a6f:c57f:9896]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id 57334721E281C; Wed, 26 Feb 2025 10:06:22 +0100 (CET) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: git: 0e58542fd246 - main - tcp: remove unused field from struct tcpcb From: tuexen@freebsd.org In-Reply-To: Date: Wed, 26 Feb 2025 10:06:21 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1B9ED49E-E36A-4C0A-A47E-C97569C2354C@freebsd.org> References: <202502252048.51PKm4YX061305@gitrepo.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3826.400.131.1.6) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-Rspamd-Queue-Id: 4Z2pVv3KXTz3bCR X-Spamd-Bar: ---- > On 26. Feb 2025, at 03:23, Bjoern A. Zeeb wrote: >=20 > On Tue, 25 Feb 2025, Michael Tuexen wrote: >=20 >> The branch main has been updated by tuexen: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0e58542fd246242bc64bd03d8b2f28cf= 981c062b >>=20 >> commit 0e58542fd246242bc64bd03d8b2f28cf981c062b >> Author: Peter Lei >> AuthorDate: 2025-02-25 20:37:48 +0000 >> Commit: Michael Tuexen >> CommitDate: 2025-02-25 20:37:48 +0000 >>=20 >> tcp: remove unused field from struct tcpcb >>=20 >> Reviewed by: tuexen >> Sponsored by: Netflix, Inc. >> --- >> sys/netinet/tcp_var.h | 1 - >> 1 file changed, 1 deletion(-) >>=20 >> diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h >> index e65e44840bd8..31663ed48f81 100644 >> --- a/sys/netinet/tcp_var.h >> +++ b/sys/netinet/tcp_var.h >> @@ -452,7 +452,6 @@ struct tcpcb { >> tcp_seq gput_seq; /* Outbound measurement seq */ >> tcp_seq gput_ack; /* Inbound measurement ack */ >> int32_t t_stats_gput_prev; /* XXXLAS: Prev gput measurement */ >> - uint32_t t_maxpeakrate; /* max peak rate set by user, bytes/s */ >=20 > Is the tcpcb no longer KBI relevant these days? > In the old days we'd simply make this a spare and not move all offsets > below around. I can do that, if it is preferred. I was actually thinking about this, but did not find any variable in the struct which indicates it is = unused, spare or so. I do know that the size of the structure matters (smaller = is better). So please let me know. I will not MFC this change. Best regards Michael >=20 >> uint32_t t_sndtlppack; /* tail loss probe packets sent */ >> uint64_t t_sndtlpbyte; /* total tail loss probe bytes sent */ >> uint64_t t_sndbytes; /* total bytes sent */ >>=20 >=20 > --=20 > Bjoern A. Zeeb = r15:7 From nobody Wed Feb 26 13:36:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2wW15nV6z5q6cD; Wed, 26 Feb 2025 13:37:01 +0000 (UTC) (envelope-from SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2wW00D1Lz3fxp; Wed, 26 Feb 2025 13:36:59 +0000 (UTC) (envelope-from SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=rw2 header.b=TqoxRpJZ; dmarc=pass (policy=quarantine) header.from=klop.ws; spf=pass (mx1.freebsd.org: domain of "SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl" designates 194.109.157.24 as permitted sender) smtp.mailfrom="SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl" Date: Wed, 26 Feb 2025 14:36:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1740577017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=GoUtTbhguEC8ktm/KOi3SPUA00DMT+u9ObPodYWGu98=; b=TqoxRpJZz98DVAmFx847zfu6+vz4iIyy1gW2r8/MLRBnEgumaUsvsdwDGQhCDb+Q5iEKD4 aZl5h0bpSCuAA4iEnx9LyZUUhW17Wakb7tn5KHPMypJA8lE5+3RtHUZlh8346fIYsmvuYL yFCgad3mnKE5ksl0f+CsUWY7NiHbQd7TY5vDHeBvpjyn/8crsfQT/FTTX+rx1ewt8RXOMc 3ptGz05/3wWh+CKy7knBt6WwIgb0vOntZK9NuOciHubE66WNwHWY60omippBO991p/KwZC UtWx36K1bkCZqtlCI/W00fJt50dDf9ae7PIDQsVtFsRsqfFDZ06yXQaNs6YlIA== From: Ronald Klop To: Konstantin Belousov Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <985139317.7211.1740577017034@localhost> In-Reply-To: <202502250720.51P7KJkI056048@gitrepo.freebsd.org> Subject: Re: git: e59991206b14 - main - fts(3): be less strict when automount does its job under us walking autofs mount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7210_1760650439.1740577017031" X-Mailer: Realworks (739.null) Importance: Normal X-Priority: 3 (Normal) X-Spamd-Result: default: False [-0.28 / 15.00]; RBL_SENDERSCORE_REPUT_9(-1.00)[194.109.157.24:from]; NEURAL_SPAM_LONG(0.96)[0.962]; NEURAL_HAM_SHORT(-0.83)[-0.831]; NEURAL_SPAM_MEDIUM(0.69)[0.692]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[klop.ws,quarantine]; FORGED_SENDER(0.30)[ronald-lists@klop.ws,SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl]; R_SPF_ALLOW(-0.20)[+ip4:194.109.157.0/24]; R_DKIM_ALLOW(-0.20)[klop.ws:s=rw2]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ONCE_RECEIVED(0.10)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.109.157.24:from]; RCVD_COUNT_ZERO(0.00)[0]; RCPT_COUNT_THREE(0.00)[4]; FROM_NEQ_ENVFROM(0.00)[ronald-lists@klop.ws,SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; HAS_X_PRIO_THREE(0.00)[3]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[klop.ws:+] X-Rspamd-Queue-Id: 4Z2wW00D1Lz3fxp X-Spamd-Bar: / ------=_Part_7210_1760650439.1740577017031 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Van: Konstantin Belousov Datum: 25 februari 2025 08:20 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commi= ts-src-main@FreeBSD.org Onderwerp: git: e59991206b14 - main - fts(3): be less strict when automoun= t does its job under us walking autofs mount >=20 >=20 > The branch main has been updated by kib: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3De59991206b1463b7e85cc8aafd= e7f1dc03fcedcf >=20 > commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf > Author: Konstantin Belousov=20 > AuthorDate: 2025-02-21 13:07:43 +0000 > Commit: Konstantin Belousov=20 > CommitDate: 2025-02-25 07:09:29 +0000 >=20 > fts(3): be less strict when automount does its job under us walking a= utofs mount > =20 > Namely, allow the file id change if the resulting file belongs to > automounted filesystem. If it is, remember the updated id. > =20 > This allows the ids from the automounted volumes to change without > restrictions, might be a further refinement would be to only allow su= ch > inconsistency once. > =20 > PR: 284914 > Reported and tested by: Lexi Winter=20 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D49094 > --- > lib/libc/gen/fts.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c > index 770a7b2cc322..bd193c7c6cfc 100644 > --- a/lib/libc/gen/fts.c > +++ b/lib/libc/gen/fts.c > @@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char= *path) > { > int ret, oerrno, newfd; > struct stat sb; > + struct statfs sf; > =20 > newfd =3D fd; > if (ISSET(FTS_NOCHDIR)) > @@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, cha= r *path) > goto bail; > } > if (p->fts_dev !=3D sb.st_dev || p->fts_ino !=3D sb.st_ino) { > - errno =3D ENOENT; /* disinformation */ > - ret =3D -1; > - goto bail; > + if (_fstatfs(newfd, &sf) !=3D 0 || > + (sf.f_flags & MNT_AUTOMOUNTED) =3D=3D 0) { > + errno =3D ENOENT; /* disinformation */ > + ret =3D -1; > + goto bail; > + } > + /* autofs might did the mount under us, accept. */ > + p->fts_dev =3D sb.st_dev; > + p->fts_ino =3D=3D sb.st_ino; > } > ret =3D fchdir(newfd); > bail: >=20 >=20 >=20 >=20 >=20 /* autofs might did the mount under us, accept. */ I=E2=80=99m not native English so forgive me my question. But what does thi= s comment mean? Regards, Ronald.=20 ------=_Part_7210_1760650439.1740577017031 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Van: Konstantin Bel= ousov <kib@FreeBSD.org>
Datum: 25 februari 2025 0= 8:20
Aan: src-committers@FreeBSD.org, dev-commits-src-a= ll@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: e59991206b14 - main - fts(3): be less strict when automount does= its job under us walking autofs mount

The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3De5999120= 6b1463b7e85cc8aafde7f1dc03fcedcf

commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf
Author:     Konstantin Belousov
AuthorDate: 2025-02-21 13:07:43 +0000
Commit:     Konstantin Belousov
CommitDate: 2025-02-25 07:09:29 +0000

    fts(3): be less strict when automount does its job = under us walking autofs mount
    
    Namely, allow the file id change if the resulting f= ile belongs to
    automounted filesystem.  If it is, remember th= e updated id.
    
    This allows the ids from the automounted volumes to= change without
    restrictions, might be a further refinement would b= e to only allow such
    inconsistency once.
    
    PR:     284914
    Reported and tested by: Lexi Winter
    Sponsored by:   The FreeBSD Foundation     MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D49094
---
 lib/libc/gen/fts.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 770a7b2cc322..bd193c7c6cfc 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *= path)
 {
    int ret, oerrno, newfd;
    struct stat sb;
+   struct statfs sf;
 
    newfd =3D fd;
    if (ISSET(FTS_NOCHDIR))
@@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char = *path)
        goto bail;
    }
    if (p->fts_dev !=3D sb.st_dev || p->fts_ino != =3D sb.st_ino) {
-       errno =3D ENOENT;    &= nbsp;/* disinformation */
-       ret =3D -1;
-       goto bail;
+       if (_fstatfs(newfd, &sf) !=3D 0 |= |
+           (sf.f_flags &= amp; MNT_AUTOMOUNTED) =3D=3D 0) {
+           errno =3D ENO= ENT;     /* disinformation */
+           ret =3D -1; +           goto bail; +       }
+       /* autofs might did the mount under u= s, accept. */
+       p->fts_dev =3D sb.st_dev;
+       p->fts_ino =3D=3D sb.st_ino;
    }
    ret =3D fchdir(newfd);
 bail:




   /* autofs might did the mount under us, a= ccept. */


I=E2=80=99m not native English = so forgive me my question. But what does this comment mean?

<= /div>
Regards,
Ronald. 


------=_Part_7210_1760650439.1740577017031-- From nobody Wed Feb 26 14:03:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2x5h37Vlz5q8rL; Wed, 26 Feb 2025 14:03:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2x5h2WD6z3tjm; Wed, 26 Feb 2025 14:03:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740578616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=li4egja3ZojePcybNgN/Ag2/idPE4LCzTZePpzjYVVc=; b=Pssa9yUd/iT3SbA00HYDkO7TRHv16eDhAVDtzzoeYCAy1Ugi4vLSIgXxPpV5kAlNKHomC4 B6W1QqaXN+/IMhUIzL4mojGreWTA+hPeQyVClhKP2iJSdsBcLei8pMTKCgrjDia2exN8yj GIMqNnr5X5rXk1SsP8gLpN3BqFuny8c2/tfmDszcuS5Pwm4gAphK/qlkB8/nNdcK0Uh+PW TTuiC6WvhYQeRHmk4GFzbWsd5ulhZEXaHNgxHA7nUxIaT7pWYmiq2ZVARJp30HzjdVVIie o9tJdMaiOg7OfIAg1nzlaQM7Q/vncUaaNBc1W0MZciCIcKJveeQyMcd6Cy6PzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740578616; a=rsa-sha256; cv=none; b=LBvKNwZXGY5KIzpAtwQKE9YmtaQHk4Qorb1s0OOVusN3EKIA4OlABFrVHlcsNP04XkgMDh +opFPpoYKoXtgYAxB7d22HHExZPkcE1me++uRCO4077p3xgYSK7h9zAjw2V5xptmIV0txY eckQuabkUsq1T9qCUzQZ6kYygg/nR66f21CTjh7qYoMFNyU8soSoQ+F3h5Lrp3j+d8CMLc u/RitlfvAH+mdNocxgK6GZjnROonxnUS8x5EO/l4SOPGIlnDmJKCtJzLgzEVzgeiCJaZYr 7OkOHMc2AAmPq65XfIGtx2fVXlWugsLgA3odG+44fwNnNJHaYwVaewDM6xr5cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740578616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=li4egja3ZojePcybNgN/Ag2/idPE4LCzTZePpzjYVVc=; b=mqQ+ZnyCQ/2EbRhk5ZR7BGMC5VC+bdeu+0ZWG+xcas5S8LcbM17m4jQXS3z3dTKe6IUVtN m4jbwUL/hGJWGyzWYyr4FSdIlOzKaB5RGZi+c+2xTdzpQnhC54MvylGvzkeG0y4jMK0moL +1EAgPdhc2dCX4aFM4YrmKJ5GnKX5GZnctvr4AZ6AMBZoCSYqM+ZIU+l/uTCZzov3IP+po wLPqPTw74rziwj4fYEXZZd3J2lb3H9O6yok+Amkb1JO/UyLpcBGJgSlv1E1dHqDC8JLRqL hKS8TvuiKCtN8xWamfsBsgpxMhZgRj7HEj8oQYI2btsZJ2Rif9Z4GzKwImhf8A== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z2x5g5VYYzsq1; Wed, 26 Feb 2025 14:03:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Wed, 26 Feb 2025 08:03:33 -0600 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: e59991206b14 - main - fts(3): be less strict when automount does its job under us walking autofs mount To: Ronald Klop , Konstantin Belousov Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <985139317.7211.1740577017034@localhost> Content-Language: en-US From: Kyle Evans In-Reply-To: <985139317.7211.1740577017034@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/26/25 07:36, Ronald Klop wrote: > > *Van:* Konstantin Belousov > *Datum:* 25 februari 2025 08:20 > *Aan:* src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev- > commits-src-main@FreeBSD.org > *Onderwerp:* git: e59991206b14 - main - fts(3): be less strict when > automount does its job under us walking autofs mount > > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/? > id=e59991206b1463b7e85cc8aafde7f1dc03fcedcf cgit.FreeBSD.org/src/commit/? > id=e59991206b1463b7e85cc8aafde7f1dc03fcedcf> > > commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf > Author:     Konstantin Belousov > AuthorDate: 2025-02-21 13:07:43 +0000 > Commit:     Konstantin Belousov > CommitDate: 2025-02-25 07:09:29 +0000 > >     fts(3): be less strict when automount does its job under us > walking autofs mount > >     Namely, allow the file id change if the resulting file belongs to >     automounted filesystem.  If it is, remember the updated id. > >     This allows the ids from the automounted volumes to change without >     restrictions, might be a further refinement would be to only > allow such >     inconsistency once. > >     PR:     284914 >     Reported and tested by: Lexi Winter >     Sponsored by:   The FreeBSD Foundation >     MFC after:      1 week >     Differential revision: https://reviews.freebsd.org/D49094 > > --- >  lib/libc/gen/fts.c | 13 ++++++++++--- >  1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c > index 770a7b2cc322..bd193c7c6cfc 100644 > --- a/lib/libc/gen/fts.c > +++ b/lib/libc/gen/fts.c > @@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, > char *path) >  { >     int ret, oerrno, newfd; >     struct stat sb; > +   struct statfs sf; > >     newfd = fd; >     if (ISSET(FTS_NOCHDIR)) > @@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int > fd, char *path) >         goto bail; >     } >     if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) { > -       errno = ENOENT;     /* disinformation */ > -       ret = -1; > -       goto bail; > +       if (_fstatfs(newfd, &sf) != 0 || > +           (sf.f_flags & MNT_AUTOMOUNTED) == 0) { > +           errno = ENOENT;     /* disinformation */ > +           ret = -1; > +           goto bail; > +       } > +       /* autofs might did the mount under us, accept. */ > +       p->fts_dev = sb.st_dev; > +       p->fts_ino == sb.st_ino; >     } >     ret = fchdir(newfd); >  bail: > > ------------------------------------------------------------------------ > > > >    /* autofs might did the mount under us, accept. */ > > > I’m not native English so forgive me my question. But what does this > comment mean? > It might have triggered an autofs mount while we're running, so we just accept the otherwise suspicious looking change. From nobody Wed Feb 26 15:03:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yQP0D4dz5qGFr; Wed, 26 Feb 2025 15:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQN6gHgz3GF1; Wed, 26 Feb 2025 15:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BPAYYwuKKyXMriAtBXCz0LpKr19wPEuRLyxiHCmVQG0=; b=oOitmwDr5ieJoU2VzCpZpyJSi3MmCpkQG55HlHflaVnHljwkY+KmGvA5nccna2MHYnr6U4 jR4glK4XC/G2hzxKL8XGOXLtu5wLhY2yvJPUA1tSfljUYLkMozmbVRa6jiw+zV571OIqDT ctSCCLtxJNP2BE0VcxL7IxNm4/i6ajxdVZ/hPfhLcJMARkNcshseihk8iDrNx0Dcrtk0zZ w+Y/CndJghKbLxUQoYzcurFIC0X70lRbPdU15opOx7qL09lJyg8n11D6ntVAWi/tMVT8AO INbFrh5af/GRdc6bK8AxRHEyNtLPyW0iQHdYZkiMasURF23PHbS9VNmmGnlFiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582189; a=rsa-sha256; cv=none; b=TuqmVAJI2pegr7Uu+kUtN8oPpWZ/qkyc6meFwWxJDcIYmCuvro8KONjODfxWHRdm8QRQzB MqDzpGPcwPqR1IO8bBxFC6xcjTdfdrvn6vbSVvhE+WTF/Yu4Oj1fCxd60Fn6arqCUEY87s 87ZmVItLkBsrj747QLKKqarxFAjRzn3R3JHsLzzYsiA2y1AE4Btoxm4ZbHsnQhTl1BBTZU b3OnvQVuYPP0SkXM2UbdW4K8JJtewluwBCsLY57PSf4sc45tbscqNZlhWIHrRgc8Rs04ZN ikhJhyvsgKoZjIH9Zj9XoAt7riydaYS/LUSJgfy6kcu/ZqYxpfG8QByKI9R+8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BPAYYwuKKyXMriAtBXCz0LpKr19wPEuRLyxiHCmVQG0=; b=ul0OiWbct6L+Z32EaCrUrfBBewuNJQdq9WviL8NdvkjE13jJx13ZW1LAJytix24ne1laf9 0ORc+e3+7lieI/U4rEJIX9svRVZRSmjw53TIFh3DH2SeNapdW5wBgM9zDlm6ZuPVPvX91r i8e0WsOItID33T/bog6jPgbWeIIOdTGgCy7AEY8Lm9yJcU9AHJ3iPlOzc06//8t1EzWUAt ivlEarp3PZvoDsahsPw7+PxmK3t9Dm//wdxb+n0aD+jrndnJIxA4GPsoOGxuychjzz0ee8 JcK9csBIPyYwYg58+iqsQk5SDTfRzRnn6Upb5BJDZ8DSJNx+ritf3PCLIDDMFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yQN6Gmlz1GnG; Wed, 26 Feb 2025 15:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF38rD014452; Wed, 26 Feb 2025 15:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF38Ir014449; Wed, 26 Feb 2025 15:03:08 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:08 GMT Message-Id: <202502261503.51QF38Ir014449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c1895bd9c035 - stable/14 - LinuxKPI: 802.11: improve cfg80211_chandef_create() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c1895bd9c035a1c4af8e44ce2505dc2e00478083 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c1895bd9c035a1c4af8e44ce2505dc2e00478083 commit c1895bd9c035a1c4af8e44ce2505dc2e00478083 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:13 +0000 LinuxKPI: 802.11: improve cfg80211_chandef_create() Implement cfg80211_chandef_create() to work with HT. Update enum with HT channel types. When calling the function from LinuxKPI 802.11 code, pass in NL80211_CHAN_HT20 if HT is supported rather than NO_HT. Sponsored by: The FreeBSD Foundation (cherry picked from commit 11450726d3cf8d76d2113d7cabe995f8ef31ec5a) --- sys/compat/linuxkpi/common/include/linux/nl80211.h | 6 ++-- sys/compat/linuxkpi/common/include/net/cfg80211.h | 35 ++++++++++------------ sys/compat/linuxkpi/common/src/linux_80211.c | 4 +-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 80546e56f0c1..b2a33a28b3a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -135,9 +135,11 @@ enum nl80211_band { NUM_NL80211_BANDS } __packed; -enum nl80211_chan_flags { - /* XXX TODO */ +enum nl80211_channel_type { NL80211_CHAN_NO_HT, + NL80211_CHAN_HT20, + NL80211_CHAN_HT40PLUS, + NL80211_CHAN_HT40MINUS, }; enum nl80211_chan_width { diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 338ffb82bd83..4ae31b257ae0 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1483,36 +1483,33 @@ cfg80211_pmsr_report(struct wireless_dev *wdev, TODO(); } -static __inline void +static inline void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, - struct linuxkpi_ieee80211_channel *chan, enum nl80211_chan_flags chan_flag) + struct linuxkpi_ieee80211_channel *chan, enum nl80211_channel_type chan_type) { KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__)); KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__)); - memset(chandef, 0, sizeof(*chandef)); + /* memset(chandef, 0, sizeof(*chandef)); */ chandef->chan = chan; - chandef->center_freq2 = 0; /* Set here and only overwrite if needed. */ + chandef->center_freq1 = chan->center_freq; + /* chandef->width, center_freq2, punctured */ - switch (chan_flag) { + switch (chan_type) { case NL80211_CHAN_NO_HT: chandef->width = NL80211_CHAN_WIDTH_20_NOHT; - chandef->center_freq1 = chan->center_freq; break; - default: - IMPROVE("Also depends on our manual settings"); - if (chan->flags & IEEE80211_CHAN_NO_HT40) - chandef->width = NL80211_CHAN_WIDTH_20; - else if (chan->flags & IEEE80211_CHAN_NO_80MHZ) - chandef->width = NL80211_CHAN_WIDTH_40; - else if (chan->flags & IEEE80211_CHAN_NO_160MHZ) - chandef->width = NL80211_CHAN_WIDTH_80; - else { - chandef->width = NL80211_CHAN_WIDTH_160; - IMPROVE("80P80 and 320 ..."); - } - chandef->center_freq1 = chan->center_freq; + case NL80211_CHAN_HT20: + chandef->width = NL80211_CHAN_WIDTH_20; + break; + case NL80211_CHAN_HT40MINUS: + chandef->width = NL80211_CHAN_WIDTH_40; + chandef->center_freq1 -= 10; + break; + case NL80211_CHAN_HT40PLUS: + chandef->width = NL80211_CHAN_WIDTH_40; + chandef->center_freq1 += 10; break; }; } diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 0574d4a502de..cc6b72dbea59 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4118,7 +4118,7 @@ lkpi_ic_set_channel(struct ieee80211com *ic) hw = LHW_TO_HW(lhw); cfg80211_chandef_create(&hw->conf.chandef, chan, #ifdef LKPI_80211_HT - (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : + (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : #endif NL80211_CHAN_NO_HT); @@ -5589,7 +5589,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) cfg80211_chandef_create(&hw->conf.chandef, &channels[i], #ifdef LKPI_80211_HT - (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : + (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : #endif NL80211_CHAN_NO_HT); break; From nobody Wed Feb 26 15:03:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yQQ2WJwz5qG2f; Wed, 26 Feb 2025 15:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQQ0skFz3GF2; Wed, 26 Feb 2025 15:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBMyq2sTWsF/a28VQH1td4zWBI7vavMl5eSsL+LjeBE=; b=Kcet7pfFAALMyTYQGVeAk/C/aNd7Km6Z7Mxt6xhsaGef8mUH87Y80VSJT66kwbskkNoeFk MVZ3NTDzwIX9PXICR1hppecnNU6p716xi3gZ76lGn44+MEQhVdzFcgB61C3sGV2OQTkL4/ Z2ZsVBICZJ7QnH8GY2RfCtA6rPc7I5uC6WIAwz7LFeeeLqselLTuShFKymb8MYzHIfLXY4 fpqyy0oVv4ZkK5rHPOZ03TmYe/0mGcWhj1HLsYUkhM4I468jEkohh1CJjHFGSvN/Pch4Tw Vx+KFuKil1OcH+U6qdoIZDCKAtLDAYd2wuTLnOcAUlrlnn/Lc3dMYyKNxMOgEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582190; a=rsa-sha256; cv=none; b=BjGprCL8KeW0bsM4AGNUJ/EgKkWyWW/zWbWUJiNNk0jpDtlsp/QA2CTl6Uc6MCA8tSeSm5 DOXhZ5jhIDbINTzOt/8TyYP+0hgP8Zw7MpaCNScSORn6/JfULIInzPE8lLOofVupV9q4dp 10mj/J4BcAqEX2EQIBZkas8FRkvl02s86XvVxGFD0ENvGm30BIYxcQx7JDZ1QPSa2u+ahG mM0eMXZkHT4Dj+ChQ/OqH6gajzCHVEzliECit6mTt8gjRRsP1S5Z5zTvxoKTjYLPxYDufr K3boeenVPgS+EDMCEBKjY2ibqYjJNdr61R0tWvhDzimJt6KsCsckt/JVZ5lO3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBMyq2sTWsF/a28VQH1td4zWBI7vavMl5eSsL+LjeBE=; b=bqPY/7Okm1vAvupJ0jMmbpx1LovfM5qnYZvvFEuUYslULKKYxK8utWFMxlvIPS8Xo/6pn3 ATSuj0U/KkOj9tpAa0vtOEM9+33uBAT4aCDBgwAFwepTjn0JuGC3izNTbrPIwNl0tLuSaj teJyLXpDNW6opZtuWsosuWG7+w1OEfYnCfuzh0MTTrIKU0mJeC3XLMSAWJ9gSWlSCJAH31 WPqHkf0KVf9k/mG3Fb3dZMXyVcI1+D7w5wKl+KbESIWAfqdquhl9CrbRGXnUzL6Lc1TYQe fKYkzfV0SAxxUJygCTa7UbgGCXB1loAydX6fOu4YJMpZKpXtDRQfUZRRaGyV6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yQQ0SDfz1Glj; Wed, 26 Feb 2025 15:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF39VR014487; Wed, 26 Feb 2025 15:03:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF39Tb014484; Wed, 26 Feb 2025 15:03:09 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:09 GMT Message-Id: <202502261503.51QF39Tb014484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8a7430903fad - stable/14 - LinuxKPI: 802.11: use net80211 macro instead of manual check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8a7430903fadc526147aeee70e6b30eb13d01ee6 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8a7430903fadc526147aeee70e6b30eb13d01ee6 commit 8a7430903fadc526147aeee70e6b30eb13d01ee6 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:18 +0000 LinuxKPI: 802.11: use net80211 macro instead of manual check Use IEEE80211_CONF_VHT() instead of manually checking if hardware supports VHT. Sponsored by: The FreeBSD Foundation (cherry picked from commit 1f73e0ed539d2be48fed70b09e87ecccce4ca869) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index cc6b72dbea59..455b86284a7a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5630,7 +5630,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->scan_ie_len += sizeof(struct ieee80211_ie_htcap); #endif #if defined(LKPI_80211_VHT) - if ((ic->ic_flags_ext & IEEE80211_FEXT_VHT) != 0) + if (IEEE80211_CONF_VHT(ic)) lhw->scan_ie_len += 2 + sizeof(struct ieee80211_vht_cap); #endif From nobody Wed Feb 26 15:03:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yQR3vkNz5qFhc; Wed, 26 Feb 2025 15:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQR1l6sz3GSd; Wed, 26 Feb 2025 15:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYOFYpmbf0/4dCiBXEqlmk2bL5ZgThqAnSppIGUz68s=; b=XG1q8Il2+FuYWwWsN3CbmUVDMbiMRCAaw7a/idVp5lbLzq+rTHDrEKBw0jOhFd1tLvFXCX do2I/UREY7i4szE6n8U+ZOrLpEsHUrn0u0VUusEvR1B7BkZva4zj8PtsGEMrvjCvnlGOCl DJ+wGWDx+gTJTu51aQVeszG0eXbm7npMXwUFbJYk6OagF7AT2QWbCbK76tsCU3TMqhUrAU ZBK0MpRHQK+txCVBq2/cMTaCwM05c6jJX/8q4XeMkR9GlHnolkcJS84yrVmk8iV/5xO3Tq TBR7Eh+Pbrvg7s+ZsclHr4oLdlm20QL5n0EXTUh4CpuB61rrdMm66TW0MngXPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582191; a=rsa-sha256; cv=none; b=IMJN727rIb2Io37RQ59ZF+eAs1oBZEoYNNGtFO5MJvHdI8RlQg73yxkwok1Rgeg18QrXJD jIzRlXJcIT7kJ3A8PTZHYsKhzGud4l+lI7nTHrjXR/yBqVu3c9Qj+qGscwkK4f9LM5t28I FESwFbxDCxNrAcX40JGIiVS7f6yEsJqM7ahIxZBh4h//bnV9MYaU+kAq3VCSE/dM11cj8Z qVNwv9ajwJYrGPF1IEorA5/vXTbL4kzt3MMlhO5W78aJobWCfng6BYNOU+HYmVm+wRJbVd jMtCQ82ZnCs8PnJXUURM463YO1RI2T2/dqxLBzP4J8NUaxs5dqV/0BM0XfDeAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYOFYpmbf0/4dCiBXEqlmk2bL5ZgThqAnSppIGUz68s=; b=pnGAaJ9CdiDb3lWFwQX9oRjTq1w5t9JKs48Zsn3ii0CfAghUubgjawzOZd52WhxNwwJSrM 1r5jrADnPPh8gO9q3yUghU32r7+nOPU3NRVwRSXF42ZBmr514VhnIwTi80RTOuLqpLnpTD BJykT2N4hBhvGF/1INB9+k/IwW0KoF87DK//Uo6mbIPZ0s0EXW9l5Iw+P3C8u2xBirXVnx 0gJ6cWb7+ekbjoeywfZ0fNNFY1+kp5fMK5N7YTmLSLoVPY+qaXwkLL1iCzucI4WZKyfKqL 42Ah0gXZEqntqG098y8iUTgEkUK8o+cev55qQuS7d0GnrQ+b6ymo8rMBd3yFTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yQR1K29z1Gx1; Wed, 26 Feb 2025 15:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3BNt014529; Wed, 26 Feb 2025 15:03:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3BbW014526; Wed, 26 Feb 2025 15:03:11 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:11 GMT Message-Id: <202502261503.51QF3BbW014526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2b93e1f9bafd - stable/14 - LinuxKPI: 802.11: add further checks for deflink.supp_rates[] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b93e1f9bafde3be0a493e5289cc1c6b8286ab1a Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2b93e1f9bafde3be0a493e5289cc1c6b8286ab1a commit 2b93e1f9bafde3be0a493e5289cc1c6b8286ab1a Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:23 +0000 LinuxKPI: 802.11: add further checks for deflink.supp_rates[] When setting the per-band supp_rates bitfield check for mandatory rates only. We cannot easily say at that point for 2Ghz whether 11g is supported so assume these days it is not pure-b. Sponsored by: The FreeBSD Foundation (cherry picked from commit 73cd1c5d44ead3b84cebcc0c24278429afa9e6ec) --- sys/compat/linuxkpi/common/src/linux_80211.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 455b86284a7a..1255691ccf70 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -550,10 +550,30 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], continue; for (i = 0; i < supband->n_bitrates; i++) { - - IMPROVE("Further supband->bitrates[i]* checks?"); - /* or should we get them from the ni? */ - sta->deflink.supp_rates[band] |= BIT(i); + switch (band) { + case NL80211_BAND_2GHZ: + switch (supband->bitrates[i].bitrate) { + case 240: /* 11g only */ + case 120: /* 11g only */ + case 110: + case 60: /* 11g only */ + case 55: + case 20: + case 10: + sta->deflink.supp_rates[band] |= BIT(i); + break; + } + break; + case NL80211_BAND_5GHZ: + switch (supband->bitrates[i].bitrate) { + case 240: + case 120: + case 60: + sta->deflink.supp_rates[band] |= BIT(i); + break; + } + break; + } } } From nobody Wed Feb 26 15:03:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yQS6qn6z5qG2l; Wed, 26 Feb 2025 15:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQS2fGvz3GNr; Wed, 26 Feb 2025 15:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXdiVVXLcyuLG/avqxsXuFyuNU3lEGICfNHAk4znG+g=; b=hqtshfYIJ8mGCWG32naGbqAbuWMs6vYeUZ0PWcgfohFw02UO6BZZFoZmcCYj2UNPZgSBMQ FVgaUH7otlldXvIGXSc15/Bgh2U9Yab9fSDtniQ2Y0nMcXSBaZ6B0ercGBn+NPpFIL+bjk t8XbgkHfQaYoUFBPra+T83Tab7F6Qik/1dNQvSi0nRoULo5y5l3Fh5zob7jRGktJO1xqRM RfBW0YNmedDBQCbW7g9MF+hFPchEJKXt6J5SsQMsuW88pIRB5nujf7sWE7oAziJ+KADdzw eZ2NoIUvbwWwRNd9EgHDtISuRU77KOeo/4lNks+5IjUarad9pICupEwhici+mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582192; a=rsa-sha256; cv=none; b=XW3Qd0zq+beqjZsBqfzBqc6t+INdHcQdkJiTrRdPLpl6EELQk4qIIjssJ/q6iN8JuIitox Ej4wUE7TFg7H536fHfMw9nF/dMOkw1UjpbGlxe3/vWlNfbEP9nFGnBzeit8gleIlb+CcOw tRnWcf0qQXJ/VkfDdebyhX/7wQFphA0Q1NECVjvIzUB5kyCZmt90yCDjxpPuWzi9MPiTko iIQMgKLDACuX28iTKuz5CK3jjR/NphLrlXlFEnhVdRUp8le0Z6HHj2ROKn9ZEhoASCqoTv Itnq35txFXNnbRyW0coxDOlC7EpM1JBkPsvUuSVY7l3rjieAefVzRi/waADXjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXdiVVXLcyuLG/avqxsXuFyuNU3lEGICfNHAk4znG+g=; b=jzxfxaUaKNALca4isiZQEARO7V9TY/fZYIxpFLsN/cCcI4o4B4wM9SOi2ge85Q5Z7qqcQu rgmHjkDkLhwQDRwjnus+531pHoSOGb2if7XHf6P1YsuA6kclzSw5P4aKNKSOaUMDUCRXXy KaDNHObA5q8MJYAMPcjRt53THJi7+D0WhuPrpFNAwsR9aqVF6pjPfqZ3YiKZRoGUGEmNOi LHXM2/aI+OI2Ogibk+EWrN8DMfBhg+8itP0+iKBOfL0Ldaw3oArCU6OGwGCu+fmekn0n7G xveo/kP9Tte6N1tWeMq5wxegmddX3HmitT5cmP3CRJbfAD4+NaaLAP/iqT+bDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yQS2CScz1Gtv; Wed, 26 Feb 2025 15:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3CC5014566; Wed, 26 Feb 2025 15:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3CgJ014563; Wed, 26 Feb 2025 15:03:12 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:12 GMT Message-Id: <202502261503.51QF3CgJ014563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 99589b0e1790 - stable/14 - LinuxKPI: rather than manually defining a value use the net80211 define List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 99589b0e1790df208c0bbfc2e0620a5cf8d23e7f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=99589b0e1790df208c0bbfc2e0620a5cf8d23e7f commit 99589b0e1790df208c0bbfc2e0620a5cf8d23e7f Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:25:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:27 +0000 LinuxKPI: rather than manually defining a value use the net80211 define Define cfg80211 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK to net80211 IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK. We should likely at some point make a sweep and replace all the values with the defines from the comments for the matching net80211 version. Sponsored by: The FreeBSD Foundation (cherry picked from commit a6994e208cca65684d160e1795a3b9e8c0a2e0a9) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 4ae31b257ae0..3454b58f1db7 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2024 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -200,7 +200,7 @@ struct ieee80211_sta_ht_cap { #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) -#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000c /* IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK */ +#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 /* IEEE80211_VHTCAP_RXLDPC */ From nobody Wed Feb 26 15:03:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yQT6TRCz5qG5f; Wed, 26 Feb 2025 15:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQT4XQVz3GZF; Wed, 26 Feb 2025 15:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=92I/McjY+QE0vhbVuIqv00Rwcm7jC7UXITAEqIuj8kk=; b=EbetE7JkbUEY92FKD4LuHrxyY7eWPCDysJn5aYw7lrl2oIBygT79t+Ldqrehlgd6CLmNlO fM9gGLG+hEWxSESJ4xnrAi+G1Ob+86DOjm2omWHBTPGMBLUrd2k1NDhjNzGQMFD7SRTx0O 44ZOypTaEYGfO4ffQll7MMk2g2nahnO2B5o9lUtU5fhEZeWhfdlEcmG5URnN1BMWWIpY/n hpR6ig0VHndl2plhgk8THlBBLDU5sIN8A2OPd6xo52uOKhsnN4ZtdDgnCSonele15AUzz5 VrXfAbgvxl11hworw6zl3jtBiIjZ4BoEUyYlJCj1URe6zKHZkYhtbnDLWukb3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582193; a=rsa-sha256; cv=none; b=u0i1Mtx1rvbwON+YG9YGyZFKKBK/wJga6Vc0TbXI31t2oUc/Zhg4ur/r3M+kbJHv9dgt7T +YTG+I2sTkREQw3CrTYvyGrIBNB0bjgeEVnEoUYpJGFcJKi/sjNVppzVAY3vd8ubgtxouc ueYpOvukrbfSlTL4jS8vs+59uB7ChllmmrTf/LAvABQuvnJ+hHf43wEZNGC8rrFRxrvhSS UZFnVtALHsh0pScim3qhVtRrgJRNHJ1JNHEJ/mSm9azsK9sOvw6kCKsVNryrF1IxGfKKRQ sGt6Fx45n5k1sre9EPLgzTZBWyytysPKL70kFeRdaZJrbwuJ1gl91K9SdCfnfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=92I/McjY+QE0vhbVuIqv00Rwcm7jC7UXITAEqIuj8kk=; b=ehF6qM6dF1PSxE2qcZDf/atKZWGUAenKu6ATvLu+2F7rIVrqZ8VZxiC+MgE9/+E6f9LbKP //Z55QhgvurEZyibyhdq0Hc1LwG2T01N0fNVMRs5banQ5+HlUSXYSZ6PBsx5l4aPuYQe2n jv2TMbD40gK3kpWCBAPRjM63HxmPT5O0WHLm65PZNYkrXm9x4xeQw+cAMBojjbWx16zEvV zZGXjTF6bJbdxeUerQJLPKOAYWygx1jPATzm/IyMbWu3ERJYLLpLUcCyhahn+2KQiUi8px eFrJp8yeDQa/EhHZLdNy7nbuCylaEJSwFjYnQo4JmxO5sSPH0/3Hf7f3nCstnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yQT3CyFz1Glk; Wed, 26 Feb 2025 15:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3Dmq014601; Wed, 26 Feb 2025 15:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3DW6014598; Wed, 26 Feb 2025 15:03:13 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:13 GMT Message-Id: <202502261503.51QF3DW6014598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: cb9ffb85c413 - stable/14 - LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cb9ffb85c4135e496d244d20ca1e65bb31d03d85 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=cb9ffb85c4135e496d244d20ca1e65bb31d03d85 commit cb9ffb85c4135e496d244d20ca1e65bb31d03d85 Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:31:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:32 +0000 LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates ieee80211_sta_recalc_aggregates() shows up in TODO traces but there is nothing we have to do there until we have active links (MLO support). Make the TODO conditional for a time when we will get there. Sponsored by: The FreeBSD Foundation (cherry picked from commit 72ee3d57f31eff420948048ba3c6afdefe4aab5b) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 69956c90042c..9faf58ed6ee5 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2043,10 +2043,12 @@ ieee80211_sta_pspoll(struct ieee80211_sta *sta) TODO(); } -static __inline void +static inline void ieee80211_sta_recalc_aggregates(struct ieee80211_sta *sta) { - TODO(); + if (sta->valid_links) { + TODO(); + } } static __inline void From nobody Wed Feb 26 15:03:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yQW0G2Vz5qGCS; Wed, 26 Feb 2025 15:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQV4CD0z3GR6; Wed, 26 Feb 2025 15:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xYPfhOhsSPm5r6+M4MSxP3BP9fO/VvHq7Vi//L90E5w=; b=oaibaGmFyEbUS6NI6Q+K12Re64kMLH4k3lo35pSqRSEBpyqxp2muwv/0jSsXFQmDyUMCjE jQFoTIrcsyjZVks1/AFcSl4d7v45jEzahmoMo7UbM+RixbKVuVSoKFdfEXBFzRwAKbGVrX Np9/nLUinbWbSw8TLpgzu1Ylb0+9erIZtkge0NOYhLG6vjDC6th0BQsqRzRhIzxDUF9Nd6 qdkQovRLPPV9T3oAvXtSgH9Ix1LXbERxYbw2zxH9QHuYjY7fkw12G4NekpXaZinbtjLS3V 2BSTUjtVk+y0BwmUEQcsVHVZ28obuZzNEDawzcOT7E4u+K37VrkXiZSaia5EsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582194; a=rsa-sha256; cv=none; b=qoNCl+geajtrCsvRg3lZe6OTlkMiGbHppadK+Pf3w3b1v4I3O1b8AdgPmmHBzTRIMgf8z0 vW3Oor7TTORsU7pRQS5S7jQTxtJgcr5wdPOG8Cts8uogECgf2li3km6pDisuABbCYWLFVo j24KB5A8HYOttYN4vZld7gQGaCd9HOlnL3+OtKvhZ4GL8d2BkqzqOdI0c9NihuRwZn6JB+ TmqcJHc0AbVTkMHC4bz4pEIlducsCGNNOUaR+zVZUjs15UOK+fZcPy49SlQnQNyWLJfnIe s0tYolTEz7o6MXfHxEV7IPZiRDdeaOqrWaL1Qu5+iOuPyoyhtic/Meta1Z3Pbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xYPfhOhsSPm5r6+M4MSxP3BP9fO/VvHq7Vi//L90E5w=; b=qfAWtEvUZmPwjeVNel0P/32dV8FLw2KWJvVABFyHmoOI60x8Q0Gt3kncaFG3XIMQx0tM9T vyc3rUYVC5ix58/aI/4bV5R68KD5IgEyXOhWfQIaxQz6yaLrpRtecraccBbMZM0K15o5MJ SCRUx2/Wk8V11ZE/WcD60qSChWFu/S/1hewX/NAbY+WFRQltMtjmPR/suCb/1aHNy8apT8 +R4iN5fenWOK6RHYDxAICx/HmV8NHYQ+bolranNog/HaT0+uSt3sIcoAbssDTkEI946S86 X/BRXnUMGHV5I7Z9Z5kswkTrV2u2wU922Lb/re04onMMZxykjO8Ulz8VHrgXmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yQV3pKHz1GnH; Wed, 26 Feb 2025 15:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3Epi014636; Wed, 26 Feb 2025 15:03:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3E9l014633; Wed, 26 Feb 2025 15:03:14 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:14 GMT Message-Id: <202502261503.51QF3E9l014633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a775c23e4061 - stable/14 - LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a775c23e406136b31d3c4c6bf6a7f2cf4a733c0b Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a775c23e406136b31d3c4c6bf6a7f2cf4a733c0b commit a775c23e406136b31d3c4c6bf6a7f2cf4a733c0b Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:38:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:35 +0000 LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop() net80211 has inconsistent locking when calling into (*ic_ampdu_rx_stop)(). Make use of 054c5ddf587a7 and conditionally check if the caller locked or not and if locked temporary drop the lock to avoid sleeping on a non-sleepaable lock during the downcall into the driver. Sponsored by: The FreeBSD Foundation (cherry picked from commit 65c573e47c40e3f167f3d7e41bd8db40b6b8f91e) --- sys/compat/linuxkpi/common/src/linux_80211.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 1255691ccf70..5ecfdf495948 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5024,6 +5024,7 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) struct ieee80211_ampdu_params params = { }; int error; uint8_t tid; + bool ic_locked; ic = ni->ni_ic; lhw = ic->ic_softc; @@ -5061,11 +5062,14 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) params.tid = tid; params.amsdu = false; - // IEEE80211_UNLOCK(ic); + ic_locked = IEEE80211_IS_LOCKED(ic); + if (ic_locked) + IEEE80211_UNLOCK(ic); LKPI_80211_LHW_LOCK(lhw); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); LKPI_80211_LHW_UNLOCK(lhw); - // IEEE80211_LOCK(ic); + if (ic_locked) + IEEE80211_LOCK(ic); if (error != 0) ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", __func__, error, ni, rap); From nobody Wed Feb 26 15:03:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yQW6jcmz5qGFy; Wed, 26 Feb 2025 15:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQW4tf6z3GRP; Wed, 26 Feb 2025 15:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KnOFKTYaOc5VVtIEyLFQe/tqt2xTsUYofVWt/2nqlzQ=; b=LokUCWjh33KihZUy+KrHc5i20ffkMv9GoSrdjfji2a3IGmm2QD8yJ+WBumU6vnMoSqZ7Pn PWU73qG12JrK6ZZsZvd5jNdyfGKiR+eYXdm5sVFV+XYwnMaZWUpu6uX3MYAIe96vyMpduE tVF/++vuEKdoj9mrI0g3FjQ8AthXdAHwDaxBEtfNa+TYfBeew0Xd1vFERx/ciGT/BvEH5w Iu//SpbkLU9K7vECkLUIPF6WgMfBk5HwDznxOp7PAvO06o2KfMKK6MiYuYkdUDM0Q4CVBT EBKs+z9/VtxOhkTjCuZw5b2OloAlKOArBA78B0oGDPhpKYgGYFhyoDnj0Hd2ZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582195; a=rsa-sha256; cv=none; b=yK4StvCMvgdXsiMbu50vOEDBX1xQn8SbNv9wWF7yQz2FQbybAJPL8PqZzId1Ck8yaDuqoC a0Adjk9vXmCve71uqTCvAu9gBlvWWUTEnQ/8oIMBxMmt44MPI5JBAd70jggo4E0fRC4nhl Ph6eAOOrTiUqES++LdITwtpNF63OH/GVQPFPXNsxHHMFi2mezMCN0T4l5kf4R1zREuisL0 WspADLoacFGLqUfQxYlT2mTqn7YcBMNfVVFqfA1DJXqW8fT7qQ7+skfkedltXffNY5sJ+T 9GF7fOBw09ShN5QREoaiZIcu+J5Tqn6EHpN2euHBlsQWpqiHK5pD9+dYBohNYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KnOFKTYaOc5VVtIEyLFQe/tqt2xTsUYofVWt/2nqlzQ=; b=HebuygLvTy4vmDqPx5NqKW1njM3SyWnjF2oh2oiI+oGI65xdgvLB5UsKdo/XR3GZmW4zHy AvN+F8jm5m5hr/J0bxg6I90q4lCrva11lMjVq4rZc2CG7vhTYdK3JiHHIjOBYSoa9Xf0Gr B4gRxKfkUPWrUG2BHTZL6+Lg1ErJWYsUFuW51/9bsDpXiE0fqwBt3KwzUzc3lmYgqa7u7o F6fMWLWLv4xi6erg0ml49V+NweaSC1D86+L3egy9sXayOtoTu4q7BsbqlHJzTFgTqw4Fxi TIPNwR1IXoCpZflQ3eRZa73utDTK6GpngFXVyIFbYa8mPBhh8uBio9Ud7mCHCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yQW3wwcz1GnJ; Wed, 26 Feb 2025 15:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3F0V014671; Wed, 26 Feb 2025 15:03:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3F9F014668; Wed, 26 Feb 2025 15:03:15 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:15 GMT Message-Id: <202502261503.51QF3F9F014668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e00588ed9cc5 - stable/14 - LinuxKPI: skbuff: add synchronization primitives and missing bits List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e00588ed9cc572d1ec02a00b6d9006982ea1ce83 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e00588ed9cc572d1ec02a00b6d9006982ea1ce83 commit e00588ed9cc572d1ec02a00b6d9006982ea1ce83 Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 02:00:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:41 +0000 LinuxKPI: skbuff: add synchronization primitives and missing bits Make a pass over skbuff.h: - implement some missing bits, - sprinkle some const, - add locking and read/write_once calls as needed to provide synchronization as expected by Linux, - fix some typos, - remove return from void functions, - adjust tracing macros. Sponsored by: The FreeBSD Foundation PR: 283903 (rtw88 skb leak) Tested by: Guillaume Outters (guillaume-freebsd outters.eu) Tested by: oleg.nauman gmail.com Differential Revision: https://reviews.freebsd.org/D49101 (cherry picked from commit 2ab4a41956159e7c974979693cb0b13cf552128e) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 281 +++++++++++++--------- sys/compat/linuxkpi/common/src/linux_skbuff.c | 2 +- 2 files changed, 165 insertions(+), 118 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 43f35d8f065f..9db29c72e20c 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2021-2023 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -45,6 +45,7 @@ #include #include #include +#include #include "opt_wlan.h" @@ -167,6 +168,7 @@ struct sk_buff { #define _SKB_FLAGS_SKBEXTFRAG 0x0001 enum sk_buff_pkt_type pkt_type; uint16_t mac_header; /* offset of mac_header */ + refcount_t refcnt; /* "Scratch" area for layers to store metadata. */ /* ??? I see sizeof() operations so probably an array. */ @@ -199,7 +201,7 @@ struct sk_buff *linuxkpi_dev_alloc_skb(size_t, gfp_t); struct sk_buff *linuxkpi_build_skb(void *, size_t); void linuxkpi_kfree_skb(struct sk_buff *); -struct sk_buff *linuxkpi_skb_copy(struct sk_buff *, gfp_t); +struct sk_buff *linuxkpi_skb_copy(const struct sk_buff *, gfp_t); /* -------------------------------------------------------------------------- */ @@ -242,6 +244,13 @@ kfree_skb(struct sk_buff *skb) linuxkpi_kfree_skb(skb); } +static inline void +consume_skb(struct sk_buff *skb) +{ + SKB_TRACE(skb); + kfree_skb(skb); +} + static inline void dev_kfree_skb(struct sk_buff *skb) { @@ -276,9 +285,12 @@ build_skb(void *data, unsigned int fragsz) /* -------------------------------------------------------------------------- */ -/* XXX BZ review this one for terminal condition as Linux "queues" are special. */ -#define skb_list_walk_safe(_q, skb, tmp) \ - for ((skb) = (_q)->next; (skb) != NULL && ((tmp) = (skb)->next); (skb) = (tmp)) +static inline bool +skb_is_nonlinear(struct sk_buff *skb) +{ + SKB_TRACE(skb); + return ((skb->data_len > 0) ? true : false); +} /* Add headroom; cannot do once there is data in there. */ static inline void @@ -350,12 +362,14 @@ skb_tailroom(struct sk_buff *skb) SKB_TRACE(skb); KASSERT((skb->end - skb->tail) >= 0, ("%s: skb %p tailroom < 0, " "end %p tail %p\n", __func__, skb, skb->end, skb->tail)); + if (unlikely(skb_is_nonlinear(skb))) + return (0); return (skb->end - skb->tail); } -/* Return numer of bytes available at the beginning of buffer. */ +/* Return number of bytes available at the beginning of buffer. */ static inline unsigned int -skb_headroom(struct sk_buff *skb) +skb_headroom(const struct sk_buff *skb) { SKB_TRACE(skb); KASSERT((skb->data - skb->head) >= 0, ("%s: skb %p headroom < 0, " @@ -502,13 +516,10 @@ skb_add_rx_frag(struct sk_buff *skb, int fragno, struct page *page, skb->len += size; skb->data_len += size; skb->truesize += truesize; - - /* XXX TODO EXTEND truesize? */ } /* -------------------------------------------------------------------------- */ -/* XXX BZ review this one for terminal condition as Linux "queues" are special. */ #define skb_queue_walk(_q, skb) \ for ((skb) = (_q)->next; (skb) != (struct sk_buff *)(_q); \ (skb) = (skb)->next) @@ -517,12 +528,23 @@ skb_add_rx_frag(struct sk_buff *skb, int fragno, struct page *page, for ((skb) = (_q)->next, (tmp) = (skb)->next; \ (skb) != (struct sk_buff *)(_q); (skb) = (tmp), (tmp) = (skb)->next) +#define skb_list_walk_safe(_q, skb, tmp) \ + for ((skb) = (_q), (tmp) = ((skb) != NULL) ? (skb)->next ? NULL; \ + ((skb) != NULL); \ + (skb) = (tmp), (tmp) = ((skb) != NULL) ? (skb)->next ? NULL) + static inline bool -skb_queue_empty(struct sk_buff_head *q) +skb_queue_empty(const struct sk_buff_head *q) { + SKB_TRACE(q); + return (q->next == (const struct sk_buff *)q); +} +static inline bool +skb_queue_empty_lockless(const struct sk_buff_head *q) +{ SKB_TRACE(q); - return (q->qlen == 0); + return (READ_ONCE(q->next) == (const struct sk_buff *)q); } static inline void @@ -537,7 +559,8 @@ static inline void skb_queue_head_init(struct sk_buff_head *q) { SKB_TRACE(q); - return (__skb_queue_head_init(q)); + __skb_queue_head_init(q); + spin_lock_init(&q->lock); } static inline void @@ -546,11 +569,11 @@ __skb_insert(struct sk_buff *new, struct sk_buff *prev, struct sk_buff *next, { SKB_TRACE_FMT(new, "prev %p next %p q %p", prev, next, q); - new->prev = prev; - new->next = next; - ((struct sk_buff_head_l *)next)->prev = new; - ((struct sk_buff_head_l *)prev)->next = new; - q->qlen++; + WRITE_ONCE(new->prev, prev); + WRITE_ONCE(new->next, next); + WRITE_ONCE(((struct sk_buff_head_l *)next)->prev, new); + WRITE_ONCE(((struct sk_buff_head_l *)prev)->next, new); + WRITE_ONCE(q->qlen, q->qlen + 1); } static inline void @@ -582,53 +605,62 @@ __skb_queue_tail(struct sk_buff_head *q, struct sk_buff *new) static inline void skb_queue_tail(struct sk_buff_head *q, struct sk_buff *new) { + unsigned long flags; + SKB_TRACE2(q, new); - return (__skb_queue_tail(q, new)); + spin_lock_irqsave(&q->lock, flags); + __skb_queue_tail(q, new); + spin_unlock_irqrestore(&q->lock, flags); } static inline struct sk_buff * -skb_peek(struct sk_buff_head *q) +skb_peek(const struct sk_buff_head *q) { struct sk_buff *skb; skb = q->next; SKB_TRACE2(q, skb); - if (skb == (struct sk_buff *)q) + if (skb == (const struct sk_buff *)q) return (NULL); return (skb); } static inline struct sk_buff * -skb_peek_tail(struct sk_buff_head *q) +skb_peek_tail(const struct sk_buff_head *q) { struct sk_buff *skb; - skb = q->prev; + skb = READ_ONCE(q->prev); SKB_TRACE2(q, skb); - if (skb == (struct sk_buff *)q) + if (skb == (const struct sk_buff *)q) return (NULL); return (skb); } static inline void -__skb_unlink(struct sk_buff *skb, struct sk_buff_head *head) +__skb_unlink(struct sk_buff *skb, struct sk_buff_head *q) { - SKB_TRACE2(skb, head); struct sk_buff *p, *n; - head->qlen--; + SKB_TRACE2(skb, q); + + WRITE_ONCE(q->qlen, q->qlen - 1); p = skb->prev; n = skb->next; - p->next = n; - n->prev = p; + WRITE_ONCE(n->prev, p); + WRITE_ONCE(p->next, n); skb->prev = skb->next = NULL; } static inline void -skb_unlink(struct sk_buff *skb, struct sk_buff_head *head) +skb_unlink(struct sk_buff *skb, struct sk_buff_head *q) { - SKB_TRACE2(skb, head); - return (__skb_unlink(skb, head)); + unsigned long flags; + + SKB_TRACE2(skb, q); + spin_lock_irqsave(&q->lock, flags); + __skb_unlink(skb, q); + spin_unlock_irqrestore(&q->lock, flags); } static inline struct sk_buff * @@ -636,32 +668,47 @@ __skb_dequeue(struct sk_buff_head *q) { struct sk_buff *skb; - SKB_TRACE(q); - skb = q->next; - if (skb == (struct sk_buff *)q) - return (NULL); + skb = skb_peek(q); if (skb != NULL) __skb_unlink(skb, q); - SKB_TRACE(skb); + SKB_TRACE2(q, skb); return (skb); } static inline struct sk_buff * skb_dequeue(struct sk_buff_head *q) { - SKB_TRACE(q); - return (__skb_dequeue(q)); + unsigned long flags; + struct sk_buff *skb; + + spin_lock_irqsave(&q->lock, flags); + skb = __skb_dequeue(q); + spin_unlock_irqrestore(&q->lock, flags); + SKB_TRACE2(q, skb); + return (skb); } static inline struct sk_buff * -skb_dequeue_tail(struct sk_buff_head *q) +__skb_dequeue_tail(struct sk_buff_head *q) { struct sk_buff *skb; skb = skb_peek_tail(q); if (skb != NULL) __skb_unlink(skb, q); + SKB_TRACE2(q, skb); + return (skb); +} +static inline struct sk_buff * +skb_dequeue_tail(struct sk_buff_head *q) +{ + unsigned long flags; + struct sk_buff *skb; + + spin_lock_irqsave(&q->lock, flags); + skb = __skb_dequeue_tail(q); + spin_unlock_irqrestore(&q->lock, flags); SKB_TRACE2(q, skb); return (skb); } @@ -677,27 +724,74 @@ __skb_queue_head(struct sk_buff_head *q, struct sk_buff *skb) static inline void skb_queue_head(struct sk_buff_head *q, struct sk_buff *skb) { + unsigned long flags; SKB_TRACE2(q, skb); - __skb_queue_after(q, (struct sk_buff *)q, skb); + spin_lock_irqsave(&q->lock, flags); + __skb_queue_head(q, skb); + spin_unlock_irqrestore(&q->lock, flags); } static inline uint32_t -skb_queue_len(struct sk_buff_head *head) +skb_queue_len(const struct sk_buff_head *q) { - SKB_TRACE(head); - return (head->qlen); + SKB_TRACE(q); + return (q->qlen); } static inline uint32_t -skb_queue_len_lockless(const struct sk_buff_head *head) +skb_queue_len_lockless(const struct sk_buff_head *q) +{ + + SKB_TRACE(q); + return (READ_ONCE(q->qlen)); +} + +static inline void +___skb_queue_splice(const struct sk_buff_head *from, + struct sk_buff *p, struct sk_buff *n) { + struct sk_buff *b, *e; - SKB_TRACE(head); - return (READ_ONCE(head->qlen)); + b = from->next; + e = from->prev; + + WRITE_ONCE(b->prev, p); + WRITE_ONCE(((struct sk_buff_head_l *)p)->next, b); + WRITE_ONCE(e->next, n); + WRITE_ONCE(((struct sk_buff_head_l *)n)->prev, e); } +static inline void +skb_queue_splice_init(struct sk_buff_head *from, struct sk_buff_head *to) +{ + + SKB_TRACE2(from, to); + + if (skb_queue_empty(from)) + return; + + ___skb_queue_splice(from, (struct sk_buff *)to, to->next); + to->qlen += from->qlen; + __skb_queue_head_init(from); +} + +static inline void +skb_queue_splice_tail_init(struct sk_buff_head *from, struct sk_buff_head *to) +{ + + SKB_TRACE2(from, to); + + if (skb_queue_empty(from)) + return; + + ___skb_queue_splice(from, to->prev, (struct sk_buff *)to); + to->qlen += from->qlen; + __skb_queue_head_init(from); +} + + static inline void __skb_queue_purge(struct sk_buff_head *q) { @@ -713,8 +807,19 @@ __skb_queue_purge(struct sk_buff_head *q) static inline void skb_queue_purge(struct sk_buff_head *q) { + struct sk_buff_head _q; + unsigned long flags; + SKB_TRACE(q); - return (__skb_queue_purge(q)); + + if (skb_queue_empty_lockless(q)) + return; + + __skb_queue_head_init(&_q); + spin_lock_irqsave(&q->lock, flags); + skb_queue_splice_init(q, &_q); + spin_unlock_irqrestore(&q->lock, flags); + __skb_queue_purge(&_q); } static inline struct sk_buff * @@ -729,7 +834,7 @@ skb_queue_prev(struct sk_buff_head *q, struct sk_buff *skb) /* -------------------------------------------------------------------------- */ static inline struct sk_buff * -skb_copy(struct sk_buff *skb, gfp_t gfp) +skb_copy(const struct sk_buff *skb, gfp_t gfp) { struct sk_buff *new; @@ -738,13 +843,6 @@ skb_copy(struct sk_buff *skb, gfp_t gfp) return (new); } -static inline void -consume_skb(struct sk_buff *skb) -{ - SKB_TRACE(skb); - SKB_TODO(); -} - static inline uint16_t skb_checksum(struct sk_buff *skb, int offs, size_t len, int x) { @@ -774,8 +872,7 @@ static inline size_t skb_frag_size(const skb_frag_t *frag) { SKB_TRACE(frag); - SKB_TODO(); - return (-1); + return (frag->size); } #define skb_walk_frags(_skb, _frag) \ @@ -800,8 +897,7 @@ static inline void * skb_frag_address(const skb_frag_t *frag) { SKB_TRACE(frag); - SKB_TODO(); - return (NULL); + return (page_address(frag->page + frag->offset)); } static inline void @@ -831,50 +927,7 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); -} - -static inline void -___skb_queue_splice(const struct sk_buff_head *from, - struct sk_buff *p, struct sk_buff *n) -{ - struct sk_buff *b, *e; - - b = from->next; - e = from->prev; - - b->prev = p; - ((struct sk_buff_head_l *)p)->next = b; - e->next = n; - ((struct sk_buff_head_l *)n)->prev = e; -} - -static inline void -skb_queue_splice_init(struct sk_buff_head *from, struct sk_buff_head *to) -{ - - SKB_TRACE2(from, to); - - if (skb_queue_empty(from)) - return; - - ___skb_queue_splice(from, (struct sk_buff *)to, to->next); - to->qlen += from->qlen; - __skb_queue_head_init(from); -} - -static inline void -skb_queue_splice_tail_init(struct sk_buff_head *from, struct sk_buff_head *to) -{ - - SKB_TRACE2(from, to); - - if (skb_queue_empty(from)) - return; - - ___skb_queue_splice(from, to->prev, (struct sk_buff *)to); - to->qlen += from->qlen; - __skb_queue_head_init(from); + skb->next = NULL; } static inline void @@ -901,25 +954,17 @@ skb_network_header(struct sk_buff *skb) return (skb->head + skb->l3hdroff); } -static inline bool -skb_is_nonlinear(struct sk_buff *skb) -{ - SKB_TRACE(skb); - return ((skb->data_len > 0) ? true : false); -} - static inline int __skb_linearize(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO(); - return (ENXIO); + return (-ENXIO); } static inline int skb_linearize(struct sk_buff *skb) { - return (skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0); } @@ -953,7 +998,7 @@ skb_header_cloned(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO(); - return (false); + return (true); } static inline uint8_t * @@ -996,7 +1041,6 @@ skb_orphan(struct sk_buff *skb) static inline __sum16 csum_unfold(__sum16 sum) { - SKB_TODO(); return (sum); } @@ -1022,7 +1066,8 @@ static inline struct sk_buff * skb_get(struct sk_buff *skb) { - SKB_TODO(); /* XXX refcnt? as in get/put_device? */ + SKB_TRACE(skb); + refcount_inc(&skb->refcnt); return (skb); } @@ -1057,7 +1102,8 @@ skb_list_del_init(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); + __list_del_entry(&skb->list); + skb_mark_not_on_list(skb); } static inline void @@ -1088,6 +1134,7 @@ static inline void skb_mark_for_recycle(struct sk_buff *skb) { SKB_TRACE(skb); + /* page_pool */ SKB_TODO(); } diff --git a/sys/compat/linuxkpi/common/src/linux_skbuff.c b/sys/compat/linuxkpi/common/src/linux_skbuff.c index 0522d3fdff41..16a7083123be 100644 --- a/sys/compat/linuxkpi/common/src/linux_skbuff.c +++ b/sys/compat/linuxkpi/common/src/linux_skbuff.c @@ -169,7 +169,7 @@ linuxkpi_build_skb(void *data, size_t fragsz) } struct sk_buff * -linuxkpi_skb_copy(struct sk_buff *skb, gfp_t gfp) +linuxkpi_skb_copy(const struct sk_buff *skb, gfp_t gfp) { struct sk_buff *new; struct skb_shared_info *shinfo; From nobody Wed Feb 26 15:15:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yj11lr0z5qH1Z; Wed, 26 Feb 2025 15:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yj040l8z3P3R; Wed, 26 Feb 2025 15:15:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3TpKte9kpDmYUOva+2kL5uqx08jONRFjK26n1Yq9ZA=; b=Vm8nN1wZUKnVezMdtkDFodwQcRiFR91J7qQj/Ojw2eZ7QmCjePRUuvBIMyjEqr9DnNhR6t F+4EiZoat8DTN1P6mUKAqiOWz6mZ2rQZ8LJ8PR79vlYoN3v5E8EMjHek+vi9DR3pwLRe10 dF2aZxikpqJLSbMesNL2Z9W2H3NKJm7FxeLNwBxiHsQwqUkS1HCiPe9/La0zLKpBh8Xue7 Z3VWgFMAJ97Yrj/xLiN3HWs0HJ4/f6qirD2meT4wKdPtaL74R0VLQ1ypVFVnfxVkb8TLqy jyUj2C/hT0enIp+5mJlBloPwoKGVD0Si/+5EIkrxOrJQuCtxF2V8tusvNKnUlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582948; a=rsa-sha256; cv=none; b=l2D5M8+nlRUCasAxrDb6n/W4SBpSzSCoe02zPxlJuEYhN2E6TLvO4At9y1kGLuqqGomPEA CYc38IwoXylTCRrFPBvJ+i3Rn+mVsTzt8PZprqTomIr2PlYQOtOZ9U1mZgLGjbkbFnAn9Q GpovJxuwGeRtMXlGpkeaBXrQqFTX6RQFMs+7QNkHzeJVWv05Bbxf992mkZJ2YUvaX66hXj egkQaIW9Ry/4MG0Ae2JlfICWkTPgnXtg/IA1s2BtP01e/r8y2zRbuRStdeiLbEAtJnqEDt +Lylsm7zhW/vyxGTR877O5UVF2ziy1nWyh+y7cfWNAW3eijcfvkDiZOyk8fsAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3TpKte9kpDmYUOva+2kL5uqx08jONRFjK26n1Yq9ZA=; b=HNxTTR8wrjPhdDv3SSjK+eDWLf699XYJxLV6WqQLpgpBHi8RuH7qeQGgkn8Atz2X5K0wms HSKuJmSSjPieKIeLrWt0caHstAf+5iE+sjeEcOijWLV27W4Hbk7oCRjo8/VmrlmnmWJcW1 +AlX7pqR9LIehfF4ffexwPmIQPtwCgC6NH8wMwMPL06gIdAbMUpD65KpRtjpHgNgoU1NSi koK9qGSqmweFTNAw4p7ktmFexbRPV32s+OI5xeWSPMCK+jALIKYCjNdcv6dqeFXvkPmu0R l9+mPz3lJ0KtAIhR3QAiVFohFSdroKc38Jf54twvrP7rSQOL17W+JjZrX4t7Dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yj03J9bz1Gxm; Wed, 26 Feb 2025 15:15:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFFmn2033913; Wed, 26 Feb 2025 15:15:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFFmtp033910; Wed, 26 Feb 2025 15:15:48 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:15:48 GMT Message-Id: <202502261515.51QFFmtp033910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d42a73fb6a85 - main - ctld: Add a dedicated API between parse.y and the rest of the program List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d42a73fb6a85b2dd4692cb003065be5c68863860 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d42a73fb6a85b2dd4692cb003065be5c68863860 commit d42a73fb6a85b2dd4692cb003065be5c68863860 Author: John Baldwin AuthorDate: 2025-02-26 15:10:33 +0000 Commit: John Baldwin CommitDate: 2025-02-26 15:10:33 +0000 ctld: Add a dedicated API between parse.y and the rest of the program The primary purpose of this is to permit the rest of ctld to use C++. However, this also has the nice side effect of reducing code duplication with the UCL parser. As a general rule, setting of options including error handling for invalid values, etc. is moved out of parse.y and into conf.c. The globals for the current configuration, auth group, portal group, lun, and target are also moved into conf.c hiding the types from parse.y. The intention is that all of the functions declared in conf.h will be extern "C" for use by parse.y and that the backing data structures can be reimplemented as C++ classes instead of C structures if desired. A few other small changes are included with this refactoring: - Warn and fail a configuration that specifies the same LUN multiple times for a target. - Use T_* constants for SCSI device types instead of magic numbers. - Warn and fail for a few UCL properties that aren't the required type including "discovery-auth-group" in a portal group context, "auth-type" and "port" in a target context. - Fix a bug where chap-mutual in a target in UCL would not auto-create a new auth-group. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48934 --- usr.sbin/ctld/Makefile | 2 +- usr.sbin/ctld/conf.c | 772 +++++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/ctld/conf.h | 100 ++++++ usr.sbin/ctld/ctld.c | 225 ++------------ usr.sbin/ctld/ctld.h | 39 +-- usr.sbin/ctld/kernel.c | 23 +- usr.sbin/ctld/parse.y | 553 ++++++++++----------------------- usr.sbin/ctld/uclparse.c | 689 +++++++++++++++++++----------------------- 8 files changed, 1388 insertions(+), 1015 deletions(-) diff --git a/usr.sbin/ctld/Makefile b/usr.sbin/ctld/Makefile index d6bef1032c5a..787a608c37be 100644 --- a/usr.sbin/ctld/Makefile +++ b/usr.sbin/ctld/Makefile @@ -5,7 +5,7 @@ CFLAGS+=-I${SRCTOP}/contrib/libucl/include PACKAGE= iscsi PROG= ctld -SRCS= ctld.c discovery.c isns.c kernel.c +SRCS= ctld.c conf.c discovery.c isns.c kernel.c SRCS+= login.c parse.y token.l y.tab.h uclparse.c CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys diff --git a/usr.sbin/ctld/conf.c b/usr.sbin/ctld/conf.c new file mode 100644 index 000000000000..ac82d06ad8fa --- /dev/null +++ b/usr.sbin/ctld/conf.c @@ -0,0 +1,772 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2012 The FreeBSD Foundation + * + * This software was developed by Edward Tomasz Napierala under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "conf.h" +#include "ctld.h" + +static struct conf *conf = NULL; +static struct auth_group *auth_group = NULL; +static struct portal_group *portal_group = NULL; +static struct target *target = NULL; +static struct lun *lun = NULL; + +void +conf_start(struct conf *new_conf) +{ + assert(conf == NULL); + conf = new_conf; +} + +void +conf_finish(void) +{ + auth_group = NULL; + portal_group = NULL; + target = NULL; + lun = NULL; + conf = NULL; +} + +bool +isns_add_server(const char *addr) +{ + return (isns_new(conf, addr)); +} + +void +conf_set_debug(int debug) +{ + conf->conf_debug = debug; +} + +void +conf_set_isns_period(int period) +{ + conf->conf_isns_period = period; +} + +void +conf_set_isns_timeout(int timeout) +{ + conf->conf_isns_timeout = timeout; +} + +void +conf_set_maxproc(int maxproc) +{ + conf->conf_maxproc = maxproc; +} + +bool +conf_set_pidfile_path(const char *path) +{ + if (conf->conf_pidfile_path != NULL) { + log_warnx("pidfile specified more than once"); + return (false); + } + conf->conf_pidfile_path = checked_strdup(path); + return (true); +} + +void +conf_set_timeout(int timeout) +{ + conf->conf_timeout = timeout; +} + +static bool +_auth_group_set_type(struct auth_group *ag, const char *str) +{ + int type; + + if (strcmp(str, "none") == 0) { + type = AG_TYPE_NO_AUTHENTICATION; + } else if (strcmp(str, "deny") == 0) { + type = AG_TYPE_DENY; + } else if (strcmp(str, "chap") == 0) { + type = AG_TYPE_CHAP; + } else if (strcmp(str, "chap-mutual") == 0) { + type = AG_TYPE_CHAP_MUTUAL; + } else { + if (ag->ag_name != NULL) + log_warnx("invalid auth-type \"%s\" for auth-group " + "\"%s\"", str, ag->ag_name); + else + log_warnx("invalid auth-type \"%s\" for target " + "\"%s\"", str, ag->ag_target->t_name); + return (false); + } + + if (ag->ag_type != AG_TYPE_UNKNOWN && ag->ag_type != type) { + if (ag->ag_name != NULL) { + log_warnx("cannot set auth-type to \"%s\" for " + "auth-group \"%s\"; already has a different " + "type", str, ag->ag_name); + } else { + log_warnx("cannot set auth-type to \"%s\" for target " + "\"%s\"; already has a different type", + str, ag->ag_target->t_name); + } + return (false); + } + + ag->ag_type = type; + + return (true); +} + +bool +auth_group_add_chap(const char *user, const char *secret) +{ + return (auth_new_chap(auth_group, user, secret)); +} + +bool +auth_group_add_chap_mutual(const char *user, const char *secret, + const char *user2, const char *secret2) +{ + return (auth_new_chap_mutual(auth_group, user, secret, user2, secret2)); +} + +bool +auth_group_add_initiator_name(const char *name) +{ + return (auth_name_new(auth_group, name)); +} + +bool +auth_group_add_initiator_portal(const char *portal) +{ + return (auth_portal_new(auth_group, portal)); +} + +bool +auth_group_set_type(const char *type) +{ + return (_auth_group_set_type(auth_group, type)); +} + +bool +auth_group_start(const char *name) +{ + /* + * Make it possible to redefine the default auth-group. but + * only once. + */ + if (strcmp(name, "default") == 0) { + if (conf->conf_default_ag_defined) { + log_warnx("duplicated auth-group \"default\""); + return (false); + } + + conf->conf_default_ag_defined = true; + auth_group = auth_group_find(conf, "default"); + return (true); + } + + auth_group = auth_group_new(conf, name); + return (auth_group != NULL); +} + +void +auth_group_finish(void) +{ + auth_group = NULL; +} + +bool +portal_group_start(const char *name) +{ + /* + * Make it possible to redefine the default portal-group. but + * only once. + */ + if (strcmp(name, "default") == 0) { + if (conf->conf_default_pg_defined) { + log_warnx("duplicated portal-group \"default\""); + return (false); + } + + conf->conf_default_pg_defined = true; + portal_group = portal_group_find(conf, "default"); + return (true); + } + + portal_group = portal_group_new(conf, name); + return (portal_group != NULL); +} + +void +portal_group_finish(void) +{ + portal_group = NULL; +} + +bool +portal_group_add_listen(const char *listen, bool iser) +{ + return (portal_group_add_portal(portal_group, listen, iser)); +} + +bool +portal_group_add_option(const char *name, const char *value) +{ + return (option_new(portal_group->pg_options, name, value)); +} + +bool +portal_group_set_discovery_auth_group(const char *name) +{ + if (portal_group->pg_discovery_auth_group != NULL) { + log_warnx("discovery-auth-group for portal-group " + "\"%s\" specified more than once", + portal_group->pg_name); + return (false); + } + portal_group->pg_discovery_auth_group = auth_group_find(conf, name); + if (portal_group->pg_discovery_auth_group == NULL) { + log_warnx("unknown discovery-auth-group \"%s\" " + "for portal-group \"%s\"", name, portal_group->pg_name); + return (false); + } + return (true); +} + +bool +portal_group_set_dscp(u_int dscp) +{ + if (dscp >= 0x40) { + log_warnx("invalid DSCP value %u for portal-group \"%s\"", + dscp, portal_group->pg_name); + return (false); + } + + portal_group->pg_dscp = dscp; + return (true); +} + +bool +portal_group_set_filter(const char *str) +{ + int filter; + + if (strcmp(str, "none") == 0) { + filter = PG_FILTER_NONE; + } else if (strcmp(str, "portal") == 0) { + filter = PG_FILTER_PORTAL; + } else if (strcmp(str, "portal-name") == 0) { + filter = PG_FILTER_PORTAL_NAME; + } else if (strcmp(str, "portal-name-auth") == 0) { + filter = PG_FILTER_PORTAL_NAME_AUTH; + } else { + log_warnx("invalid discovery-filter \"%s\" for portal-group " + "\"%s\"; valid values are \"none\", \"portal\", " + "\"portal-name\", and \"portal-name-auth\"", + str, portal_group->pg_name); + return (false); + } + + if (portal_group->pg_discovery_filter != PG_FILTER_UNKNOWN && + portal_group->pg_discovery_filter != filter) { + log_warnx("cannot set discovery-filter to \"%s\" for " + "portal-group \"%s\"; already has a different " + "value", str, portal_group->pg_name); + return (false); + } + + portal_group->pg_discovery_filter = filter; + + return (true); +} + +void +portal_group_set_foreign(void) +{ + portal_group->pg_foreign = true; +} + +bool +portal_group_set_offload(const char *offload) +{ + + if (portal_group->pg_offload != NULL) { + log_warnx("cannot set offload to \"%s\" for " + "portal-group \"%s\"; already defined", + offload, portal_group->pg_name); + return (false); + } + + portal_group->pg_offload = checked_strdup(offload); + + return (true); +} + +bool +portal_group_set_pcp(u_int pcp) +{ + if (pcp > 7) { + log_warnx("invalid PCP value %u for portal-group \"%s\"", + pcp, portal_group->pg_name); + return (false); + } + + portal_group->pg_pcp = pcp; + return (true); +} + +bool +portal_group_set_redirection(const char *addr) +{ + + if (portal_group->pg_redirection != NULL) { + log_warnx("cannot set redirection to \"%s\" for " + "portal-group \"%s\"; already defined", + addr, portal_group->pg_name); + return (false); + } + + portal_group->pg_redirection = checked_strdup(addr); + + return (true); +} + +void +portal_group_set_tag(uint16_t tag) +{ + portal_group->pg_tag = tag; +} + +bool +lun_start(const char *name) +{ + lun = lun_new(conf, name); + return (lun != NULL); +} + +void +lun_finish(void) +{ + lun = NULL; +} + +bool +lun_add_option(const char *name, const char *value) +{ + return (option_new(lun->l_options, name, value)); +} + +bool +lun_set_backend(const char *value) +{ + if (lun->l_backend != NULL) { + log_warnx("backend for lun \"%s\" specified more than once", + lun->l_name); + return (false); + } + + lun->l_backend = checked_strdup(value); + return (true); +} + +bool +lun_set_blocksize(size_t value) +{ + if (lun->l_blocksize != 0) { + log_warnx("blocksize for lun \"%s\" specified more than once", + lun->l_name); + return (false); + } + lun->l_blocksize = value; + return (true); +} + +bool +lun_set_device_type(const char *value) +{ + uint64_t device_type; + + if (strcasecmp(value, "disk") == 0 || + strcasecmp(value, "direct") == 0) + device_type = T_DIRECT; + else if (strcasecmp(value, "processor") == 0) + device_type = T_PROCESSOR; + else if (strcasecmp(value, "cd") == 0 || + strcasecmp(value, "cdrom") == 0 || + strcasecmp(value, "dvd") == 0 || + strcasecmp(value, "dvdrom") == 0) + device_type = T_CDROM; + else if (expand_number(value, &device_type) != 0 || device_type > 15) { + log_warnx("invalid device-type \"%s\" for lun \"%s\"", value, + lun->l_name); + return (false); + } + + lun->l_device_type = device_type; + return (true); +} + +bool +lun_set_device_id(const char *value) +{ + if (lun->l_device_id != NULL) { + log_warnx("device_id for lun \"%s\" specified more than once", + lun->l_name); + return (false); + } + + lun->l_device_id = checked_strdup(value); + return (true); +} + +bool +lun_set_path(const char *value) +{ + if (lun->l_path != NULL) { + log_warnx("path for lun \"%s\" specified more than once", + lun->l_name); + return (false); + } + + lun->l_path = checked_strdup(value); + return (true); +} + +bool +lun_set_serial(const char *value) +{ + if (lun->l_serial != NULL) { + log_warnx("serial for lun \"%s\" specified more than once", + lun->l_name); + return (false); + } + + lun->l_serial = checked_strdup(value); + return (true); +} + +bool +lun_set_size(uint64_t value) +{ + if (lun->l_size != 0) { + log_warnx("size for lun \"%s\" specified more than once", + lun->l_name); + return (false); + } + + lun->l_size = value; + return (true); +} + +bool +lun_set_ctl_lun(uint32_t value) +{ + + if (lun->l_ctl_lun >= 0) { + log_warnx("ctl_lun for lun \"%s\" specified more than once", + lun->l_name); + return (false); + } + lun->l_ctl_lun = value; + return (true); +} + +bool +target_start(const char *name) +{ + target = target_new(conf, name); + return (target != NULL); +} + +void +target_finish(void) +{ + target = NULL; +} + +bool +target_add_chap(const char *user, const char *secret) +{ + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot use both auth-group and " + "chap for target \"%s\"", target->t_name); + return (false); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) + return (false); + target->t_auth_group->ag_target = target; + } + return (auth_new_chap(target->t_auth_group, user, secret)); +} + +bool +target_add_chap_mutual(const char *user, const char *secret, + const char *user2, const char *secret2) +{ + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot use both auth-group and " + "chap-mutual for target \"%s\"", target->t_name); + return (false); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) + return (false); + target->t_auth_group->ag_target = target; + } + return (auth_new_chap_mutual(target->t_auth_group, user, secret, user2, + secret2)); +} + +bool +target_add_initiator_name(const char *name) +{ + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot use both auth-group and " + "initiator-name for target \"%s\"", target->t_name); + return (false); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) + return (false); + target->t_auth_group->ag_target = target; + } + return (auth_name_new(target->t_auth_group, name)); +} + +bool +target_add_initiator_portal(const char *addr) +{ + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot use both auth-group and " + "initiator-portal for target \"%s\"", + target->t_name); + return (false); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) + return (false); + target->t_auth_group->ag_target = target; + } + return (auth_portal_new(target->t_auth_group, addr)); +} + +bool +target_add_lun(u_int id, const char *name) +{ + struct lun *t_lun; + + if (id >= MAX_LUNS) { + log_warnx("LUN %u too big for target \"%s\"", id, + target->t_name); + return (false); + } + + if (target->t_luns[id] != NULL) { + log_warnx("duplicate LUN %u for target \"%s\"", id, + target->t_name); + return (false); + } + + t_lun = lun_find(conf, name); + if (t_lun == NULL) { + log_warnx("unknown LUN named %s used for target \"%s\"", + name, target->t_name); + return (false); + } + + target->t_luns[id] = t_lun; + return (true); +} + +bool +target_add_portal_group(const char *pg_name, const char *ag_name) +{ + struct portal_group *pg; + struct auth_group *ag; + struct port *p; + + pg = portal_group_find(conf, pg_name); + if (pg == NULL) { + log_warnx("unknown portal-group \"%s\" for target \"%s\"", + pg_name, target->t_name); + return (false); + } + + if (ag_name != NULL) { + ag = auth_group_find(conf, ag_name); + if (ag == NULL) { + log_warnx("unknown auth-group \"%s\" for target \"%s\"", + ag_name, target->t_name); + return (false); + } + } else + ag = NULL; + + p = port_new(conf, target, pg); + if (p == NULL) { + log_warnx("can't link portal-group \"%s\" to target \"%s\"", + pg_name, target->t_name); + return (false); + } + p->p_auth_group = ag; + return (true); +} + +bool +target_set_alias(const char *alias) +{ + if (target->t_alias != NULL) { + log_warnx("alias for target \"%s\" specified more than once", + target->t_name); + return (false); + } + target->t_alias = checked_strdup(alias); + return (true); +} + +bool +target_set_auth_group(const char *name) +{ + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) + log_warnx("auth-group for target \"%s\" " + "specified more than once", target->t_name); + else + log_warnx("cannot use both auth-group and explicit " + "authorisations for target \"%s\"", target->t_name); + return (false); + } + target->t_auth_group = auth_group_find(conf, name); + if (target->t_auth_group == NULL) { + log_warnx("unknown auth-group \"%s\" for target \"%s\"", name, + target->t_name); + return (false); + } + return (true); +} + +bool +target_set_auth_type(const char *type) +{ + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot use both auth-group and " + "auth-type for target \"%s\"", target->t_name); + return (false); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) + return (false); + target->t_auth_group->ag_target = target; + } + return (_auth_group_set_type(target->t_auth_group, type)); +} + +bool +target_set_physical_port(const char *pport) +{ + if (target->t_pport != NULL) { + log_warnx("cannot set multiple physical ports for target " + "\"%s\"", target->t_name); + return (false); + } + target->t_pport = checked_strdup(pport); + return (true); +} + +bool +target_set_redirection(const char *addr) +{ + + if (target->t_redirection != NULL) { + log_warnx("cannot set redirection to \"%s\" for " + "target \"%s\"; already defined", + addr, target->t_name); + return (false); + } + + target->t_redirection = checked_strdup(addr); + + return (true); +} + +bool +target_start_lun(u_int id) +{ + struct lun *new_lun; + char *name; + + if (id >= MAX_LUNS) { + log_warnx("LUN %u too big for target \"%s\"", id, + target->t_name); + return (false); + } + + if (target->t_luns[id] != NULL) { + log_warnx("duplicate LUN %u for target \"%s\"", id, + target->t_name); + return (false); + } + + if (asprintf(&name, "%s,lun,%u", target->t_name, id) <= 0) + log_err(1, "asprintf"); + + new_lun = lun_new(conf, name); + if (new_lun == NULL) + return (false); + + lun_set_scsiname(new_lun, name); + free(name); + + target->t_luns[id] = new_lun; + + lun = new_lun; + return (true); +} diff --git a/usr.sbin/ctld/conf.h b/usr.sbin/ctld/conf.h new file mode 100644 index 000000000000..d8f036e67136 --- /dev/null +++ b/usr.sbin/ctld/conf.h @@ -0,0 +1,100 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2012 The FreeBSD Foundation + * + * This software was developed by Edward Tomasz Napierala under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __CONF_H__ +#define __CONF_H__ + +/* + * This file defines the interface between parse.y and the rest of + * ctld. + */ + +bool auth_group_start(const char *name); +void auth_group_finish(void); +bool auth_group_add_chap(const char *user, const char *secret); +bool auth_group_add_chap_mutual(const char *user, const char *secret, + const char *user2, const char *secret2); +bool auth_group_add_initiator_name(const char *name); +bool auth_group_add_initiator_portal(const char *portal); +bool auth_group_set_type(const char *type); + +void conf_set_debug(int debug); +void conf_set_isns_period(int period); +void conf_set_isns_timeout(int timeout); +void conf_set_maxproc(int maxproc); +bool conf_set_pidfile_path(const char *path); +void conf_set_timeout(int timeout); + +bool isns_add_server(const char *addr); + +bool portal_group_start(const char *name); +void portal_group_finish(void); +bool portal_group_add_listen(const char *listen, bool iser); +bool portal_group_add_option(const char *name, const char *value); +bool portal_group_set_discovery_auth_group(const char *name); +bool portal_group_set_dscp(u_int dscp); +bool portal_group_set_filter(const char *filter); +void portal_group_set_foreign(void); +bool portal_group_set_offload(const char *offload); +bool portal_group_set_pcp(u_int pcp); +bool portal_group_set_redirection(const char *addr); +void portal_group_set_tag(uint16_t tag); + +bool target_start(const char *name); +void target_finish(void); +bool target_add_chap(const char *user, const char *secret); +bool target_add_chap_mutual(const char *user, const char *secret, + const char *user2, const char *secret2); +bool target_add_initiator_name(const char *name); +bool target_add_initiator_portal(const char *addr); +bool target_add_lun(u_int id, const char *name); +bool target_add_portal_group(const char *pg_name, const char *ag_name); +bool target_set_alias(const char *alias); +bool target_set_auth_group(const char *name); +bool target_set_auth_type(const char *type); +bool target_set_physical_port(const char *pport); +bool target_set_redirection(const char *addr); +bool target_start_lun(u_int id); + +bool lun_start(const char *name); +void lun_finish(void); +bool lun_add_option(const char *name, const char *value); +bool lun_set_backend(const char *value); +bool lun_set_blocksize(size_t value); +bool lun_set_ctl_lun(uint32_t value); +bool lun_set_device_id(const char *value); +bool lun_set_device_type(const char *value); +bool lun_set_path(const char *value); +bool lun_set_serial(const char *value); +bool lun_set_size(uint64_t value); + +bool parse_conf(const char *path); + +#endif /* !__CONF_H__ */ diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index a76db10999e1..21d833df5f83 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -49,7 +49,9 @@ #include #include #include +#include +#include "conf.h" #include "ctld.h" #include "isns.h" @@ -237,7 +239,7 @@ auth_check_secret_length(struct auth *auth) } } -const struct auth * +bool auth_new_chap(struct auth_group *ag, const char *user, const char *secret) { @@ -253,7 +255,7 @@ auth_new_chap(struct auth_group *ag, const char *user, log_warnx("cannot mix \"chap\" authentication with " "other types for target \"%s\"", ag->ag_target->t_name); - return (NULL); + return (false); } auth = auth_new(ag); @@ -262,10 +264,10 @@ auth_new_chap(struct auth_group *ag, const char *user, auth_check_secret_length(auth); - return (auth); + return (true); *** 2675 LINES SKIPPED *** From nobody Wed Feb 26 15:15:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yj168qyz5qH8h; Wed, 26 Feb 2025 15:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yj13vVmz3P3X; Wed, 26 Feb 2025 15:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q15F+E9iC+C7HGqtIVGv+PbJb2iEFJ9gEVdX3Fv5xiQ=; b=DFRTRyNeSYlSgKZIB+Vf91RyYJ833RoPYaAj3WRU2z1XZGqyMotUldVgnu5KGdOW0yvr0M teX/Ovf9MZITW8p9/Cwduqy+eTiawb2GrCpYCTrNVGH+elS5WIkvBkpt4sRZyjFW3oxksm t9j9Mmo/DreQiyAxi2wg4+IrRMbjMczDnDDbJ1pij2v3eq/asWETdziNELg1EqU2/iSFcX W0DoVouQ94P57SxlqHyUbUOUP5rcyXhICkd1EPcItcpa958w0tDgSS30eXGrpN2QHL6QEw oVxoNSGbX6OTuZjw1Y0eod1SNYoMdXZHmxqu2ELJcttL8dz4an+75S1o0W4udw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582949; a=rsa-sha256; cv=none; b=SoY9jgi49qmMY+j7D1xlP6IdDgEn0CScpMJPlQIxh9qD2aRPMsZ+ti/PuZkgMlNYJC8TWV dmjI7Gcd/ltONJbnYg22oydHABPUgbRKv2lGYbLFo7WjIdK4kkeLm1ADuEHTJvyDTXskwk 5vsQ4Pn4MctMFGLijsT/FLnecWRKG/w5wpE0iOulnvf0AUhreKxHSzMP7D3rQeQVMyZkV3 0WYhlDHHpituFJZVD7K9BFBnGAvRXAOv/x2QhRwjLIU3FPn4iZPV3ZdWHHLtho73/IQmlv pkFdqc64RfRGtDaS6/2EbcLcQwahsrOZYvWqBEetmioEuXS3FmGd+w+uXby+Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q15F+E9iC+C7HGqtIVGv+PbJb2iEFJ9gEVdX3Fv5xiQ=; b=lci+J4MzK/Mh7Sgw91Ed5I96JnvtzAcWDdXsKLsqyc33pVYal3DbFRiGErg2zQtd8R835z HVhK8D4c0emzFWveKDBnfZfuTkPB54txcbP18ZF9tlZr4P5gQzgWrEJvadT+rjI+zd78Mg PTnA0JmhyOSSmK/DWsGGNyBA7h8heNeuvpILgI2M5LxRKno8TCdqqAgRi495Ukpd++aEqp v9n+QnMHGeM2npcJiiIBHA568bHRzgZZsBicN6dH0vXOVvvziu0G9Gq3VHVYAQEV5BC4xq dCbSAYSPL2+xu3z2iYSChQ0dNdz78tvV8F8s700/CDRSc9zTzmV3iBbi4Y4GSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yj13HR2z1Gxn; Wed, 26 Feb 2025 15:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFFnlV033951; Wed, 26 Feb 2025 15:15:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFFnEb033948; Wed, 26 Feb 2025 15:15:49 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:15:49 GMT Message-Id: <202502261515.51QFFnEb033948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f3a43b3db881 - main - ctld: Fail UCL configurations with a nested error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3a43b3db881679d0b82b97f18871422050a5819 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f3a43b3db881679d0b82b97f18871422050a5819 commit f3a43b3db881679d0b82b97f18871422050a5819 Author: John Baldwin AuthorDate: 2025-02-26 15:11:07 +0000 Commit: John Baldwin CommitDate: 2025-02-26 15:11:07 +0000 ctld: Fail UCL configurations with a nested error Errors from auth groups, portal groups, global luns, and targets were not propagated out of the main loop. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D49071 --- usr.sbin/ctld/uclparse.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index f8f8954304fa..2dc4872bee84 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -336,7 +336,9 @@ uclparse_toplevel(const ucl_object_t *top) if (obj->type == UCL_OBJECT) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, true))) { - uclparse_auth_group(ucl_object_key(child), child); + if (!uclparse_auth_group( + ucl_object_key(child), child)) + return (false); } } else { log_warnx("\"auth-group\" section is not an object"); @@ -348,7 +350,9 @@ uclparse_toplevel(const ucl_object_t *top) if (obj->type == UCL_OBJECT) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, true))) { - uclparse_portal_group(ucl_object_key(child), child); + if (!uclparse_portal_group( + ucl_object_key(child), child)) + return (false); } } else { log_warnx("\"portal-group\" section is not an object"); @@ -360,7 +364,9 @@ uclparse_toplevel(const ucl_object_t *top) if (obj->type == UCL_OBJECT) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, true))) { - uclparse_lun(ucl_object_key(child), child); + if (!uclparse_lun(ucl_object_key(child), + child)) + return (false); } } else { log_warnx("\"lun\" section is not an object"); @@ -379,8 +385,9 @@ uclparse_toplevel(const ucl_object_t *top) iter = NULL; while ((child = ucl_iterate_object(obj, &iter, true))) { - uclparse_target(ucl_object_key(child), - child); + if (!uclparse_target( + ucl_object_key(child), child)) + return (false); } } else { log_warnx("\"target\" section is not an object"); From nobody Wed Feb 26 15:15:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yj30C7bz5qHDw; Wed, 26 Feb 2025 15:15:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yj25J5Fz3NnK; Wed, 26 Feb 2025 15:15:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=To7qEX4jQ24pKwV+vFq9nOOndfARqetS/AErrlDDT4c=; b=xlDnfNz7hJg+JANnZsej63GF4SbBKGvqS45UZekAFgqSrc3hjfcDV4XB7D4/Zg6pNb+tfn y8X9gfqQai7IhjXvH4Lnk3hXA3nbjrn23qtyBMbYmV6He/ky+I4pWL0npXD8EfCHGQshbR IxagdE8It5nc62DaiRjUiSDZ614KODY2zUxd6b6SEsVrB007BouLImhnsQqJHpXQ2+mRq7 3YIyJfy2IxHZHgGTfcrhtjMoSQ9/1HOgeB9uWuqCZJTmtImKndxiR4XXcQx2Bzble60+YA 8naMVB3kWxqLS0ZoY8A1z7ALXTE3+rCUoOIDTwO36Lacx7+lRuvH1pzjhz7L7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582950; a=rsa-sha256; cv=none; b=RAXOScEt/RUvdIaly5sOc9uxvJp2R/WKzPWKlJsKAoGVEc2S4h+GNnsPEVRuNkzsjscuP4 3Nkj2/RC79n2d37cZO7P+x8yx5/u3lJx96ufPJMK8n3KxYUw1lMsvZa2BdVQVcbhVpAmOx ZMgqigSwa0Ah9iZj2gLnycvEyzxFHF8ZuBHI8cPc8Fzj9CkK1UiX11CRC6TC4cvpkP+uaU T6XbuYXuda78dnzMap77J07PfCf9TqhuHdjmMyatWAPFNraMalBkGZolL+cCWoMq2eEHYp VXJvPOsdT1ppIqNnDaIujOJd5t32jrka4OtW37ANjf5UB4HetfinQcZlBZZw6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=To7qEX4jQ24pKwV+vFq9nOOndfARqetS/AErrlDDT4c=; b=KO2TX05sMW8d+uRJ3Q88eGF2AzDsa82bp5udEUVhZDeNLEfA6hNZU07Rk/d1voUEOThBKM bKiygdS4g1az5LBpYaRX6OqVW//0EyTrMZBbJGdJcBKpfKtEYEVx8Naxy4HS/j7JoeLZzj vR0miLYEA9JInxCxdXOHCY/mbBNdXwKY/JCdJMzUmPYCoMbH0cY3DVzL0cT+nzt6nJCBh4 zvQtTpIHBSKRx6vER1i09ubZFBfoTb/otxcJALo1zNDpOiOS8hlyC+iftI0h+xlnH+otnq f33L9COqojxIDqzbfSJfllcLHLY0x9mWZvLD/LYTSL7B4oxxheWKRSXJUQgTSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yj24Wbmz1Gw5; Wed, 26 Feb 2025 15:15:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFFo6w033988; Wed, 26 Feb 2025 15:15:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFFovv033985; Wed, 26 Feb 2025 15:15:50 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:15:50 GMT Message-Id: <202502261515.51QFFovv033985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e28b758b35d0 - main - ctld: Be more consistent for auth parameters in the UCL config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e28b758b35d0f80b38c295587271ec9588040077 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e28b758b35d0f80b38c295587271ec9588040077 commit e28b758b35d0f80b38c295587271ec9588040077 Author: John Baldwin AuthorDate: 2025-02-26 15:11:30 +0000 Commit: John Baldwin CommitDate: 2025-02-26 15:11:30 +0000 ctld: Be more consistent for auth parameters in the UCL config The auth-group context required an array of entries for "chap", "chap-mutual", "initiator-name", and "initiator-portal" whereas the target context required exactly one entry (and only permitted a single entry). Allow either a single entry or an array of entries for these keywords in both the auth-group and target contexts. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48935 --- usr.sbin/ctld/uclparse.c | 163 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 121 insertions(+), 42 deletions(-) diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index 2dc4872bee84..e8e026247b71 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -420,66 +420,90 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) } if (strcmp(key, "chap") == 0) { - if (obj->type != UCL_ARRAY) { - log_warnx("\"chap\" property of " - "auth-group \"%s\" is not an array", + if (obj->type == UCL_OBJECT) { + if (!uclparse_chap(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_chap(name, tmp)) + goto fail; + } + } else { + log_warnx("\"chap\" property of auth-group " + "\"%s\" is not an array or object", name); goto fail; } - - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (!uclparse_chap(name, tmp)) - goto fail; - } } if (strcmp(key, "chap-mutual") == 0) { - if (obj->type != UCL_ARRAY) { + if (obj->type == UCL_OBJECT) { + if (!uclparse_chap_mutual(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_chap_mutual(name, tmp)) + goto fail; + } + } else { log_warnx("\"chap-mutual\" property of " - "auth-group \"%s\" is not an array", + "auth-group \"%s\" is not an array or object", name); goto fail; } - - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (!uclparse_chap_mutual(name, tmp)) - goto fail; - } } if (strcmp(key, "initiator-name") == 0) { - if (obj->type != UCL_ARRAY) { - log_warnx("\"initiator-name\" property of " - "auth-group \"%s\" is not an array", - name); - goto fail; - } - - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - const char *value = ucl_object_tostring(tmp); + if (obj->type == UCL_STRING) { + const char *value = ucl_object_tostring(obj); if (!auth_group_add_initiator_name(value)) goto fail; - } - } + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + const char *value = + ucl_object_tostring(tmp); - if (strcmp(key, "initiator-portal") == 0) { - if (obj->type != UCL_ARRAY) { - log_warnx("\"initiator-portal\" property of " - "auth-group \"%s\" is not an array", + if (!auth_group_add_initiator_name( + value)) + goto fail; + } + } else { + log_warnx("\"initiator-name\" property of " + "auth-group \"%s\" is not an array or string", name); goto fail; } + } - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - const char *value = ucl_object_tostring(tmp); + if (strcmp(key, "initiator-portal") == 0) { + if (obj->type == UCL_STRING) { + const char *value = ucl_object_tostring(obj); if (!auth_group_add_initiator_portal(value)) goto fail; + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + const char *value = + ucl_object_tostring(tmp); + + if (!auth_group_add_initiator_portal( + value)) + goto fail; + } + } else { + log_warnx("\"initiator-portal\" property of " + "auth-group \"%s\" is not an array or string", + name); + goto fail; } } } @@ -746,25 +770,80 @@ uclparse_target(const char *name, const ucl_object_t *top) } if (strcmp(key, "chap") == 0) { - if (!uclparse_target_chap(name, obj)) + if (obj->type == UCL_OBJECT) { + if (!uclparse_target_chap(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_target_chap(name, tmp)) + goto fail; + } + } else { + log_warnx("\"chap\" property of target " + "\"%s\" is not an array or object", + name); goto fail; + } } if (strcmp(key, "chap-mutual") == 0) { - if (!uclparse_target_chap_mutual(name, obj)) + if (obj->type == UCL_OBJECT) { + if (!uclparse_target_chap_mutual(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_target_chap_mutual(name, + tmp)) + goto fail; + } + } else { + log_warnx("\"chap-mutual\" property of target " + "\"%s\" is not an array or object", + name); goto fail; + } } if (strcmp(key, "initiator-name") == 0) { - if (!target_add_initiator_name( - ucl_object_tostring(obj))) + if (obj->type == UCL_STRING) { + if (!target_add_initiator_name( + ucl_object_tostring(obj))) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!target_add_initiator_name( + ucl_object_tostring(tmp))) + goto fail; + } + } else { + log_warnx("\"initiator-name\" property of " + "target \"%s\" is not an array or string", + name); goto fail; + } } if (strcmp(key, "initiator-portal") == 0) { - if (!target_add_initiator_portal( - ucl_object_tostring(obj))) + if (obj->type == UCL_STRING) { + if (!target_add_initiator_portal( + ucl_object_tostring(obj))) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!target_add_initiator_portal( + ucl_object_tostring(tmp))) + goto fail; + } + } else { + log_warnx("\"initiator-portal\" property of " + "target \"%s\" is not an array or string", + name); goto fail; + } } if (strcmp(key, "portal-group") == 0) { From nobody Wed Feb 26 15:15:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yj43KDPz5qH1j; Wed, 26 Feb 2025 15:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yj35tMPz3P5x; Wed, 26 Feb 2025 15:15:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9TBSAzIsrNLtenckBILx1GaKsvMEehYpBtfsHuSBzPY=; b=rTJZ4bxWWgwzZx9uGt7qcajGA07Mdh4ld1Y9tPIeywQ4QRxr1guj0qlzF2ikXAVICb7ppb sm8TalPatTrgRUBB4LkTSP3AR7p961TtzsA14gF4iCBDbWKL0Xw3mP1IDxCQpNAdec6RAn 4qJ64Z+1b3f+1UB1kTTFG2jsopvm99vOPXgddR/VTbFO3Tr4N7LexCSxCh34zUVZSBDKiw 4aP+kgFMAQK/u0K+tyJB8RgqbIYYDJcLCN0abo+xhrj7agGEXhfV9RvfqIepFuAGj1dy7J Bsx/o8o+5kJ8K6de67073L3lIRdiHr4TXzYTxBh9e+H+LQEFIgY+jw+tYeGjBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582951; a=rsa-sha256; cv=none; b=YMQ0oqCtBpg/SGYe9OlVY3LAsdqUxYxYObkUwvteaKZkrVCVDrxfOH0COPC4kkF+1TfA/0 VzQnLHVBzaPlNErOmeAztH8vXwrvQXb8DzQh+NP21gaGZNoxEaeUikaFcD3a11u/bQL7Wr gWpayAoONp0pibsvwmDMyMh6hmALaHsVPjhGJHH6TdW0FtYAqfIaWLvxSQJNOu3C/smH+u ihapdvsZ/OkScLlpIlLdYTMD2wKch8Kq7dc4eiJTtOJy1atNLUp4bvOvo01C01p8HPH1uF QnQxFx4Og0JfBzhmJBbnWzHn7s32qMQowq4XdwMD6bwNmtmKTf3LDs+HtHB5aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9TBSAzIsrNLtenckBILx1GaKsvMEehYpBtfsHuSBzPY=; b=jV1GdBogtzUCr2d3oBAm5/zu73Ks1Ih7bJU/cAlmo+3dSaHsAwPZBtswuTB/U7FSxPwp/L E2HDa7Mmj/jO2+FrwyJv7vm5EHCTTfHfVfldqNxkmP2hKeFkkxN3109tbGd1q4LBsQb2qk 35qtl9H/x3fcGZWpaaIaJIUrWQu2RawM7Ew6Uo4xNrKMu3MUFhlajiJxTTJfkc4mlBOTfI U1Q7hT7rVqPUafORBryQ3KwjsbHoY7gHBNAVkg4oAOW40j9AJqPiB4wS/CV9HyOPzSRdnO XdMxeiRUM2JwBxZoXKWylt260cbG2ZdUbKZDBjIKyNciBqT+CuhHD0h9v16maw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yj35Swnz1Gw6; Wed, 26 Feb 2025 15:15:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFFphx034023; Wed, 26 Feb 2025 15:15:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFFpZH034021; Wed, 26 Feb 2025 15:15:51 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:15:51 GMT Message-Id: <202502261515.51QFFpZH034021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 67940b204f58 - main - ctld: Add missing properties to the UCL parser List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67940b204f5829a72e7c47f92069fb06a7dad91f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=67940b204f5829a72e7c47f92069fb06a7dad91f commit 67940b204f5829a72e7c47f92069fb06a7dad91f Author: John Baldwin AuthorDate: 2025-02-26 15:12:25 +0000 Commit: John Baldwin CommitDate: 2025-02-26 15:12:25 +0000 ctld: Add missing properties to the UCL parser - Support for "foreign", "offload", and "tag" properties in portal group contexts. - Support for "ctl-lun" and "device-type" properties in LUN contexts. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48936 --- usr.sbin/ctld/uclparse.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index e8e026247b71..7c786afb1e93 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -634,6 +634,10 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) goto fail; } + if (strcmp(key, "foreign") == 0) { + portal_group_set_foreign(); + } + if (strcmp(key, "listen") == 0) { if (obj->type == UCL_STRING) { if (!portal_group_add_listen( @@ -676,6 +680,18 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } } + if (strcmp(key, "offload") == 0) { + if (obj->type != UCL_STRING) { + log_warnx("\"offload\" property of " + "portal-group \"%s\" is not a string", + name); + goto fail; + } + + if (!portal_group_set_offload(ucl_object_tostring(obj))) + goto fail; + } + if (strcmp(key, "redirect") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"listen\" property of " @@ -705,6 +721,17 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } } + if (strcmp(key, "tag") == 0) { + if (obj->type != UCL_INT) { + log_warnx("\"tag\" property of portal group " + "\"%s\" is not an integer", + name); + goto fail; + } + + portal_group_set_tag(ucl_object_toint(obj)); + } + if (strcmp(key, "dscp") == 0) { if (!uclparse_dscp("portal", name, obj)) goto fail; @@ -946,6 +973,28 @@ uclparse_lun(const char *name, const ucl_object_t *top) goto fail; } + if (strcmp(key, "device-type") == 0) { + if (obj->type != UCL_STRING) { + log_warnx("\"device-type\" property of lun " + "\"%s\" is not an integer", name); + goto fail; + } + + if (!lun_set_device_type(ucl_object_tostring(obj))) + goto fail; + } + + if (strcmp(key, "ctl-lun") == 0) { + if (obj->type != UCL_INT) { + log_warnx("\"ctl-lun\" property of lun " + "\"%s\" is not an integer", name); + goto fail; + } + + if (!lun_set_ctl_lun(ucl_object_toint(obj))) + goto fail; + } + if (strcmp(key, "options") == 0) { if (obj->type != UCL_OBJECT) { log_warnx("\"options\" property of lun " From nobody Wed Feb 26 15:15:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yj52gcCz5qHF2; Wed, 26 Feb 2025 15:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yj46qXWz3Nsd; Wed, 26 Feb 2025 15:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bfSaRDkpSTjtImzQCtnq2vkAPUXzvcohG1XOiZxNCpc=; b=acIyLnIY0aumFGJLIR6rNBzFHGSlVPp5bfg3s+JmgViRwkJ8/8z77wkvVjE4ouI9sW+sKJ xx8O7YlETS5ckhVK0+n43hHT/vhEee91bS1ayW+tlTaDFJLTn0QAHrhE1pNwBeo2bwEEWY FOFUHXjw3NHFORyY+Ij0X96+9E28pz2Z0/AgOPFuKiwlWTFI2BWBB7XX+nk4bLpIQNk368 NDMJTWVMLO5OQjw6CzxQeY6Burz5PbReMRccFUxFgx8vQXSVzv+zfRD57WClgl3fO9Q3cg WDvHgIE1YiP6TozkM9Dc6I61l4WeXk05jDTjyVEE+Ogf51xihc/S6dQOueW6nA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582953; a=rsa-sha256; cv=none; b=f42Kkp0UJG6ipGEXp339CUlP04/W7G/FsL3klKZlyCK0diyQkAGHJIkhnYX12UzpPJCfe8 jtAGor3FwTGAJQOkN1grANCBSuACLIEfP6GKV7dmPqok7j6EIv+5z3/dqhbRhQ4bETo/Na asf5enp8aCtzjy2H69521Ukx0aM9uOpicI/TSYDoeWOPpF0ly1UVmv9LbYfEfK8eUA3Ugw LOtNhrEIajhztvLowMmU+1nnjulrcstbM5J8Debyc1xWowyPmeEqjxkodmFc2t7aKHaj/y CyBVz9f5ZfBKunghgS9gViZ5Z8WGwKV6QLnijbChuzcqYkuaF3vf17GyCHTI0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bfSaRDkpSTjtImzQCtnq2vkAPUXzvcohG1XOiZxNCpc=; b=FTbIf73R3OszmrJS0QC/8hW6AvwUBn2Im+N21UHHut7WMIw6Ouj8BQwoC5LGaoV09hKWG1 i4eHWSXE4CGJfpgEUkPQLbSWf4PONMBvyBsflMpaI6Zpjv2s5IdTaZ+D/JlwDHsaT/D684 buor0C64pnEemfYUDNS/ZqeEOYnp8lzwVv0dovfa56aOyTUmp1SVkIsrqn/2jKRJIul5X/ b5JPgVc/6mURi/dfi7iA1PaIOSwG9kOgUyGimiCZSXJZhSXErcinAG9D0R/QquegCTXMhl R48suIFmbvkpjrt5Y/gbg+qyD2tDk1gJeRfCYVN6nrXmQf9HCvDAk6/FB5bWDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yj46RFXz1HDB; Wed, 26 Feb 2025 15:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFFq8c034058; Wed, 26 Feb 2025 15:15:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFFq8D034055; Wed, 26 Feb 2025 15:15:52 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:15:52 GMT Message-Id: <202502261515.51QFFq8D034055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b797cc839a12 - main - ctld: Support anonymous LUN entries in UCL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b797cc839a12fc358e99635ca3adf3cf80e0825b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b797cc839a12fc358e99635ca3adf3cf80e0825b commit b797cc839a12fc358e99635ca3adf3cf80e0825b Author: John Baldwin AuthorDate: 2025-02-26 15:13:10 +0000 Commit: John Baldwin CommitDate: 2025-02-26 15:13:48 +0000 ctld: Support anonymous LUN entries in UCL If a target LUN entry doesn't have a name property, assume it is an anonymous LUN and parse other properties from the entry to define the LUN. This removes the odd support for target LUNs only named by an integer. My guess is this was meant to implement support for anonymous LUNs based on how the syntax for this works in the non-UCL case, but the prior implementation was useless (it just created unconfigured LUNs). Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48937 --- usr.sbin/ctld/ctl.conf.5 | 30 +++++++------- usr.sbin/ctld/uclparse.c | 106 ++++++++++++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 59 deletions(-) diff --git a/usr.sbin/ctld/ctl.conf.5 b/usr.sbin/ctld/ctl.conf.5 index 0be873fe512c..015fc1e12e36 100644 --- a/usr.sbin/ctld/ctl.conf.5 +++ b/usr.sbin/ctld/ctl.conf.5 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 13, 2020 +.Dd February 26, 2025 .Dt CTL.CONF 5 .Os .Sh NAME @@ -543,25 +543,12 @@ portal-group { } lun { - example_0 { - path = /dev/zvol/tank/example_0 - blocksize = 4096 - size = 4GB - } - example_1 { path = /dev/zvol/tank/example_1 options { naa = "0x50015178f369f093" } } - - example_2 { - path = /dev/zvol/tank/example_2 - options { - vendor = "FreeBSD" - } - } } target { @@ -569,7 +556,12 @@ target { alias = "Example target" auth-group = no-authentication lun = [ - { number = 0, name = example_0 }, + { + number = 0 + path = /dev/zvol/tank/example_0 + blocksize = 4096 + size = 4GB + } ] } @@ -578,7 +570,13 @@ target { portal-group { name = pg0 } lun = [ { number = 0, name = example_1 }, - { number = 1, name = example_2 } + { + number = 1 + path = /dev/zvol/tank/example_2 + options { + vendor = "FreeBSD" + } + } ] } diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index 7c786afb1e93..b9d88a1d45d2 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -48,6 +48,7 @@ static bool uclparse_toplevel(const ucl_object_t *); static bool uclparse_chap(const char *, const ucl_object_t *); static bool uclparse_chap_mutual(const char *, const ucl_object_t *); static bool uclparse_lun(const char *, const ucl_object_t *); +static bool uclparse_lun_entries(const char *, const ucl_object_t *); static bool uclparse_auth_group(const char *, const ucl_object_t *); static bool uclparse_portal_group(const char *, const ucl_object_t *); static bool uclparse_target(const char *, const ucl_object_t *); @@ -216,35 +217,44 @@ uclparse_target_portal_group(const char *t_name, const ucl_object_t *obj) static bool uclparse_target_lun(const char *t_name, const ucl_object_t *obj) { - if (obj->type == UCL_INT) { - if (!target_start_lun(ucl_object_toint(obj))) - return (false); - lun_finish(); - return (true); + const ucl_object_t *num; + const ucl_object_t *name; + char *lun_name; + u_int id; + bool ok; + + if (obj->type != UCL_OBJECT) { + log_warnx("lun section entries in target \"%s\" must be objects", + t_name); + return (false); } - if (obj->type == UCL_OBJECT) { - const ucl_object_t *num = ucl_object_find_key(obj, "number"); - const ucl_object_t *name = ucl_object_find_key(obj, "name"); + num = ucl_object_find_key(obj, "number"); + if (num == NULL || num->type != UCL_INT) { + log_warnx("lun section in target \"%s\" is missing " + "\"number\" integer property", t_name); + return (false); + } + id = ucl_object_toint(num); - if (num == NULL || num->type != UCL_INT) { - log_warnx("lun section in target \"%s\" is missing " - "\"number\" integer property", t_name); + name = ucl_object_find_key(obj, "name"); + if (name == NULL) { + if (!target_start_lun(id)) return (false); - } - if (name == NULL || name->type != UCL_STRING) { - log_warnx("lun section in target \"%s\" is missing " - "\"name\" string property", t_name); - return (false); - } + asprintf(&lun_name, "lun %u for target \"%s\"", id, t_name); + ok = uclparse_lun_entries(lun_name, obj); + free(lun_name); + return (ok); + } - if (!target_add_lun(ucl_object_toint(num), - ucl_object_tostring(name))) - return (false); + if (name->type != UCL_STRING) { + log_warnx("\"name\" property for lun %u for target " + "\"%s\" is not a string", id, t_name); + return (false); } - return (true); + return (target_add_lun(id, ucl_object_tostring(name))); } static bool @@ -929,21 +939,31 @@ fail: static bool uclparse_lun(const char *name, const ucl_object_t *top) { - ucl_object_iter_t it = NULL, child_it = NULL; - const ucl_object_t *obj = NULL, *child = NULL; - const char *key; + char *lun_name; + bool ok; if (!lun_start(name)) return (false); + asprintf(&lun_name, "lun \"%s\"", name); + ok = uclparse_lun_entries(lun_name, top); + free(lun_name); + return (ok); +} + +static bool +uclparse_lun_entries(const char *name, const ucl_object_t *top) +{ + ucl_object_iter_t it = NULL, child_it = NULL; + const ucl_object_t *obj = NULL, *child = NULL; + const char *key; while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); if (strcmp(key, "backend") == 0) { if (obj->type != UCL_STRING) { - log_warnx("\"backend\" property of lun " - "\"%s\" is not a string", - name); + log_warnx("\"backend\" property of %s " + "is not a string", name); goto fail; } @@ -953,8 +973,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "blocksize") == 0) { if (obj->type != UCL_INT) { - log_warnx("\"blocksize\" property of lun " - "\"%s\" is not an integer", name); + log_warnx("\"blocksize\" property of %s " + "is not an integer", name); goto fail; } @@ -964,8 +984,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "device-id") == 0) { if (obj->type != UCL_STRING) { - log_warnx("\"device-id\" property of lun " - "\"%s\" is not an integer", name); + log_warnx("\"device-id\" property of %s " + "is not an integer", name); goto fail; } @@ -975,8 +995,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "device-type") == 0) { if (obj->type != UCL_STRING) { - log_warnx("\"device-type\" property of lun " - "\"%s\" is not an integer", name); + log_warnx("\"device-type\" property of %s " + "is not an integer", name); goto fail; } @@ -986,8 +1006,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "ctl-lun") == 0) { if (obj->type != UCL_INT) { - log_warnx("\"ctl-lun\" property of lun " - "\"%s\" is not an integer", name); + log_warnx("\"ctl-lun\" property of %s " + "is not an integer", name); goto fail; } @@ -997,8 +1017,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "options") == 0) { if (obj->type != UCL_OBJECT) { - log_warnx("\"options\" property of lun " - "\"%s\" is not an object", name); + log_warnx("\"options\" property of %s " + "is not an object", name); goto fail; } @@ -1012,8 +1032,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "path") == 0) { if (obj->type != UCL_STRING) { - log_warnx("\"path\" property of lun " - "\"%s\" is not a string", name); + log_warnx("\"path\" property of %s " + "is not a string", name); goto fail; } @@ -1023,8 +1043,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "serial") == 0) { if (obj->type != UCL_STRING) { - log_warnx("\"serial\" property of lun " - "\"%s\" is not a string", name); + log_warnx("\"serial\" property of %s " + "is not a string", name); goto fail; } @@ -1034,8 +1054,8 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (strcmp(key, "size") == 0) { if (obj->type != UCL_INT) { - log_warnx("\"size\" property of lun " - "\"%s\" is not an integer", name); + log_warnx("\"size\" property of %s " + "is not an integer", name); goto fail; } From nobody Wed Feb 26 15:15:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yj7756Hz5qHBn; Wed, 26 Feb 2025 15:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yj71tdJz3Nsq; Wed, 26 Feb 2025 15:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjWYkAD3tBKLjsqm00PAGtOep9drW7pB2yJ+o3/KO+Y=; b=pDojmtQFY6UC1fjegVt/Sw9yhKXPGcnoNhwQI7uS9fD5h9XUHsRdTPikgt71EFgG9OGqHP xSKxYP4t+TJUW55me790tPwGw1hTqccnAIlBOS5FsCWRYImm15v8AyR4JE6DEd4YfXnAq6 1TJGSLQ7ERzjPNkUG2PAM7t52hJGA1tOGCAtaCVwchPjBdcQW5EuLMStOxSCulF1ypHT4h YXkmUD7ZlHRQPsXiYIs9JR38hupRD1zw5nIHO8rv2dwIFRcVxSiXSOTwobtuRspAMPVIe1 +UQry1ptJbTdLp84CxAWXaJeDaUHWseuNfGTijvzgRkPyB12YFWWAAXzALpPOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582955; a=rsa-sha256; cv=none; b=sPOltpKoEhJZtcSLah1bCEOHu0Pm3XHPFpYBCj7dFM7MUfaDEfs65kYZ1Rajg8Iddk1n06 rhrmrfQ4W7y86CZcu4zy9YKau3Hwg+rfjbv/rLpONUJlDZKMBX+BQ7xriEKJtnmO1bXm0F LWNc6dW4uo09nKt/MP8XAVdI7us/MbBG/OGFfBouAxifTzQ6XZowVfahghJDQEXObPLzTn kmYUS32a34vDkcbAVsOZvAbDkRRLozoFh1XDh+6znFLSMR8ui3zgI+g87ddWUFAZxohHiS /9oFgoHHubGi/7FCrK2q9Wfa13kEH6WTQNldxC4KyvFSHTqeLF24T5XoMkFSuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjWYkAD3tBKLjsqm00PAGtOep9drW7pB2yJ+o3/KO+Y=; b=XC66v1Hh1tSmGBWwyJog+TlHVj3wJVmW5neP+Pfg4fBYwnk0idk+xtU7jj21M4lcxHN6qQ GJUS+gjgQum8RgdWCZhNZCoiBKWO2hUiGgsAZ2jbXNRQzJ7U25o1/wyl+cpF+46V21sqaE 60iG4SumtqCMXNWAg6Hpl6qkWsqt+iJ4VIMetS2iQdfb6q/B7SmDHFh5A5hHH2t9zA7u+q fAugOT2dWiNnBRKygqeHSxHbpVbEGe5zjDVe3oevFQDMEHHBLastg2uO3Jp44NepNrmNAQ 5eKVwNm7luTm21mJHF3KrPOlRIAW63Sz0Sc5DYfq93C7mkoyG5PIaDViRDmjgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yj71Cdyz1HDC; Wed, 26 Feb 2025 15:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFFtxJ034127; Wed, 26 Feb 2025 15:15:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFFtxA034124; Wed, 26 Feb 2025 15:15:55 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:15:55 GMT Message-Id: <202502261515.51QFFtxA034124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5b511473999a - main - ctld: Permit simpler syntax for target LUNs in UCL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b511473999a1d0145635fcc9d922601f34b670b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5b511473999a1d0145635fcc9d922601f34b670b commit 5b511473999a1d0145635fcc9d922601f34b670b Author: John Baldwin AuthorDate: 2025-02-26 15:14:53 +0000 Commit: John Baldwin CommitDate: 2025-02-26 15:14:53 +0000 ctld: Permit simpler syntax for target LUNs in UCL Allow the LUN number to be specified as the key for a LUN instead of requiring it as a "number" field. If a key is used, permit a simple string value to be used for non-anymous LUNs. This permits replacing: lun = [ { number = 0, name = zvol_lun }, { number = 1 backend = ramdisk size = 1GB } ] with: lun = { 0 = zvol_lun 1 { backend = ramdisk size = 1GB } } Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48939 --- usr.sbin/ctld/ctl.conf.5 | 22 ++++++++++------------ usr.sbin/ctld/uclparse.c | 30 +++++++++++++++++++++++------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/usr.sbin/ctld/ctl.conf.5 b/usr.sbin/ctld/ctl.conf.5 index 8cc7c85b6f95..e42dd8067006 100644 --- a/usr.sbin/ctld/ctl.conf.5 +++ b/usr.sbin/ctld/ctl.conf.5 @@ -555,36 +555,34 @@ target { "iqn.2012-06.com.example:target0" { alias = "Example target" auth-group = no-authentication - lun = [ - { - number = 0 + lun = { + 0 { path = /dev/zvol/tank/example_0 blocksize = 4096 size = 4GB } - ] + } } "iqn.2012-06.com.example:target1" { auth-group = ag0 portal-group = pg0 - lun = [ - { number = 0, name = example_1 }, - { - number = 1 + lun { + 0 = example_1 + 1 { path = /dev/zvol/tank/example_2 options { vendor = "FreeBSD" } } - ] + } } naa.50015178f369f092 { port = isp0 - lun = [ - { number = 0, name = example_1 } - ] + lun { + 0 = example_1 + } } } .Ed diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index ab41e328cd90..05cfcc8df7e7 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -233,23 +233,39 @@ uclparse_target_lun(const char *t_name, const ucl_object_t *obj) { const ucl_object_t *num; const ucl_object_t *name; - char *lun_name; + const char *key; + char *end, *lun_name; u_int id; bool ok; + key = ucl_object_key(obj); + if (key != NULL) { + id = strtoul(key, &end, 0); + if (*end != '\0') { + log_warnx("lun key \"%s\" in target \"%s\" is invalid", + key, t_name); + return (false); + } + + if (obj->type == UCL_STRING) + return (target_add_lun(id, ucl_object_tostring(obj))); + } + if (obj->type != UCL_OBJECT) { log_warnx("lun section entries in target \"%s\" must be objects", t_name); return (false); } - num = ucl_object_find_key(obj, "number"); - if (num == NULL || num->type != UCL_INT) { - log_warnx("lun section in target \"%s\" is missing " - "\"number\" integer property", t_name); - return (false); + if (key == NULL) { + num = ucl_object_find_key(obj, "number"); + if (num == NULL || num->type != UCL_INT) { + log_warnx("lun section in target \"%s\" is missing " + "\"number\" integer property", t_name); + return (false); + } + id = ucl_object_toint(num); } - id = ucl_object_toint(num); name = ucl_object_find_key(obj, "name"); if (name == NULL) { From nobody Wed Feb 26 15:15:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2yj63t1lz5qH8j; Wed, 26 Feb 2025 15:15:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yj60fC1z3P3g; Wed, 26 Feb 2025 15:15:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hm6xWeC4DxGdUQQsWSqK4WcNywaCiM7oq9ECXcHCERk=; b=uKrtCdQSqbPaTPonWHe4PhUZgQqLfwyRMxUR1WxhzMjT1odsn7NQkYKcJmgBJORR7TRo74 Ymd1dYxrFSn53w2NHMViHV7h61SxRCYkVTBeNHbsxYkU/N2dz67yeT5Jw+zpJ/embnnfw8 Un4+jbbaeMk/4RkwdOw8TcFHxIXoZQCr8x/mKuJrxObPJgkdEnI5jXRxDD++HMrgPjai+u 6lbl2jzwT+3XFmtQwXBqJ0r/pJZvupFq57FMLq84rEB5+5sZKwcdo/jI9fiB6LDz34VFSQ VK3tB4y+ilr6o3IebIoHU1H0Mz1ShohRc9n+g0PRRgiBiWmWJ7b37aMgL5r3GQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582954; a=rsa-sha256; cv=none; b=LIlHJ+WqzQec82CE1F7l9hJrvjJStjeypopGht24p9iAYE60+t1AUwp0lkmA3QFerAbp9v JLUjGy3vZQEzbGxMkYUgIgnQaOTSZUvZMGH9EJH/Yo1B2wmhpgVQZM17RgR3coy+SBl+S5 VTQslwC9foBlQ350JbggWkIL9htiRHKYT5DiqP2bzD3xzufiQ1LcaN4MvD6p1piTCpaTK+ gCpXbgoKZlILzAbqWpaI4df96NOgL74eEEWP1NEYhcmhiB624U4zyFkAhfbPA5SRHYZ+dp Ilcm1bvDkrRyJHvr8giCdmIs4AiNHropMeCQ3yE6vOdos5yde0pDK/DSkimvDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hm6xWeC4DxGdUQQsWSqK4WcNywaCiM7oq9ECXcHCERk=; b=p4S1TRyxjPrlaG2wi6kDecB5PUmNdLdN24SK+POXy8SgpIWATU2OaD9c5yhYhthEx+2wgQ pOVB9IBRKCGPDgyWJKFy/QH97YKwQUx4Nen4scehC700vwzYL11WJ3Vh2/RQ1SaTOjIlps r6MANMmzuK66Fu/gvpRoIoIu8IHgyJQw0h3J5z5hp0gVGSObewas7rDGKgC2KZIZHaQxbD /tkr+50WZXXmAQ63rxTNkVrHQPTIcBzW+OGyQm+3Boo+LdF1V4zmzsSAgcd7oClUvHt8kQ ih5Ja6Im+k1MQz0o37kdJAy2/3RHIIHcmEMMqMco3M8O1S9Gs4inMixKewqdXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2yj60FZKz1HCr; Wed, 26 Feb 2025 15:15:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFFrw3034093; Wed, 26 Feb 2025 15:15:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFFrba034090; Wed, 26 Feb 2025 15:15:53 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:15:53 GMT Message-Id: <202502261515.51QFFrba034090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e49db000c493 - main - ctld: Permit targets to use a string for portal-groups in UCL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e49db000c4932753fb309ad895c02e98723023f3 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e49db000c4932753fb309ad895c02e98723023f3 commit e49db000c4932753fb309ad895c02e98723023f3 Author: John Baldwin AuthorDate: 2025-02-26 15:13:56 +0000 Commit: John Baldwin CommitDate: 2025-02-26 15:13:56 +0000 ctld: Permit targets to use a string for portal-groups in UCL In the case that a separate auth-group is not required, this permits replacing: portal-group = { name = pg0 } with: portal-group = pg0 Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48938 --- usr.sbin/ctld/ctl.conf.5 | 2 +- usr.sbin/ctld/uclparse.c | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ctld/ctl.conf.5 b/usr.sbin/ctld/ctl.conf.5 index 015fc1e12e36..8cc7c85b6f95 100644 --- a/usr.sbin/ctld/ctl.conf.5 +++ b/usr.sbin/ctld/ctl.conf.5 @@ -567,7 +567,7 @@ target { "iqn.2012-06.com.example:target1" { auth-group = ag0 - portal-group { name = pg0 } + portal-group = pg0 lun = [ { number = 0, name = example_1 }, { diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index b9d88a1d45d2..ab41e328cd90 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -191,6 +191,20 @@ uclparse_target_portal_group(const char *t_name, const ucl_object_t *obj) const ucl_object_t *portal_group, *auth_group; const char *ag_name; + /* + * If the value is a single string, assume it is a + * portal-group name. + */ + if (obj->type == UCL_STRING) + return (target_add_portal_group(ucl_object_tostring(obj), + NULL)); + + if (obj->type != UCL_OBJECT) { + log_warnx("portal-group section in target \"%s\" must be " + "an object or string", t_name); + return (false); + } + portal_group = ucl_object_find_key(obj, "name"); if (!portal_group || portal_group->type != UCL_STRING) { log_warnx("portal-group section in target \"%s\" is missing " @@ -884,11 +898,6 @@ uclparse_target(const char *name, const ucl_object_t *top) } if (strcmp(key, "portal-group") == 0) { - if (obj->type == UCL_OBJECT) { - if (!uclparse_target_portal_group(name, obj)) - goto fail; - } - if (obj->type == UCL_ARRAY) { while ((tmp = ucl_iterate_object(obj, &it2, true))) { @@ -896,6 +905,9 @@ uclparse_target(const char *name, const ucl_object_t *top) tmp)) goto fail; } + } else { + if (!uclparse_target_portal_group(name, obj)) + goto fail; } } From nobody Wed Feb 26 15:58:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z2zfj0WgLz5qLTR; Wed, 26 Feb 2025 15:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2zfh4ckjz3l5g; Wed, 26 Feb 2025 15:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740585532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyCoXrdOnhAnUkB2Dlloz/VF5qJjweVGFOYAC8J08+0=; b=gNh5swF38dZ0ze9n5Ai6dkCLKAn6zNyOSn7hFPGoyJ6jnksP/8+678/3X0KW2IVUKzcvAv PRyPGojI1gGMAYA8z7Lgk0nChCbBG0dz+30TkTYHrbk0fQiEO+bisx0TiFwD5Ee5ZXkYSc sB3nlFAOf8kaqH1OL7LFBEiVFekYUNJDDA7LB0Gq9H6odkdg2Ps1UJNbsIvZb9UDkeTNtX 7Of4kpg9liHHRfPGNCG8x5UKphFuJLIlGR9uylorrwF31c3swheeJdwprJ32RNKF3XVIqT T9UnngSKiJM+lH8hFMJjUu/i1j7EvEVhuriraOmBm46u870ahVdxJzvailrZ3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740585532; a=rsa-sha256; cv=none; b=BuIhqveeU2txw6pcHakPwjHZkD5/A7xqBK6NlodtnM0n2841fM38d1E3wdUoFqK1tFXrVm 5oILu03CDUfaOVj/OhgI8ZSVF7eaabJCu1XqpySTHy2qKqDMjdVP/HO1vLB1EwsiQKC5dq rV4PlNvTzKzVwDDSzA9uTiQxBxEkFf8fcR5w2kwcFvVRbvjqFFdaRIYJu68NNG5pgTtW0x SikdJ5Itd0eRMrarXPXk0ILAtz+pyvYeZZoc/V8CSnN2b9zmokn2Tc5OLKMKL3kGpmaPPA p5cyujfXIlEVCbRA2lZadrZly3yyPa7FVfkEVIJU4M1pB6uT+PdsCmSSWzq2rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740585532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyCoXrdOnhAnUkB2Dlloz/VF5qJjweVGFOYAC8J08+0=; b=xamRW/7GQUpgbFxU2ER0o8Z6+x/gSq3sKKMYElr4s3YCuKCcd7dtGgUGKSe/el3rvfKvLF r4+OxKp9W2EIByVoltaXbFsK1Z2kbsWyiI0frKScCvu+cSCUeZJ3GSsBDCtfW3Ysl9VuiH 6Im7S7rf0J8uYWtLIDlRpaV3WyOb1thzKajn1FHCrXGEDBEtptAUN4p1FSVUOQj7VibFAI QWCKNAN0D1T7/F97BVQw+iVPAwI0MoTWA7nz3xgnmZwH9rslV3/1rrGRO472YrU/1/Tfd8 dpMmv02zrkELWDbZ9RSkK60AeWM5dYUjuj4EalFEbUT4LnfnSSfmVsfOG1c02A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z2zfh3LMlz1J1p; Wed, 26 Feb 2025 15:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QFwqhM009286; Wed, 26 Feb 2025 15:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QFwq77009283; Wed, 26 Feb 2025 15:58:52 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:58:52 GMT Message-Id: <202502261558.51QFwq77009283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a6b74183b63d - main - pf: list dependecy on crypto.ko List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6b74183b63ddd5428c68daf7c66d4bb49e3a469 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a6b74183b63ddd5428c68daf7c66d4bb49e3a469 commit a6b74183b63ddd5428c68daf7c66d4bb49e3a469 Author: Kristof Provost AuthorDate: 2025-02-26 09:52:44 +0000 Commit: Kristof Provost CommitDate: 2025-02-26 14:58:29 +0000 pf: list dependecy on crypto.ko Since 9d5c83a0b84c pf depends on the crypto module (for SHA512_*). Explicitly list this dependency. PR: 285019 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index c8447b4e64b8..e622186f671f 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -6933,4 +6933,5 @@ static moduledata_t pf_mod = { DECLARE_MODULE(pf, pf_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_SECOND); MODULE_DEPEND(pf, netlink, 1, 1, 1); +MODULE_DEPEND(pf, crypto, 1, 1, 1); MODULE_VERSION(pf, PF_MODVER); From nobody Wed Feb 26 16:35:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z30Sq2znWz52dtv; Wed, 26 Feb 2025 16:35:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z30Sq2SLcz438m; Wed, 26 Feb 2025 16:35:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740587723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vYzoCfbr21bbJJfnCILrH4U5UGGDWGltDGaUEAtTA3g=; b=OIt6Es94cvD+sAaOLqBhpsLiQXavIOhlMr4mZ+FURow7wsV+jKWb3xYUfVnKh8hU6kEI/O 8WXVAAdiXsxK3MVsZs6PTBU5jseeysoPx+8j6cerj+6uf6GWSgPkyDXu36T7mEcraZugeb sW6hOns0ob+NzTaiPyUNyyGOnZcpAJJQa72xz+pFYcf5kfZfRWGhRTDw0zpsp5jZsOz6qV yXCujUD0MI9+0xjULL9GcXDAWYXqmIL1T5NL7kW60PD1u7BowSayhVH8WAeoPCRJllZobU nzTTmE0QO7bsFJhNM8UxF4Iamzz0GX/GVxykn3N/s8uStMYuYfM7svWWP57ISA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740587723; a=rsa-sha256; cv=none; b=QCRpULLVQSn+18MVWOBrODe9Nt3vx8o4nda3FfEDwBdiXVyW7lMhU8jyRBb7l+zy5T8cns /W8ODSzcZZQLkkp6An8Zy6iQuBCSQtfgAKHH3tFEO+RzvIfdKttvok4qzRUQG56lklVoqO q4WtqnmiV/FihMJ9wKDnlNWXJYFArgJos02K87XyNRma7S743FP+zpjWDthkgBrM7lb/0E OZp3uSkNq5i6mzFh96rPrwz/d+zMvIBrvn7djXSrfN4L0WVwJX8RwGywoOXLyIGmT+cW4u SkEBKSuC7hR5dMX7b++8LhvuNSZf5lb04n3nr/c/xl+/4kMWBfz3na3ZzVVr6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740587723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vYzoCfbr21bbJJfnCILrH4U5UGGDWGltDGaUEAtTA3g=; b=Q6xD2BndNuMshMJ437M4/O5i13WMzg3Vrb22yipiB92qGne11wychak0rxOw58tKeMTl5X DgtHU6rGrwvrGgU4/OpIgd/amT2pqn7+gVOiTCg9ol1qjXVMTu2qmhk2Ie787e6rvRrmFs 9cCvBgs7ofBx4UoEgE/3LyIeV5H0axpW6vzqBNIyPhkv8mgd7KdU6E+fWlCRuZhY60Zvcd YTERG8lNMvM4QCkDbAClM/zRb+xBYdGTEco8fe06Ajm+tNJNHwwFEzvxHxDG1InYpeDU// mbYiDi0qliUjK9qqxfVOflQ8typW+A6V6EDmJG28nP2aBH/q4uPW9W5UYRD+Gw== Received: from [IPV6:2601:5c0:4200:b830:a15f:d124:4862:d27d] (unknown [IPv6:2601:5c0:4200:b830:a15f:d124:4862:d27d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z30Sq00KRzxV0; Wed, 26 Feb 2025 16:35:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Wed, 26 Feb 2025 11:35:21 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 0e58542fd246 - main - tcp: remove unused field from struct tcpcb Content-Language: en-US To: "Bjoern A. Zeeb" , Michael Tuexen Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202502252048.51PKm4YX061305@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/25/25 21:23, Bjoern A. Zeeb wrote: > On Tue, 25 Feb 2025, Michael Tuexen wrote: > >> The branch main has been updated by tuexen: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=0e58542fd246242bc64bd03d8b2f28cf981c062b >> >> commit 0e58542fd246242bc64bd03d8b2f28cf981c062b >> Author: Peter Lei >> AuthorDate: 2025-02-25 20:37:48 +0000 >> Commit: Michael Tuexen >> CommitDate: 2025-02-25 20:37:48 +0000 >> >> tcp: remove unused field from struct tcpcb >> >> Reviewed by: tuexen >> Sponsored by: Netflix, Inc. >> --- >> sys/netinet/tcp_var.h | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h >> index e65e44840bd8..31663ed48f81 100644 >> --- a/sys/netinet/tcp_var.h >> +++ b/sys/netinet/tcp_var.h >> @@ -452,7 +452,6 @@ struct tcpcb { >> tcp_seq gput_seq; /* Outbound measurement seq */ >> tcp_seq gput_ack; /* Inbound measurement ack */ >> int32_t t_stats_gput_prev; /* XXXLAS: Prev gput measurement */ >> - uint32_t t_maxpeakrate; /* max peak rate set by user, bytes/s */ > > Is the tcpcb no longer KBI relevant these days? > In the old days we'd simply make this a spare and not move all offsets > below around. Only in stable branches would we do that sort of thing though. In main we keep all the spares at the end and never use them (they are reserved so they can be used for MFC of new fields in stable). -- John Baldwin From nobody Wed Feb 26 16:43:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z30f72rX3z52fj6; Wed, 26 Feb 2025 16:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z30f70hwCz46n5; Wed, 26 Feb 2025 16:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740588207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RM/ATHS5sIuIPX/0fmYwmCrWV9r4TkmS26n9WianSHI=; b=jKX9lQnBO6vKtVBBZQEolHFTUDG2NE5gCQBaFBAcWG/nLrcLCvTDb8lyf8FgdAeFs/OnY4 10QDor2GBiyM7ufMzs3zlmjJxh29kU41Lnau0xjkDi90DCLh5mvPFpdyGr1s7FeuF04p1w VZmuXwznwIciuEhs+fLzexGsjk4wvTsxm8gNl6lkFGUa9soGWCOjxwbX/iYu1/I6ihxP5u ZoDlhkVsu/a1M08jAOsuty6ld/THyJ2SYArjHSQICoxMPSwsldjBpYVRa4T6R85tGMDKvN Q2Xt1TJDMHkXrGPIWxIbPGw8USOr4RcdpwW0/4p00cIerN5rxnKiLGOlS3qv3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740588207; a=rsa-sha256; cv=none; b=EaPvVAIuU7oU2Q9F8zIMZaVQr26cXIdfySufZIunQeThxFof33+SrkXmiuvvRmq20SlW0n lfeiIIy8EIotZF+rYbGRhdK/YOVP6hqsGxHDWUH+4r7xm9hfxNVYC9yoIAkMDoOXkyZJkm SfM2xl6lueTwARd63PTfjs7n3NABm6dixw3adxVcJCKA2o6vGkp5KERBkH9bnUfMGRAx5X EXdxmkC+IbkZwKMx/y3lHQcu+xweSK3uAhU0rw/D6cVSES4Etw/lbFzEXef7/3kNIxJ/s4 OGuZ0r8TXl1J+IpdMQNol04/eDut4D3Z0MwMdI17RmAsMWUgUlNS8x8ejZ+NTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740588207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RM/ATHS5sIuIPX/0fmYwmCrWV9r4TkmS26n9WianSHI=; b=iqBWCPsz3zCE6NaXyPN2tqVSmN7/nDXy9uk1cg2k6J4oTS9HSOmbmo0vtvT1zYmmyXCXfU 3HIht1oUX1eLXPKi5PJT/ffIQuN7v5xlTTJGqb7SKg+LDPM5mticejiAPMjyXGBLiGrwvS 4NyWktl0hUqZou2g1CSJgaxcpdS6UdewNWoGsCjZpctzwqAwATlJpamH2WQlLVIGu0uyus uqHlXTm4Pz+tI8WiNOHn8UXPJz+wOzLwCTEHR6BJ64wH3cAa9jj9aCI5vgkb8BpY8b/fdo /QJuJhASq1PvxE96kVzNcLRL6GiTIw50tynjsPglExYtn0xjmEzYOwvqeQPqqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z30f70FJgz1Jqn; Wed, 26 Feb 2025 16:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QGhQYd001259; Wed, 26 Feb 2025 16:43:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QGhQs5001256; Wed, 26 Feb 2025 16:43:26 GMT (envelope-from git) Date: Wed, 26 Feb 2025 16:43:26 GMT Message-Id: <202502261643.51QGhQs5001256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 707ac59c2b31 - stable/14 - openssh: Fix blacklistd sshd-session integration List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 707ac59c2b31bdf3a593bc545d2fe233598cb97c Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=707ac59c2b31bdf3a593bc545d2fe233598cb97c commit 707ac59c2b31bdf3a593bc545d2fe233598cb97c Author: Jose Luis Duran AuthorDate: 2025-02-24 14:38:52 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-26 16:40:46 +0000 openssh: Fix blacklistd sshd-session integration In version 9.8, the server was split into a listener binary, sshd(8), and a per-session binary "sshd-session". Our blacklistd changes also have to be moved from sshd.c to sshd-session.c. Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49116 (cherry picked from commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16) --- crypto/openssh/sshd-session.c | 3 +++ crypto/openssh/sshd.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 3092cd91242e..ee983176d3aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -109,6 +109,7 @@ #include "sk-api.h" #include "srclimit.h" #include "dh.h" +#include "blacklist_client.h" /* Re-exec fds */ #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) @@ -1316,6 +1317,8 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); + BLACKLIST_INIT(); + if (privsep_preauth(ssh) == 1) goto authenticated; diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 68e48d75369a..fd48835ebd2a 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -101,7 +101,6 @@ #include "sk-api.h" #include "addr.h" #include "srclimit.h" -#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -1876,9 +1875,6 @@ main(int ac, char **av) } #endif #endif - - - BLACKLIST_INIT(); } /* server specific fatal cleanup */ From nobody Wed Feb 26 16:43:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z30ff2gyZz52fHF; Wed, 26 Feb 2025 16:43:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z30fd1w1Fz47nq; Wed, 26 Feb 2025 16:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740588233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RhhrbLNDI3Q/97A4XnE6NFyWDvvFShd7TiXve1sNSLk=; b=e0xW3xdzeQmNsHMc5LnJ4CdPBK7TU1ppdwlt1zY3CZT1V8JaKIvPfPEPNQozQDhJxMhVvs q3KkMAsZw9rsFSNAnDtjSZj1WbdRqqNjYd01s280rqIcftGyaMjaGOvp/ZerRS2fe2C7gL L3GUNnFa1d8ugOWxhHdxyWhygiYmj8RMCxZs0zf4TqoQ2/LfAKElOIrsWPVZlHuMwNcs81 lQd8OqPm6F438B1y7uS51kLq1Fb4fvdI0Kshn0bVMpzH6mECPG0gGZbFi7R2gb6inY1IMn 0EVMCXRpyLMNVKXccbw43z4Exn5CLwjnl/vTu4Yfq73Ui/O70NtEYh02PW+izA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740588233; a=rsa-sha256; cv=none; b=d9ZU+fcVHACtwJeqg6KzXXNIZiF/IyhMiYTW+GVkE6wDLSGciKzJVN6VT/JFcGWXCb9j9u N8zuPLyGvp8aH1OfNX9Wh5sU96ekFGZdNkE5mnxSWzBFdihB5htv3hO22pksnwyQ2aH7RX 2MIu48zXGZJQ6/QpUiYFwEAyRro1zRH70ROUkwySpmH1McHpYB1P4DeUxnlPq5O1RGqJBg jPVbci6x/qnrl/wYGtR6LDgEMWSRoOwRY0vdbeCWbKC1dGB2wEuxOkG1Nap5V2kLqKtM9p QKKit/cwkTLVU2EvfWfiZTzTGZkbAJtS7C+tz+Eq2SxsEf2PD7IUgV9/qi4eqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740588233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RhhrbLNDI3Q/97A4XnE6NFyWDvvFShd7TiXve1sNSLk=; b=FIF3OhoSZNUESRqWbRqZQ6R1SkP+REvsS/IHOu7orz9d0CqXF0Hd2I7W+5p+WmPsN06Mt1 PY2frp29QH4NhphplzKpOKVoGj7uw6lPBlbLqdJ9mNXBPFybn0Tvj1VrykGBqA6UmSUORz XcjM6T3R9NBsN7I6mC4yXYnhoyLtG2xJx5JEc9jKF9qlj0EqmFOosmILzkle8yiDaZrSih 5Gecv2vj7pgqFC2ww5RulpOzzUhkT7D0iVEltP8On9htuurXTXpTRkw0QT85rd2UWBd6dk b9CxrTC//WNXiwB4fruPlx2S0yssznxOzPRCev5VoJcYiHYHn1y67NkNl6tHKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z30fd1FMJz1KFh; Wed, 26 Feb 2025 16:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QGhrTR001509; Wed, 26 Feb 2025 16:43:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QGhrBq001506; Wed, 26 Feb 2025 16:43:53 GMT (envelope-from git) Date: Wed, 26 Feb 2025 16:43:53 GMT Message-Id: <202502261643.51QGhrBq001506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: f931a32bcaf3 - stable/13 - openssh: Fix blacklistd sshd-session integration List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f931a32bcaf3f86581d2dbe46f7809eb47d1b167 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=f931a32bcaf3f86581d2dbe46f7809eb47d1b167 commit f931a32bcaf3f86581d2dbe46f7809eb47d1b167 Author: Jose Luis Duran AuthorDate: 2025-02-24 14:38:52 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-26 16:42:45 +0000 openssh: Fix blacklistd sshd-session integration In version 9.8, the server was split into a listener binary, sshd(8), and a per-session binary "sshd-session". Our blacklistd changes also have to be moved from sshd.c to sshd-session.c. Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49116 (cherry picked from commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16) (cherry picked from commit 707ac59c2b31bdf3a593bc545d2fe233598cb97c) --- crypto/openssh/sshd-session.c | 3 +++ crypto/openssh/sshd.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 3092cd91242e..ee983176d3aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -109,6 +109,7 @@ #include "sk-api.h" #include "srclimit.h" #include "dh.h" +#include "blacklist_client.h" /* Re-exec fds */ #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) @@ -1316,6 +1317,8 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); + BLACKLIST_INIT(); + if (privsep_preauth(ssh) == 1) goto authenticated; diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 68e48d75369a..fd48835ebd2a 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -101,7 +101,6 @@ #include "sk-api.h" #include "addr.h" #include "srclimit.h" -#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -1876,9 +1875,6 @@ main(int ac, char **av) } #endif #endif - - - BLACKLIST_INIT(); } /* server specific fatal cleanup */ From nobody Wed Feb 26 17:52:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z329b1tg2z52mpl; Wed, 26 Feb 2025 17:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z329b1F2vz3mNv; Wed, 26 Feb 2025 17:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740592339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=phmDoqWI/VEBeVZO3CddIflEx+mz1V4Mt9dWBoh3c4c=; b=feT8rVnU3AfGEtyOS1pZ7vYmWamt8htvgG9a/70OSPbSoawvxr1nCPAqfmgGO+i1Kz8QMD sPrx3nIQ/NszexEKalgInO1Dg0+lKeLlJRxI5xlEHBD751FsxW8Kz8v0y6aKtxjP2UL7vH MJZSUsqUinDwgHc2H3qwlDKTigqg4dZv8bPnedr6VcxNVbm3EsWonyBQWK0chB5IDEh0vk zaD6ZjiknPUz/k2m0wBfOChnDQBUL/LG1pihbu5+wAFmTu+/ZQmkLe3KS22wzRuXl81xFf 5i4XhsIUFq4uY9sVTGX8T/32W7HvdLdNUHr/N7pjzNc4bM/g4DIYdh0vh5ZZRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740592339; a=rsa-sha256; cv=none; b=Qa8tv8FXI/w/VgpU3B/TUodeIzKxl2b5gn784pqSDlhSnp6lhzvOSItyzfsWUYVvfuV6TP odrj9hA2fG6LVBUcKrKlM62X8OJAXCSj9WG/lHtL/zT7dOMnpuF+iugT3aOwhesQ48xvl5 jDWP7yRBXS3/I2OPp0eNVW6M+EWKA4opx1Cb0SEAhFb7vzuvKNycEimeH8DWVjEPkkSAPU Bq+F/BlOyKQY7ptqQrgLlRLI7/g5qxRtpdIEFtj5ClBHXH+h7DYkeOIaN848BE5O4kjs49 PFdHXS6NXNqraoDfbjI+hkXVYnW32ZbHFssygkQ+HazUvXgBa8LZ0cot1DzABg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740592339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=phmDoqWI/VEBeVZO3CddIflEx+mz1V4Mt9dWBoh3c4c=; b=Ro6Leu6nGPKfmFq3M6Qe01+pjodMETatzvBDy/xwfaWy66vEiEN2R4AU6u476aI5h0wb6x BCzkAHP6HxM417HKdhhKd+BemQ3sGpCTWFMfgibMb0WOwhYDIFXHfHXNfAgqC/NmpNCYYH rJ0zZC2ZlkfzEfzG7Yu5T1jopoOgvabEOk9j480V1TIp0RVgQayGBNLBr7CHnU5rhaHyCm pNOuz4fxIJnXwcNGyZXpsxfOqLbTAKu4Oddij3eOnZPqaYkwwBXUun9Dme0d9wG+UnjIX8 XTx79dPutv0JKYyXm62Uh/mB6KsmG8PNQ/eHvCCXAasNFyMMGHFfOEpcDy6OSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z329b0bWSz1M21; Wed, 26 Feb 2025 17:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QHqI98031052; Wed, 26 Feb 2025 17:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QHqIli031049; Wed, 26 Feb 2025 17:52:18 GMT (envelope-from git) Date: Wed, 26 Feb 2025 17:52:18 GMT Message-Id: <202502261752.51QHqIli031049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: e8043c76e378 - releng/13.5 - openssh: Fix blacklistd sshd-session integration List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: e8043c76e3788c555f633a0de6395a4d10ea375b Auto-Submitted: auto-generated The branch releng/13.5 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=e8043c76e3788c555f633a0de6395a4d10ea375b commit e8043c76e3788c555f633a0de6395a4d10ea375b Author: Jose Luis Duran AuthorDate: 2025-02-24 14:38:52 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-26 17:16:16 +0000 openssh: Fix blacklistd sshd-session integration In version 9.8, the server was split into a listener binary, sshd(8), and a per-session binary "sshd-session". Our blacklistd changes also have to be moved from sshd.c to sshd-session.c. Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49116 (cherry picked from commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16) (cherry picked from commit 707ac59c2b31bdf3a593bc545d2fe233598cb97c) (cherry picked from commit f931a32bcaf3f86581d2dbe46f7809eb47d1b167) Approved by: re (cperciva) --- crypto/openssh/sshd-session.c | 3 +++ crypto/openssh/sshd.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 3092cd91242e..ee983176d3aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -109,6 +109,7 @@ #include "sk-api.h" #include "srclimit.h" #include "dh.h" +#include "blacklist_client.h" /* Re-exec fds */ #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) @@ -1316,6 +1317,8 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); + BLACKLIST_INIT(); + if (privsep_preauth(ssh) == 1) goto authenticated; diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 68e48d75369a..fd48835ebd2a 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -101,7 +101,6 @@ #include "sk-api.h" #include "addr.h" #include "srclimit.h" -#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -1876,9 +1875,6 @@ main(int ac, char **av) } #endif #endif - - - BLACKLIST_INIT(); } /* server specific fatal cleanup */ From nobody Wed Feb 26 19:31:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34N72McRz5nksH; Wed, 26 Feb 2025 19:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34N70BdKz3d7s; Wed, 26 Feb 2025 19:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qrjqs0GK5S0UB3sAWRqkA7IX9+QG2ZQoC5SlYqZh2F4=; b=SQX52ir+aNr1ZI1EyXsGorjEmXT6VPYsHywQbj3GBzl+nNp4ZPy9tMpvy7KjCF+BUJo6jP 6afcbETPqactEZdEZrnqf5sLRVVNszaSaqw5ICpFvJ5umSzJdrYw8SqslSNsyiijmNeq0h u6UyoQ6rHH7RzscVblZt1uHuP0cAPKwZWwGK0t0fLYjpQ/4eOGl5hJsdbxs92CVXZ8K6Hw aveS6GaYoInwYs6HwrgTZS49L3D6ssTN4gdIrMhNbHEYro4jt7wNK7k0VTgsGPSA/1d7rs N8v/GEh0cWs+8MtoKMrQ3m8AqS5nA5CnWD3+KK6klfPkZ4AGaE/bd7zsED7B/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598295; a=rsa-sha256; cv=none; b=G3qeCQSrERdDOHgGiY0J0kk9uCQnMj39OzG27p+QLVLQikylvaq+s/1RFoOp3HKG4EeyEW 3K4i2C8N0nDlXDwqreQjdI5n20Dm3nGPVp1Wl9pJzNgfX3QNB4VooVXY/UYGyfgryemnCi vW6EVD7J+2BlKAQUoWcofwHeyY/MiBg7eIabNHknYx8Hk1sJYtItKZ3H2vGEDQhMffMnS9 9OMTuhZpn3HNg/knPFTZp+ucrlix1q0N51YezJEQRT2rjg/wkuaxxPtqUXUKjOykvUJXER cBN6K9nJWJN457e9SwraJlcdMOVC7is0ExLw0AmHhuiTV3mw9C4S8Fb5umRpEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qrjqs0GK5S0UB3sAWRqkA7IX9+QG2ZQoC5SlYqZh2F4=; b=U1bXqI6198QgKzAGE/xVnRi60EWPBcdnnvuc0rWba7Aaeq7rYZSKwaDOoELTAb1OksLOD6 EFufM9TD7nPpyLrWzRze1RvVX6mJKjGmglJWBEBmP5Sxacu7nwoVrZScvjcMEpLREQEGwh nhbHq/+yUpxLogfeUhRIoH2ZU3yqblptqoY0gZvKYZqs2+x95rn/A4RN20nE5/UaWV+0M2 /tDRx1bWLG4gdwJyJ2eOXTys0VgGh+kSu1/8COITaXgCowsr4/b1b53jCylMyOmmO9eHD6 0ySC9kVTkH7DLeu+cAgPvJvgUBne5vnEe4h+anZNgZniLan0adv+zwBhq5kmhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34N66pBBz1PYg; Wed, 26 Feb 2025 19:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVY08017475; Wed, 26 Feb 2025 19:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVYXM017472; Wed, 26 Feb 2025 19:31:34 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:34 GMT Message-Id: <202502261931.51QJVYXM017472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 38075f7d5c87 - main - net80211: remove direct use of ni->ni_txrate, add indirection methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38075f7d5c87176f7b317c368712444a2f450a5e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=38075f7d5c87176f7b317c368712444a2f450a5e commit 38075f7d5c87176f7b317c368712444a2f450a5e Author: Adrian Chadd AuthorDate: 2025-01-02 03:52:25 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:29:09 +0000 net80211: remove direct use of ni->ni_txrate, add indirection methods The summary: * Refactor ni_txrate access into ieee80211_node_get_txrate_dot11rate() and ieee80211_node_set_txrate_dot11rate(). These wrap the ni->ni_txrate access and will eventually be able to do runtime sanity checks and fallback where necessary. * Refactor ieee80211_node_get_txrate_kbit() from the ioctl code which sets isi_txmbps (which is in 0.5Mbit/s units.) This new routine returns the TX rate in kbit/s units. * Also use ieee80211_node_get_txrate_kbit() in various places in the code where the dot11rate was turned into a Mbit/sec value, which was very wrong for HT (but also only used for logging, so it didn't have an effect on normal runtime.) * Mb -> Mbit/s The long version: The current ni->ni_txrate value is what net80211's phy code calls a 'dot11rate'. Inside the ieee80211_phy.c tables you'll find a bunch of tables which represent: * for legacy rates its in 1/2 mbit units. * for turbo (Atheros 40MHz OFDM) it's the non-turbo rates, but the turbo rate speed in kbit/sec. * for 802.11n rates its the MCS, starting at 0x80. However there are a couple of catches with this: * Basic rates are represented in the pre-11n rates using the high bit (IEEE80211_RATE_BASIC) * 11n rates are also represented using the high bit (IEEE80211_RATE_MCS) Now, ni->ni_txrate will clear the IEEE80211_RATE_BASIC flag before storing it, so if the high bit exists it must be an 802.11n rate. However, there's still a bunch of code everywhere that purposefully filters that out. The goals of this commit: * Provide an easy API to migrate existing drivers and other consumers to - ieee80211_node_get_txrate_dot11rate() is defined as "will return the normal legacy or HT rate" so all the existing code can work. * Lay the ground work for extending ni_txrate (and a rate representation in general) that can represent legacy, HT, VHT, EHT, HE, etc rates. * Create a central place where ni_txrate is updated from rate control, drivers that will update ni_txrate itself, and consumers, so we can provide some basic runtime checks / logging as VHT, EHT, HE, etc rates are eventually added. For example, a VHT driver will eventually receive VHT rates, but an existing HT driver will not, so the API should log and return a sensible default when something like a VHT rate shows up on a HT only device. The rate control code currently returns a rix, and sets ni_txrate to the dot11rate. Drivers can choose either. However, choosing the rix is risky because you need to know if it's the ni_rates or ni_htrates, which requires a lot of duplicate work that lines up consistently at all layers (see the AMRR code for an example.) Differential Revision: https://reviews.freebsd.org/D48601 Reviewed by: bz, thj --- sys/net80211/ieee80211.c | 2 +- sys/net80211/ieee80211_adhoc.c | 5 ++- sys/net80211/ieee80211_amrr.c | 14 +++++--- sys/net80211/ieee80211_hostap.c | 7 ++-- sys/net80211/ieee80211_ioctl.c | 20 ++--------- sys/net80211/ieee80211_mesh.c | 2 +- sys/net80211/ieee80211_node.c | 65 +++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_node.h | 6 ++++ sys/net80211/ieee80211_ratectl_none.c | 6 ++-- sys/net80211/ieee80211_rssadapt.c | 16 +++++---- sys/net80211/ieee80211_scan_sta.c | 2 +- sys/net80211/ieee80211_sta.c | 7 ++-- sys/net80211/ieee80211_superg.c | 10 +++--- 13 files changed, 112 insertions(+), 50 deletions(-) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 49d313e5077d..eb796462d3d1 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -2306,7 +2306,7 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr) * In station mode report the current transmit rate. */ imr->ifm_active |= ieee80211_rate2media(ic, - vap->iv_bss->ni_txrate, mode); + ieee80211_node_get_txrate_dot11rate(vap->iv_bss), mode); } else imr->ifm_active |= IFM_AUTO; if (imr->ifm_status & IFM_ACTIVE) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index d252b75899a2..77e5a2d99904 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -235,10 +235,9 @@ adhoc_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ether_sprintf(ni->ni_bssid)); ieee80211_print_essid(vap->iv_bss->ni_essid, ni->ni_esslen); - /* XXX MCS/HT */ - printf(" channel %d start %uMb\n", + printf(" channel %d start %uMbit/s\n", ieee80211_chan2ieee(ic, ic->ic_curchan), - IEEE80211_RATE2MBS(ni->ni_txrate)); + ieee80211_node_get_txrate_kbit(ni) / 1000); } #endif break; diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index 386a3de92a74..d366bf71e367 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -207,7 +207,7 @@ amrr_node_init(struct ieee80211_node *ni) rate |= IEEE80211_RATE_MCS; /* Assign initial rate from the rateset */ - ni->ni_txrate = rate; + ieee80211_node_set_txrate_dot11rate(ni, rate); amn->amn_ticks = ticks; /* XXX TODO: we really need a rate-to-string method */ @@ -321,7 +321,8 @@ amrr_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) /* XXX should return -1 here, but drivers may not expect this... */ if (!amn) { - ni->ni_txrate = ni->ni_rates.rs_rates[0]; + ieee80211_node_set_txrate_dot11rate(ni, + ni->ni_rates.rs_rates[0]); return 0; } @@ -338,13 +339,16 @@ amrr_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) if (is_enough(amn) && (ticks - amn->amn_ticks) > amrr->amrr_interval) { rix = amrr_update(amrr, amn, ni); if (rix != amn->amn_rix) { + uint8_t dot11Rate; /* update public rate */ - ni->ni_txrate = rs->rs_rates[rix]; + dot11Rate = rs->rs_rates[rix]; /* XXX strip basic rate flag from txrate, if non-11n */ if (ieee80211_ht_check_tx_ht(ni)) - ni->ni_txrate |= IEEE80211_RATE_MCS; + dot11Rate |= IEEE80211_RATE_MCS; else - ni->ni_txrate &= IEEE80211_RATE_VAL; + dot11Rate &= IEEE80211_RATE_VAL; + ieee80211_node_set_txrate_dot11rate(ni, dot11Rate); + amn->amn_rix = rix; } amn->amn_ticks = ticks; diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 1dce9a6b5923..76c419f5bdf8 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -63,8 +63,6 @@ #include #include /* for parse_wmeie */ -#define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) - static void hostap_vattach(struct ieee80211vap *); static int hostap_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int hostap_input(struct ieee80211_node *ni, struct mbuf *m, @@ -311,10 +309,9 @@ hostap_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ether_sprintf(ni->ni_bssid)); ieee80211_print_essid(ni->ni_essid, ni->ni_esslen); - /* XXX MCS/HT */ - printf(" channel %d start %uMb\n", + printf(" channel %d start %uMbit/s\n", ieee80211_chan2ieee(ic, ic->ic_curchan), - IEEE80211_RATE2MBS(ni->ni_txrate)); + ieee80211_node_get_txrate_kbit(ni) / 1000); } #endif break; diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 3b57e7d8cd8e..24ec9659dc2d 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -406,23 +406,9 @@ get_sta_info(void *arg, struct ieee80211_node *ni) if (si->isi_nrates > 15) si->isi_nrates = 15; memcpy(si->isi_rates, ni->ni_rates.rs_rates, si->isi_nrates); - si->isi_txrate = ni->ni_txrate; - if (si->isi_txrate & IEEE80211_RATE_MCS) { - const struct ieee80211_mcs_rates *mcs = - &ieee80211_htrates[ni->ni_txrate &~ IEEE80211_RATE_MCS]; - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { - if (ni->ni_flags & IEEE80211_NODE_SGI40) - si->isi_txmbps = mcs->ht40_rate_800ns; - else - si->isi_txmbps = mcs->ht40_rate_400ns; - } else { - if (ni->ni_flags & IEEE80211_NODE_SGI20) - si->isi_txmbps = mcs->ht20_rate_800ns; - else - si->isi_txmbps = mcs->ht20_rate_400ns; - } - } else - si->isi_txmbps = si->isi_txrate; + si->isi_txrate = ieee80211_node_get_txrate_dot11rate(ni); + /* Note: txmbps is in 1/2Mbit/s units */ + si->isi_txmbps = ieee80211_node_get_txrate_kbit(ni) / 500; si->isi_associd = ni->ni_associd; si->isi_txpower = ni->ni_txpower; si->isi_vlan = ni->ni_vlan; diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index c52122ebeb13..9f81bc3643aa 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -3298,7 +3298,7 @@ mesh_airtime_calc(struct ieee80211_node *ni) uint64_t res; /* Time to transmit a frame */ - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); overhead = ieee80211_compute_duration(ic->ic_rt, ifp->if_mtu + IEEE80211_MESH_MAXOVERHEAD, rate, 0) << M_BITS; /* Error rate in percentage */ diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index f2fc3d21a361..f5b05ed769c9 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3137,3 +3137,68 @@ ieee80211_getsignal(struct ieee80211vap *vap, int8_t *rssi, int8_t *noise) if (vap->iv_opmode != IEEE80211_M_STA) *rssi = ieee80211_getrssi(vap); } + +uint8_t +ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *ni) +{ + return (ni->ni_txrate); +} + +void +ieee80211_node_set_txrate_dot11rate(struct ieee80211_node *ni, + uint8_t dot11Rate) +{ + ni->ni_txrate = dot11Rate; +} + +void +ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *ni, + uint8_t mcs) +{ + KASSERT(mcs <= 76, ("%s: MCS is not 0..76 (%d)", __func__, mcs)); + if (mcs > 76) { + ic_printf(ni->ni_ic, "%s: invalid MCS (%d)\n", __func__, mcs); + return; + } + ni->ni_txrate = IEEE80211_RATE_MCS | mcs; +} + + +/* + * @brief Fetch the transmit rate for the given node in kbit/s. + * + * This currently only works for CCK, OFDM and HT rates. + * + * @param ni struct ieee80211_node * to lookup + * @returns current transmit rate in kbit/s + */ +uint32_t +ieee80211_node_get_txrate_kbit(struct ieee80211_node *ni) +{ + uint32_t mbps; + + if (ni->ni_txrate & IEEE80211_RATE_MCS) { + const struct ieee80211_mcs_rates *mcs = + &ieee80211_htrates[ni->ni_txrate & ~IEEE80211_RATE_MCS]; + + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + /* Note: these are in 1/2Mbit/s units */ + if (ni->ni_flags & IEEE80211_NODE_SGI40) + mbps = mcs->ht40_rate_800ns; + else + mbps = mcs->ht40_rate_400ns; + } else { + if (ni->ni_flags & IEEE80211_NODE_SGI20) + mbps = mcs->ht20_rate_800ns; + else + mbps = mcs->ht20_rate_400ns; + } + } else + /* Note: CCK/OFDM dot11rate entries are in 1/2Mbit/s units */ + mbps = ni->ni_txrate; + + /* + * Note; 'mbps' in 1/2 Mbit/s units so *500 to make it in kbit/s units. + */ + return (mbps * 500); +} diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 0039c743544c..722f3d54a00b 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -498,4 +498,10 @@ void ieee80211_node_join(struct ieee80211_node *,int); void ieee80211_node_leave(struct ieee80211_node *); int8_t ieee80211_getrssi(struct ieee80211vap *); void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *); + +uint8_t ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *); +void ieee80211_node_set_txrate_dot11rate(struct ieee80211_node *, uint8_t); +void ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *, uint8_t); +uint32_t ieee80211_node_get_txrate_kbit(struct ieee80211_node *); + #endif /* _NET80211_IEEE80211_NODE_H_ */ diff --git a/sys/net80211/ieee80211_ratectl_none.c b/sys/net80211/ieee80211_ratectl_none.c index 4ab122fbab92..47f88cbd3a79 100644 --- a/sys/net80211/ieee80211_ratectl_none.c +++ b/sys/net80211/ieee80211_ratectl_none.c @@ -62,7 +62,8 @@ none_deinit(struct ieee80211vap *vap) static void none_node_init(struct ieee80211_node *ni) { - ni->ni_txrate = ni->ni_rates.rs_rates[0] & IEEE80211_RATE_VAL; + ieee80211_node_set_txrate_dot11rate(ni, + ni->ni_rates.rs_rates[0] & IEEE80211_RATE_VAL); } static void @@ -75,7 +76,8 @@ none_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) { int rix = 0; - ni->ni_txrate = ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL; + ieee80211_node_set_txrate_dot11rate(ni, + ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL); return rix; } diff --git a/sys/net80211/ieee80211_rssadapt.c b/sys/net80211/ieee80211_rssadapt.c index 6c77727d7526..43118aad53c3 100644 --- a/sys/net80211/ieee80211_rssadapt.c +++ b/sys/net80211/ieee80211_rssadapt.c @@ -203,11 +203,13 @@ rssadapt_node_init(struct ieee80211_node *ni) ra->ra_rix > 0 && (rs->rs_rates[ra->ra_rix] & IEEE80211_RATE_VAL) > 72; ra->ra_rix--) ; - ni->ni_txrate = rs->rs_rates[ra->ra_rix] & IEEE80211_RATE_VAL; + ieee80211_node_set_txrate_dot11rate(ni, + rs->rs_rates[ra->ra_rix] & IEEE80211_RATE_VAL); ra->ra_ticks = ticks; IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "RSSADAPT initial rate %d", ni->ni_txrate); + "RSSADAPT initial rate %d Mbit/s", + ieee80211_node_get_txrate_kbit(ni) / 1000); } static void @@ -244,7 +246,8 @@ rssadapt_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg) /* XXX should return -1 here, but drivers may not expect this... */ if (!ra) { - ni->ni_txrate = ni->ni_rates.rs_rates[0]; + ieee80211_node_set_txrate_dot11rate(ni, + ni->ni_rates.rs_rates[0]); return 0; } @@ -263,12 +266,13 @@ rssadapt_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg) break; if (rix != ra->ra_rix) { /* update public rate */ - ni->ni_txrate = ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL; + ieee80211_node_set_txrate_dot11rate(ni, + ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL); ra->ra_rix = rix; IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "RSSADAPT new rate %d (pktlen %d rssi %d)", - ni->ni_txrate, pktlen, rssi); + "RSSADAPT new rate %d Mbit/s (pktlen %d rssi %d)", + ieee80211_node_get_txrate_kbit(ni) / 1000, pktlen, rssi); } return rix; } diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index a8159fca6d80..69347a5d99cf 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -1365,7 +1365,7 @@ sta_roam_check(struct ieee80211_scan_state *ss, struct ieee80211vap *vap) /* NB: the most up to date rssi is in the node, not the scan cache */ curRssi = ic->ic_node_getrssi(ni); if (ucastRate == IEEE80211_FIXED_RATE_NONE) { - curRate = ni->ni_txrate; + curRate = ieee80211_node_get_txrate_dot11rate(ni); IEEE80211_DPRINTF(vap, IEEE80211_MSG_ROAM, "%s: currssi %d currate %u roamrssi %d roamrate %u\n", __func__, curRssi, curRate, roamRssi, roamRate); diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 9e4e1013fd2f..96603f339710 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -64,8 +64,6 @@ #include #include -#define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) - static void sta_vattach(struct ieee80211vap *); static void sta_beacon_miss(struct ieee80211vap *); static int sta_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -417,10 +415,9 @@ sta_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ether_sprintf(ni->ni_bssid)); ieee80211_print_essid(vap->iv_bss->ni_essid, ni->ni_esslen); - /* XXX MCS/HT */ - printf(" channel %d start %uMb\n", + printf(" channel %d start %uMbit/s\n", ieee80211_chan2ieee(ic, ic->ic_curchan), - IEEE80211_RATE2MBS(ni->ni_txrate)); + ieee80211_node_get_txrate_kbit(ni) / 1000); } #endif ieee80211_scan_assoc_success(vap, ni->ni_macaddr); diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c index 815fb356891c..ee3b70d5ed9f 100644 --- a/sys/net80211/ieee80211_superg.c +++ b/sys/net80211/ieee80211_superg.c @@ -725,6 +725,7 @@ ff_approx_txtime(struct ieee80211_node *ni, struct ieee80211vap *vap = ni->ni_vap; uint32_t framelen; uint32_t frame_time; + uint8_t dot11rate; /* * Approximate the frame length to be transmitted. A swag to add @@ -746,15 +747,16 @@ ff_approx_txtime(struct ieee80211_node *ni, * For now, we assume non-shortgi, 20MHz, just because I want to * at least test 802.11n. */ - if (ni->ni_txrate & IEEE80211_RATE_MCS) + dot11rate = ieee80211_node_get_txrate_dot11rate(ni); + if (dot11rate & IEEE80211_RATE_MCS) frame_time = ieee80211_compute_duration_ht(framelen, - ni->ni_txrate, - IEEE80211_HT_RC_2_STREAMS(ni->ni_txrate), + dot11rate, + IEEE80211_HT_RC_2_STREAMS(dot11rate), 0, /* isht40 */ 0); /* isshortgi */ else frame_time = ieee80211_compute_duration(ic->ic_rt, framelen, - ni->ni_txrate, 0); + dot11rate, 0); return (frame_time); } From nobody Wed Feb 26 19:31:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34N8430pz5nkpD; Wed, 26 Feb 2025 19:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34N80qKQz3dVT; Wed, 26 Feb 2025 19:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uofPAcPZP+v7cuqhZfb8rKlqEQA/M5C3D42M2LC/b1M=; b=fKJ8mxJxf3REBGEyOKHG8BYiymBhleKFhLRKFKPg5YggjyF/VNWN/1SBzwYXN1egRprGlk ZZwC/C5VeB8nafr4SchmMB78Pi1jgJyQXSPxZGpzaixCsCJq+8PStIOmKscoB7W5B08Li0 znwoJaFNCdnDvbk1FjFbMh9ST7Q4v4MYbvOjtDzl1r3D7DT6ad3zU45pefiYSPgZm/k8NZ 8L7i587ecTHWOHBa/lpz9wPOg4xaAkcbqIrZGUejeJ+Yco74XUJMwUikpFgVkBY2hDz7HS QkD2FagtR3ao+NuW886IUbZh+10RQxNZicdl5o9+SpmlmV6rXtkYB/vqCy6aVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598296; a=rsa-sha256; cv=none; b=TUZU9ESWBW/A0pmiLE+WQAUUunnXCO27vraQi14bEoeIaRzaSW3KCCWxNkJuSRkVDyr2lf 8oXVN/m+PHSdjsIOV6/42NZFjmzBVBHM6C7p3qA4w4N94K+kL2LNq5uUPOx9Ki2m/4yEnL Up8pn0C/WZrX1dJ5/vkUUW1PUDSIlFmZC6uE+Po9zoqrbbcs9ECAE7KvTMRc0Kl1w6OpRH 4/C3W6rBDVzOyeARzTbl5bYaZd24sT89SCCC1sj0ujAmL2rP+K744N6F6ajKCPEH0R+VRz qm1mGa9R0FtSlmcYAlma5P00Nf0+ImucZDL9xk9pRyrA2e5IaP/F+VBMjZmJ9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uofPAcPZP+v7cuqhZfb8rKlqEQA/M5C3D42M2LC/b1M=; b=S2IqMivRHfe/AQLE8sVNcrwGf7CWZk+Si8KVz6p91j3p151GqlBIwi9wSQubbsYEa/KbBW yGbHYYusI0mY0GX0qQHiuydQZuRly2Pn10k3fJqQbkreoJW8QvlmCjviJa+LQOUsPlGYpI 60JcBIejpZq56XyYAIsjmdA0lDt8FzK/ttHG3SvU+7lvA859nim5ESpPNaVssiacPRaX5+ bNLu1e6QJGORR8dmrL+S/XFcBJUh8uk4eXsNU8eqS0p8WuVHfYytSB7vSTTng/EBYj/tef VxGoL4ucZouzOC6mzh9x2nsnv9cO22K/4j1eE9pcwPsccazStWJgaHQ6asLVOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34N80PyWz1PTw; Wed, 26 Feb 2025 19:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVaw8017512; Wed, 26 Feb 2025 19:31:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVZKf017509; Wed, 26 Feb 2025 19:31:35 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:35 GMT Message-Id: <202502261931.51QJVZKf017509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 706745001093 - main - sys: convert ni->ni_txrate references use to the new net80211 API List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7067450010931479f8dd97e51e4c5bf6a4d34c7e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=7067450010931479f8dd97e51e4c5bf6a4d34c7e commit 7067450010931479f8dd97e51e4c5bf6a4d34c7e Author: Adrian Chadd AuthorDate: 2025-01-02 04:35:24 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:29:18 +0000 sys: convert ni->ni_txrate references use to the new net80211 API This just mechanically converts things. * For linuxkpi, it was just used for display. * For uath, it was just used for display, as firmware doesn't report it up. Differential Revision: https://reviews.freebsd.org/D48602 Reviewed by: bz, thj --- sys/compat/linuxkpi/common/src/linux_80211.c | 6 ++++-- sys/dev/ath/ath_rate/amrr/amrr.c | 7 +++++-- sys/dev/ath/ath_rate/onoe/onoe.c | 8 +++++--- sys/dev/ath/ath_rate/sample/sample.c | 15 ++++++++++----- sys/dev/bwi/if_bwi.c | 2 +- sys/dev/bwn/if_bwn.c | 2 +- sys/dev/ipw/if_ipw.c | 4 ++-- sys/dev/iwi/if_iwi.c | 4 ++-- sys/dev/iwm/if_iwm.c | 8 +++++--- sys/dev/iwn/if_iwn.c | 2 +- sys/dev/malo/if_malo.c | 2 +- sys/dev/mwl/if_mwl.c | 11 ++++++----- sys/dev/otus/if_otus.c | 9 ++++++--- sys/dev/ral/rt2560.c | 4 ++-- sys/dev/ral/rt2661.c | 4 ++-- sys/dev/ral/rt2860.c | 2 +- sys/dev/rtwn/if_rtwn_tx.c | 2 +- sys/dev/usb/wlan/if_mtw.c | 10 ++++++---- sys/dev/usb/wlan/if_rsu.c | 3 ++- sys/dev/usb/wlan/if_rum.c | 2 +- sys/dev/usb/wlan/if_run.c | 7 +++++-- sys/dev/usb/wlan/if_uath.c | 3 ++- sys/dev/usb/wlan/if_ural.c | 2 +- sys/dev/usb/wlan/if_zyd.c | 2 +- sys/dev/wpi/if_wpi.c | 2 +- sys/dev/wtap/if_wtap.c | 5 ++--- 26 files changed, 76 insertions(+), 52 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 894d0db39677..72227378b097 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6925,7 +6925,8 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, #ifdef LINUXKPI_DEBUG_80211 int old_rate; - old_rate = ni->ni_vap->iv_bss->ni_txrate; + old_rate = + ieee80211_node_get_txrate_dot11rate(ni->ni_vap->iv_bss); #endif txs.pktlen = skb->len; txs.flags |= IEEE80211_RATECTL_STATUS_PKTLEN; @@ -6951,7 +6952,8 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, if (linuxkpi_debug_80211 & D80211_TRACE_TX) { printf("TX-RATE: %s: old %d new %d ridx %d, " "long_retries %d\n", __func__, - old_rate, ni->ni_vap->iv_bss->ni_txrate, + old_rate, + ieee80211_node_get_txrate_dot11rate(ni->ni_vap->iv_bss), ridx, txs.long_retries); } #endif diff --git a/sys/dev/ath/ath_rate/amrr/amrr.c b/sys/dev/ath/ath_rate/amrr/amrr.c index 81bd03484de5..8f696eba23eb 100644 --- a/sys/dev/ath/ath_rate/amrr/amrr.c +++ b/sys/dev/ath/ath_rate/amrr/amrr.c @@ -245,8 +245,11 @@ ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate) * lowest hardware rate. */ if (ni->ni_rates.rs_nrates > 0) { - ni->ni_txrate = ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL; - amn->amn_tx_rix0 = sc->sc_rixmap[ni->ni_txrate]; + uint8_t dot11rate; + + dot11rate = ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL; + amn->amn_tx_rix0 = sc->sc_rixmap[dot11rate]; + ieee80211_node_set_txrate_dot11rate(ni, dot11rate); amn->amn_tx_rate0 = rt->info[amn->amn_tx_rix0].rateCode; amn->amn_tx_rate0sp = amn->amn_tx_rate0 | rt->info[amn->amn_tx_rix0].shortPreamble; diff --git a/sys/dev/ath/ath_rate/onoe/onoe.c b/sys/dev/ath/ath_rate/onoe/onoe.c index 8d86f13ef703..035d54b00b62 100644 --- a/sys/dev/ath/ath_rate/onoe/onoe.c +++ b/sys/dev/ath/ath_rate/onoe/onoe.c @@ -203,6 +203,7 @@ ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate) struct ieee80211vap *vap = ni->ni_vap; const HAL_RATE_TABLE *rt = sc->sc_currates; u_int8_t rix; + uint8_t dot11rate; KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); @@ -221,8 +222,9 @@ ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate) if (ni->ni_rates.rs_nrates == 0) goto done; on->on_rix = rate; - ni->ni_txrate = ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL; - on->on_tx_rix0 = sc->sc_rixmap[ni->ni_txrate]; + dot11rate = ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL; + ieee80211_node_set_txrate_dot11rate(ni, dot11rate); + on->on_tx_rix0 = sc->sc_rixmap[dot11rate]; on->on_tx_rate0 = rt->info[on->on_tx_rix0].rateCode; on->on_tx_rate0sp = on->on_tx_rate0 | @@ -389,7 +391,7 @@ ath_rate_ctl(void *arg, struct ieee80211_node *ni) if (nrate != on->on_rix) { IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "%s: %dM -> %dM (%d ok, %d err, %d retr)", __func__, - ni->ni_txrate / 2, + ieee80211_node_get_txrate_kbit(ni) / 1000, (rs->rs_rates[nrate] & IEEE80211_RATE_VAL) / 2, on->on_tx_ok, on->on_tx_err, on->on_tx_retr); ath_rate_update(sc, ni, nrate); diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c index 58df9ad1c1cd..8fba3c68099f 100644 --- a/sys/dev/ath/ath_rate/sample/sample.c +++ b/sys/dev/ath/ath_rate/sample/sample.c @@ -855,9 +855,13 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, /* * Set the visible txrate for this node. */ - an->an_node.ni_txrate = - (rt->info[best_rix].phy == IEEE80211_T_HT) ? - MCS(best_rix) : DOT11RATE(best_rix); + if (rt->info[best_rix].phy == IEEE80211_T_HT) + ieee80211_node_set_txrate_ht_mcsrate( + &an->an_node, MCS(best_rix)); + else + ieee80211_node_set_txrate_dot11rate( + &an->an_node, + DOT11RATE(best_rix)); } rix = sn->current_rix[size_bin]; sn->packets_since_switch[size_bin]++; @@ -1409,9 +1413,10 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni) #endif /* set the visible bit-rate */ if (sn->static_rix != -1) - ni->ni_txrate = DOT11RATE(sn->static_rix); + ieee80211_node_set_txrate_dot11rate(ni, + DOT11RATE(sn->static_rix)); else - ni->ni_txrate = RATE(0); + ieee80211_node_set_txrate_dot11rate(ni, RATE(0)); #undef RATE #undef DOT11RATE } diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index f9a6b2357cc0..079dac73ea43 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -2944,7 +2944,7 @@ bwi_encap(struct bwi_softc *sc, int idx, struct mbuf *m, rate = rate_fb = tp->ucastrate; } else { rix = ieee80211_ratectl_rate(ni, NULL, pkt_len); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); if (rix > 0) { rate_fb = ni->ni_rates.rs_rates[rix-1] & diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index 0f44c3c94672..571482afda70 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -6421,7 +6421,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struct ieee80211_node *ni, rate = rate_fb = tp->ucastrate; else { rix = ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); if (rix > 0) rate_fb = ni->ni_rates.rs_rates[rix - 1] & diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c index 68662f378933..01d713cdae18 100644 --- a/sys/dev/ipw/if_ipw.c +++ b/sys/dev/ipw/if_ipw.c @@ -838,8 +838,8 @@ ipw_media_status(if_t ifp, struct ifmediareq *imr) struct ipw_softc *sc = ic->ic_softc; /* read current transmission rate from adapter */ - vap->iv_bss->ni_txrate = ipw_cvtrate( - ipw_read_table1(sc, IPW_INFO_CURRENT_TX_RATE) & 0xf); + ieee80211_node_set_txrate_dot11rate(vap->iv_bss, + ipw_cvtrate(ipw_read_table1(sc, IPW_INFO_CURRENT_TX_RATE) & 0xf)); ieee80211_media_status(ifp, imr); } diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 4d71550f512e..3a410a5cbf2c 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -927,8 +927,8 @@ iwi_media_status(if_t ifp, struct ifmediareq *imr) /* read current transmission rate from adapter */ ni = ieee80211_ref_node(vap->iv_bss); - ni->ni_txrate = - iwi_cvtrate(CSR_READ_4(sc, IWI_CSR_CURRENT_TX_RATE)); + ieee80211_node_set_txrate_dot11rate(ni, + iwi_cvtrate(CSR_READ_4(sc, IWI_CSR_CURRENT_TX_RATE))); ieee80211_free_node(ni); ieee80211_media_status(ifp, imr); } diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 248bfd056580..bfe8c3635c7c 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -3445,7 +3445,7 @@ iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, struct ieee80211_node *ni = &in->in_ni; struct ieee80211vap *vap = ni->ni_vap; int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK; - int new_rate, cur_rate = vap->iv_bss->ni_txrate; + int new_rate, cur_rate; boolean_t rate_matched; uint8_t tx_resp_rate; @@ -3463,6 +3463,7 @@ iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, le32toh(tx_resp->initial_rate), (int) le16toh(tx_resp->wireless_media_time)); + cur_rate = ieee80211_node_get_txrate_dot11rate(vap->iv_bss); tx_resp_rate = iwm_rate_from_ucode_rate(le32toh(tx_resp->initial_rate)); /* For rate control, ignore frames sent at different initial rate */ @@ -3502,7 +3503,7 @@ iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, ieee80211_ratectl_tx_complete(ni, txs); int rix = ieee80211_ratectl_rate(vap->iv_bss, NULL, 0); - new_rate = vap->iv_bss->ni_txrate; + new_rate = ieee80211_node_get_txrate_dot11rate(vap->iv_bss); if (new_rate != 0 && new_rate != cur_rate) { struct iwm_node *in = IWM_NODE(vap->iv_bss); iwm_setrates(sc, in, rix); @@ -3695,7 +3696,8 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node *in, } else { /* for data frames, use RS table */ IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: DATA\n", __func__); - ridx = iwm_rate2ridx(sc, ni->ni_txrate); + ridx = iwm_rate2ridx(sc, + ieee80211_node_get_txrate_dot11rate(ni)); if (ridx == -1) ridx = 0; diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index b887ebf842e1..b7c452a4f074 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -4570,7 +4570,7 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) else { /* XXX pass pktlen */ (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } /* diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index 52419f377bb6..79a3213c6802 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -898,7 +898,7 @@ malo_updatetxrate(struct ieee80211_node *ni, int rix) static const int ieeerates[] = { 2, 4, 11, 22, 44, 12, 18, 24, 36, 48, 96, 108 }; if (rix < nitems(ieeerates)) - ni->ni_txrate = ieeerates[rix]; + ieee80211_node_set_txrate_dot11rate(ni, ieeerates[rix]); } static int diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index d0d13e576d31..2570cbce525b 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -3344,6 +3344,7 @@ mwl_tx_processq(struct mwl_softc *sc, struct mwl_txq *txq) ni = bf->bf_node; if (ni != NULL) { status = le32toh(ds->Status); + int rate; if (status & EAGLE_TXD_STATUS_OK) { uint16_t Format = le16toh(ds->Format); uint8_t txant = _IEEE80211_MASKSHIFT(Format, @@ -3356,14 +3357,14 @@ mwl_tx_processq(struct mwl_softc *sc, struct mwl_txq *txq) sc->sc_stats.mst_tx_mretries++; if (txq->qnum >= MWL_WME_AC_VO) ic->ic_wme.wme_hipri_traffic++; - ni->ni_txrate = _IEEE80211_MASKSHIFT(Format, + rate = _IEEE80211_MASKSHIFT(Format, EAGLE_TXD_RATE); if ((Format & EAGLE_TXD_FORMAT_HT) == 0) { - ni->ni_txrate = mwl_cvtlegacyrix( - ni->ni_txrate); + rate = mwl_cvtlegacyrix(rate); } else - ni->ni_txrate |= IEEE80211_RATE_MCS; - sc->sc_stats.mst_tx_rate = ni->ni_txrate; + rate |= IEEE80211_RATE_MCS; + sc->sc_stats.mst_tx_rate = rate; + ieee80211_node_set_txrate_dot11rate(ni, rate); } else { if (status & EAGLE_TXD_STATUS_FAILED_LINK_ERROR) sc->sc_stats.mst_tx_linkerror++; diff --git a/sys/dev/otus/if_otus.c b/sys/dev/otus/if_otus.c index a620a400bfd6..5919e75a59cf 100644 --- a/sys/dev/otus/if_otus.c +++ b/sys/dev/otus/if_otus.c @@ -2281,7 +2281,8 @@ otus_tx(struct otus_softc *sc, struct ieee80211_node *ni, struct mbuf *m, rate = otus_rate_to_hw_rate(sc, tp->ucastrate); else { (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = otus_rate_to_hw_rate(sc, ni->ni_txrate); + rate = otus_rate_to_hw_rate(sc, + ieee80211_node_get_txrate_dot11rate(ni)); } phyctl = 0; @@ -2346,9 +2347,11 @@ otus_tx(struct otus_softc *sc, struct ieee80211_node *ni, struct mbuf *m, data->m = m; OTUS_DPRINTF(sc, OTUS_DEBUG_XMIT, - "%s: tx: m=%p; data=%p; len=%d mac=0x%04x phy=0x%08x rate=0x%02x, ni_txrate=%d\n", + "%s: tx: m=%p; data=%p; len=%d mac=0x%04x phy=0x%08x " + "rate=0x%02x, dot11rate=%d\n", __func__, m, data, le16toh(head->len), macctl, phyctl, - (int) rate, (int) ni->ni_txrate); + (int) rate, + (int) ieee80211_node_get_txrate_dot11rate(ni)); /* Submit transfer */ STAILQ_INSERT_TAIL(&sc->sc_tx_pending[OTUS_BULK_TX], data, next); diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index aaae1245a9a1..09b01ea55be9 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -1740,7 +1740,7 @@ rt2560_tx_data(struct rt2560_softc *sc, struct mbuf *m0, rate = tp->ucastrate; } else { (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { @@ -1821,7 +1821,7 @@ rt2560_tx_data(struct rt2560_softc *sc, struct mbuf *m0, /* remember link conditions for rate adaptation algorithm */ if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) { - data->rix = ni->ni_txrate; + data->rix = ieee80211_node_get_txrate_dot11rate(ni); /* XXX probably need last rssi value and not avg */ data->rssi = ic->ic_node_getrssi(ni); } else diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index 4912e1106fa6..38cd99d899ed 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -1431,7 +1431,7 @@ rt2661_tx_data(struct rt2661_softc *sc, struct mbuf *m0, rate = tp->ucastrate; } else { (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } rate &= IEEE80211_RATE_VAL; @@ -1515,7 +1515,7 @@ rt2661_tx_data(struct rt2661_softc *sc, struct mbuf *m0, /* remember link conditions for rate adaptation algorithm */ if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) { - data->rix = ni->ni_txrate; + data->rix = ieee80211_node_get_txrate_dot11rate(ni); /* XXX probably need last rssi value and not avg */ data->rssi = ic->ic_node_getrssi(ni); } else diff --git a/sys/dev/ral/rt2860.c b/sys/dev/ral/rt2860.c index e928de084bcb..1449df683a93 100644 --- a/sys/dev/ral/rt2860.c +++ b/sys/dev/ral/rt2860.c @@ -1493,7 +1493,7 @@ rt2860_tx(struct rt2860_softc *sc, struct mbuf *m, struct ieee80211_node *ni) rate = tp->ucastrate; } else { (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } rate &= IEEE80211_RATE_VAL; diff --git a/sys/dev/rtwn/if_rtwn_tx.c b/sys/dev/rtwn/if_rtwn_tx.c index c59d1de1dea8..f355bc589143 100644 --- a/sys/dev/rtwn/if_rtwn_tx.c +++ b/sys/dev/rtwn/if_rtwn_tx.c @@ -143,7 +143,7 @@ rtwn_tx_data(struct rtwn_softc *sc, struct ieee80211_node *ni, if (sc->sc_ratectl == RTWN_RATECTL_NET80211) { /* XXX pass pktlen */ (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } else { if (ni->ni_flags & IEEE80211_NODE_HT) rate = IEEE80211_RATE_MCS | 0x4; /* MCS4 */ diff --git a/sys/dev/usb/wlan/if_mtw.c b/sys/dev/usb/wlan/if_mtw.c index 51398134ff9d..b42ed336d18e 100644 --- a/sys/dev/usb/wlan/if_mtw.c +++ b/sys/dev/usb/wlan/if_mtw.c @@ -2155,7 +2155,7 @@ mtw_iter_func(void *arg, struct ieee80211_node *ni) uint32_t sta[3]; uint16_t(*wstat)[3]; int error, ridx; - + uint8_t txrate = 0; /* Check for special case */ if (sc->rvp_cnt <= 1 && vap->iv_opmode == IEEE80211_M_STA && @@ -2208,11 +2208,13 @@ mtw_iter_func(void *arg, struct ieee80211_node *ni) ieee80211_ratectl_tx_update(vap, txs); ieee80211_ratectl_rate(ni, NULL, 0); + txrate = ieee80211_node_get_txrate_dot11rate(ni); + /* XXX TODO: methodize with MCS rates */ for (ridx = 0; ridx < MTW_RIDX_MAX; ridx++) { MTW_DPRINTF(sc, MTW_DEBUG_RATE, "ni_txrate=0x%x\n", - ni->ni_txrate); - if (rt2860_rates[ridx].rate == ni->ni_txrate) { + txrate); + if (rt2860_rates[ridx].rate == txrate) { break; } } @@ -2221,7 +2223,7 @@ fail: MTW_UNLOCK(sc); MTW_DPRINTF(sc, MTW_DEBUG_RATE, "rate=%d, ridx=%d\n", - ni->ni_txrate, rn->amrr_ridx); + txrate, rn->amrr_ridx); } static void diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c index c967435250ee..997a739562f6 100644 --- a/sys/dev/usb/wlan/if_rsu.c +++ b/sys/dev/usb/wlan/if_rsu.c @@ -1500,7 +1500,8 @@ rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) ni = ieee80211_ref_node(vap->iv_bss); rs = &ni->ni_rates; /* Indicate highest supported rate. */ - ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; + ieee80211_node_set_txrate_dot11rate(ni, + rs->rs_rates[rs->rs_nrates - 1]); (void) rsu_set_fw_power_state(sc, RSU_PWR_SLEEP); ieee80211_free_node(ni); startcal = 1; diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index fc83409543ec..48674d84ffe3 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -1646,7 +1646,7 @@ rum_tx_data(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) rate = tp->ucastrate; else { (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index e709ceff8849..81f4d172241f 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -2685,6 +2685,7 @@ run_iter_func(void *arg, struct ieee80211_node *ni) union run_stats sta[2]; uint16_t (*wstat)[3]; int error, ridx; + uint8_t dot11rate; RUN_LOCK(sc); @@ -2737,15 +2738,17 @@ run_iter_func(void *arg, struct ieee80211_node *ni) ieee80211_ratectl_tx_update(vap, txs); ieee80211_ratectl_rate(ni, NULL, 0); /* XXX TODO: methodize with MCS rates */ + dot11rate = ieee80211_node_get_txrate_dot11rate(ni); for (ridx = 0; ridx < RT2860_RIDX_MAX; ridx++) - if (rt2860_rates[ridx].rate == ni->ni_txrate) + if (rt2860_rates[ridx].rate == dot11rate) break; rn->amrr_ridx = ridx; fail: RUN_UNLOCK(sc); - RUN_DPRINTF(sc, RUN_DEBUG_RATE, "rate=%d, ridx=%d\n", ni->ni_txrate, rn->amrr_ridx); + RUN_DPRINTF(sc, RUN_DEBUG_RATE, "rate=0x%02x, ridx=%d\n", + ieee80211_node_get_txrate_dot11rate(ni), rn->amrr_ridx); } static void diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index 10e3b50eaeb3..e4493ba50a30 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -2058,7 +2058,8 @@ uath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) * Tx rate is controlled by firmware, report the maximum * negotiated rate in ifconfig output. */ - ni->ni_txrate = ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1]; + ieee80211_node_set_txrate_dot11rate(ni, + ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1]); if (uath_write_associd(sc) != 0) { device_printf(sc->sc_dev, diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c index 6e01592da44f..c47b8cbeb3ae 100644 --- a/sys/dev/usb/wlan/if_ural.c +++ b/sys/dev/usb/wlan/if_ural.c @@ -1227,7 +1227,7 @@ ural_tx_data(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) rate = tp->ucastrate; else { (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index 76e7d4312040..1815dc04cd09 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -2460,7 +2460,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) rate = tp->ucastrate; else { (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } } diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 11b8a749090d..471700ca9f5c 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -2821,7 +2821,7 @@ wpi_tx_data(struct wpi_softc *sc, struct mbuf *m, struct ieee80211_node *ni) else { /* XXX pass pktlen */ (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; + rate = ieee80211_node_get_txrate_dot11rate(ni); } /* Encrypt the frame if need be. */ diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c index f9e0c2a7e5c4..3aa3831e72c2 100644 --- a/sys/dev/wtap/if_wtap.c +++ b/sys/dev/wtap/if_wtap.c @@ -401,7 +401,7 @@ wtap_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], /* TODO this is a hack to force it to choose the rate we want */ ni = ieee80211_ref_node(vap->iv_bss); - ni->ni_txrate = 130; + ieee80211_node_set_txrate_ht_mcsrate(ni, 2); ieee80211_free_node(ni); return vap; } @@ -617,8 +617,7 @@ wtap_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) M_NOWAIT|M_ZERO); if (ni == NULL) return (NULL); - - ni->ni_txrate = 130; + ieee80211_node_set_txrate_ht_mcsrate(ni, 2); return ni; } From nobody Wed Feb 26 19:31:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34N94CxLz5nkpF; Wed, 26 Feb 2025 19:31:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34N92Jvlz3d5D; Wed, 26 Feb 2025 19:31:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LsSksQ71Y3HlsrbETlsU9vXGA7Xtq2YuMWurMeHrZxE=; b=nXpwwI0iNAeEyI5+Bml8ko4DaaKBZJP5uSbDcvYn33nUVyTSW8lQn1E5ey0+AVxbw4W/QT 7UjzGYYrJ3ecDGuWNT1+xeNxeZYC5DKEXSqhvCFskuKYwkPreW0wvLXYDLaJPyNFMwVaa0 rBRUS4gv4uYxbU5Z/KHiR8zIAnVovwYnB+mIUj7Ar9ahzMOIK3v7i+5E2iyUr3J6b5/pOE xKk6QI6y9NBg+BtAXDhxsquzGAfq+RZlVC/aP1iC/hDZQ4uLrQfpmOibNsqhsvIA5R1OmN kylBJiEwQsL5f9itC/y//qLw65zLlQQqK6BOQp3nyc1OYWc14bNGrwmS4ji2HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598297; a=rsa-sha256; cv=none; b=LWoxzXgD+F5CR1KU/yAoIGZH2ljObI6EOnlvyEX4ePSifjnICFJF9S+FdAts9u/7Jcrk86 XLpgr7r7IYx/tcJ5k+yMUWLFXasYB6C0UKisOvt5UREAoojKPqjverYEzZarS91SIIfC7o Zvi7rqc+H7iygEl7cM60NWqlWRYOAQu24fIzVCPUfjmR10LyflhC0OwB/SXnovLTnxlB7H wY+KUZFgrsJykXLtTXEDN657o4KRSPjHi5f6dQO/8oM0ucVcSFToydBtA9Y2IKYjv92GwH Qk9kVGJPp9OxVQmoVbwSVfYHxWo++WWTmCc57+cgQx3UjRZWtLRyBUj69YQLbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LsSksQ71Y3HlsrbETlsU9vXGA7Xtq2YuMWurMeHrZxE=; b=j3YKytMPJrLa8VkvD/jXb4oYNmvNKqbVAu5KwGXHFVB8AyEtsl+Zz/CsIV8+9GzvMAp2gb nRxZSq5X6RV3O0eyVDOTVcnmIx7t2809SYjrazDv7adMqhO+SuQDUe/mVEJuERhCz8G/ko ZJt35+Z1Dcikk94DM3CpDqsHxpCvaZTN39kqSxw/oovEkQqO3/LvK7z6ynU/G4r2RuH+hx ex8s9XSZq6dY56nRSnlMB5rmX1jW8U2wownnAJdbFQXaxDiOjKqrb7k94OSjRVFmgyCp9Q 2/uWyCe7zgiIR5QOGxIp+jQ4OeTVNrDtNSAymWfNsVO+wVmS3IBZ9ciceaO7zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34N91fRVz1P2F; Wed, 26 Feb 2025 19:31:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVbJ8017547; Wed, 26 Feb 2025 19:31:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVbih017544; Wed, 26 Feb 2025 19:31:37 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:37 GMT Message-Id: <202502261931.51QJVbih017544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 46de4d9fc21d - main - net80211: change ieee80211_ratectl_rate() to not return a rix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46de4d9fc21dfd8945e95135f607ba4fdfdf3d78 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=46de4d9fc21dfd8945e95135f607ba4fdfdf3d78 commit 46de4d9fc21dfd8945e95135f607ba4fdfdf3d78 Author: Adrian Chadd AuthorDate: 2025-01-12 15:48:59 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:29:36 +0000 net80211: change ieee80211_ratectl_rate() to not return a rix There are only a few places where the returned rix is used: * linuxkpi - logging * bwi/bwn - used for finding a fallback rate to choose, which honestly should be returned by the ratectl API * iwm - building the rateset to program into firmware Everyone else uses the dot11rate value in ni->ni_txnode. This is a precursor for VHT and later rate support; where currently there aren't rate tables in ieee80211_phy.c for VHT and later rates. Although it's likely doable to add tables for VHT, 11ax and MU-OFDMA (HE) rates are sufficiently larger/different to just not fit in the current scheme without more refactoring. Differential Revision: https://reviews.freebsd.org/D48603 Reviewed by: bz, thj --- sys/compat/linuxkpi/common/src/linux_80211.c | 7 +++--- sys/dev/bwi/if_bwi.c | 13 ++++------- sys/dev/bwn/if_bwn.c | 12 ++++------- sys/dev/iwm/if_iwm.c | 32 ++++++++++++++++++++++------ sys/net80211/ieee80211_ratectl.h | 4 ++-- 5 files changed, 39 insertions(+), 29 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 72227378b097..14c7bab163b6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6921,7 +6921,6 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, } if (ni != NULL) { - int ridx __unused; #ifdef LINUXKPI_DEBUG_80211 int old_rate; @@ -6946,15 +6945,15 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, IMPROVE("only update of rate matches but that requires us to get a proper rate"); ieee80211_ratectl_tx_complete(ni, &txs); - ridx = ieee80211_ratectl_rate(ni->ni_vap->iv_bss, NULL, 0); + 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 ridx %d, " + 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), - ridx, txs.long_retries); + txs.long_retries); } #endif } diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index 079dac73ea43..1087ca813d65 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -2916,7 +2916,7 @@ bwi_encap(struct bwi_softc *sc, int idx, struct mbuf *m, uint32_t mac_ctrl; uint16_t phy_ctrl; bus_addr_t paddr; - int type, ismcast, pkt_len, error, rix; + int type, ismcast, pkt_len, error; #if 0 const uint8_t *p; int i; @@ -2943,15 +2943,10 @@ bwi_encap(struct bwi_softc *sc, int idx, struct mbuf *m, } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) { rate = rate_fb = tp->ucastrate; } else { - rix = ieee80211_ratectl_rate(ni, NULL, pkt_len); + ieee80211_ratectl_rate(ni, NULL, pkt_len); rate = ieee80211_node_get_txrate_dot11rate(ni); - - if (rix > 0) { - rate_fb = ni->ni_rates.rs_rates[rix-1] & - IEEE80211_RATE_VAL; - } else { - rate_fb = rate; - } + /* TODO: assign rate_fb the previous rate, if available */ + rate_fb = rate; } tb->tb_rate[0] = rate; tb->tb_rate[1] = rate_fb; diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index 571482afda70..38bf6f5d31a3 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -6394,7 +6394,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struct ieee80211_node *ni, uint8_t *prot_ptr; unsigned int len; uint32_t macctl = 0; - int rts_rate, rts_rate_fb, ismcast, isshort, rix, type; + int rts_rate, rts_rate_fb, ismcast, isshort, type; uint16_t phyctl = 0; uint8_t rate, rate_fb; int fill_phy_ctl1 = 0; @@ -6420,14 +6420,10 @@ bwn_set_txhdr(struct bwn_mac *mac, struct ieee80211_node *ni, else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) rate = rate_fb = tp->ucastrate; else { - rix = ieee80211_ratectl_rate(ni, NULL, 0); + ieee80211_ratectl_rate(ni, NULL, 0); rate = ieee80211_node_get_txrate_dot11rate(ni); - - if (rix > 0) - rate_fb = ni->ni_rates.rs_rates[rix - 1] & - IEEE80211_RATE_VAL; - else - rate_fb = rate; + /* TODO: assign rate_fb the previous rate, if available */ + rate_fb = rate; } sc->sc_tx_rate = rate; diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index bfe8c3635c7c..1e9090310ece 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -3502,11 +3502,11 @@ iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, if (rate_matched) { ieee80211_ratectl_tx_complete(ni, txs); - int rix = ieee80211_ratectl_rate(vap->iv_bss, NULL, 0); + ieee80211_ratectl_rate(vap->iv_bss, NULL, 0); new_rate = ieee80211_node_get_txrate_dot11rate(vap->iv_bss); if (new_rate != 0 && new_rate != cur_rate) { struct iwm_node *in = IWM_NODE(vap->iv_bss); - iwm_setrates(sc, in, rix); + iwm_setrates(sc, in, new_rate); iwm_send_lq_cmd(sc, &in->in_lq, FALSE); } } @@ -4270,7 +4270,7 @@ iwm_rate2ridx(struct iwm_softc *sc, uint8_t rate) static void -iwm_setrates(struct iwm_softc *sc, struct iwm_node *in, int rix) +iwm_setrates(struct iwm_softc *sc, struct iwm_node *in, int dot11rate) { struct ieee80211_node *ni = &in->in_ni; struct iwm_lq_cmd *lq = &in->in_lq; @@ -4278,8 +4278,27 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in, int rix) int nrates = rs->rs_nrates; int i, ridx, tab = 0; // int txant = 0; + int rix; - KASSERT(rix >= 0 && rix < nrates, ("invalid rix")); + /* + * Look up the rate index for the given legacy rate from + * the rs_rates table. Default to the lowest rate if it's + * not found (which is obviously hugely problematic.) + */ + rix = -1; + for (i = 0; i < nrates; i++) { + int rate = rs->rs_rates[i] & IEEE80211_RATE_VAL; + if (rate == dot11rate) { + rix = i; + break; + } + } + if (rix < 0) { + device_printf(sc->sc_dev, + "%s: failed to lookup dot11rate (%d)\n", + __func__, dot11rate); + rix = 0; + } if (nrates > nitems(lq->rs_table)) { device_printf(sc->sc_dev, @@ -4559,8 +4578,9 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) iwm_enable_beacon_filter(sc, ivp); iwm_power_update_mac(sc); iwm_update_quotas(sc, ivp); - int rix = ieee80211_ratectl_rate(&in->in_ni, NULL, 0); - iwm_setrates(sc, in, rix); + ieee80211_ratectl_rate(&in->in_ni, NULL, 0); + iwm_setrates(sc, in, + ieee80211_node_get_txrate_dot11rate(&in->in_ni)); if ((error = iwm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { device_printf(sc->sc_dev, diff --git a/sys/net80211/ieee80211_ratectl.h b/sys/net80211/ieee80211_ratectl.h index 2eae34763ed4..0e5beb5185cb 100644 --- a/sys/net80211/ieee80211_ratectl.h +++ b/sys/net80211/ieee80211_ratectl.h @@ -127,12 +127,12 @@ ieee80211_ratectl_node_deinit(struct ieee80211_node *ni) vap->iv_rate->ir_node_deinit(ni); } -static int __inline +static void __inline ieee80211_ratectl_rate(struct ieee80211_node *ni, void *arg, uint32_t iarg) { const struct ieee80211vap *vap = ni->ni_vap; - return vap->iv_rate->ir_rate(ni, arg, iarg); + vap->iv_rate->ir_rate(ni, arg, iarg); } static __inline void From nobody Wed Feb 26 19:31:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NC26zSz5nl19; Wed, 26 Feb 2025 19:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NB2nvzz3dBS; Wed, 26 Feb 2025 19:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BJRMgZsrYTOwenLB2LarIXgFJ/4QsVCLINx3Cp6XWSs=; b=XJcMe7rixVkBDrDiBa6DlQidTgRprWSO1doKDbJvLNJCD6yzZor8ZCnB7UZC6eKt7UGxSf S5ZF1C69MIlpyKymLW+VQcYSagd5z3B6llK8jiRaMUePa5itz4rFVPv31tAyjPoV2hSYvu EtHduszp+Nxa4Xi38AbArmyOaJBtnYTTLjQYPFnnb0AXstiNQ6GnppEJQGe6dsIFXYWqTh mdNbe5pTfvUnRzdbLRGe4DSCeAG4tB2vhSchrr7jixsQPavyPqg/Ep13PiC7Rf84LwZciy Y326LcBaWa3Tqsx8biKlIZwAiDzL+ohiyzlown8ayM9GeyNdu3rJSqjFEsrHzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598298; a=rsa-sha256; cv=none; b=nAH+HoA/nmSMEMCWfsG4N/H6xPL1FCAyzgVdLD6pqPM1adteaiTQuMoS+HXAUY26HkTl10 8qm7fQ3Psq2YRxZpbMn4XCyxidGoQNdXWT4VOhtkAugKseXiLHMNcCnuy0RSWkNxfR58f4 1TNsINwCwoO3gwDy3WSfAkgHTpAwnXLCq6uZSZZ8urduwG4oWXHlWO5Dzm+llsq7rYSN2B 55P/e9tzP1iL9xAmpnApGNMy+Ql0IE4fLSAs6CdyIBt2QdV3yutUskXdxTHMdsdp7HvtCs TnthhjjlrFCwTDHeNPxqJPuol3nYHBYIciXVUVXtT4SCCh+eB23tBoPEDZTUSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BJRMgZsrYTOwenLB2LarIXgFJ/4QsVCLINx3Cp6XWSs=; b=tJflNKfsGzDvkoPyQ1EzTM89aDfaDjKzSyvIq1i3jezTPHCtJdAr2k1FGdTAVVtjoXHiWy S6UvlfqZ3fd8JI/uyu+Pv4ij5nFgDbE9LJNzRnXSQEsLL+agJChJTGn6YvPgGWbxflV62a Keb+aWK7EwaE3fVvqaS82BQITNpOrD+Zxx9WcBZtyq2bdmvVlWg9PqPf4V/1w7TbJRYj23 cMrmHZ7yAxr5GspRrjgrQzzckgw6TZSm79k6ERFYShqWx7iKaop+kTt5UAOoJyS0Zl0zpz O97ONjJMF51LgXTFQWWl2lpu5GZ1LG9Iq9xDZeLYtcUphV5qzAy9D/dwor4Ovw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NB29Ltz1P2G; Wed, 26 Feb 2025 19:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVcsn017585; Wed, 26 Feb 2025 19:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVc6S017582; Wed, 26 Feb 2025 19:31:38 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:38 GMT Message-Id: <202502261931.51QJVc6S017582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 378eeae502e2 - main - net80211: convert ni_txrate to a struct, with extra rate information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 378eeae502e2d556733d20edaac8dc1ac5573d6d Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=378eeae502e2d556733d20edaac8dc1ac5573d6d commit 378eeae502e2d556733d20edaac8dc1ac5573d6d Author: Adrian Chadd AuthorDate: 2025-01-12 23:58:58 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:29:39 +0000 net80211: convert ni_txrate to a struct, with extra rate information * create struct ieee80211_node_txrate, which represents both the existing legacy / HT rates, and makes space for VHT rates * convert the ieee80211_node_* routines that manipulate the txrate field to use the new format * return OFDM6 for now if a VHT rate is set but the driver calls ieee80211_node_get_txrate_dot11rate(). It SHOULD be the lowest available rate - which for 11b will be a CCK rate, for turbo/half/quarter will be different rates! - but this is just for development. This should be a no-op for existing drivers and rate control, as everything now uses the accessor functions instead of directly accessing ni->ni_txrate. Locally tested: * RTL8821AU, STA mode (5GHz VHT/40) Differential Revision: https://reviews.freebsd.org/D48604 Reviewed by: bz, thj --- sys/net80211/ieee80211_ddb.c | 5 ++- sys/net80211/ieee80211_node.c | 94 ++++++++++++++++++++++++++++++++++++++----- sys/net80211/ieee80211_node.h | 21 +++++++++- 3 files changed, 108 insertions(+), 12 deletions(-) diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index 05b370eafa38..5dbb20dfe8e0 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -306,8 +306,9 @@ _db_show_sta(const struct ieee80211_node *ni) if (ni->ni_rx_ampdu[i].rxa_flags) _db_show_rxampdu("\t", i, &ni->ni_rx_ampdu[i]); - db_printf("\tinact %u inact_reload %u txrate %u\n", - ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); + db_printf("\tinact %u inact_reload %u txrate type %d rate %u\n", + ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate.type, + ni->ni_txrate.dot11rate); #ifdef IEEE80211_SUPPORT_MESH _db_show_ssid("\tmeshid ", 0, ni->ni_meshidlen, ni->ni_meshid); db_printf(" mlstate %b mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n", diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index f5b05ed769c9..01f7c8904237 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2667,8 +2667,10 @@ ieee80211_dump_node(struct ieee80211_node_table *nt __unused, ni->ni_esslen, ni->ni_essid, (ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_freq : 0, (ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_flags : 0); - printf("\tinact %u inact_reload %u txrate %u\n", - ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); + printf("\tinact %u inact_reload %u txrate type %d dot11rate %u\n", + ni->ni_inact, ni->ni_inact_reload, + ni->ni_txrate.type, + ni->ni_txrate.dot11rate); printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", ni->ni_htcap, ni->ni_htparam, ni->ni_htctlchan, ni->ni_ht2ndchan); @@ -3138,19 +3140,73 @@ ieee80211_getsignal(struct ieee80211vap *vap, int8_t *rssi, int8_t *noise) *rssi = ieee80211_getrssi(vap); } +/** + * @brief return a dot11rate / ratecode representing the current transmit rate + * + * This is the API call for legacy / 802.11n drivers and rate control APIs + * which expect a dot11rate / ratecode representation for legacy and HT MCS + * rates. + * + * Drivers which support VHT should not use this API, as it will log an error + * and return a low rate if a VHT rate is selected. + * + * @param ni the ieee80211_node to return the transmit rate for + * @returns the dot11rate / ratecode for legacy/MCS, or the + * lowest available dot11rate if it's VHT (and shouldn't + * have been called.) + */ uint8_t ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *ni) { - return (ni->ni_txrate); + switch (ni->ni_txrate.type) { + case IEEE80211_NODE_TXRATE_LEGACY: + case IEEE80211_NODE_TXRATE_HT: + return (ni->ni_txrate.dot11rate); + break; + case IEEE80211_NODE_TXRATE_VHT: + default: + printf("%s: called for VHT / unknown rate (type %d)!\n", + __func__, ni->ni_txrate.type); + return (12); /* OFDM6 for now */ + } } +/** + * @brief set the dot11rate / ratecode representing the current transmit rate + * + * This is the API call for legacy / 802.11n drivers and rate control APIs + * which expect a dot11rate / ratecode representation for legacy and HT MCS + * rates. + * + * @param ni the ieee80211_node to return the transmit rate for + * @param dot11rate the dot11rate rate code to use + */ void ieee80211_node_set_txrate_dot11rate(struct ieee80211_node *ni, uint8_t dot11Rate) { - ni->ni_txrate = dot11Rate; + if (dot11Rate & IEEE80211_RATE_MCS) { + ni->ni_txrate.type = IEEE80211_NODE_TXRATE_HT; + ni->ni_txrate.mcs = dot11Rate & IEEE80211_RATE_VAL; + ni->ni_txrate.nss = 0; + ni->ni_txrate.dot11rate = dot11Rate; + } else { + ni->ni_txrate.type = IEEE80211_NODE_TXRATE_LEGACY; + ni->ni_txrate.mcs = ni->ni_txrate.nss = 0; + ni->ni_txrate.dot11rate = dot11Rate; + } } +/** + * @brief set the dot11rate / ratecode representing the current HT transmit rate + * + * This is the API call for 802.11n drivers and rate control APIs + * which expect a dot11rate / ratecode representation for legacy and HT MCS + * rates. It expects an MCS rate code from 0 .. 76. + * + * @param ni the ieee80211_node to return the transmit rate for + * @param mcs the MCS rate to select + */ void ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *ni, uint8_t mcs) @@ -3160,7 +3216,11 @@ ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *ni, ic_printf(ni->ni_ic, "%s: invalid MCS (%d)\n", __func__, mcs); return; } - ni->ni_txrate = IEEE80211_RATE_MCS | mcs; + + ni->ni_txrate.type = IEEE80211_NODE_TXRATE_HT; + ni->ni_txrate.mcs = mcs; + ni->ni_txrate.nss = 0; + ni->ni_txrate.dot11rate = IEEE80211_RATE_MCS | mcs; } @@ -3177,10 +3237,26 @@ ieee80211_node_get_txrate_kbit(struct ieee80211_node *ni) { uint32_t mbps; - if (ni->ni_txrate & IEEE80211_RATE_MCS) { - const struct ieee80211_mcs_rates *mcs = - &ieee80211_htrates[ni->ni_txrate & ~IEEE80211_RATE_MCS]; + /* + * TODO: only handle legacy/HT rates, VHT will need + * to use other logic. + */ + switch (ni->ni_txrate.type) { + case IEEE80211_NODE_TXRATE_LEGACY: + case IEEE80211_NODE_TXRATE_HT: + break; + case IEEE80211_NODE_TXRATE_VHT: + default: + printf("%s: called for VHT / unknown rate (type %d)!\n", + __func__, ni->ni_txrate.type); + return (0); + } + /* Legacy / MCS rates */ + if (ni->ni_txrate.dot11rate & IEEE80211_RATE_MCS) { + const struct ieee80211_mcs_rates *mcs = + &ieee80211_htrates[ni->ni_txrate.dot11rate & + ~IEEE80211_RATE_MCS]; if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { /* Note: these are in 1/2Mbit/s units */ if (ni->ni_flags & IEEE80211_NODE_SGI40) @@ -3195,7 +3271,7 @@ ieee80211_node_get_txrate_kbit(struct ieee80211_node *ni) } } else /* Note: CCK/OFDM dot11rate entries are in 1/2Mbit/s units */ - mbps = ni->ni_txrate; + mbps = ni->ni_txrate.dot11rate; /* * Note; 'mbps' in 1/2 Mbit/s units so *500 to make it in kbit/s units. diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 722f3d54a00b..859b8b0288a1 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -139,6 +139,20 @@ ieee80211_ni_chw_to_str(enum ieee80211_sta_rx_bw bw) } } +enum ieee80211_node_txrate_type { + IEEE80211_NODE_TXRATE_UNDEFINED = 0, + IEEE80211_NODE_TXRATE_LEGACY = 1, /* CCK/OFDM, HT for now */ + IEEE80211_NODE_TXRATE_HT = 2, /* HT */ + IEEE80211_NODE_TXRATE_VHT = 3, /* VHT */ +}; + +struct ieee80211_node_txrate { + enum ieee80211_node_txrate_type type; + uint8_t nss; /* VHT - number of spatial streams */ + uint8_t mcs; /* HT/VHT - MCS */ + uint8_t dot11rate; /* Legacy/HT - dot11rate / ratecode */ +}; + /* * Node specific information. Note that drivers are expected * to derive from this structure to add device-specific per-node @@ -275,7 +289,7 @@ struct ieee80211_node { /* others */ short ni_inact; /* inactivity mark count */ short ni_inact_reload;/* inactivity reload value */ - int ni_txrate; /* legacy rate/MCS */ + struct ieee80211_node_txrate ni_txrate; /* current transmit rate */ struct ieee80211_psq ni_psq; /* power save queue */ struct ieee80211_nodestats ni_stats; /* per-node statistics */ @@ -499,6 +513,11 @@ void ieee80211_node_leave(struct ieee80211_node *); int8_t ieee80211_getrssi(struct ieee80211vap *); void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *); +/* + * Node transmit rate specific manipulation. + * + * This should eventually be refactored into its own type. + */ uint8_t ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *); void ieee80211_node_set_txrate_dot11rate(struct ieee80211_node *, uint8_t); void ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *, uint8_t); From nobody Wed Feb 26 19:31:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NC5Sl0z5nkgv; Wed, 26 Feb 2025 19:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NC3cRcz3dXn; Wed, 26 Feb 2025 19:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcnsk/MzukAmZDePM/BXV8PQfWXUXUxSRcWj5ifpxFE=; b=X9UvL/+jwo057rGrN2xyJR8XQUN/HKzoRcm/UVaFH2m/mTqVtjrP6pSZVUFGlSE3/X0+dT i5eF4vhF0gyEBvLUipWJ+Ebrxo+ngLAcxqzWUZS37+80dSuO1MpbVUbiPbElKpuBjmT0qX 2Wht1HpJR7HBzro0tnWCsYMBxL3lDsZv2JfcdhWjXWW2S3KMOt4pwmFcgjIwExnDUnbai0 y5WpBjcoNUGYE0q1g5AXafwd2SlD9hxsZi/2PdG69Y+ozmG74GlB78znFF5h1lAMXgC1Bv yyp+rDJU/SIQNoZ0EC6M2ixgLUI7dXYnncWOJi/MaYMWnt8R/O6J41eqmSqq9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598299; a=rsa-sha256; cv=none; b=Tg0qK5Rf5wOVN6C8DpeFYb04qJcVu3SqUtbnBYUUzhdL8+dbPLZE5Y8YY41dOGZGH3zVvB H3wpzcQMD5WvkeApNAlYOk0Of3EeuE1RrQ41Er1FFteBFmDEsAgtPfh1KBiESqhQF1GBFw QL1aQRxbDZKWkVwvAumCL01l7uP5WE2DDUAZr87BXdtZzWxl1jc/wfw8v/mDMJqadbonAu jpr6ZZtMg59x9uNPala6flKFiJH8Cla6uD/XZesCtgoD6Umufu5XM2TDE+Qd4wbxAwuAKH 90r7tFD1k+XxpRmRkL0ldmMrT2waJdSlEcuY9crZMKJmK2uZjttUYoChO9IHFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcnsk/MzukAmZDePM/BXV8PQfWXUXUxSRcWj5ifpxFE=; b=aEatGo8OTaaKt23bkaw3mnzLyz5cfLNETGuBzR2AqKQS8sKBijrVqh6zt03GTazSqa8Oo1 eOji3u3qQfeaI+DIAO5qG282lCeviVJLqsBvSI4zAiUs+ubSdngn0cYH4F+hLW8TaAa5FC Q+ez29yr6bCtICzo7yFM2B8JMAj460HufXw2KzOfRwrkdj1tmH3YRpn6Bjhv/Uttmr5nOf s4P5nnobNW/TtYqkqddL3XqOIha87XjzrZfTYpOzEg48HbeoqLw6XFGP4h491H6prSsbUV GJtRSpKYAB+Cf54Of4v5npEBC/d8gYuJ2hcAOK40VYtqxafy0OtOZjXb2B2KWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NC36C0z1P6y; Wed, 26 Feb 2025 19:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVd8e017623; Wed, 26 Feb 2025 19:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVdkN017620; Wed, 26 Feb 2025 19:31:39 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:39 GMT Message-Id: <202502261931.51QJVdkN017620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 0da0a5fc73e6 - main - net80211: add ieee80211_node_get_txrate() to populate the "new" transmit struct List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0da0a5fc73e66c8839ebc8455dd12a9c3c273d5a Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=0da0a5fc73e66c8839ebc8455dd12a9c3c273d5a commit 0da0a5fc73e66c8839ebc8455dd12a9c3c273d5a Author: Adrian Chadd AuthorDate: 2025-01-13 02:13:51 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:29:52 +0000 net80211: add ieee80211_node_get_txrate() to populate the "new" transmit struct ieee80211_node_get_txrate() populates the passed-in ieee80211_node_txrate with the current rate configuration. This is a no-op - nothing is yet setting VHT rates. Differential Revision: https://reviews.freebsd.org/D48605 Reviewed by: bz --- sys/net80211/ieee80211_node.c | 20 ++++++++++++++++++++ sys/net80211/ieee80211_node.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 01f7c8904237..c781280d5e8a 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3171,6 +3171,26 @@ ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *ni) } } +/** + * @brief return the txrate representing the current transmit rate + * + * This is the API call for drivers and rate control APIs to fetch + * rates. It will populate a struct ieee80211_node_txrate with the + * current rate configuration to use. + * + * @param ni the ieee80211_node to return the transmit rate for + * @param txrate the struct ieee80211_node_txrate to populate + */ +void +ieee80211_node_get_txrate(struct ieee80211_node *ni, + struct ieee80211_node_txrate *txr) +{ + MPASS(ni != NULL); + MPASS(txr != NULL); + + *txr = ni->ni_txrate; +} + /** * @brief set the dot11rate / ratecode representing the current transmit rate * diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 859b8b0288a1..bb14c8c4bb42 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -519,6 +519,8 @@ void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *); * This should eventually be refactored into its own type. */ uint8_t ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *); +void ieee80211_node_get_txrate(struct ieee80211_node *, + struct ieee80211_node_txrate *); void ieee80211_node_set_txrate_dot11rate(struct ieee80211_node *, uint8_t); void ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *, uint8_t); uint32_t ieee80211_node_get_txrate_kbit(struct ieee80211_node *); From nobody Wed Feb 26 19:31:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NF2XLSz5nl5G; Wed, 26 Feb 2025 19:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34ND4GxLz3d5L; Wed, 26 Feb 2025 19:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L6GBab9aJ98IHHUGTi1HejEdNJvQOjpaPxKpm6b+sk0=; b=cRcrAZNOSCxOrwPlRzlZYoyOYjKnjQOyCpWo/0VUzg5V/Sa6DtPpd2b3TVW686StX3WKV+ A2bBLCgDdA6gSSUyqOn0THFF52RBZeVr3XmlixmzxU/Fsb2Wa57jiTY4trUlnHLKmY6yxV 0D0Z5wgeWDUO9FEXlsv9p7Cv0XYrRa2yTT8CogY9FYSJgY4DN0rMQIK76deNzBZNGhPPav ++Rvfz4kf20Y1/YcWxnxIksU9SFwAfVKP2rwRrFzzEpVTDxRpd+5vxSE6HHzkrNG7CXVvI I9XRY6ZwdOty/VyqZ3dTDPfLJbFBjLgHxxfAFTJCV+nrMz6Aahm8rP0Jk/VUAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598300; a=rsa-sha256; cv=none; b=vtPDjDbIveN5HOkypapd/7UoUlEpSzjDTAHjmjLekuL1aTliVmiUMHzM+2ygHWnsu+CGQI wmZj1hPHtbWCSRpxeJI66t1m2UzgMAJbTcDgfmI/pOFeyFJ7T2cBAqhy8PFyFx+vq39jSc sEIVOPxYxNyZCQtgMN/fA+Avu9pnExjZO16gwAq/vVgXACf8uNxSXj+J1/Kml1URnLc0Jg QHcA5RfAlU4NhsJFZ4D2XV3mqqTatjMebIgHV3Sp2NH6gnj4ohdbm9YQYKJ1tOOapu05sg s4LWjfuPWss+ySiPvYZdg/RMRFj6+ipP6BPpd61Hupa3oLilciGWRSWE1gpnrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L6GBab9aJ98IHHUGTi1HejEdNJvQOjpaPxKpm6b+sk0=; b=Zx8hHlgybw1dk4Lml39ooC2gTWVRjC5KRAPor3nLmvNfiKEJx3lSWaq+B8DV6j2hDnXLGW yVm5/46j3/tGkNR23JE62JFwZfGhQRv7XR6QNJicPwScIQAx8+2forY9OWqd0AEDpFiLsj LSjbDo47+ImWxpTjfiTjo02LxbZOZ3hDr7ixdxBAzu4WEmy8vpZG0nCl/xKjpyAnXpim/j AF47thIWviCRzeGmVhscGOEv2DpnCJIfyFSMHcyFuf9Uduv8MJ/F5MOQKu/A3xQk1RAk+P cEtHSlhQ0ifPPBpqUZOT4SR5PArnfTuQOidLZAAZtxQqXC4lKACymQEc53LoRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34ND3lVvz1P9p; Wed, 26 Feb 2025 19:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVeE9017657; Wed, 26 Feb 2025 19:31:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVemW017654; Wed, 26 Feb 2025 19:31:40 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:40 GMT Message-Id: <202502261931.51QJVemW017654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: fdc884161187 - main - rtwn: move to using ieee80211_node_get_txrate() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fdc88416118759692fb1773deffe298e86cc902b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=fdc88416118759692fb1773deffe298e86cc902b commit fdc88416118759692fb1773deffe298e86cc902b Author: Adrian Chadd AuthorDate: 2025-01-13 02:15:05 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:30:01 +0000 rtwn: move to using ieee80211_node_get_txrate() Migrate the transmit path to use ieee80211_node_get_txrate(), and handle VHT rates. Nothing is currently setting VHT rates, but the driver should now be ready. Differential Revision: https://reviews.freebsd.org/D48606 Reviewed by: bz --- sys/dev/rtwn/if_rtwn_tx.c | 49 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/sys/dev/rtwn/if_rtwn_tx.c b/sys/dev/rtwn/if_rtwn_tx.c index f355bc589143..2c9c246dfbb4 100644 --- a/sys/dev/rtwn/if_rtwn_tx.c +++ b/sys/dev/rtwn/if_rtwn_tx.c @@ -105,6 +105,33 @@ rtwn_get_cipher(u_int ic_cipher) return (cipher); } +static uint8_t +rtwn_tx_ratectl_to_ridx(struct rtwn_softc *sc, struct ieee80211_node *ni, + struct ieee80211_node_txrate *txr) +{ + /* TODO: this should be based on the node channel */ + struct ieee80211com *ic = &sc->sc_ic; + uint8_t ridx; + + switch (txr->type) { + case IEEE80211_NODE_TXRATE_LEGACY: + case IEEE80211_NODE_TXRATE_HT: + ridx = rate2ridx(txr->dot11rate); + break; + case IEEE80211_NODE_TXRATE_VHT: + ridx = RTWN_RIDX_VHT_MCS(txr->nss - 1, txr->mcs); + break; + default: + if (ic->ic_curmode != IEEE80211_MODE_11B) + ridx = RTWN_RIDX_OFDM36; + else + ridx = RTWN_RIDX_CCK55; + break; + } + + return (ridx); +} + static int rtwn_tx_data(struct rtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m) @@ -116,7 +143,7 @@ rtwn_tx_data(struct rtwn_softc *sc, struct ieee80211_node *ni, struct ieee80211_frame *wh; struct rtwn_tx_desc_common *txd; struct rtwn_tx_buf buf; - uint8_t rate, ridx, type; + uint8_t ridx, type; bool force_rate = false; u_int cipher; int ismcast; @@ -131,31 +158,31 @@ rtwn_tx_data(struct rtwn_softc *sc, struct ieee80211_node *ni, if (type == IEEE80211_FC0_TYPE_MGT || type == IEEE80211_FC0_TYPE_CTL || (m->m_flags & M_EAPOL) != 0) { - rate = tp->mgmtrate; + ridx = rate2ridx(tp->mgmtrate); force_rate = true; } else if (ismcast) { + ridx = rate2ridx(tp->mcastrate); force_rate = true; - rate = tp->mcastrate; } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) { + ridx = rate2ridx(tp->ucastrate); force_rate = true; - rate = tp->ucastrate; } else { if (sc->sc_ratectl == RTWN_RATECTL_NET80211) { + struct ieee80211_node_txrate txr = { 0 }; /* XXX pass pktlen */ - (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ieee80211_node_get_txrate_dot11rate(ni); + ieee80211_ratectl_rate(ni, NULL, 0); + ieee80211_node_get_txrate(ni, &txr); + ridx = rtwn_tx_ratectl_to_ridx(sc, ni, &txr); } else { if (ni->ni_flags & IEEE80211_NODE_HT) - rate = IEEE80211_RATE_MCS | 0x4; /* MCS4 */ + ridx = rate2ridx(IEEE80211_RATE_MCS | 0x4); /* MCS4 */ else if (ic->ic_curmode != IEEE80211_MODE_11B) - rate = ridx2rate[RTWN_RIDX_OFDM36]; + ridx = RTWN_RIDX_OFDM36; else - rate = ridx2rate[RTWN_RIDX_CCK55]; + ridx = RTWN_RIDX_CCK55; } } - ridx = rate2ridx(rate); - cipher = IEEE80211_CIPHER_NONE; if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); From nobody Wed Feb 26 19:31:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NG04T7z5nl1B; Wed, 26 Feb 2025 19:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NF5R8kz3dbJ; Wed, 26 Feb 2025 19:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOKZbIdrOLrVQE+2ZO1TpV053XqhCV1sVjwaO+lW/+U=; b=M+awjHB3rkfeAzKI3+oAoKi7ei0uoIWpDkGaflvvKZKiTjLB3uZESngW4bj1uc6n13mvB3 vZTc8nBNuXtljftxKLGreImp5x1P1OX7Aq7Yvv/PgvYWo2KcBS10mpE1EJNK5bcgMzzl5y d7yhht/2fvgNHVqUnYK+6Lob6MunBPIqTJfQi98cQihYfGCz+CjVmdmeaFBqJ6ibIBeRlO L/ZEOuXpOmOygKMYFbci6H2Z4V2dD5M50KaYdbvPnJIyjqvwYqmbNUoD20q29JqjBg0Xul WJ2/rFFLQ2BkxJuW3cYuwiO516tnZoDEWFWZIHPpf+RBeWIL1eR+uKirXv3o1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598301; a=rsa-sha256; cv=none; b=FGKjG+O88WBRV0wvfcHX7cRn4+BkLkRWSawOU6qaZxbCVqLi74Ic3MJPGLNDnDFIRdMt9w hRQZ1OGux05u1qi4YMWw9xSQfiuEAzgmDwK3tmqTeIp49hbSbjbY2MtiH2vf1AiXeV0p0e /obMxeiaSA30jaXAXRo6OvOajEobiohs71Ca94SHVklekOyRzlkasqqYWZjLBgTy2mXEOq jWxJaNuonQ/UZBQY0U1id2MhsD34x2dDjEkt/Wq68Ikj0/nLWw4QQVrV75oFMQ+XInfPZH Bpb3Mi3/RJlK6++N9E2H7teTfQqwWqKz7EQm/kf59OfESLcWuZtOUc9fIu9Qqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOKZbIdrOLrVQE+2ZO1TpV053XqhCV1sVjwaO+lW/+U=; b=S1w4rntrXDRlmeYz1YvpPPWU0ftPQIMzL3evHFPDRuZKsx8IFfcLgALylPXaab4OQHAkgR 72u57lJpJwIK9/f2vJ0szvu4NW1sXUHf7SYxecX0+NEs/tac1l0YDT85s3vp2MWhAfOoIv JVYlAsQPjQth54frF8qtJt5dnZUdIGT1+FNEJImayJhZGyUeHh/EvoVexiYvDCRKlbSjK4 izMtf75yEulXdUr7EraWWnrf+aNeDOG3HYeYhT213/t0g+znVZhazn0/MI98fVHycnZCH8 LG8cd2pA5V7n/E36v80PJbbUam1ACIWRYNX3rG0hCEdq9RvcbaQD5G2hthRJdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NF4nwWz1P9r; Wed, 26 Feb 2025 19:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVf2u017691; Wed, 26 Feb 2025 19:31:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVfQN017688; Wed, 26 Feb 2025 19:31:41 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:41 GMT Message-Id: <202502261931.51QJVfQN017688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 1c746222c2ef - main - net80211: Implement ieee80211_setup_vht_rates() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c746222c2ef25d2caa7578217ce92b637a1ee3d Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=1c746222c2ef25d2caa7578217ce92b637a1ee3d commit 1c746222c2ef25d2caa7578217ce92b637a1ee3d Author: Adrian Chadd AuthorDate: 2025-01-13 05:17:36 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:30:23 +0000 net80211: Implement ieee80211_setup_vht_rates() Implement ieee80211_setup_vht_rates() - calculate the intersection between the peers advertised RX VHT MCS map and the vap's configured TX map. Whilst here, remove the unused vhtcap/vhtinfo fields; they're already populated in the ieee80211_node before ieee80211_setup_vht_rates() is called. Differential Revision: https://reviews.freebsd.org/D48607 Reviewed by: bz --- sys/net80211/ieee80211_ddb.c | 4 +-- sys/net80211/ieee80211_node.c | 7 ++--- sys/net80211/ieee80211_node.h | 4 +-- sys/net80211/ieee80211_sta.c | 2 +- sys/net80211/ieee80211_vht.c | 61 +++++++++++++++++++++++++++++++++++++++---- sys/net80211/ieee80211_vht.h | 3 +-- 6 files changed, 64 insertions(+), 17 deletions(-) diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index 5dbb20dfe8e0..3c57b03ddc65 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -317,9 +317,9 @@ _db_show_sta(const struct ieee80211_node *ni) #endif /* VHT state */ - db_printf("\tvhtcap %b vht_basicmcs %#06x vht_pad2 %#06x\n", + db_printf("\tvhtcap %b vht_basicmcs %#06x vht_tx_map %#06x\n", ni->ni_vhtcap, IEEE80211_VHTCAP_BITS, - ni->ni_vht_basicmcs, ni->ni_vht_pad2); + ni->ni_vht_basicmcs, ni->ni_vht_tx_map); db_printf("\tvht_mcsinfo: { rx_mcs_map %#06x rx_highest %#06x " "tx_mcs_map %#06x tx_highest %#06x }\n", ni->ni_vht_mcsinfo.rx_mcs_map, ni->ni_vht_mcsinfo.rx_highest, diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index c781280d5e8a..5a239bbd30f6 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1044,8 +1044,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, ieee80211_vht_updateparams(ni, ni->ni_ies.vhtcap_ie, ni->ni_ies.vhtopmode_ie); - ieee80211_setup_vht_rates(ni, ni->ni_ies.vhtcap_ie, - ni->ni_ies.vhtopmode_ie); + ieee80211_setup_vht_rates(ni); do_ht = 1; } } @@ -1874,9 +1873,7 @@ ieee80211_init_neighbor(struct ieee80211_node *ni, ieee80211_vht_updateparams(ni, ni->ni_ies.vhtcap_ie, ni->ni_ies.vhtopmode_ie); - ieee80211_setup_vht_rates(ni, - ni->ni_ies.vhtcap_ie, - ni->ni_ies.vhtopmode_ie); + ieee80211_setup_vht_rates(ni); } } diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index bb14c8c4bb42..969d8e563fa9 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -274,8 +274,8 @@ struct ieee80211_node { /* VHT state */ uint32_t ni_vhtcap; - uint16_t ni_vht_basicmcs; - uint16_t ni_vht_pad2; + uint16_t ni_vht_basicmcs; /* Basic VHT MCS bitmap from IE */ + uint16_t ni_vht_tx_map; /* Negotiated MCS TX map with peer */ struct ieee80211_vht_mcs_info ni_vht_mcsinfo; uint8_t ni_vht_chan1; /* 20/40/80/160 - VHT chan1 */ uint8_t ni_vht_chan2; /* 80+80 - VHT chan2 */ diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 96603f339710..48d56d0ad217 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -1875,7 +1875,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, } else { ieee80211_vht_node_init(ni); ieee80211_vht_updateparams(ni, vhtcap, vhtopmode); - ieee80211_setup_vht_rates(ni, vhtcap, vhtopmode); + ieee80211_setup_vht_rates(ni); } } diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index 82879f90c67b..e704e0cbd176 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -284,14 +284,65 @@ ieee80211_vht_updateparams(struct ieee80211_node *ni, return (0); } +/** + * @brief calculate the supported MCS rates for this node + * + * This is called once a node has finished association / + * joined a BSS. The vhtcap / vhtop IEs are from the + * peer. The transmit rate tables need to be combined + * together to setup the list of available rates. + * + * This must be called after the ieee80211_node VHT fields + * have been parsed / populated by either ieee80211_vht_updateparams() or + * ieee80211_parse_vhtcap(), + * + * This does not take into account the channel bandwidth, + * which (a) may change during operation, and (b) depends + * upon packet to packet rate transmission selection. + * There are various rate combinations which are not + * available in various channel widths and those will + * need to be masked off separately. + * + * (See 802.11-2020 21.5 Parameters for VHT-MCSs for the + * tables and supported rates.) + * + * ALSO: i need to do some filtering based on the HT set too. + * (That should be done here too, and in the negotiation, sigh.) + * (See 802.11-2016 10.7.12.3 Additional rate selection constraints + * for VHT PPDUs) + * + * @param ni struct ieee80211_node to configure + */ void -ieee80211_setup_vht_rates(struct ieee80211_node *ni, - const uint8_t *vhtcap_ie, - const uint8_t *vhtop_ie) +ieee80211_setup_vht_rates(struct ieee80211_node *ni) { + struct ieee80211vap *vap = ni->ni_vap; + uint32_t val, val1, val2; + uint16_t tx_mcs_map = 0; + int i; - //printf("%s: called\n", __func__); - /* XXX TODO */ + /* + * Merge our tx_mcs_map with the peer rx_mcs_map to determine what + * can be actually transmitted to the peer. + */ + + for (i = 0; i < 8; i++) { + /* + * Merge the two together; remember that 0..2 is in order + * of increasing MCS support, but 3 equals + * IEEE80211_VHT_MCS_NOT_SUPPORTED so must "win". + */ + val1 = (vap->iv_vht_cap.supp_mcs.tx_mcs_map >> (i*2)) & 0x3; + val2 = (ni->ni_vht_mcsinfo.rx_mcs_map >> (i*2)) & 0x3; + val = MIN(val1, val2); + if (val1 == IEEE80211_VHT_MCS_NOT_SUPPORTED || + val2 == IEEE80211_VHT_MCS_NOT_SUPPORTED) + val = IEEE80211_VHT_MCS_NOT_SUPPORTED; + tx_mcs_map |= (val << (i*2)); + } + + /* Store the TX MCS map somewhere in the node that can be used */ + ni->ni_vht_tx_map = tx_mcs_map; } void diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h index bcb61020c5a1..a61804a43059 100644 --- a/sys/net80211/ieee80211_vht.h +++ b/sys/net80211/ieee80211_vht.h @@ -40,8 +40,7 @@ void ieee80211_parse_vhtcap(struct ieee80211_node *, const uint8_t *); int ieee80211_vht_updateparams(struct ieee80211_node *, const uint8_t *, const uint8_t *); -void ieee80211_setup_vht_rates(struct ieee80211_node *, - const uint8_t *, const uint8_t *); +void ieee80211_setup_vht_rates(struct ieee80211_node *); void ieee80211_vht_timeout(struct ieee80211vap *vap); From nobody Wed Feb 26 19:31:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NL1lcKz5nksT; Wed, 26 Feb 2025 19:31:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NK2djDz3d5y; Wed, 26 Feb 2025 19:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BIvViSubOXdXcUHNhCySB9O291kV0SEMGEECIM1GLw4=; b=rU5IA5VTD0aUd+qiKaWunbqymp+2zoeUDyt8tVGPu03cTBAvZkreqQBkpwgJmPuTIa0gDS ztjXWJlAgU6JlZaqSIR5LwDOjv2ANwowFu/pp7o7IK7Uc7BWoZ3o6I8tuTSetRH6vmAhUR I2jcpNn/2aXTOv9Mh9sjwPDHq6cr2MMqF4CMNnYqJcs7mLcz+Ua1v6AzoWlQTWg7suhZ+2 SYIRur5hnG7AXnVqv4wNs58Qg8jTM6qQlwv+tTdv5KTluA4zGmUGeI6J9zHncnnk6Z08xo 0bB2Qif5y+/UtJEEC1/PdowXLS40NR0u54ePXpRkuC5UpNemI26mZJivhoenvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598305; a=rsa-sha256; cv=none; b=hWxSM+wlaTQb0NkcYDbR2F5MHHVXniUYyPqlcX3q9K8Q3qjdlxf2f+C9QSDRuFknPk6Qo0 iCXBTE57K096hG3iOQPBIR794Uob06kKfP4PtCP8frHs5kL/UeEIczliBJt/CiUTFN+R71 SvuuZVUMD7Kn3fxQczSSBqO72FPfDZs0ADkbkcpu2dsyGtOz+oPklo4NzNDCtGrgHVtLPU MlCAPjMryuntgxjjD9dr+G1RvRIBSKnd53dDfenmHkr2HEbaI9337FvtQT0kUDpRaq5olr khEPd51lUEfRWENeg/5+qnWAVi84XkYe0irEGNg+m2ZJ/aqZRcOn8UO1aKPHGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BIvViSubOXdXcUHNhCySB9O291kV0SEMGEECIM1GLw4=; b=LsqYkPHpNh5UuFrGjyxEj5Q6HBSClVjQAFaMaKUuSYuxom/CglLLdbxCgQzSIty/dQK1Gn LU7AVaWL2eDO2281dMlGnulgcKYxkZW3pTHb8QUd6wonPX57mNv7BKtr3vsdE1r9uzjl0w Tg5W7QHorxo90ltxb4nlRKZuwYc/qHyLLq//FIK2nw8wcWUePpslY/FihmwuqgMnGuIkXP oDguyYXb4hZQVkFG9efybs2o9m4ic7fPmsx26/8ppw3Ei8JHc1fucCtrgaJB57hduEBTj3 hpdlJwoDxPdouhsa/PP4BQkbsl9pQj/r8T31m6IrqpkJox18hdOLWsJ0Ngq2rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NK0ST7z1P70; Wed, 26 Feb 2025 19:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVi8Q017800; Wed, 26 Feb 2025 19:31:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVi5i017797; Wed, 26 Feb 2025 19:31:44 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:44 GMT Message-Id: <202502261931.51QJVi5i017797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 7b0e3c5b2b74 - main - net80211: add ieee80211_vht_node_check_tx_valid_mcs() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b0e3c5b2b74f6e249d2820dbac6e420338bd226 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=7b0e3c5b2b74f6e249d2820dbac6e420338bd226 commit 7b0e3c5b2b74f6e249d2820dbac6e420338bd226 Author: Adrian Chadd AuthorDate: 2025-01-23 02:18:07 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:02 +0000 net80211: add ieee80211_vht_node_check_tx_valid_mcs() Introduce ieee80211_vht_node_check_tx_valid_mcs(), which takes the node, bandwidth, NSS and MCS and validates whether that is possible to TX to the given node. Differential Revision: https://reviews.freebsd.org/D48610 Reviewed by: bz, thj --- sys/net80211/ieee80211_vht.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_vht.h | 2 ++ 2 files changed, 51 insertions(+) diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index e704e0cbd176..703447945845 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -1061,3 +1061,52 @@ ieee80211_vht_check_tx_bw(const struct ieee80211_node *ni, return (false); } } + +/** + * @brief Check if the given VHT bw/nss/mcs combination is valid + * for the give node. + * + * This checks whether the given VHT bw/nss/mcs is valid based on + * the negotiated rate mask in the node. + * + * @param ni struct ieee80211_node node to check + * @param bw channel bandwidth to check + * @param nss NSS + * @param mcs MCS + * @returns True if this combination is available, false otherwise. + */ +bool +ieee80211_vht_node_check_tx_valid_mcs(const struct ieee80211_node *ni, + enum ieee80211_sta_rx_bw bw, uint8_t nss, uint8_t mcs) +{ + uint8_t mc; + + /* Validate arguments */ + if (nss < 1 || nss > 8) + return (false); + if (mcs > 9) + return (false); + + /* Check our choice of rate is actually valid */ + if (!ieee80211_phy_vht_validate_mcs(bw, nss, mcs)) + return (false); + + /* + * Next, check if the MCS rate is available for the + * given NSS. + */ + mc = ni->ni_vht_tx_map >> (2*(nss-1)) & 0x3; + switch (mc) { + case IEEE80211_VHT_MCS_NOT_SUPPORTED: + /* Not supported at this NSS */ + return (false); + case IEEE80211_VHT_MCS_SUPPORT_0_9: + return (mcs <= 9); + case IEEE80211_VHT_MCS_SUPPORT_0_8: + return (mcs <= 8); + case IEEE80211_VHT_MCS_SUPPORT_0_7: + return (mcs <= 7); + default: + return (false); + } +} diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h index a61804a43059..2964de63c343 100644 --- a/sys/net80211/ieee80211_vht.h +++ b/sys/net80211/ieee80211_vht.h @@ -67,5 +67,7 @@ void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, bool ieee80211_vht_check_tx_vht(const struct ieee80211_node *); bool ieee80211_vht_check_tx_bw(const struct ieee80211_node *, enum ieee80211_sta_rx_bw); +bool ieee80211_vht_node_check_tx_valid_mcs(const struct ieee80211_node *, + enum ieee80211_sta_rx_bw bw, uint8_t, uint8_t); #endif /* _NET80211_IEEE80211_VHT_H_ */ From nobody Wed Feb 26 19:31:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NK34Ksz5nl5P; Wed, 26 Feb 2025 19:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NJ0jt5z3dY9; Wed, 26 Feb 2025 19:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k/OdvO6KM2kveG2la6gTIOEujkR75h2UR3GI3oNhMtw=; b=ARHGf4j0w+utvEEILS+aad863oza510QuyWmR1OMhyE82V5c6icmU/VVk3HaC4darna7oh IRMZMKxR9egTlkP3Uxe45uIFmo32PL5OOtedAgUwToJ0ss0Kk+VQMPZw8mwjeBSza8oGpn CV81d87jB7G9GR5dtEygzf2uC4srns17tPQG5vDuUU6C2BuWjVHXcTVQZgkiEZo3CskvJ6 omCt6OymlG6HFswPfvjgcUakQv3Re+UJAuxwFRa/BPYV3m/U09/zWfrBICE+SJe9JdZBnC flQxKjNDnxtufLE1pVSBeHSJt9SsZs40lfe6uCn4yahDmLwNoiHjq8ED4MGAsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598304; a=rsa-sha256; cv=none; b=IBmeTxrmDBcKZE84qq2Jhk40ncGvVEHZPhuQ16MNLqx2MQbS8E7BFdUtZn3MJlpV81dAG3 uic4yXtbyIoL4CKeUcyKDkixpiDzBtEGHWUkT3H6Kk+J46a5BlkDVdky+gQJaZm+eMQmYq cgQNC1tmm9DUcdXdmEZ3PitRYYHKp6oRwOIF2FmDMbOylr+iu4ilRlKZYQ6tWwczBUk2jc hnKvdOov4JfS45iktM2iYUz15+/DeFHgZisqaAtsMH87bq5pDbOqIsIMvJnOh1owShUY3O UZqmczg+u8gDOk3GROtLmfOEpw+nJ87/idKfpnm9g0KhvNQ7pFCne/sFHbeQTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k/OdvO6KM2kveG2la6gTIOEujkR75h2UR3GI3oNhMtw=; b=iuPkbQ1IpDjkkaeH6ISy3VUZsXhITkKwQ89+8pvE84sADJD6xbNj2moAeOIXbZQXGFyArc j0Sz7ZfOOIndIJWijjLU16ePx0Qpcu/Bm1afJttnrO9iGwLklXe3s1LbxMQxQy8IkIRZ5g 5jO2RfhIppOvpx0+qV1HoHXqX2/byg53bJVfV/mWWLxT3BFZxXrbMpwUsUc0LhIM5sBDK8 yP5uJbrWvAzGSYilnu42QaDSL2zKvwzJl/zjQ31S7vB1xr3jyNG2vb9tAOYPZRMcW/R4hM qXBUOJ+O7leDGRo1fzyEHXj1dnxekEyOsb9f4vkne74sAyH+38s3kcREnygT4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NH6vHsz1PYl; Wed, 26 Feb 2025 19:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVhjb017761; Wed, 26 Feb 2025 19:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVhp8017757; Wed, 26 Feb 2025 19:31:43 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:43 GMT Message-Id: <202502261931.51QJVhp8017757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 1086f7bab303 - main - net80211: add node VHT transmit rate helper functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1086f7bab303cc61b3dce1ae51cb008675ad758a Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=1086f7bab303cc61b3dce1ae51cb008675ad758a commit 1086f7bab303cc61b3dce1ae51cb008675ad758a Author: Adrian Chadd AuthorDate: 2025-01-13 05:50:34 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:30:51 +0000 net80211: add node VHT transmit rate helper functions * add a node VHT transmit function, which configures the parameters accordingly. * add a node VHT transmit function which just copies in another ieee80211_node_txrate struct. Differential Revision: https://reviews.freebsd.org/D48609 Reviewed by: bz --- sys/net80211/ieee80211_node.c | 40 ++++++++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_node.h | 4 ++++ 2 files changed, 44 insertions(+) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 5a239bbd30f6..bc0358feb7a8 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3188,6 +3188,26 @@ ieee80211_node_get_txrate(struct ieee80211_node *ni, *txr = ni->ni_txrate; } +/** + * @brief Set the txrate representing the current transmit rate + * + * This is the API call for drivers and rate control APIs to set + * rates. It will copy a struct ieee80211_node_txrate with the + * current rate configuration to use. + * + * @param ni the ieee80211_node to return the transmit rate for + * @param txrate the struct ieee80211_node_txrate to copy to the node + */ +void +ieee80211_node_set_txrate(struct ieee80211_node *ni, + const struct ieee80211_node_txrate *txr) +{ + MPASS(ni != NULL); + MPASS(txr != NULL); + + ni->ni_txrate = *txr; +} + /** * @brief set the dot11rate / ratecode representing the current transmit rate * @@ -3240,6 +3260,26 @@ ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *ni, ni->ni_txrate.dot11rate = IEEE80211_RATE_MCS | mcs; } +/** + * @brief set the rate to the given VHT transmission rate. + * + * This sets the current transmit rate to the given VHT NSS/MCS. + * + * @param ni the ieee80211_node to set the transmit rate for + * @param nss the number of spatial streams + * @param mcs the MCS rate to select + */ +void +ieee80211_node_set_txrate_vht_rate(struct ieee80211_node *ni, + uint8_t nss, uint8_t mcs) +{ + MPASS(ni != NULL); + + ni->ni_txrate.type = IEEE80211_NODE_TXRATE_VHT; + ni->ni_txrate.mcs = mcs; + ni->ni_txrate.nss = nss; + ni->ni_txrate.dot11rate = 0; +} /* * @brief Fetch the transmit rate for the given node in kbit/s. diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 969d8e563fa9..ae5f72a070b6 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -521,8 +521,12 @@ void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *); uint8_t ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *); void ieee80211_node_get_txrate(struct ieee80211_node *, struct ieee80211_node_txrate *); +void ieee80211_node_set_txrate(struct ieee80211_node *, + const struct ieee80211_node_txrate *); void ieee80211_node_set_txrate_dot11rate(struct ieee80211_node *, uint8_t); void ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *, uint8_t); uint32_t ieee80211_node_get_txrate_kbit(struct ieee80211_node *); +void ieee80211_node_set_txrate_vht_rate(struct ieee80211_node *ni, + uint8_t nss, uint8_t mcs); #endif /* _NET80211_IEEE80211_NODE_H_ */ From nobody Wed Feb 26 19:31:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NH4RyJz5nl4b; Wed, 26 Feb 2025 19:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NG6TjWz3dLR; Wed, 26 Feb 2025 19:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1WQZEy+Cw2D4wUmf5EMx4im6lOTn8tWDC0SSTbmXOM4=; b=iuMDvwvHMVMXyFfvWmzvcQ0WyscpFOMzvStPV2ubbuDTtowbHicOUy+HLX9jvO/xTyaS1U GNhhce4tqbxEryrdXRcL5o93sDDFgjD0WDztHK6WW/t8rW4ZB0B5k67qTOZJECGYftQYrb 5wG+kHRvtKXCnGLUtBJg6gvGiwi999jwAx4qD/9KoZbbEv2LsUFyiKnGjN0A1+D6gY71mj GUCh8KobKDWNe9tFGPfQjQCXfkWW/MIFEVjJBouUXYQJ8j7GL25+UZN+h1PTEMVI3AReKc DcIyjKJ7Kt563WmVg7LGhE3t/JSdgbtkIaoVfV5skRe2c+iuLk0TscmkXGk0ZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598302; a=rsa-sha256; cv=none; b=YGSNeK2+swBmgF1cLah0uosf1zkynZ4JIRL7GhypAKn530CS0KNn8jmLvOyzRROCbcIU/v 16x2SaL1lVhUOQjJTuv6ydVYd3cYMjEujo6dwO1Hq1/InuFj1AlCM8Sp/rYrSW3PhBkvns e8W6CPAZ323xnKHg+zT7dikgJn1u0gEmK7W6iHwF9E7GPtldn2AJ7lKiipBrnZdt5x5Qh+ R0Xq27m3gC9Ckl74ncX5l5kYGpCuVNRqfZvWBoRyoAk+IsICrrVoQC9NN7Xfkq6ZeJgY3o fw+uXnqy7CKk0P+vunEg1AhbA0zw8NRNkSCRyo6bpRpfh9GdQn7tcz7Bwk6kSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1WQZEy+Cw2D4wUmf5EMx4im6lOTn8tWDC0SSTbmXOM4=; b=Hy16R00bGc8tKXcH7VV/AOStlRCUhGYfuOVJjQ/QFNSUoB/054VGhkgsYIlyOIwirBj5K3 yOGumCQFvExw2ajV7sv5lYk3czeX2rQyymkakNJGieOs4Fr8bKSNgGhLr4cnzIZh//tTP3 OofjQkPnpPQ4s23dccscp9JVMT8YH54VxV5wyxOBeOe55oYxv22vR50Ww3JvaoMB7aVVfh OESpCAHfnipmsKY0XOE7f2AceKqatJ99EqdQFQb8v/cRO3xJm+cf85o6fWmvEvACm8oo7O fYGyySXYOgiEc7buoBySyFuNuY7BRqZSM/63g6gfSBTy+Iyx2uZ9UMTD1Ob4gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NG5qspz1NX8; Wed, 26 Feb 2025 19:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVgGv017725; Wed, 26 Feb 2025 19:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVgTT017722; Wed, 26 Feb 2025 19:31:42 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:42 GMT Message-Id: <202502261931.51QJVgTT017722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 1568caaf5721 - main - net80211: add valid VHT MCS combinations and helper functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1568caaf572125b883aa6d0ed7f87b87ab0c9d45 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=1568caaf572125b883aa6d0ed7f87b87ab0c9d45 commit 1568caaf572125b883aa6d0ed7f87b87ab0c9d45 Author: Adrian Chadd AuthorDate: 2025-01-13 05:47:37 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:30:51 +0000 net80211: add valid VHT MCS combinations and helper functions Not all NSS / MCS / channel bandwidth combinations are valid. This will be important for rate control and transmit rate setup (eg static management, unicast, multicast rates.) This is based on 802.11-2020 Section 21.5 (Parameters for VHT-MCSs.) Differential Revision: https://reviews.freebsd.org/D48608 Reviewed by: bz --- sys/net80211/ieee80211_phy.c | 86 ++++++++++++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_phy.h | 7 ++++ 2 files changed, 93 insertions(+) diff --git a/sys/net80211/ieee80211_phy.c b/sys/net80211/ieee80211_phy.c index eaad7dde0653..9c2b1197564a 100644 --- a/sys/net80211/ieee80211_phy.c +++ b/sys/net80211/ieee80211_phy.c @@ -621,3 +621,89 @@ ieee80211_compute_duration_ht(uint32_t frameLen, uint16_t rate, #undef HT_L_LTF #undef HT_L_STF #undef OFDM_PLCP_BITS + + +/* + * A bitmask of allowable rates for each spatial stream + * and bandwidth. + * + * This is based on 802.11-2020 21.5 (Parameters for VHT-MCSs.) + * + * Not all MCS rate / channel widths are valid, as there needs + * to be an integer number of symbols and the number of tones + * available for each channel bandwidth doesn't result in + * an integer value. + */ +static uint16_t ieee80211_vht_mcs_allowed_list_20[] = { + 0x01ff, 0x01ff, 0x03ff, 0x01ff, 0x01ff, 0x03ff, 0x01ff, 0x01ff, +}; + +static uint16_t ieee80211_vht_mcs_allowed_list_40[] = { + 0x03ff, 0x03ff, 0x03ff, 0x03ff, 0x03ff, 0x03ff, 0x03ff, 0x03ff, +}; + +static uint16_t ieee80211_vht_mcs_allowed_list_80[] = { + 0x03ff, 0x03ff, 0x03bf, 0x03ff, 0x03ff, 0x01ff, 0x03bf, 0x03ff, +}; + +static uint16_t ieee80211_vht_mcs_allowed_list_160[] = { + 0x03ff, 0x03ff, 0x01ff, 0x03ff, 0x03ff, 0x03ff, 0x03ff, 0x03ff, +}; + +/** + * @brief Fetch the allowable MCS mask for the given channel bandwidth and NSS + * + * Return a bitmask of valid MCS rates from 0..9 given a channel bandwith + * and number of spatial streams. + * + * See 802.11-2020 21.5 (Parameters for VHT-MCSs) for more details. + * + * @param bw channel bandwidth, via enum ieee80211_sta_rx_bw + * @param nss number of spatial streams, 1..8 + * @returns bitmask of valid MCS rates from 0..9 + */ +uint16_t +ieee80211_phy_vht_get_mcs_mask(enum ieee80211_sta_rx_bw bw, uint8_t nss) +{ + if (nss == 0 || nss > 8) + return (0); + + switch (bw) { + case IEEE80211_STA_RX_BW_20: + return (ieee80211_vht_mcs_allowed_list_20[nss - 1]); + case IEEE80211_STA_RX_BW_40: + return (ieee80211_vht_mcs_allowed_list_40[nss - 1]); + case IEEE80211_STA_RX_BW_80: + return (ieee80211_vht_mcs_allowed_list_80[nss - 1]); + case IEEE80211_STA_RX_BW_160: + return (ieee80211_vht_mcs_allowed_list_160[nss - 1]); + case IEEE80211_STA_RX_BW_320: + /* invalid for VHT */ + return (0); + } +} + +/** + * @brief Check if the given NSS/MCS combination is valid for the given channel + * bandwidth + * + * See 802.11-2020 21.5 (Parameters for VHT-MCSs) for more details. + * + * @param bw channel bandwidth, via enum ieee80211_sta_rx_bw + * @param nss number of spatial streams, 1..8 + * @param mcs MCS rate, 0..9 + * @retval true if the NSS / MCS / bandwidth combination is valid + * @retval false if the NSS / MCS / bandwidth combination is not valid + */ +bool +ieee80211_phy_vht_validate_mcs(enum ieee80211_sta_rx_bw bw, uint8_t nss, + uint8_t mcs) +{ + uint16_t mask; + + mask = ieee80211_phy_vht_get_mcs_mask(bw, nss); + if (mask == 0) + return (false); + + return ((mask & (1 << mcs)) != 0); +} diff --git a/sys/net80211/ieee80211_phy.h b/sys/net80211/ieee80211_phy.h index f73abaff85d0..466f59584f2c 100644 --- a/sys/net80211/ieee80211_phy.h +++ b/sys/net80211/ieee80211_phy.h @@ -221,5 +221,12 @@ uint32_t ieee80211_compute_duration_ht(uint32_t frameLen, uint16_t rate, int streams, int isht40, int isShortGI); +enum ieee80211_sta_rx_bw; + +uint16_t ieee80211_phy_vht_get_mcs_mask(enum ieee80211_sta_rx_bw, + uint8_t); +bool ieee80211_phy_vht_validate_mcs(enum ieee80211_sta_rx_bw, + uint8_t, uint8_t); + #endif /* _KERNEL */ #endif /* !_NET80211_IEEE80211_PHY_H_ */ From nobody Wed Feb 26 19:31:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NN6BFvz5nksX; Wed, 26 Feb 2025 19:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NN2jk2z3dX5; Wed, 26 Feb 2025 19:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1RDsHcHHa5AKxLQWBQFb6KrikAnl7TNPWPwkJQV7fvU=; b=lKU54+A0P1Oql7F1xOX4TKCTD4o9Q+OsIgu0D+EH+4I0qwCxsZ1AQiNJy3tnQz0NjNN76H Tr3L7T7TzfnGpJQPk/jpUz6iL11D8JUsNgcXktAlbl2GbOV7TZ1KXjzc8ogS/67Xe+HpF8 eyL4fH7NIos2QA8FIe0tpvycstb6HKnNwYlJwRnOqw5NyQRZiBrcW5cex1HOROoHPXwDBg Wuh2y8Ri2QX7KsJFQ21BPIOMHmPc7tVP212FNCy1vi0PO+8LZ3lN7n51q8+jcniwr0jb+Q P6mo8VDwAgbD/XpHRu6ETyl/QA6cAuavSZjerl+gRPx3VTm5pOmX9X5T7XyFCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598308; a=rsa-sha256; cv=none; b=LMqHVWa5vFBd1QJIPv5Q5057cLruNbcfbZC4uZkgKpGBI7H6IwzAZaUZGfsItfjrHtuvIM LzzH8YlVmiJNKatuVelu9QPw2rzFsESkzdg19rkFxhK3Q5XvKG7Cv3SpZWJes/L52XOszX M/a6NceKO5WgMz8085oH2nHFWV+FesMPJmNUKMT4JvY7qulEe3KRxvTPP2gN631e9Vl6TQ 1JWF0Mn1//lf28zgTzgGWedmmLLvGXtKWN7CczbWfh79v7ZMbN/G+1bSkC/3lVkwmxo1I/ beepQVhqKOWUYRpzIqW8yhLarYLqN23KjXV1bj82BrbFPML/HcFSOeYYRN4ePA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1RDsHcHHa5AKxLQWBQFb6KrikAnl7TNPWPwkJQV7fvU=; b=ZOlUOqhgIrLnkhh9l0e1iBJGNbbi8vljJpIvzD4KiKCFBwsrrHSrxRuhparYNeK58TISTz vLUwUGwpKAj7Xkti7hT6v6YzpNHE3+RujXuWv/4Ad3B5pysX1EBkwz/ZeFlkCnU7IrRGAV h0JodppwZ6iRvXAC4ZXx/B9AMRJUrb0ALCdMLOjPIanYs2gnYBiotGtY1YgwfgrBUzgaAF 6puIWraUUF1MMejpx5DDyuNG8pNYbsqgreRF7Z4NBvgXMYetGT+nQ1jDuX8pJFJauZTpQO 0SX/KIsalSUIebEwn0NlAyn9miuFxDAMJGJTGCdQ4SdZHsI9Sl7My528vIhb/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NN2HZpz1Pm0; Wed, 26 Feb 2025 19:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVmbD018854; Wed, 26 Feb 2025 19:31:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVmsf018851; Wed, 26 Feb 2025 19:31:48 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:48 GMT Message-Id: <202502261931.51QJVmsf018851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 4b2c7dfe768d - main - net80211: add VHT MCS in AMRR rate control List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b2c7dfe768d341336f58db3cced9b097e1a6d2d Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=4b2c7dfe768d341336f58db3cced9b097e1a6d2d commit 4b2c7dfe768d341336f58db3cced9b097e1a6d2d Author: Adrian Chadd AuthorDate: 2025-01-13 17:05:31 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:24 +0000 net80211: add VHT MCS in AMRR rate control This is a simple implementation, similar to HT, to generate VHT MCS rates for testing. I've verified it seems to do the right thing through MCS 0..9 and NSS 1..2. It's not very optimal - same issues as with 11n - but it at least now fully tests the 11ac TX path in rtwn and the tx rate refactoring. Differential Revision: https://reviews.freebsd.org/D48611 --- sys/net80211/ieee80211_amrr.c | 183 ++++++++++++++++++++++++++++++++++++++++-- sys/net80211/ieee80211_amrr.h | 4 + 2 files changed, 181 insertions(+), 6 deletions(-) diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index 352f8df3a03e..1a06303bd2c9 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -49,6 +49,7 @@ #include #include +#include #include #include @@ -138,6 +139,23 @@ amrr_deinit(struct ieee80211vap *vap) nrefs--; /* XXX locking */ } +static void +amrr_node_init_vht(struct ieee80211_node *ni) +{ + struct ieee80211_amrr_node *amn = ni->ni_rctls; + + /* Default to VHT NSS 1 MCS 2; should be reliable! */ + amn->amn_vht_mcs = 2; + amn->amn_vht_nss = 1; + ieee80211_node_set_txrate_vht_rate(ni, amn->amn_vht_nss, + amn->amn_vht_mcs); + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: VHT: initial rate NSS %d MCS %d", + amn->amn_vht_nss, + amn->amn_vht_mcs); +} + static void amrr_node_init_ht(struct ieee80211_node *ni) { @@ -237,8 +255,10 @@ amrr_node_init(struct ieee80211_node *ni) amn->amn_success_threshold = amrr->amrr_min_success_threshold; amn->amn_ticks = ticks; - /* 11n or not? Pick the right rateset */ - if (ieee80211_ht_check_tx_ht(ni)) + /* Pick the right rateset */ + if (ieee80211_vht_check_tx_vht(ni)) + amrr_node_init_vht(ni); + else if (ieee80211_ht_check_tx_ht(ni)) amrr_node_init_ht(ni); else amrr_node_init_legacy(ni); @@ -250,6 +270,137 @@ amrr_node_deinit(struct ieee80211_node *ni) IEEE80211_FREE(ni->ni_rctls, M_80211_RATECTL); } +static void +amrr_update_vht_inc(struct ieee80211_node *ni) +{ + struct ieee80211_amrr_node *amn = ni->ni_rctls; + uint8_t nss, mcs; + + /* + * For now just keep looping over MCS to 9, then NSS up, checking if + * it's valid via ieee80211_vht_node_check_tx_valid_mcs(), + * until we hit max. This at least tests the VHT MCS rates, + * but definitely is suboptimal (in the same way the 11n MCS selection + * is suboptimal.) + */ + nss = amn->amn_vht_nss; + mcs = amn->amn_vht_mcs; + + while (nss <= 8 && mcs <= 9) { + /* Increment MCS 0..9, NSS 1..8 */ + if (mcs == 9) { + mcs = 0; + nss++; + } else + mcs++; + if (nss > 8) + break; + + if (ieee80211_vht_node_check_tx_valid_mcs(ni, ni->ni_chw, nss, + mcs)) { + amn->amn_vht_nss = nss; + amn->amn_vht_mcs = mcs; + break; + } + } +} + +static void +amrr_update_vht_dec(struct ieee80211_node *ni) +{ + struct ieee80211_amrr_node *amn = ni->ni_rctls; + uint8_t nss, mcs; + + /* + * For now just keep looping over MCS 9 .. 0 then NSS down, checking if + * it's valid via ieee80211_vht_node_check_tx_valid_mcs(), + * until we hit min. This at least tests the VHT MCS rates, + * but definitely is suboptimal (in the same way the 11n MCS selection + * is suboptimal. + */ + nss = amn->amn_vht_nss; + mcs = amn->amn_vht_mcs; + + while (nss >= 1 && mcs >= 0) { + + if (mcs == 0) { + mcs = 9; + nss--; + } else + mcs--; + if (nss < 1) + break; + + if (ieee80211_vht_node_check_tx_valid_mcs(ni, ni->ni_chw, nss, + mcs)) { + amn->amn_vht_nss = nss; + amn->amn_vht_mcs = mcs; + break; + } + } +} + +/* + * A placeholder / temporary hack VHT rate control. + * + * Use the available MCS rates at the current node bandwidth + * and configured / negotiated MCS rates. + */ +static int +amrr_update_vht(struct ieee80211_node *ni) +{ + struct ieee80211_amrr_node *amn = ni->ni_rctls; + struct ieee80211_amrr *amrr = ni->ni_vap->iv_rs; + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: VHT: current rate NSS %d MCS %d, txcnt=%d, retrycnt=%d", + amn->amn_vht_nss, amn->amn_vht_mcs, amn->amn_txcnt, + amn->amn_retrycnt); + + if (is_success(amn)) { + amn->amn_success++; + if (amn->amn_success >= amn->amn_success_threshold) { + amn->amn_recovery = 1; + amn->amn_success = 0; + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: VHT: increase rate (txcnt=%d retrycnt=%d)", + amn->amn_txcnt, amn->amn_retrycnt); + + amrr_update_vht_inc(ni); + } else { + amn->amn_recovery = 0; + } + } else if (is_failure(amn)) { + amn->amn_success = 0; + + if (amn->amn_recovery) { + amn->amn_success_threshold *= 2; + if (amn->amn_success_threshold > + amrr->amrr_max_success_threshold) + amn->amn_success_threshold = + amrr->amrr_max_success_threshold; + } else { + amn->amn_success_threshold = + amrr->amrr_min_success_threshold; + } + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: VHT: decreasing rate (txcnt=%d retrycnt=%d)", + amn->amn_txcnt, amn->amn_retrycnt); + + amrr_update_vht_dec(ni); + + amn->amn_recovery = 0; + } + + /* Reset counters */ + amn->amn_txcnt = 0; + amn->amn_retrycnt = 0; + + /* Return 0, not useful anymore */ + return (0); +} + static int amrr_update_ht(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, struct ieee80211_node *ni) @@ -382,8 +533,10 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, KASSERT(is_enough(amn), ("txcnt %d", amn->amn_txcnt)); - /* 11n or not? Pick the right rateset */ - if (ieee80211_ht_check_tx_ht(ni)) + /* Pick the right rateset */ + if (ieee80211_vht_check_tx_vht(ni)) + rix = amrr_update_vht(ni); + else if (ieee80211_ht_check_tx_ht(ni)) rix = amrr_update_ht(amrr, amn, ni); else rix = amrr_update_legacy(amrr, amn, ni); @@ -395,6 +548,22 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, return (rix); } +static int +amrr_rate_vht(struct ieee80211_node *ni) +{ + struct ieee80211_amrr *amrr = ni->ni_vap->iv_rs; + struct ieee80211_amrr_node *amn = ni->ni_rctls; + + if (is_enough(amn) && (ticks - amn->amn_ticks) > amrr->amrr_interval) + amrr_update_vht(ni); + + ieee80211_node_set_txrate_vht_rate(ni, amn->amn_vht_nss, + amn->amn_vht_mcs); + + /* Note: There's no vht rs_rates, and the API doesn't use it anymore */ + return (0); +} + /* * Return the rate index to use in sending a data frame. * Update our internal state if it's been long enough. @@ -416,9 +585,10 @@ amrr_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) return 0; } - amrr = amn->amn_amrr; + if (ieee80211_vht_check_tx_vht(ni)) + return (amrr_rate_vht(ni)); - /* 11n or not? Pick the right rateset */ + /* Pick the right rateset */ if (ieee80211_ht_check_tx_ht(ni)) { /* XXX ew */ rs = (struct ieee80211_rateset *) &ni->ni_htrates; @@ -426,6 +596,7 @@ amrr_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) rs = &ni->ni_rates; } + amrr = amn->amn_amrr; if (is_enough(amn) && (ticks - amn->amn_ticks) > amrr->amrr_interval) { rix = amrr_update(amrr, amn, ni); if (rix != amn->amn_rix) { diff --git a/sys/net80211/ieee80211_amrr.h b/sys/net80211/ieee80211_amrr.h index 795cbf673e56..49d62953e625 100644 --- a/sys/net80211/ieee80211_amrr.h +++ b/sys/net80211/ieee80211_amrr.h @@ -49,6 +49,10 @@ struct ieee80211_amrr_node { struct ieee80211_amrr *amn_amrr;/* backpointer */ int amn_rix; /* current rate index */ int amn_ticks; /* time of last update */ + /* for VHT, since there's no VHT RIX right now */ + int amn_vht_mcs; + int amn_vht_nss; + /* statistics */ u_int amn_txcnt; u_int amn_success; From nobody Wed Feb 26 19:31:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NL5ybhz5nl5Q; Wed, 26 Feb 2025 19:31:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NL2TFFz3dks; Wed, 26 Feb 2025 19:31:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B8yvYP2DkJb7Fs/2RHYTpPb3jRswbnMEMltU9MgovvE=; b=yhuNZWMMXsSZf79yJvIBwaeLDGfKjvp0/lz+tsTo2GUpLubthvjs5IALqm7l6dUDFAkVDC 13QagPf2F+oCT0JsVJ1rxpRiy1ocX0C5PcZi6CsTg3Ev+/UrPFhkqcheKvjtWqn/FVXH/A 1t9qO6Qko20/hUuUnSLdrecF+v1ib3n6/BKg5Pj5UcednpMT8hvUz7PHBfWgCzhPHcmGgL R9KMYJh69kpW89iptPBpLdalE9dTOvv0kutkKXibfEkzTLZSmSTuDJiTZS0F7JKQhKSW/h Xz8hW1Bpo5HJ1KvvoSsm8i5z8W2CQpVWnevFpRERVgHT6ZYTYTLy6B+idGxlag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598306; a=rsa-sha256; cv=none; b=bRbabbJ3EGRWXKDQus1Oxl3i4ngNfFN5GXIwFzjx+1K0FKvtGvaplezY9UDIa4+4pmm1iA 6d7vvRtYmjYZY+bn499rO4/F9zHVhFEOLey08M+L73qpNv8sEfueItZoeBvu/12X4dD442 mzxWm0OkSPiR4Tap4xMDe5AAKucRdTGTUSKqhsY6mB5MrCI4qpFfOp6ZqFL0IHLyh9L8qS oPtoPBF8KSLc2RrBEPaDxyul3bFoa9ObORxQ7psaBHhiJjH8WAX+PdkSdeHFgkKjuB3OPC XJNai63wExBYIg7BCalv6ThP46MLJeesEWO+AQuFhXRYJ4KbxE5O8yhyLf5dqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B8yvYP2DkJb7Fs/2RHYTpPb3jRswbnMEMltU9MgovvE=; b=ih2I3gmhnSHm+SInvDZQbNyoTypjmChBFXgmc3lsJ+WAvsU8ExU0YHyM+BoMF5aGQorCx7 NFUJq2BfQnPEjhxxM6Yt/4yQ/sZmHwDd3CqXCHQF9hbbfEBl6MNKSnj35PXYDWt6rOD451 SU+VSvS6T20bvzrYeGaBB5bV7erZkrVNyI88hCz6XOogz2wCtXHkePi32iL3MKht6RzXNW YVjmrs3R1Yk+nCBJUha1ZbvOgVX/JIY2/cXuDseMk26ypF16ubZ23Aj+H5g7OQy3fqW9FH ry4UAILP5Jgdsxax4YFuc3QKuC2JlUrco7yeyaVOIVhkA0hzdiPiKU10+OhlDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NL0szWz1PTx; Wed, 26 Feb 2025 19:31:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVkQM018485; Wed, 26 Feb 2025 19:31:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVkEC018472; Wed, 26 Feb 2025 19:31:46 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:46 GMT Message-Id: <202502261931.51QJVkEC018472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: e99cbea414ff - main - net80211: refactor amrr_update() into HT and legacy paths List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e99cbea414ffa2c439a651e4726896ea8de99c83 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=e99cbea414ffa2c439a651e4726896ea8de99c83 commit e99cbea414ffa2c439a651e4726896ea8de99c83 Author: Adrian Chadd AuthorDate: 2024-12-29 19:38:51 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:21 +0000 net80211: refactor amrr_update() into HT and legacy paths Split the amrr_update() routine into HT and legacy paths. Currently they're the same, minus HT / non-HT specific comments and some logging changes. HT rates don't monotonically go up (ie, going MCS 7 -> MCS 8 is wrong, as MCS8 is "just" two stream MCS0) and failing a rate by a little shouldn't necessarily preclude testing the next rate up. This should be a no-op, besides the logging changes. Locally tested: * RTL8192CU, STA mode Differential Revision: https://reviews.freebsd.org/D48248 Reviewed by: bz, thj --- sys/net80211/ieee80211_amrr.c | 101 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 83 insertions(+), 18 deletions(-) diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index d366bf71e367..20e90026bfe9 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -226,26 +226,17 @@ amrr_node_deinit(struct ieee80211_node *ni) } static int -amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, +amrr_update_ht(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, struct ieee80211_node *ni) { int rix = amn->amn_rix; - const struct ieee80211_rateset *rs = NULL; + const struct ieee80211_rateset *rs; - KASSERT(is_enough(amn), ("txcnt %d", amn->amn_txcnt)); - - /* 11n or not? Pick the right rateset */ - if (ieee80211_ht_check_tx_ht(ni)) { - /* XXX ew */ - rs = (struct ieee80211_rateset *) &ni->ni_htrates; - } else { - rs = &ni->ni_rates; - } + rs = (struct ieee80211_rateset *)&ni->ni_htrates; /* XXX TODO: we really need a rate-to-string method */ - /* XXX TODO: non-11n rate should be divided by two.. */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "AMRR: current rate %d, txcnt=%d, retrycnt=%d", + "AMRR: current rate MCS %d, txcnt=%d, retrycnt=%d", rs->rs_rates[rix] & IEEE80211_RATE_VAL, amn->amn_txcnt, amn->amn_retrycnt); @@ -266,9 +257,9 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, amn->amn_success = 0; rix++; /* XXX TODO: we really need a rate-to-string method */ - /* XXX TODO: non-11n rate should be divided by two.. */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "AMRR increasing rate %d (txcnt=%d retrycnt=%d)", + "AMRR increasing rate MCS %d " + "(txcnt=%d retrycnt=%d)", rs->rs_rates[rix] & IEEE80211_RATE_VAL, amn->amn_txcnt, amn->amn_retrycnt); } else { @@ -289,20 +280,94 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, } rix--; /* XXX TODO: we really need a rate-to-string method */ - /* XXX TODO: non-11n rate should be divided by two.. */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "AMRR decreasing rate %d (txcnt=%d retrycnt=%d)", + "AMRR decreasing rate MCS %d " + "(txcnt=%d retrycnt=%d)", rs->rs_rates[rix] & IEEE80211_RATE_VAL, amn->amn_txcnt, amn->amn_retrycnt); } amn->amn_recovery = 0; } + return (rix); +} + +static int +amrr_update_legacy(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, + struct ieee80211_node *ni) +{ + int rix = amn->amn_rix; + const struct ieee80211_rateset *rs; + + rs = &ni->ni_rates; + + /* XXX TODO: we really need a rate-to-string method */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: current rate %d Mb, txcnt=%d, retrycnt=%d", + (rs->rs_rates[rix] & IEEE80211_RATE_VAL) / 2, + amn->amn_txcnt, + amn->amn_retrycnt); + + if (is_success(amn)) { + amn->amn_success++; + if (amn->amn_success >= amn->amn_success_threshold && + rix + 1 < rs->rs_nrates) { + amn->amn_recovery = 1; + amn->amn_success = 0; + rix++; + /* XXX TODO: we really need a rate-to-string method */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR increasing rate %d Mb (txcnt=%d retrycnt=%d)", + (rs->rs_rates[rix] & IEEE80211_RATE_VAL) / 2, + amn->amn_txcnt, amn->amn_retrycnt); + } else { + amn->amn_recovery = 0; + } + } else if (is_failure(amn)) { + amn->amn_success = 0; + if (rix > 0) { + if (amn->amn_recovery) { + amn->amn_success_threshold *= 2; + if (amn->amn_success_threshold > + amrr->amrr_max_success_threshold) + amn->amn_success_threshold = + amrr->amrr_max_success_threshold; + } else { + amn->amn_success_threshold = + amrr->amrr_min_success_threshold; + } + rix--; + /* XXX TODO: we really need a rate-to-string method */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR decreasing rate %d Mb (txcnt=%d retrycnt=%d)", + (rs->rs_rates[rix] & IEEE80211_RATE_VAL) / 2, + amn->amn_txcnt, amn->amn_retrycnt); + } + amn->amn_recovery = 0; + } + + return (rix); +} + +static int +amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, + struct ieee80211_node *ni) +{ + int rix; + + KASSERT(is_enough(amn), ("txcnt %d", amn->amn_txcnt)); + + /* 11n or not? Pick the right rateset */ + if (ieee80211_ht_check_tx_ht(ni)) + rix = amrr_update_ht(amrr, amn, ni); + else + rix = amrr_update_legacy(amrr, amn, ni); + /* reset counters */ amn->amn_txcnt = 0; amn->amn_retrycnt = 0; - return rix; + return (rix); } /* From nobody Wed Feb 26 19:31:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NM4y89z5nl4j; Wed, 26 Feb 2025 19:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NM25zXz3dc5; Wed, 26 Feb 2025 19:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oDvP8aL56FvIDrRi3fh52p82raU38XdfNqb4Hk33rlw=; b=oaN2v6JPySKvJ9NMvsxoed2ijoeAhs7uiyZD6+5ATskshTZyFQioJTITj7/GM6oDGdIahZ ykx0l2KiX6LfSXCsG7Otc9OX3RUFM4YCI33fw9uFFhPUrCZVJKUW7t+wb0dtbIF4S2yqzu 44SFTrB6yR/knbxDxgl2GSV1xMGs5KjAR25epPkIauZQV7bxYpVreSjbe/IZoduVtQEPzl Pft+0cg+g35Rw3RfA+EP9afiQZlc3HzuDD1lI4R3S2KCswL8shtArAyoG2ZqNf1GWTzXHe DjZf2YzkjsIsXUjpN11WY8HtvKdcIP3bwHnqpY32y7hw/x0QTeOY8/HHgGNtYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598307; a=rsa-sha256; cv=none; b=sebjhtjh3yzp4L9V4kVzEhgr9hscCTIDrYDacE0N04nlxbykZgCYq5iGzu8OJE8ctX9y4n KbvWeC1LzlUBnsuZKhd6VVZDDXQyTG22R3FIUCMmlT0luP508ZhU3W8e4B3h0vn7qqFRGF jru+XnbRlGP1dVH1WzuloJ3YQxB7yK64pPGEwal4XAeFBxEOKdrCa74iQdGMH1XzWTpkZk bJ7aIyKa2Rf5poJXATMZmnZNAgfcpPdqr/1yZ0fwtnJIejh7ef260RW2u642yvGQSo4jJB EzQz6+8wFmLizgFjCI34G59JClAhiGNw88i2lWbPTiWUcMyggGUQYgm0xE/VZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oDvP8aL56FvIDrRi3fh52p82raU38XdfNqb4Hk33rlw=; b=ssgynmVrXXhL5VMnK3Cd/JFue0wrzw6mWVPnAZcl+sYSh9sHJNThl1BG2x1YPxsfFYksGP vfUyy6P8HsdHm9Ai6KiT50jDSaGUliQpjFRPS4KtHI+5fZ32i3BnSWpNdySTuqvWz41ehj mvkNtSfmSRpJKDnesfJXQgJEFl/+Q+EEetBALufqz5r69pQShM1u2Dou6Cbu6n4KZNvOUm Kd2ObfmXNi2tGJySVt9BK2/PxLjSOHBdi8DeEc9URJyalmtj8OEcEKzVjLvBlFT2MzzUI2 uTTNF3dTD0Fy9075Jj4Zn3n4dLK+CuDLH+QxOzUX1f9jfKYYgZMLMe4AVswq6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NM1Msbz1Pgj; Wed, 26 Feb 2025 19:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVl6L018821; Wed, 26 Feb 2025 19:31:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVl8d018818; Wed, 26 Feb 2025 19:31:47 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:47 GMT Message-Id: <202502261931.51QJVl8d018818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 078acac88264 - main - net80211: refactor amrr_node_init() into HT and legacy paths List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 078acac882642ac5c88409d2f3e9d04acdcc63cc Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=078acac882642ac5c88409d2f3e9d04acdcc63cc commit 078acac882642ac5c88409d2f3e9d04acdcc63cc Author: Adrian Chadd AuthorDate: 2025-01-04 02:53:01 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:24 +0000 net80211: refactor amrr_node_init() into HT and legacy paths Refactor amrr_node_init() into HT and legacy paths, clean up the printing to be a bit clearer about the selected rates. This is precursor work to setting VHT rates in ni->ni_txrate . Differential Revision: https://reviews.freebsd.org/D48429 --- sys/net80211/ieee80211_amrr.c | 121 +++++++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 48 deletions(-) diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index 20e90026bfe9..352f8df3a03e 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -138,14 +138,79 @@ amrr_deinit(struct ieee80211vap *vap) nrefs--; /* XXX locking */ } +static void +amrr_node_init_ht(struct ieee80211_node *ni) +{ + const struct ieee80211_rateset *rs; + struct ieee80211_amrr_node *amn = ni->ni_rctls; + uint8_t rate; /* dot11rate */ + + rs = (struct ieee80211_rateset *) &ni->ni_htrates; + /* Initial rate - lowest */ + rate = rs->rs_rates[0]; + + /* Pick something low that's likely to succeed */ + for (amn->amn_rix = rs->rs_nrates - 1; amn->amn_rix > 0; + amn->amn_rix--) { + /* 11n - stop at MCS4 */ + if ((rs->rs_rates[amn->amn_rix] & 0x1f) < 4) + break; + } + rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; + + /* Ensure the MCS bit is set */ + rate |= IEEE80211_RATE_MCS; + + /* Assign initial rate from the rateset */ + ieee80211_node_set_txrate_dot11rate(ni, rate); + + /* XXX TODO: we really need a rate-to-string method */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: nrates=%d, initial rate MCS %d", + rs->rs_nrates, + (rate & IEEE80211_RATE_VAL)); +} + +static void +amrr_node_init_legacy(struct ieee80211_node *ni) +{ + const struct ieee80211_rateset *rs; + struct ieee80211_amrr_node *amn = ni->ni_rctls; + uint8_t rate; /* dot11rate */ + + rs = &ni->ni_rates; + /* Initial rate - lowest */ + rate = rs->rs_rates[0]; + + /* Clear the basic rate flag if it's not 11n */ + rate &= IEEE80211_RATE_VAL; + + /* Pick something low that's likely to succeed */ + for (amn->amn_rix = rs->rs_nrates - 1; amn->amn_rix > 0; + amn->amn_rix--) { + /* legacy - anything < 36mbit, stop searching */ + if ((rs->rs_rates[amn->amn_rix] & + IEEE80211_RATE_VAL) <= 72) + break; + } + rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; + + /* Assign initial rate from the rateset */ + ieee80211_node_set_txrate_dot11rate(ni, rate); + + /* XXX TODO: we really need a rate-to-string method */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: nrates=%d, initial rate %d Mb", + rs->rs_nrates, + (rate & IEEE80211_RATE_VAL) / 2); +} + static void amrr_node_init(struct ieee80211_node *ni) { - const struct ieee80211_rateset *rs = NULL; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_amrr *amrr = vap->iv_rs; struct ieee80211_amrr_node *amn; - uint8_t rate; if (!amrr) { if_printf(vap->iv_ifp, "ratectl structure was not allocated, " @@ -163,60 +228,20 @@ amrr_node_init(struct ieee80211_node *ni) } } else amn = ni->ni_rctls; + + /* Common state */ amn->amn_amrr = amrr; amn->amn_success = 0; amn->amn_recovery = 0; amn->amn_txcnt = amn->amn_retrycnt = 0; amn->amn_success_threshold = amrr->amrr_min_success_threshold; + amn->amn_ticks = ticks; /* 11n or not? Pick the right rateset */ - if (ieee80211_ht_check_tx_ht(ni)) { - /* XXX ew */ - IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "%s: 11n node", __func__); - rs = (struct ieee80211_rateset *) &ni->ni_htrates; - } else { - IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "%s: non-11n node", __func__); - rs = &ni->ni_rates; - } - - /* Initial rate - lowest */ - rate = rs->rs_rates[0]; - - /* XXX clear the basic rate flag if it's not 11n */ - if (! ieee80211_ht_check_tx_ht(ni)) - rate &= IEEE80211_RATE_VAL; - - /* pick initial rate from the rateset - HT or otherwise */ - /* Pick something low that's likely to succeed */ - for (amn->amn_rix = rs->rs_nrates - 1; amn->amn_rix > 0; - amn->amn_rix--) { - /* legacy - anything < 36mbit, stop searching */ - /* 11n - stop at MCS4 */ - if (ieee80211_ht_check_tx_ht(ni)) { - if ((rs->rs_rates[amn->amn_rix] & 0x1f) < 4) - break; - } else if ((rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL) <= 72) - break; - } - rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; - - /* if the rate is an 11n rate, ensure the MCS bit is set */ if (ieee80211_ht_check_tx_ht(ni)) - rate |= IEEE80211_RATE_MCS; - - /* Assign initial rate from the rateset */ - ieee80211_node_set_txrate_dot11rate(ni, rate); - amn->amn_ticks = ticks; - - /* XXX TODO: we really need a rate-to-string method */ - /* XXX TODO: non-11n rate should be divided by two.. */ - IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "AMRR: nrates=%d, initial rate %s%d", - rs->rs_nrates, - ieee80211_ht_check_tx_ht(ni) ? "MCS " : "", - rate & IEEE80211_RATE_VAL); + amrr_node_init_ht(ni); + else + amrr_node_init_legacy(ni); } static void From nobody Wed Feb 26 19:31:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NP6m3Qz5nksY; Wed, 26 Feb 2025 19:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NP3lw0z3dhw; Wed, 26 Feb 2025 19:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9R9VtWgfozUtTK/Cx8zjZ2c4CsakGmm62ZyWDNjmu0s=; b=bq6ZSQMt/VWd84Js4s3PL1kdw/EoT1JQrhGlqQwqGu7WGCCG2dLK8RYnVZstZv9yfm5lHX /X00feTXJo6pNPCZ+3fhDJJ3Trt55aWvDtIlRtog5IRGCtopt+ivPqtJnbOyO2VZuBvJHt nRLo6wJhymFB7z8CUAY8lJkDw8azyLu/O1yY9Qo2BH8zVKXwKIhrP1xicKQ5wYK/RQEdfl seZOhxAIJxcFtCsdnSqg2YK/keEGEMFSYEwZO7mUIuHarsI/4VgLIwP2e1eqlHL2xuHXDK aFImv/ii2SNl06FnNRgWD+J8T5MhBW57/UjbEYvIcRLBOZZ+OyKIBpERlRSDNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598309; a=rsa-sha256; cv=none; b=FrvDl4EWifzer10L4a0ahxcc/RTAmo5NOxqcXYAvPteMJIWRxwOlJISQPov8XvuQhcFNeQ IQ69v6i9DU//b9xTjErwFwUitTKa+g3OCPVFyMIsCACWKafYUfswKeWmEvDa1qUUYz7GET WsikrbIYOhlFneeIytG/8hFrTAityeCnxsDaPZf2cszVE5Iq2hp1w6Faqr9J6Wc35CLSb4 pv8hqf1Xce1Y5wYFK9ACuBUcAQ3oRo4jDGmehrifL9287k9CgI5P/EV6otuSipyceqENeR YrOS+ilU2IfYbwuok0EkAWZGO56ioVWsav/8M18tZ+McPHN6a+SG0G9CX9lCgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9R9VtWgfozUtTK/Cx8zjZ2c4CsakGmm62ZyWDNjmu0s=; b=oSEJGUIRo/I7DZHE9M01DE9RlypvTKQPH+g+AcEn1eo3wl8u9g3/L/xdfatKGaiQGDHjWD YDX9YJitwyVjq4WvhhobdgsGRKEIuXcagJGkcpPsbjSwJvMtk74oen8XhRimQKZtyWdsRa hpnF1AURCdsRvMSwg4LVr8oaAxlAmnNa6doXXiPaWNvvxUsKEmlaVfNOQZoXCeakL3N2BF E9Y1I2HxOHF++Izvtl6UsGQDmjBr/MwF+nrUIWph6rADNGOMjLcn0gBtc0sm8odsjYDDcE aZIYrN0MlC9cOaentb/wSt3CgjxLEmZTk/RP7vK1m5RoEuaQeEbYTYvqyncIjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NP3CFbz1PTy; Wed, 26 Feb 2025 19:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVnWs018888; Wed, 26 Feb 2025 19:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVnfr018885; Wed, 26 Feb 2025 19:31:49 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:49 GMT Message-Id: <202502261931.51QJVnfr018885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: ff0e22f88d04 - main - net80211: add ieee80211_phy_vht_get_mcs_kbit() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff0e22f88d041da2a146d70140a535c57b40c16d Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=ff0e22f88d041da2a146d70140a535c57b40c16d commit ff0e22f88d041da2a146d70140a535c57b40c16d Author: Adrian Chadd AuthorDate: 2025-01-15 05:09:27 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:25 +0000 net80211: add ieee80211_phy_vht_get_mcs_kbit() Add ieee80211_phy_vht_get_mcs_kbit(), which calculates the VHT rate in kbit/sec. Differential Revision: https://reviews.freebsd.org/D48612 --- sys/net80211/ieee80211_phy.c | 85 ++++++++++++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_phy.h | 2 ++ 2 files changed, 87 insertions(+) diff --git a/sys/net80211/ieee80211_phy.c b/sys/net80211/ieee80211_phy.c index 9c2b1197564a..eb96d74a2bd9 100644 --- a/sys/net80211/ieee80211_phy.c +++ b/sys/net80211/ieee80211_phy.c @@ -707,3 +707,88 @@ ieee80211_phy_vht_validate_mcs(enum ieee80211_sta_rx_bw bw, uint8_t nss, return ((mask & (1 << mcs)) != 0); } + +struct mcs_entry { + int n_sym; /* Number of bits per symbol */ + int cod_n; /* Coding rate numerator */ + int cod_d; /* Coding rate denominator */ +}; + +/* + * These parameters are taken from 802.11-2020 Table 21-29 + * (VHT-MCSs for Mandatory 20 MHZ, Nss=1). + * + * n_sym corresponds to "Nbpscs", cod_n/cod_d corresponds to + * "R". + */ +static struct mcs_entry mcs_entries[] = { + { 1, 1, 2 }, /* MCS0 */ + { 2, 1, 2 }, + { 2, 3, 4 }, + { 4, 1, 2 }, + { 4, 3, 4 }, + { 6, 2, 3 }, + { 6, 3, 4 }, + { 6, 5, 6 }, + { 8, 3, 4 }, + { 8, 5, 6 }, /* MCS9 */ +}; + +/** + * @brief Calculate the bitrate of the given VHT MCS rate. + * + * @param bw Channel bandwidth (enum ieee80211_sta_rx_bw) + * @param nss Number of spatial streams, 1..8 + * @param mcs MCS, 0..9 + * @param is_shortgi True if short guard-interval (400nS) + * false otherwise (800nS) + * + * @returns The bitrate in kbit/sec. + */ +uint32_t +ieee80211_phy_vht_get_mcs_kbit(enum ieee80211_sta_rx_bw bw, + uint8_t nss, uint8_t mcs, bool is_shortgi) +{ + uint32_t sym_len, n_carriers; + + /* Validate MCS 0..9, NSS 1..8 */ + if (mcs > 9) + return (0); + if (nss == 0 || nss > 8) + return (0); + + /* + * Short-GI - 3.6uS symbol time, long-GI - 4.0uS symbol time + * + * See 802.11-2020 Table 21-5 (Timing-related constraints.) + */ + if (is_shortgi) + sym_len = 36; + else + sym_len = 40; + + /* + * Calculate the number of carriers for the given channel bandwidth + * + * See 802.11-2020 Table 21-5 (Timing-related constraints.) + */ + switch (bw) { + case IEEE80211_STA_RX_BW_20: + n_carriers = 52; + break; + case IEEE80211_STA_RX_BW_40: + n_carriers = 108; + break; + case IEEE80211_STA_RX_BW_80: + n_carriers = 234; + break; + case IEEE80211_STA_RX_BW_160: + n_carriers = 468; + break; + default: + return (0); + } + + return ((n_carriers * mcs_entries[mcs].n_sym * mcs_entries[mcs].cod_n * + nss * 10000) / (mcs_entries[mcs].cod_d * sym_len)); +} diff --git a/sys/net80211/ieee80211_phy.h b/sys/net80211/ieee80211_phy.h index 466f59584f2c..749b082e34e9 100644 --- a/sys/net80211/ieee80211_phy.h +++ b/sys/net80211/ieee80211_phy.h @@ -227,6 +227,8 @@ uint16_t ieee80211_phy_vht_get_mcs_mask(enum ieee80211_sta_rx_bw, uint8_t); bool ieee80211_phy_vht_validate_mcs(enum ieee80211_sta_rx_bw, uint8_t, uint8_t); +uint32_t ieee80211_phy_vht_get_mcs_kbit(enum ieee80211_sta_rx_bw, + uint8_t, uint8_t, bool); #endif /* _KERNEL */ #endif /* !_NET80211_IEEE80211_PHY_H_ */ From nobody Wed Feb 26 19:31:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NR48DFz5nl7y; Wed, 26 Feb 2025 19:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NQ4ylBz3dcb; Wed, 26 Feb 2025 19:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nR0qHLnlv2AMDMcNRRYoAa3FwVQUTgoHLOBwsr3kV7w=; b=fe88+aeGakSqN1oIoW0wMV8zmzSDf3U/HNid4PJs5yhOcQZHbUkBlUSBBiHNeZ93viHywI osb2NUMFgirjPHVbX+g0VJlKheVCCbMZe2F6RNjHoowuEm82T9ZBpOjfZayzP02AFLFwkH TbW9bbnlsRBbTXr9f/rTTFKTVkLkIXm9gn/8fI97xaH+/ph5z8Pzv6Xl0Au9j5DCywtI4t 1I92/gg+DOdo2w9bZ3GvThuggDEViwq1BLFWUQBxloVZFdI0VlUbqOtk0Yrwz6vZ6pGqxm NemWRub6n3miOWeZYtNPjgp0A6S9rVQcjjghSyBnRmNFa8TlS9E9AtqbUqYDuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598310; a=rsa-sha256; cv=none; b=P/XD8LWWhpK02v2dFbC6Dervf5PSEpRj3NfeEQhVeS5VHgdhkPzwiVZZLub4MiAZmVfR3M MEO0ZuZ36huGlFBG+LWb40DUuVjsfoKHy4x9SG9m2cEYYnSnX/nWTKaNSWn1ETQgfvKijj 54rsc06yZbZ1NRcqlxKPg8FmRyCVEyC2sGibCt45VEXBoZRp2S8D/9WgrXaGpmlFS3UKFi KyM7gnXNgQZzjUNLLMlSgrfqwephNLHbp8TsyPRHLaTw6gcVow4c9sb5/pu7wF1tUTBks6 i1fdAyPHNCCk6uj5fQYuymzwGkIZ4Vi9Ngeh1cYe+PqQzY23JpjD8apbfD6+AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nR0qHLnlv2AMDMcNRRYoAa3FwVQUTgoHLOBwsr3kV7w=; b=ep2QX1JL9xOkKRTaOUjKjvGvkyWR+jgEdjeMXxlqYqQFX3ifgcElqOGqlWFpbr9LD/4Ves oQy7wcybMrgi9Fpy5y6XI1rfdgeZ6td+EM3iesLT5prbIRu2MHFeOd3n1cPDUz81HVh0CL phafpqA4rzC8vvaiHcrB8JsOEo/lx0BJY1E73xD2+JbFZ1XPPyOlxnVbj1ngUrxbdkns2z EVxNjW2Rt0xLPI8itBEpMsl3J6BRDtK8wl2/ak3TuHel3N7dSzTrkfM15EZVWrEPvkQvaS Vm3274crk7mKyNm5zOAtqbxOnl/+9VUTLkXY1StV/GaKnG4rpwGm70zvmcVCCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NQ482Kz1NX9; Wed, 26 Feb 2025 19:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVort018929; Wed, 26 Feb 2025 19:31:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVoQi018926; Wed, 26 Feb 2025 19:31:50 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:50 GMT Message-Id: <202502261931.51QJVoQi018926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 6fef9e7378d0 - main - net80211: update ieee80211_node_get_txrate_mbit() to support VHT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fef9e7378d0af0e710ce7c3601886410db82cd6 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=6fef9e7378d0af0e710ce7c3601886410db82cd6 commit 6fef9e7378d0af0e710ce7c3601886410db82cd6 Author: Adrian Chadd AuthorDate: 2025-01-15 05:10:59 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:26 +0000 net80211: update ieee80211_node_get_txrate_mbit() to support VHT Update ieee80211_node_get_txrate_mbit() to use ieee80211_phy_vht_get_mcs_kbit() to calculate VHT rates. For now just assume long-GI; I'd have to go and do some extra work to figure out which short/long GI flag to use. Differential Revision: https://reviews.freebsd.org/D48613 --- sys/net80211/ieee80211_node.c | 58 ++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index bc0358feb7a8..f4185dfb04d4 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3292,46 +3292,42 @@ ieee80211_node_set_txrate_vht_rate(struct ieee80211_node *ni, uint32_t ieee80211_node_get_txrate_kbit(struct ieee80211_node *ni) { - uint32_t mbps; + uint32_t kbps; - /* - * TODO: only handle legacy/HT rates, VHT will need - * to use other logic. - */ switch (ni->ni_txrate.type) { case IEEE80211_NODE_TXRATE_LEGACY: + kbps = ni->ni_txrate.dot11rate * 500; + break; case IEEE80211_NODE_TXRATE_HT: + /* Note: Valid for MCS 0..76 */ + { + const struct ieee80211_mcs_rates *mcs = + &ieee80211_htrates[ni->ni_txrate.dot11rate & + ~IEEE80211_RATE_MCS]; + + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + if (ni->ni_flags & IEEE80211_NODE_SGI40) + kbps = mcs->ht40_rate_800ns * 500; + else + kbps = mcs->ht40_rate_400ns * 500; + } else { + if (ni->ni_flags & IEEE80211_NODE_SGI20) + kbps = mcs->ht20_rate_800ns * 500; + else + kbps = mcs->ht20_rate_400ns * 500; + } + } break; case IEEE80211_NODE_TXRATE_VHT: + /* Note: valid for VHT rates, assumes long-GI for now */ + kbps = ieee80211_phy_vht_get_mcs_kbit(ni->ni_chw, + ni->ni_txrate.nss, ni->ni_txrate.mcs, false); + break; default: - printf("%s: called for VHT / unknown rate (type %d)!\n", + printf("%s: called for unknown rate (type %d)!\n", __func__, ni->ni_txrate.type); return (0); } - /* Legacy / MCS rates */ - if (ni->ni_txrate.dot11rate & IEEE80211_RATE_MCS) { - const struct ieee80211_mcs_rates *mcs = - &ieee80211_htrates[ni->ni_txrate.dot11rate & - ~IEEE80211_RATE_MCS]; - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { - /* Note: these are in 1/2Mbit/s units */ - if (ni->ni_flags & IEEE80211_NODE_SGI40) - mbps = mcs->ht40_rate_800ns; - else - mbps = mcs->ht40_rate_400ns; - } else { - if (ni->ni_flags & IEEE80211_NODE_SGI20) - mbps = mcs->ht20_rate_800ns; - else - mbps = mcs->ht20_rate_400ns; - } - } else - /* Note: CCK/OFDM dot11rate entries are in 1/2Mbit/s units */ - mbps = ni->ni_txrate.dot11rate; - - /* - * Note; 'mbps' in 1/2 Mbit/s units so *500 to make it in kbit/s units. - */ - return (mbps * 500); + return (kbps); } From nobody Wed Feb 26 19:31:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NS1cXkz5nl82; Wed, 26 Feb 2025 19:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NR5ThYz3dcn; Wed, 26 Feb 2025 19:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mpr/ND3HIFE8KgnMztEYZBT3jGuyI1kkq4/f43zEtiE=; b=bDwxEmYAWY8FW1fn6ttDZvGlhBL8TOcSc7OJgQQr8a45dR3LYD8i1ebOngXH4uiEeDelD3 5CB8CUdC8UHJ3+X8y8v6XQy2m3A3/c7Q2wkEhLUWP7iSHtgFNk8nrE071PkoAACr3VoJ3E SWenXAzBZVlVE+tn5LdxlKSXSh/o7yd6VpTGgv9a2bqnsCbpAA5vYJBLhSLpqiCYVWMMPw 0QLktxum1Q54FFm3ncj07xibfF0Nvx/MgwGlCwkUuN4XW+5gpB8RXC3tfIkV7pUvyvSq9g qGUrfhKxxygVFGHIS6DxrhAh4VMA6cjJkNAq3fkZOtMrhx+OCB4PGW/5AgBCew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598311; a=rsa-sha256; cv=none; b=pUOJswlLGTE5ua1n+c9XpEDLNGwgTHHOXXO+dqHEGi1+Hh2vyvI05qcJmPrC64tpH4FgL2 jhKzYUrRIoarMuB9R8vESHAIpMLUN+0nGLUahYE4C2+oogBtfegmVNz34UTmgBhP5+MRrs CZlaQW5+6t51o2psGmoJf0UyvSZpWR3Z7fKkZpp7wx6itnhwQN8CNMiZ2PJeEBDr98516W dQqn6GMPzOVCkOZd6JYJVf7Ak/xEIeiApj/k+xaJzFZTZbjenySuczpkBxtxRkhH0Z+Wgv dK1DwF0DVS8a+/6IBGEtdkdEYs1OAT+uGhnCGTW/mIp8es6+KblDqkg7QQ525Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mpr/ND3HIFE8KgnMztEYZBT3jGuyI1kkq4/f43zEtiE=; b=HBbaluGfps1dfS0JPwlfhC6QpqQex/ny7rtaGvAXI+IexlBj9P4EoBqwt7cqs0oGs6TdOp YhCR9NZtAZYYoUDOtrBgYAGgHNq5tPiPibUBT58Kn+1pI6qUS6a+v7Gefcp8mShN1jmUSV rDN8xwN5vM44HItcY3NQgP9kX/nDWcN6smJ+CTyOpjI4R/nm7Zm5zvSVu4OwYlSL10hNOD 08aiDWoi3Z7GQ/YHcxbYkZFsCk/C0u12MJ9u61EtHPJIsx2IhqwSBP1WHmD1cGomqQU/rJ OjuSjL6xfvoxN6OqBxbqPd25XiaqQ8NxLkrB6raji7Daoi9ia2sSlhp3a27UKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NR54gcz1PV1; Wed, 26 Feb 2025 19:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVpZF018964; Wed, 26 Feb 2025 19:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVptH018961; Wed, 26 Feb 2025 19:31:51 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:51 GMT Message-Id: <202502261931.51QJVptH018961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 62823019db16 - main - net80211: add static initialisers for the ieee80211_node_txrate options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62823019db16bdd30a6505290c090db105d432d4 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=62823019db16bdd30a6505290c090db105d432d4 commit 62823019db16bdd30a6505290c090db105d432d4 Author: Adrian Chadd AuthorDate: 2025-01-17 02:34:44 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:26 +0000 net80211: add static initialisers for the ieee80211_node_txrate options Add static initialisers for legacy, ht and vht rates. Differential Revision: https://reviews.freebsd.org/D48614 --- sys/net80211/ieee80211_node.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index ae5f72a070b6..e87192a8a5ae 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -153,6 +153,24 @@ struct ieee80211_node_txrate { uint8_t dot11rate; /* Legacy/HT - dot11rate / ratecode */ }; +#define IEEE80211_NODE_TXRATE_INIT_LEGACY(rate) \ + (struct ieee80211_node_txrate) { .type = IEEE80211_NODE_TXRATE_LEGACY, \ + .nss = 0, \ + .mcs = 0, \ + .dot11rate = (rate) } + +#define IEEE80211_NODE_TXRATE_INIT_HT(i_mcs) \ + (struct ieee80211_node_txrate) { .type = IEEE80211_NODE_TXRATE_HT, \ + .nss = 0, \ + .mcs = (i_mcs), \ + .dot11rate = (i_mcs) | IEEE80211_RATE_MCS } + +#define IEEE80211_NODE_TXRATE_INIT_VHT(i_nss, i_mcs) \ + (struct ieee80211_node_txrate) { .type = IEEE80211_NODE_TXRATE_VHT, \ + .nss = (i_nss), \ + .mcs = (i_mcs), \ + .dot11rate = 0 } + /* * Node specific information. Note that drivers are expected * to derive from this structure to add device-specific per-node From nobody Wed Feb 26 19:31:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NT1lPdz5nkpx; Wed, 26 Feb 2025 19:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NS6jXdz3djf; Wed, 26 Feb 2025 19:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XJn9thu+DglhMzH0Xu2L5D7MUfaZi1q+3qWBJS6PHVk=; b=orfz03ZqSoERVxJp9AHCpg2AypXRdC1iKo4VNSVDUb6hVqxTsaB6yrnFnyTT8UiFw6dDtK qJIKo4N9PGY2QYq09CaOEH2Xwz+ptDM4vbe4j58aCnrzlwDkGWr3toCTmNqmo2rJGnAsGE z9WkifW6whquC6BDfvXYbO4gqXewiP7KrKRI1L0aGA/L0pSV6qHXkROWtB+S8o/A1cXoG2 gRSbxOnMdXvAwKHP9BvGHk9/xPPMJZCflkdDthz4XexBL2ZvF1/ffFK1XulU3yrD1VlLLP 2D7WSE8xkbBdKoQW8OFlMRFEWWcTQ5eni44se8ZcLdlrkKoCLWXdKDS2F26rOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598312; a=rsa-sha256; cv=none; b=pTjA0v6ohzjCf5Hjfg/3ShfocdcdJoYqNzuRhtPwci3rlB+2NxETyKgA+OA8C+CC2LFKnC FfO1JFmNIcpf0Ocbltu67AN/UMusuBDl+nrFxlAUrnv/amN2FdP+dfM/6ibmVE+X4hw0M1 VducpAtaF1IHEmtcrOHyw+3+WR2Spk3VxLHSuyMSijxXWa6crwHAO2nWuJbzavtMNfiKFz 5ezUw/EyivRQTEkC2ZTLCcyyeqJlYjtYYO3UzHFEJ7llCjC+L57deeirP9VdzQNsRv85jw 6+T53qUp6SUR1IcViqTFdi8gaHx+qoYXXhf5LN0SmM49aFN8KOeyiiKgiNG+SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XJn9thu+DglhMzH0Xu2L5D7MUfaZi1q+3qWBJS6PHVk=; b=cmggJlsqi0vdI3MRMC65R8ruCngnM8kkqlEsDb5BnMQTlrw4G8nngNvR2BhOxL25kOQhdZ pU1Wz83zcAp+xkxuRFr0xqdMUzjFcthRl3+zaE7gGurt6sTx0D6HokU6Q8E/kXOavXGw8C VwAkeog4jlLiscozGSHOnZWBfXzSYbYUULgfV928pc5PaDotHUW4xJt/BKPWBvVbk1DBTB m+nYZbt2KdkNiLhmetcEWgorWiYCHT7FNjjqbF6XYXbiRbUxCYHD+91PezxP1hsYq+RhPK Bwiu8+YD6WxdOsrz6Rr+9+B/VsZk1RahZA5PTeCJpSlIVkaMKkJeCYf9td9Ikg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NS62mmz1PYn; Wed, 26 Feb 2025 19:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVq34018999; Wed, 26 Feb 2025 19:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVqb8018996; Wed, 26 Feb 2025 19:31:52 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:52 GMT Message-Id: <202502261931.51QJVqb8018996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: e274a23c0d3d - main - net80211: migrate ieee80211_rate2media() to use ieee80211_node_txrate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e274a23c0d3d3c8e9796158029f36e60edf61831 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=e274a23c0d3d3c8e9796158029f36e60edf61831 commit e274a23c0d3d3c8e9796158029f36e60edf61831 Author: Adrian Chadd AuthorDate: 2025-01-17 02:35:10 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:27 +0000 net80211: migrate ieee80211_rate2media() to use ieee80211_node_txrate This is one of the two obvious left-over dot11rate lookups that trigger a debug print. (The other is get_sta_info()). * Change ieee80211_rate2media() to use the passed in ieee80211_node_txrate and use the rate type field to see if it's legacy/ht or vht. * .. and (I hope!) actually handle the VHT rate correctly. * Change the callers of ieee80211_rate2media() to use the new static initialisers. For the one spot in ieee80211_ht.c which uses the HT initialiser, it should just be a straight up mechanical change that correctly sets the HT MCS rate. For the rest of them in ieee80211.c, they're doing table initialisation for the media types / rates, and it's currently very focused on legacy rates. So just leave that all as-is for now with a mechanical change. Differential Revision: https://reviews.freebsd.org/D48615 --- sys/net80211/ieee80211.c | 56 ++++++++++++++++++++++++++++---------------- sys/net80211/ieee80211_ht.c | 5 +++- sys/net80211/ieee80211_var.h | 3 ++- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index eb796462d3d1..9d036f298ed3 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1949,6 +1949,7 @@ ieee80211_media_setup(struct ieee80211com *ic, enum ieee80211_phymode mode; const struct ieee80211_rateset *rs; struct ieee80211_rateset allrates; + struct ieee80211_node_txrate tn; /* * Fill in media characteristics. @@ -1968,7 +1969,8 @@ ieee80211_media_setup(struct ieee80211com *ic, rs = &ic->ic_sup_rates[mode]; for (i = 0; i < rs->rs_nrates; i++) { rate = rs->rs_rates[i]; - mword = ieee80211_rate2media(ic, rate, mode); + tn = IEEE80211_NODE_TXRATE_INIT_LEGACY(rate); + mword = ieee80211_rate2media(ic, &tn, mode); if (mword == 0) continue; addmedia(media, caps, addsta, mode, mword); @@ -1990,8 +1992,8 @@ ieee80211_media_setup(struct ieee80211com *ic, } } for (i = 0; i < allrates.rs_nrates; i++) { - mword = ieee80211_rate2media(ic, allrates.rs_rates[i], - IEEE80211_MODE_AUTO); + tn = IEEE80211_NODE_TXRATE_INIT_LEGACY(allrates.rs_rates[i]); + mword = ieee80211_rate2media(ic, &tn, IEEE80211_MODE_AUTO); if (mword == 0) continue; /* NB: remove media options from mword */ @@ -2071,6 +2073,7 @@ ieee80211_announce(struct ieee80211com *ic) int i, rate, mword; enum ieee80211_phymode mode; const struct ieee80211_rateset *rs; + struct ieee80211_node_txrate tn; /* NB: skip AUTO since it has no rates */ for (mode = IEEE80211_MODE_AUTO+1; mode < IEEE80211_MODE_11NA; mode++) { @@ -2079,7 +2082,8 @@ ieee80211_announce(struct ieee80211com *ic) ic_printf(ic, "%s rates: ", ieee80211_phymode_name[mode]); rs = &ic->ic_sup_rates[mode]; for (i = 0; i < rs->rs_nrates; i++) { - mword = ieee80211_rate2media(ic, rs->rs_rates[i], mode); + tn = IEEE80211_NODE_TXRATE_INIT_LEGACY(rs->rs_rates[i]); + mword = ieee80211_rate2media(ic, &tn, mode); if (mword == 0) continue; rate = ieee80211_media2rate(mword); @@ -2278,6 +2282,7 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr) struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; enum ieee80211_phymode mode; + struct ieee80211_node_txrate tn; imr->ifm_status = IFM_AVALID; /* @@ -2299,14 +2304,15 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr) /* * A fixed rate is set, report that. */ - imr->ifm_active |= ieee80211_rate2media(ic, - vap->iv_txparms[mode].ucastrate, mode); + tn = IEEE80211_NODE_TXRATE_INIT_LEGACY( + vap->iv_txparms[mode].ucastrate); + imr->ifm_active |= ieee80211_rate2media(ic, &tn, mode); } else if (vap->iv_opmode == IEEE80211_M_STA) { /* * In station mode report the current transmit rate. */ - imr->ifm_active |= ieee80211_rate2media(ic, - ieee80211_node_get_txrate_dot11rate(vap->iv_bss), mode); + ieee80211_node_get_txrate(vap->iv_bss, &tn); + imr->ifm_active |= ieee80211_rate2media(ic, &tn, mode); } else imr->ifm_active |= IFM_AUTO; if (imr->ifm_status & IFM_ACTIVE) @@ -2399,7 +2405,8 @@ findmedia(const struct ratemedia rates[], int n, u_int match) * or an MCS index. */ int -ieee80211_rate2media(struct ieee80211com *ic, int rate, enum ieee80211_phymode mode) +ieee80211_rate2media(struct ieee80211com *ic, + const struct ieee80211_node_txrate *tr, enum ieee80211_phymode mode) { static const struct ratemedia rates[] = { { 2 | IFM_IEEE80211_FH, IFM_IEEE80211_FH1 }, @@ -2530,35 +2537,44 @@ ieee80211_rate2media(struct ieee80211com *ic, int rate, enum ieee80211_phymode m { 11, IFM_IEEE80211_VHT }, #endif }; - int m; + int m, rate; /* * Check 11ac/11n rates first for match as an MCS. */ if (mode == IEEE80211_MODE_VHT_5GHZ) { - if (rate & IFM_IEEE80211_VHT) { - rate &= ~IFM_IEEE80211_VHT; - m = findmedia(vhtrates, nitems(vhtrates), rate); + if (tr->type == IEEE80211_NODE_TXRATE_VHT) { + m = findmedia(vhtrates, nitems(vhtrates), tr->mcs); if (m != IFM_AUTO) return (m | IFM_IEEE80211_VHT); } } else if (mode == IEEE80211_MODE_11NA) { - if (rate & IEEE80211_RATE_MCS) { - rate &= ~IEEE80211_RATE_MCS; - m = findmedia(htrates, nitems(htrates), rate); + /* NB: 12 is ambiguous, it will be treated as an MCS */ + if (tr->type == IEEE80211_NODE_TXRATE_HT) { + m = findmedia(htrates, nitems(htrates), + tr->dot11rate & ~IEEE80211_RATE_MCS); if (m != IFM_AUTO) return m | IFM_IEEE80211_11NA; } } else if (mode == IEEE80211_MODE_11NG) { /* NB: 12 is ambiguous, it will be treated as an MCS */ - if (rate & IEEE80211_RATE_MCS) { - rate &= ~IEEE80211_RATE_MCS; - m = findmedia(htrates, nitems(htrates), rate); + if (tr->type == IEEE80211_NODE_TXRATE_HT) { + m = findmedia(htrates, nitems(htrates), + tr->dot11rate & ~IEEE80211_RATE_MCS); if (m != IFM_AUTO) return m | IFM_IEEE80211_11NG; } } - rate &= IEEE80211_RATE_VAL; + + /* + * At this point it needs to be a dot11rate (legacy/HT) for the + * rest of the logic to work. + */ + if ((tr->type != IEEE80211_NODE_TXRATE_LEGACY) && + (tr->type != IEEE80211_NODE_TXRATE_HT)) + return (IFM_AUTO); + rate = tr->dot11rate & IEEE80211_RATE_VAL; + switch (mode) { case IEEE80211_MODE_11A: case IEEE80211_MODE_HALF: /* XXX good 'nuf */ diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 9e047244cc3b..08912dc8fca2 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -317,9 +317,12 @@ static int ht_getrate(struct ieee80211com *ic, int index, enum ieee80211_phymode mode, int ratetype) { + struct ieee80211_node_txrate tr; int mword, rate; - mword = ieee80211_rate2media(ic, index | IEEE80211_RATE_MCS, mode); + tr = IEEE80211_NODE_TXRATE_INIT_HT(index); + + mword = ieee80211_rate2media(ic, &tr, mode); if (IFM_SUBTYPE(mword) != IFM_IEEE80211_MCS) return (0); switch (ratetype) { diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 5a0d017bd590..4f3ed5e4a3d8 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -794,7 +794,8 @@ void ieee80211_iterate_coms(ieee80211_com_iter_func *, void *); int ieee80211_media_change(struct ifnet *); void ieee80211_media_status(struct ifnet *, struct ifmediareq *); int ieee80211_ioctl(struct ifnet *, u_long, caddr_t); -int ieee80211_rate2media(struct ieee80211com *, int, +int ieee80211_rate2media(struct ieee80211com *, + const struct ieee80211_node_txrate *, enum ieee80211_phymode); int ieee80211_media2rate(int); int ieee80211_mhz2ieee(u_int, u_int); From nobody Wed Feb 26 19:31:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z34NV55M6z5nkt0; Wed, 26 Feb 2025 19:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z34NV1Dmkz3dtp; Wed, 26 Feb 2025 19:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8upJysKzA3TtraSjZY0lyJ/GXKJEP1P2q6Wm71H0fSk=; b=T1ky5aGYXFpw2x8jhmuueqTK1TQpY7TD2fcl+O7iycASHvzJN5W7K+fDoxwnChGdpyhBLs mq2W/stPEDojd53+ytWm47+qiJVJRPrG/JRz2az4H07WnDqeyUkkk/01/V3X4k/dRhfeIx 17lKhLNeSaS0/nwLZfkvQIAuzV2yChqx/5KEyaLKssmXi1X0X4wSdIYqLNYN7A0aQOAlP9 FUwBJvh7z+W8VpXgCddpX9jsJIqZ9dGm32R/g7m5nSIriSd5RYMnGthTLAKLU5gbjNc4CE TXmvWFapTKgK3Qq8W3s5vR3VnMVPMYpONDnNmQtF4Pqd9VCq+c8kF5KMqFw0JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598314; a=rsa-sha256; cv=none; b=PYg4JFaZR6flrnW0rvM+McQS11WbeALI02qWIxa0TcOk65vOCo6SyHdiz4j56ufjuHz8Fl uY5nshuTFKVtj6Z6TKm6sEvRk2TUv0BbRCouxjxSRlaXYEshrKkEmkfNbW3NjVbTMNOsx0 aMyZpFci0EUaMh2bx5ebprg7Jb5LnldF8ocitVoGLHfLpalDidSj7NDcJathsuGtedBbal fsR8bvDXcVToTuEazdfXrbtAVjpGRG8xxM8A+h1YC4GgK8ii0k3vwEMQJirCGAhFoOZCLT VFQLEjqtCr1s2C5uaBHx/fD1yXT6Rh95ifr70qb6p6GXfxaBHwaiCnXyYreU6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8upJysKzA3TtraSjZY0lyJ/GXKJEP1P2q6Wm71H0fSk=; b=gaeiyZ7SR+AbZIpfLyRd8e4SxEPP4JzG9u7fdI2XoZJ2eLhDyid7sYyh5tLQaiV6xZGh3R oDXYbWGxfYmLHvaJ4h7Ehj3SC1++OqxRn1ImCdyonAlOnTR3BrmazZtOBL/sbZsTuvJJyp ds2ZJ6KwmKrQYvh0UoKU/qbNX/5I/vZVUlSGUg+GXQ/qva0K1vhatzERZchawg08FV1ck8 RhTILoekftec3vv6PyT2n0yGBdKvwNVpmF7rqYx1gv38mGa8LQeO1LjP9rISpzEpVMjc7W okoYw7oqcCez54rNJcgIR/w83mVHJiMC+uELz7NgWFEVOMgRd9DxmJedamxk0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z34NT6nxgz1P4L; Wed, 26 Feb 2025 19:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QJVr1d019034; Wed, 26 Feb 2025 19:31:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVrdh019031; Wed, 26 Feb 2025 19:31:53 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:53 GMT Message-Id: <202502261931.51QJVrdh019031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 17e8437e8d05 - main - net80211: update get_sta_info() to only populate isi_txrate for legacy rates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17e8437e8d05aa91f2d1f31cece68204e7294a74 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=17e8437e8d05aa91f2d1f31cece68204e7294a74 commit 17e8437e8d05aa91f2d1f31cece68204e7294a74 Author: Adrian Chadd AuthorDate: 2025-01-17 02:41:14 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:31:27 +0000 net80211: update get_sta_info() to only populate isi_txrate for legacy rates The isi_txrate field is 8 bits and only represents legacy/HT rates. So to avoid logging a warning, only populate if it's a legacy/HT rate. Differential Revision: https://reviews.freebsd.org/D48616 --- sys/net80211/ieee80211_ioctl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 24ec9659dc2d..caa0c77e2897 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -376,6 +376,7 @@ static void get_sta_info(void *arg, struct ieee80211_node *ni) { struct stainforeq *req = arg; + struct ieee80211_node_txrate tr; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211req_sta_info *si; size_t ielen, len; @@ -406,7 +407,16 @@ get_sta_info(void *arg, struct ieee80211_node *ni) if (si->isi_nrates > 15) si->isi_nrates = 15; memcpy(si->isi_rates, ni->ni_rates.rs_rates, si->isi_nrates); - si->isi_txrate = ieee80211_node_get_txrate_dot11rate(ni); + /* + * isi_txrate can only represent the legacy/HT rates. + * Only set it if the rate is a legacy/HT rate. + * + * TODO: For VHT and later rates the API will need changing. + */ + ieee80211_node_get_txrate(ni, &tr); + if ((tr.type == IEEE80211_NODE_TXRATE_LEGACY) || + (tr.type == IEEE80211_NODE_TXRATE_HT)) + si->isi_txrate = ieee80211_node_get_txrate_dot11rate(ni); /* Note: txmbps is in 1/2Mbit/s units */ si->isi_txmbps = ieee80211_node_get_txrate_kbit(ni) / 500; si->isi_associd = ni->ni_associd; From nobody Wed Feb 26 21:13:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z36fN1tWRz5nw3c; Wed, 26 Feb 2025 21:14:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z36fM4YTFz3nTr; Wed, 26 Feb 2025 21:14:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 51QLDr8s030620; Wed, 26 Feb 2025 23:13:56 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 51QLDr8s030620 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 51QLDqqv030619; Wed, 26 Feb 2025 23:13:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 26 Feb 2025 23:13:52 +0200 From: Konstantin Belousov To: Kyle Evans Cc: Ronald Klop , dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e59991206b14 - main - fts(3): be less strict when automount does its job under us walking autofs mount Message-ID: References: <985139317.7211.1740577017034@localhost> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4Z36fM4YTFz3nTr X-Spamd-Bar: ---- On Wed, Feb 26, 2025 at 08:03:33AM -0600, Kyle Evans wrote: > On 2/26/25 07:36, Ronald Klop wrote: > > > > *Van:* Konstantin Belousov > > *Datum:* 25 februari 2025 08:20 > > *Aan:* src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev- > > commits-src-main@FreeBSD.org > > *Onderwerp:* git: e59991206b14 - main - fts(3): be less strict when > > automount does its job under us walking autofs mount > > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/? > > id=e59991206b1463b7e85cc8aafde7f1dc03fcedcf > cgit.FreeBSD.org/src/commit/? > > id=e59991206b1463b7e85cc8aafde7f1dc03fcedcf> > > > > commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf > > Author:     Konstantin Belousov > > AuthorDate: 2025-02-21 13:07:43 +0000 > > Commit:     Konstantin Belousov > > CommitDate: 2025-02-25 07:09:29 +0000 > > > >     fts(3): be less strict when automount does its job under us > > walking autofs mount > > > >     Namely, allow the file id change if the resulting file belongs to > >     automounted filesystem.  If it is, remember the updated id. > > > >     This allows the ids from the automounted volumes to change without > >     restrictions, might be a further refinement would be to only > > allow such > >     inconsistency once. > > > >     PR:     284914 > >     Reported and tested by: Lexi Winter > >     Sponsored by:   The FreeBSD Foundation > >     MFC after:      1 week > >     Differential revision: https://reviews.freebsd.org/D49094 > > > > --- > >  lib/libc/gen/fts.c | 13 ++++++++++--- > >  1 file changed, 10 insertions(+), 3 deletions(-) > > > > diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c > > index 770a7b2cc322..bd193c7c6cfc 100644 > > --- a/lib/libc/gen/fts.c > > +++ b/lib/libc/gen/fts.c > > @@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, > > char *path) > >  { > >     int ret, oerrno, newfd; > >     struct stat sb; > > +   struct statfs sf; > > > >     newfd = fd; > >     if (ISSET(FTS_NOCHDIR)) > > @@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int > > fd, char *path) > >         goto bail; > >     } > >     if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) { > > -       errno = ENOENT;     /* disinformation */ > > -       ret = -1; > > -       goto bail; > > +       if (_fstatfs(newfd, &sf) != 0 || > > +           (sf.f_flags & MNT_AUTOMOUNTED) == 0) { > > +           errno = ENOENT;     /* disinformation */ > > +           ret = -1; > > +           goto bail; > > +       } > > +       /* autofs might did the mount under us, accept. */ > > +       p->fts_dev = sb.st_dev; > > +       p->fts_ino == sb.st_ino; > >     } > >     ret = fchdir(newfd); > >  bail: > > > > ------------------------------------------------------------------------ > > > > > > > >    /* autofs might did the mount under us, accept. */ > > > > > > I’m not native English so forgive me my question. But what does this > > comment mean? > > > > It might have triggered an autofs mount while we're running, so we just > accept the otherwise suspicious looking change. If you have a better formulation for the comment, please go ahead and commit. I did not wanted to give too formal explanation there, esp. due to the notes given in the commit message. From nobody Wed Feb 26 22:24:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z38Cj2D7vz5p3Yd; Wed, 26 Feb 2025 22:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z38Cj0y7Wz3mDJ; Wed, 26 Feb 2025 22:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740608673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1h+v+ffPWl4U7F/q7x4MnymaM+DSgfZHbbmtPGEXR3c=; b=J2qcpIcMbBYqcq0tCeJ9rlf6AG/VR0bHI5RfWzAJSkJXYc+SHBaSNqvfkwb825WQgB1dz5 vUzBVXAqzQoZwp0V0ZJzxyB5rFzrykDlvfW8I78TIdoEL78pSjoIb6Pn2vYOsTVa8tqto3 vrwUx/mtrxCNvExtkoRGJDqFe/UowUwyBH/IhlZNV2Zfw/nvwd61OJKw0JWd0/c0e1dUKS MW/maf7kCdLzzSdOlIhDKRakUvkFEVo8IsHjKWLZAw8mG9MOk5eIgoCNMJ/OHq8VQsI7/v ygtnxpTV2NqrtqWa6laGMlLAXmrcUGpsOGcbLYRN4o4HVWjy2b9mS+ZvHtuXbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740608673; a=rsa-sha256; cv=none; b=j+b3EZtXwluaTuhLYyo+fyTEjjSEnmIJoiCNUAyoq41dUwZfMptJdrHIW6wE/ngRP64VAA 3LvS1RxIQ22/E3+nFD9IUarAFSC5Arpj1xvhdPl0kXdBBNjG6/ugKOfWez/SxUnvmFR2wm BUVkp3Ia66UUiPKVpaDHoRElWK5Cdcy13dazGW+CgvMkyeXj6TaG0ZMOkMZnof/RHFdNfR lcbF1XjbJ1nAM4dPJXW7Hyesag98IVHZXyf6zD4S0/hkN6WFThBE3fJ6UPsXYVKV7f1Myb 0WnaRiJOzZu5z2NcoAMEGUkwZq2jUn5ZFTb8I7hWxEl4/PpdgzGAB/4y5vtRQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740608673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1h+v+ffPWl4U7F/q7x4MnymaM+DSgfZHbbmtPGEXR3c=; b=D1qDGOkP7So06LIEZysTTlex+JgjUG8Icd33Kz78iQdYfe0i6WmQKwnBkg/PZoAW1WUIyt ri6xaTyyCTDmPQj06k8+7fO1DAz6t5QNmqir8KGZEbZ7vTYIeabkV7sfKRXIbm8Lcshzhj UNs9Tw99FD14N40l62dXpJq/riGPzhWhl9+gqiphN6SD1a51w03oxpWw5wJO8NcIw+/NWi lUIVLuQclfMcZTGABfLnUhmGE220xr554a9pn46sZp24R1ZhWhGPpoaQ0NYKB705/ppZs9 YPK45/1Kn1JboazE9qWkYmzydoXa7Rnd8bj/hSxoszSnhtDWXvEw4umaVdpTHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z38Cj0PQDz17N; Wed, 26 Feb 2025 22:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QMOWKl036226; Wed, 26 Feb 2025 22:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QMOWWM036223; Wed, 26 Feb 2025 22:24:32 GMT (envelope-from git) Date: Wed, 26 Feb 2025 22:24:32 GMT Message-Id: <202502262224.51QMOWWM036223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 181549c37f19 - main - libbe: avoid copying encryption-related props List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 181549c37f1913f5ca292d8515a6e5e0068a9fe7 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=181549c37f1913f5ca292d8515a6e5e0068a9fe7 commit 181549c37f1913f5ca292d8515a6e5e0068a9fe7 Author: Kyle Evans AuthorDate: 2025-02-26 22:23:24 +0000 Commit: Kyle Evans CommitDate: 2025-02-26 22:24:24 +0000 libbe: avoid copying encryption-related props libzfs insists that these be cloned from the origin, so avoid making a deep copy of them ourselves to unbreak creating a new BE from a BE with encrypted components -- in today's environment, without a loader that does encryption, this means a deep BE setup where something underneath the BE (e.g., home directories) are encrypted. Reported and tested by: arrowd Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D48464 --- lib/libbe/be.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index 62563a33d975..e0ced1c5bcfc 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -680,8 +680,20 @@ be_deep_clone_prop(int prop, void *cb) dccb = cb; /* Skip some properties we don't want to touch */ - if (prop == ZFS_PROP_CANMOUNT) + switch (prop) { + /* + * libzfs insists on these being naturally inherited in the + * cloning process. + */ + case ZFS_PROP_KEYFORMAT: + case ZFS_PROP_KEYLOCATION: + case ZFS_PROP_ENCRYPTION: + case ZFS_PROP_PBKDF2_ITERS: + + /* FALLTHROUGH */ + case ZFS_PROP_CANMOUNT: /* Forced by libbe */ return (ZPROP_CONT); + } /* Don't copy readonly properties */ if (zfs_prop_readonly(prop)) From nobody Wed Feb 26 22:41:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z38b51mFNz5p5fw; Wed, 26 Feb 2025 22:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z38b46lnpz41Yt; Wed, 26 Feb 2025 22:41:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740609680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J39RPAQ/83tildPh9qI29Wz+rnkhul14M8E9w2eG2Ec=; b=V42Fbjw2cYcRA4WVEiCUZBRah4j4zqAqW7wycDAwyzVcXgscPNyXmKJuW34dSsV7ql2Pn4 UFsovoqUVutbag7xYFTdmDV4FI7+1Vxyt7ZzDUrnBJlBe3t2GBvODxbCatwXyHhpxX4zmr C0JH4gL7pj8EYPw/m+6/XLyQHMS1lus43VDtcD80VoW+6Na5w7SQJPRgWAaHjrmRRdD1cW U9IlO8zrhxJeDD8jbXVbEUbLTK/tdQdJAi4YNA3JQDcXT/Xf/2PoCuwzgyv7A93rnnYtz4 hu1tGIXiaFb78Hoa4lDk2/jW+l+hGAXlG4/6KauNpdBp6ehF036KT2HtPfZ32A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740609680; a=rsa-sha256; cv=none; b=F8lwkJqkB02AbyUpuhf8peGu79E19HqMChLyqKtrepjAxha1OVyfaWOCFR5ZytJu2cUaVR RirH/tdJSw4v/yYXmkprS3/bUaqQ9L9UUTJpmmc3ofOK/zmb18sY+AeUFVSFE5qv0YYoK9 ZgSkVgnU+Bpc6SkvVA9Ds+7COXwMT50RCNQFO3JyN0aAccU+4A4WyEndgzxMAZq9domCSP Ngr3DML3jdjKl/TLoMF/QZ5Y8+5ehyDUaK/kOyRSEV1dxCDxdCjlNJPXbgyr0OA0L7B/EH LJ2Io80GprIyyKp5UcMn0zCjP0MJUqFk0dGvvUmEBuh1DS6v8MWfyjXg8I7cZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740609680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J39RPAQ/83tildPh9qI29Wz+rnkhul14M8E9w2eG2Ec=; b=bKa6Mmq6JWVhUrTbAgp6NBsMewZ7qGfk4k9xmLyPQ5ujULwtGTZJOpRqwCWHgRLNRGkpjP gkV+pXWtW+lRNr/kLbB62JtVyKYRtk/PJ4dSgahROS/KVerObJQeujqdh9na9P9eFFbbOr WyOJukB9+W4HSWLe6twULGduA4eeR/yxznnL1Kf2Wib+64CcHe/LiQLQLhpKDow6I9hR0k 8cIlepVF3s+I5lpbqz+uLpx1eTfnmcDgY6G9lkAkfzZKGTXAJBpAXFUV/6RxjI8h8JIgOV 8sf+curORmlOiTsgrTvwZpFjJN6hrhvcZhxJj+VnYnOqyUoZ762quI++vjvHcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z38b46DSrz1Sx; Wed, 26 Feb 2025 22:41:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QMfKLk067780; Wed, 26 Feb 2025 22:41:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QMfKJc067777; Wed, 26 Feb 2025 22:41:20 GMT (envelope-from git) Date: Wed, 26 Feb 2025 22:41:20 GMT Message-Id: <202502262241.51QMfKJc067777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8a85584785e3 - main - pf: fix incorrect calls to pf_translate_icmp_af() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a85584785e3135f00a6d42e642f0e7ccee4f0f5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8a85584785e3135f00a6d42e642f0e7ccee4f0f5 commit 8a85584785e3135f00a6d42e642f0e7ccee4f0f5 Author: Kristof Provost AuthorDate: 2025-02-26 16:22:25 +0000 Commit: Kristof Provost CommitDate: 2025-02-26 22:40:40 +0000 pf: fix incorrect calls to pf_translate_icmp_af() The 'iih' argument is already a pointer, pass it as is rather than its address. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f3c9ea7a2fb1..24ddf75936de 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8353,7 +8353,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, nk->af)) return (PF_DROP); pd->proto = IPPROTO_ICMPV6; - if (pf_translate_icmp_af(nk->af, &iih)) + if (pf_translate_icmp_af(nk->af, iih)) return (PF_DROP); if (virtual_type == htons(ICMP_ECHO) && nk->port[iidx] != iih->icmp_id) @@ -8465,7 +8465,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, nk->af)) return (PF_DROP); pd->proto = IPPROTO_ICMP; - if (pf_translate_icmp_af(nk->af, &iih)) + if (pf_translate_icmp_af(nk->af, iih)) return (PF_DROP); if (virtual_type == htons(ICMP6_ECHO_REQUEST) && From nobody Wed Feb 26 23:46:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3B1w2NLnz5pBqW; Wed, 26 Feb 2025 23:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B1w141Qz3p8d; Wed, 26 Feb 2025 23:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hoW6j/T1bnpGdYu4dkm0uF9s6pDA6YL7BaKTIzVczk0=; b=bg78bTcF5uHIhePnvYPlBulMrXTyPS6fRn0tldua0BCb/hXX6jyWXcvs5/ZzQOTFYB7jsu +ngn5GT3d46ZSdGbdwZSR29ohZIBZuEUxGt9vi+AOgN9MiH9JbwZuOTGTDfQvsnWAMxaJA KJ6yNo3VDWCOKgisiEQRShBm5f82Sq0yYueIP5dNtVF3kXDnVgcQvfXPF7D9yufH+YOasB 6azCAjwGXYV0llUz6TeA6B/qaak/UcEAwrXr1zSN4/9vrDFz/q0jQ07FKH2VBYT5HVwtmJ N4ixFguoPyLKNSksSZfWOCXVq7mwPz6/2YQ4kCRq+Hi0qVQgy/8Lbhj7JH2v9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613572; a=rsa-sha256; cv=none; b=xk0Js4Qb4ZaQJeWDSQUnRyAb+Vy+zL2XBx0TOOx6eFJw8SKJz/Q6HB6WkXTsEYtfx7eL2s IecdEoipMC8d7owEnX8GQTo9ZcN9EFepBFsylLbRCn2+hcdlE8ipgQFkmLMZZvyKWNvD3z ZO3Myk67/dvkL+ArEfR1bciT4RgoN2xUyq9UyPVNTHbs5Rnjj2nMRblr6B8otuytcedW24 3wFKT2WJS+SZ7xUSzpWMkVkP8BNTfOfxZybEEftSUlRe0IftrF/14CzJiD7n+v7s8HA7D1 ft7xlP3C+O45+YWk7dMCCw0wsoVNXn6Uw4PhUI89B5L3CLfxjb8MbgEWKmGt4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hoW6j/T1bnpGdYu4dkm0uF9s6pDA6YL7BaKTIzVczk0=; b=yMtBtMFKf6rdXKdPgA0ff9ierDCYOVF1vaxDEkxeCdVybmcWpu6hh2qk3NLSglDMhbGS4t zIiur9nHObbhE9WaJjNegDKiSxjsV39VgFnOlNtc+a+wj5nyGGxZT8vxcUWyQxdLzyXwx8 Q5Tmj+D9B0n/8GOjK9XhoQgTf2wh/yNQk7O21tkRcnu+OoK5byM8Vc1lHRHR8RWulNRprO GvzxCvSwHl3iIU/BoCCJHF4ekUiwTzyImbB/xqIiZG4BByYLqqRa9pgY7x5nQP9Ev5cFRG emgCUP6j/6W5LLudnhligRu+3e3zcxwGoRFhkwJYyPnI9jC2l3QnxsMmGzVI8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3B1w0Lz3z34Q; Wed, 26 Feb 2025 23:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkBvl086482; Wed, 26 Feb 2025 23:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkBTj086479; Wed, 26 Feb 2025 23:46:11 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:11 GMT Message-Id: <202502262346.51QNkBTj086479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7907a9276081 - stable/14 - usbconfig: add -l option to dump_device_desc for single line output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7907a9276081e9b1ccac839af91fe096e6779e9f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7907a9276081e9b1ccac839af91fe096e6779e9f commit 7907a9276081e9b1ccac839af91fe096e6779e9f Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 22:53:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 usbconfig: add -l option to dump_device_desc for single line output Like pciconf -l add a -l to dump_device_desc for usbconfig which will fold most fields into a single line. We do filter out some we think will not be interesting in this case. While mangling with string output in ways not always anticipated when the program was initially written this should help to parse the available devices for programs like fwget(8). While I had this in mind for other bits for a while I got prompted by D48678 to finally do it. Sponsored by: The FreebSD Foundation Reviewed by: bapt (LGTM), ziaee (man) Differential Revision: https://reviews.freebsd.org/D48974 (cherry picked from commit c66308d7bcc3931b60a096bfe6ba0f50105e77de) --- usr.sbin/usbconfig/dump.c | 145 +++++++++++++++++++++++++++++++++++------ usr.sbin/usbconfig/dump.h | 5 +- usr.sbin/usbconfig/usbconfig.8 | 6 +- usr.sbin/usbconfig/usbconfig.c | 20 ++++-- 4 files changed, 148 insertions(+), 28 deletions(-) diff --git a/usr.sbin/usbconfig/dump.c b/usr.sbin/usbconfig/dump.c index 36f026bfc2fb..2a4a5300efeb 100644 --- a/usr.sbin/usbconfig/dump.c +++ b/usr.sbin/usbconfig/dump.c @@ -3,6 +3,10 @@ * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 2024 Baptiste Daroussin + * Copyright (c) 2025 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,22 +32,32 @@ #include +#include #include #include #include +#include #include #include #include #include #include +#include #include #include +#include + #include "dump.h" #include "pathnames.h" +#ifndef IOUSB +#define IOUSB(a) a +#endif + #define DUMP0(n,type,field,...) dump_field(pdev, " ", #field, n->field); +#define DUMP0L(n,type,field,...) dump_fieldl(pdev, " ", #field, n->field); #define DUMP1(n,type,field,...) dump_field(pdev, " ", #field, n->field); #define DUMP2(n,type,field,...) dump_field(pdev, " ", #field, n->field); #define DUMP3(n,type,field,...) dump_field(pdev, " ", #field, n->field); @@ -113,11 +127,21 @@ dump_power_mode(uint8_t value) } static void -dump_field(struct libusb20_device *pdev, const char *plevel, - const char *field, uint32_t value) +_dump_field(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value, bool list_mode) { uint8_t temp_string[256]; + if (list_mode) { + /* Skip fields we are not interested in. */ + if (strcmp(field, "bLength") == 0 || + strcmp(field, "bDescriptorType") == 0 || + strcmp(field, "bMaxPacketSize0") == 0) + return; + + printf("%s=%#06x ", field, value); + return; + } printf("%s%s = 0x%04x ", plevel, field, value); if (strlen(plevel) == 8) { @@ -257,6 +281,20 @@ dump_field(struct libusb20_device *pdev, const char *plevel, printf("\n"); } +static void +dump_field(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value) +{ + _dump_field(pdev, plevel, field, value, false); +} + +static void +dump_fieldl(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value) +{ + _dump_field(pdev, plevel, field, value, true); +} + static void dump_extra(struct libusb20_me_struct *str, const char *plevel) { @@ -396,16 +434,34 @@ load_vendors(void) return (usb_vendors); } +enum _device_descr_list_type { + _DEVICE_DESCR_LIST_TYPE_DEFAULT = 0, + _DEVICE_DESCR_LIST_TYPE_UGEN = 1, + _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR = 2, +}; + static char * -_device_desc(struct libusb20_device *pdev) +_device_desc(struct libusb20_device *pdev, + enum _device_descr_list_type list_type) { static struct usb_vendors *usb_vendors = NULL; char *desc = NULL; const char *vendor = NULL, *product = NULL; - uint16_t vid = libusb20_dev_get_device_desc(pdev)->idVendor; - uint16_t pid = libusb20_dev_get_device_desc(pdev)->idProduct; + uint16_t vid; + uint16_t pid; struct usb_vendor_info *vi; struct usb_product_info *pi; + struct usb_device_info devinfo; + + if (list_type == _DEVICE_DESCR_LIST_TYPE_UGEN) { + asprintf(&desc, "ugen%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + return (desc); + } + + vid = libusb20_dev_get_device_desc(pdev)->idVendor; + pid = libusb20_dev_get_device_desc(pdev)->idProduct; if (usb_vendors == NULL) usb_vendors = load_vendors(); @@ -424,6 +480,44 @@ _device_desc(struct libusb20_device *pdev) } } } + + /* + * Try to gather the information; libusb2 unfortunately seems to + * only build an entire string but not save vendor/product individually. + */ + if (vendor == NULL || product == NULL) { + char buf[64]; + int f; + + snprintf(buf, sizeof(buf), "/dev/" USB_GENERIC_NAME "%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + + f = open(buf, O_RDWR); + if (f < 0) + goto skip_vp_recovery; + + if (ioctl(f, IOUSB(USB_GET_DEVICEINFO), &devinfo)) + goto skip_vp_recovery; + + + if (vendor == NULL) + vendor = devinfo.udi_vendor; + if (product == NULL) + product = devinfo.udi_product; + +skip_vp_recovery: + if (f >= 0) + close(f); + } + + if (list_type == _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR) { + asprintf(&desc, "vendor='%s' product='%s'", + (vendor != NULL) ? vendor : "", + (product != NULL) ? product : ""); + return (desc); + } + if (vendor == NULL || product == NULL) return (NULL); @@ -433,12 +527,12 @@ _device_desc(struct libusb20_device *pdev) product, vendor, libusb20_dev_get_bus_number(pdev)); - return (desc); } void -dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) +dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv, + bool list_mode) { char buf[128]; uint8_t n; @@ -447,18 +541,22 @@ dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) usage = libusb20_dev_get_power_usage(pdev); - desc = _device_desc(pdev); - - printf("%s, cfg=%u md=%s spd=%s pwr=%s (%umA)\n", - desc ? desc : libusb20_dev_get_desc(pdev), - libusb20_dev_get_config_index(pdev), - dump_mode(libusb20_dev_get_mode(pdev)), - dump_speed(libusb20_dev_get_speed(pdev)), - dump_power_mode(libusb20_dev_get_power_mode(pdev)), - usage); + desc = _device_desc(pdev, (list_mode) ? _DEVICE_DESCR_LIST_TYPE_UGEN : + _DEVICE_DESCR_LIST_TYPE_DEFAULT); + + if (list_mode) + printf("%s: ", desc); + else + printf("%s, cfg=%u md=%s spd=%s pwr=%s (%umA)\n", + desc ? desc : libusb20_dev_get_desc(pdev), + libusb20_dev_get_config_index(pdev), + dump_mode(libusb20_dev_get_mode(pdev)), + dump_speed(libusb20_dev_get_speed(pdev)), + dump_power_mode(libusb20_dev_get_power_mode(pdev)), + usage); free(desc); - if (!show_ifdrv) + if (list_mode || !show_ifdrv) return; for (n = 0; n != 255; n++) { @@ -531,12 +629,21 @@ dump_be_dev_quirks(struct libusb20_backend *pbe) } void -dump_device_desc(struct libusb20_device *pdev) +dump_device_desc(struct libusb20_device *pdev, bool list_mode) { struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; ddesc = libusb20_dev_get_device_desc(pdev); - LIBUSB20_DEVICE_DESC(DUMP0, ddesc); + if (list_mode) { + char *desc; + + LIBUSB20_DEVICE_DESC(DUMP0L, ddesc); + desc = _device_desc(pdev, _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR); + printf("%s\n", (desc != NULL) ? desc : ""); + free(desc); + } else { + LIBUSB20_DEVICE_DESC(DUMP0, ddesc); + } } void diff --git a/usr.sbin/usbconfig/dump.h b/usr.sbin/usbconfig/dump.h index 71adb47262ea..6adc8e54e5a9 100644 --- a/usr.sbin/usbconfig/dump.h +++ b/usr.sbin/usbconfig/dump.h @@ -32,10 +32,11 @@ const char *dump_mode(uint8_t value); const char *dump_speed(uint8_t value); const char *dump_power_mode(uint8_t value); void dump_string_by_index(struct libusb20_device *pdev, uint8_t index); -void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv); +void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv, + bool list_mode); void dump_be_quirk_names(struct libusb20_backend *pbe); void dump_be_dev_quirks(struct libusb20_backend *pbe); -void dump_device_desc(struct libusb20_device *pdev); +void dump_device_desc(struct libusb20_device *pdev, bool list_mode); void dump_device_stats(struct libusb20_device *pdev); void dump_config(struct libusb20_device *pdev, uint8_t all_cfg); diff --git a/usr.sbin/usbconfig/usbconfig.8 b/usr.sbin/usbconfig/usbconfig.8 index 3926b03747e5..511fa9c5dddb 100644 --- a/usr.sbin/usbconfig/usbconfig.8 +++ b/usr.sbin/usbconfig/usbconfig.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2022 +.Dd February 12, 2025 .Dt USBCONFIG 8 .Os .Sh NAME @@ -30,6 +30,7 @@ .Nd configure the USB subsystem .Sh SYNOPSIS .Nm +.Op Fl l .Op Fl v .Op Fl a Ar addr .Op Fl i Ar interface_index @@ -40,6 +41,7 @@ .Sm off .Oo Oo Cm /dev/ Oc Cm ugen Oc Ar unit Cm \&. Ar addr .Sm on +.Op Fl l .Op Fl v .Op Fl i Ar interface_index .Op Ar cmds ... @@ -70,6 +72,8 @@ Show help and available commands. Specify interface index as indicated by the command description. If this argument is not specified a value of zero will be used for the interface index. +.It Fl l Cm dump_device_desc +Show numeral only key=value output as one long line. .It Fl u Ar unit Limit device range to USB devices connected to the given USBUS unit. .It Fl v diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c index 7d257fea52cd..9337effd835d 100644 --- a/usr.sbin/usbconfig/usbconfig.c +++ b/usr.sbin/usbconfig/usbconfig.c @@ -25,6 +25,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -91,6 +92,7 @@ struct options { uint8_t got_dump_string:1; uint8_t got_do_request:1; uint8_t got_detach_kernel_driver:1; + uint8_t opt_dump_in_list_mode:1; }; struct token { @@ -504,11 +506,13 @@ flush_command(struct libusb20_backend *pbe, struct options *opt) if (opt->got_list || dump_any) { dump_device_info(pdev, - opt->got_show_iface_driver); + opt->got_show_iface_driver, + opt->opt_dump_in_list_mode && opt->got_dump_device_desc); } if (opt->got_dump_device_desc) { - printf("\n"); - dump_device_desc(pdev); + if (!opt->opt_dump_in_list_mode) + printf("\n"); + dump_device_desc(pdev, opt->opt_dump_in_list_mode); } if (opt->got_dump_all_config) { printf("\n"); @@ -518,14 +522,14 @@ flush_command(struct libusb20_backend *pbe, struct options *opt) dump_config(pdev, 0); } else if (opt->got_dump_all_desc) { printf("\n"); - dump_device_desc(pdev); + dump_device_desc(pdev, false); dump_config(pdev, 1); } if (opt->got_dump_stats) { printf("\n"); dump_device_stats(pdev); } - if (dump_any) { + if (dump_any && !opt->opt_dump_in_list_mode) { printf("\n"); } if (libusb20_dev_close(pdev)) { @@ -559,7 +563,7 @@ main(int argc, char **argv) if (pbe == NULL) err(1, "could not access USB backend\n"); - while ((ch = getopt(argc, argv, "a:d:hi:u:v")) != -1) { + while ((ch = getopt(argc, argv, "a:d:hi:lu:v")) != -1) { switch (ch) { case 'a': opt->addr = num_id(optarg, "addr"); @@ -596,6 +600,10 @@ main(int argc, char **argv) opt->iface = num_id(optarg, "iface"); break; + case 'l': + opt->opt_dump_in_list_mode = 1; + break; + case 'u': opt->bus = num_id(optarg, "busnum"); opt->got_bus = 1; From nobody Wed Feb 26 23:46:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3B1x2zLvz5pBpW; Wed, 26 Feb 2025 23:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B1x0Xlbz3pHD; Wed, 26 Feb 2025 23:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SwQdpAz0/NTDRqpXR2JGrCiMNlY/95gy75LNz2744v8=; b=rHAriiY4qGpmZpvRitj+Bz8RvEiG/45j1+Q55GQRRo7Jpjw+IA5pv+2mfQfJfK/dlJAdP7 CcTgdmLO0y4xWkFW8oKIt5ea9YKLZAeBApUih1ecLbIfCuK1FTJmsBXqC7tf5RGBOl1CYQ HSGuxoOPZrsBvRl8KfaiNeQtJi/rmXxGCCMTvRftvvIGe6gKlFyI6wMNQxJKc4ah050MtM ake7l7VFD4mj3G+qEuSvOgu5E5c1TyyHAARn/KKiVuBZhcdfqzcqbBSs4jM3QuJjDgUF7U yM03QNokbGLCHOTrsNYe+9R6nVT3LaQPTG1FGI8Kkw/7u4iRKdHl6iIqiQ8vJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613573; a=rsa-sha256; cv=none; b=hngfsSfOk5gKwJRMhsD/XGrPHS+t0Rx0yjKOp/guOg9GLyaybLCqLgzqvcC/wjb+Ye7D4N Ky8oolvEjXDBo6arlyPlfojAffqtqMTmG08KOnP/23QwpSZBbspPKz3h2T8WfzxRxhL3xT n8beCiLjU0K+oiRXcOC6fc4g5TB2w4eaprVsQ7jdPsNguMpfb82lGUpJEU9xcVCgzPN4BJ TwOsrDKq5gTqTOVGnRjPWNXuq9hrfj/h9fJlGcWkUJmL/qAKtGr0EnygwFbr5D5ZKUjeEd 6qKSX9DEaI/G0l+WK8Kxs3TUouK/OplhnD1hNWYSYMjVe/+0PLPOPfKKZCaLuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SwQdpAz0/NTDRqpXR2JGrCiMNlY/95gy75LNz2744v8=; b=u3DyQzC2y5kwLYu+EDozDev+2nXwseDLerMwiOZA7EwrkxNSIyh9c0/vT48sEknVZ/eQ/G k7BCavt0ZV0Qps4qOUberAz6JgY8W+X2QDL/LbygQa5rkEbE5tUNlLgow7yeWuJP+ZRJY4 3cj77OfCArMGRylJ0HFi5CnmWGyYcaD6WiOsOJDcHTTk1GbuOcRjC1LUJGNLLBpWkwJXh2 1bfF0etxxTJ/ersup1YICQhiL9CmqAmh2vc43yUT8dYifOlx0wsawmLVbeV9PpssbcnGX5 dq6xrvB2lOpfLRQf9W8g2zn2h2m9IwSKJhDJTlrk68q6JVzLfi0NN3UwnjaDUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3B1x06W0z3J0; Wed, 26 Feb 2025 23:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkCPb086519; Wed, 26 Feb 2025 23:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkCRf086516; Wed, 26 Feb 2025 23:46:12 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:12 GMT Message-Id: <202502262346.51QNkCRf086516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0ce3f5ee4e35 - stable/14 - LinuxKPI: 802.11: synchronize LinuxKPI 802.11 sta from net80211 ni List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0ce3f5ee4e3540b7071742cded5c3341e4c92d57 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0ce3f5ee4e3540b7071742cded5c3341e4c92d57 commit 0ce3f5ee4e3540b7071742cded5c3341e4c92d57 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: synchronize LinuxKPI 802.11 sta from net80211 ni Have a wrapper function dealing with the synchronization for all the dfferent standards (HT and VHT currently). In case HT or VHT is not supported make sure to turn the LinuxKPI "supported" flag off for that. Previously if it was on once it would never be turned off. For HT and VHT properly compute the NSS and also set the max_amsdu_len correctly. Set the NSS directly in the function (which is called in proper order for this) rather than passing the results back and do the setting in the caller. The only thing we need to make sure upfront is that it remains at least 1 (see f5a58c2da239). This all makes the caller and code a tiny bit simpler and work better. There is more synchronization to be done between the chanctx and the deflink bandwidth, which needs to happen dynamically in case net80211 decides to change that under us but no native driver seems to properly implement this (if at all). HT20-only, HT40, and VHT80 are supposed to work for now at least. VHT160 and VHT80P80 have further debug work to do as it does not yet seem to be consistently set in all cases to sync from. Sponsored by: The FreeBSD Foundation (cherry picked from commit f9c7a07d7f5e1c3694b463423c43051451b61e87) --- sys/compat/linuxkpi/common/src/linux_80211.c | 133 +++++++++++++++++++-------- 1 file changed, 96 insertions(+), 37 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 5ecfdf495948..aece603bb763 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -367,19 +367,17 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) #if defined(LKPI_80211_HT) static void -lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *ht_rx_nss) +lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) { struct ieee80211vap *vap; uint8_t *ie; struct ieee80211_ht_cap *htcap; int i, rx_nss; - if ((ni->ni_flags & IEEE80211_NODE_HT) == 0) + if ((ni->ni_flags & IEEE80211_NODE_HT) == 0) { + sta->deflink.ht_cap.ht_supported = false; return; - - if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && - IEEE80211_IS_CHAN_HT40(ni->ni_chan)) - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + } sta->deflink.ht_cap.ht_supported = true; @@ -401,43 +399,116 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, i sta->deflink.ht_cap.cap = htcap->cap_info; sta->deflink.ht_cap.mcs = htcap->mcs; + if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0) + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + + /* + * 802.11n-2009 20.6 Parameters for HT MCSs gives the mandatory/ + * optional MCS for Nss=1..4. We need to check the first four + * MCS sets from the Rx MCS Bitmask; then there is MCS 32 and + * MCS33.. is UEQM. + */ rx_nss = 0; - for (i = 0; i < nitems(htcap->mcs.rx_mask); i++) { + for (i = 0; i < 4; i++) { if (htcap->mcs.rx_mask[i]) rx_nss++; } - if (ht_rx_nss != NULL) - *ht_rx_nss = rx_nss; + if (rx_nss > 0) + sta->deflink.rx_nss = rx_nss; - IMPROVE("sta->wme, sta->deflink.agg.max*"); + IMPROVE("sta->wme"); + + if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_7935; + else + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_3839; + sta->deflink.agg.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA; +#ifdef __handled_by_driver__ /* iwlwifi only? actually unused? */ + for (i = 0; i < nitems(sta.deflink.agg.max_tid_amsdu_len); i++) { + sta->deflink.agg.max_tid_amsdu_len[j] = ; + } +#endif } #endif #if defined(LKPI_80211_VHT) static void -lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *vht_rx_nss) +lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) { + uint32_t width; + int rx_nss; + uint16_t rx_mcs_map; + uint8_t mcs; - if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) + if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) { + sta->deflink.vht_cap.vht_supported = false; return; + } - if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { -#ifdef __notyet__ - if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; /* XXX? */ - } else + sta->deflink.vht_cap.vht_supported = true; + + sta->deflink.vht_cap.cap = ni->ni_vhtcap; + sta->deflink.vht_cap.vht_mcs = ni->ni_vht_mcsinfo; + + width = (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); + switch (width) { +#if 0 + case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ: + case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ: + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; + break; #endif - if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + default: + /* Check if we do support 160Mhz somehow after all. */ +#if 0 + if ((sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) != 0) sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; - else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + else +#endif sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; } - IMPROVE("VHT sync ni to sta"); - return; + + rx_nss = 0; + rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; + for (int i = 7; i >= 0; i--) { + mcs = rx_mcs_map >> (2 * i); + mcs &= 0x3; + if (mcs != IEEE80211_VHT_MCS_NOT_SUPPORTED) { + rx_nss = i + 1; + break; + } + } + if (rx_nss > 0) + sta->deflink.rx_nss = rx_nss; + + switch (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK) { + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_11454; + break; + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_7991; + break; + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895: + default: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_3895; + break; + } } #endif +static void +lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) +{ + +#if defined(LKPI_80211_HT) + lkpi_sta_sync_ht_from_ni(sta, ni); +#endif +#if defined(LKPI_80211_VHT) + lkpi_sta_sync_vht_from_ni(sta, ni); +#endif +} + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -480,8 +551,6 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], struct ieee80211_vif *vif; struct ieee80211_sta *sta; int band, i, tid; - int ht_rx_nss; - int vht_rx_nss; lsta = malloc(sizeof(*lsta) + hw->sta_data_size, M_LKPI80211, M_NOWAIT | M_ZERO); @@ -581,18 +650,9 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; sta->deflink.rx_nss = 1; - ht_rx_nss = 0; -#if defined(LKPI_80211_HT) - lkpi_sta_sync_ht_from_ni(sta, ni, &ht_rx_nss); -#endif - vht_rx_nss = 0; -#if defined(LKPI_80211_VHT) - lkpi_sta_sync_vht_from_ni(sta, ni, &vht_rx_nss); -#endif + lkpi_sta_sync_from_ni(sta, ni); - sta->deflink.rx_nss = MAX(ht_rx_nss, sta->deflink.rx_nss); - sta->deflink.rx_nss = MAX(vht_rx_nss, sta->deflink.rx_nss); - IMPROVE("he, ... smps_mode, .."); + IMPROVE("he, eht, bw_320, ... smps_mode, .."); /* Link configuration. */ IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); @@ -2531,10 +2591,9 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IMPROVE("net80211 does not consider node authorized"); } -#if defined(LKPI_80211_HT) + sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss); IMPROVE("Is this the right spot, has net80211 done all updates already?"); - lkpi_sta_sync_ht_from_ni(sta, ni, NULL); -#endif + lkpi_sta_sync_from_ni(sta, ni); /* Update sta_state (ASSOC to AUTHORIZED). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); From nobody Wed Feb 26 23:46:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3B1y3mmTz5pBlx; Wed, 26 Feb 2025 23:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B1y21gpz3pVY; Wed, 26 Feb 2025 23:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=peTZM0aYmAsQIATuf0TtdTCIIaKB1k4s/MS9XveB7o4=; b=v9Vv58NKCtaglQ0llc4mgMilmhAUuqVTDIsSV6InutY1liLD7y+FrmIDFM2LuGu7sVzJik 3rFtvusIz2Xze/RiSxxLGZ0x6jcV6plvUPMYaFPHizVtb+btrtSa2Vo9HKa423aR7/JKrs aaxZdGUQf6cgNNrCez3efm5GgtsR/TTOlftvly/vNw04q4Fw0zcpTc8gHmd59J1PQHt7/B yvAcqfXATWl9uanRIii+3mCjbS9iPFoqoPhsZtKs31w1SvUkh2gWvwY1pmPRtFGCAfrcYW ShmFR4Q+DPB6Rcaed59/jiDfHwLYQvgTBHiwoeNV8ZlSmUDgWRvJ5V1lJMZ18Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613574; a=rsa-sha256; cv=none; b=o9VQMo/U5zdvkEAN2q67FjFcd6jYq9bwBwMQuAMMvxczAnX+8Qw8m5M6JNKgLXmfgwidLs jrd7LoJ1Eh9sk44lI5QT+uuysJCzu3P72GJWZFUwbgd2GDGbED7LS2Eoa9GACt2IRro721 ZewHzbSCtFXMtQoHrdIPo5aWAua8IoGAb0FSx7lnNUpiDwFGyCbqyVu9c/NhQQq0WJy3EC 9PmkkA/pM4xRWdfXM3BwMIB4APO2+Lax/3o8kYgLdPoJ3x4C65gRX9C4SgxUFQr8qAg6ng zqMKbJVpsSpWnLVpfpf5wzQZwLSvpgd5lotpwqMj1JKtpxAGz/gdLWCAYbYTbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=peTZM0aYmAsQIATuf0TtdTCIIaKB1k4s/MS9XveB7o4=; b=ccGzCKVAIkIpyMewUidXy+kw1PHm0L5EOMTZDZFg+9aGsHwAiMq1ryk/bMjrXkvfor32uQ 3lgZTY7KQwFlcf2R95NUt7zCsq3eYGC3fXzGjcqHR+t6uAA3nQJ2zypK3EXvjq4Y2SqEXL tRnzO6ZrTYPrry47J0qr77sEdmoKT+Vx7TxsBF/wAGQxK+FtZFlUpkcVKXD8swbPWbIz1/ G1XXhhV6mYqfIk/8HQ15aQjTZ8L+w7DZ6ku1SrHI9FZu9+8tCLUyannFwILfZMOSVH8AMP fHGhqaOPkNkwC74EhVOwPm9taAeq+vltDdji43D41Oj80Yk8FJvBW0BCoMeu8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3B1y1QG1z314; Wed, 26 Feb 2025 23:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkEkj086554; Wed, 26 Feb 2025 23:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkE1e086551; Wed, 26 Feb 2025 23:46:14 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:14 GMT Message-Id: <202502262346.51QNkE1e086551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2cc0f3d2f0b1 - stable/14 - LinuxKPI: 802.11: cleanup chanctx freq/width settings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2cc0f3d2f0b1422b7b317bf01a1d678e5ef77acb Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2cc0f3d2f0b1422b7b317bf01a1d678e5ef77acb commit 2cc0f3d2f0b1422b7b317bf01a1d678e5ef77acb Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 01:42:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: cleanup chanctx freq/width settings Cleanup chanctx freq1/2 and width settings using the channel from the net80211 node and the net80211 functions to return the center frequencies (already doing the math for us or using pre-computed values). Set the min_def (minimum channel definition) to def (channel definition) for the moment as it seems to be unused by anything but iwl_mvm_chanctx_def() to avoid complications. Sponsored by: The FreeBSD Foundation (cherry picked from commit 90d8e307ff610f20dccffe038353affbad0c374e) --- sys/compat/linuxkpi/common/src/linux_80211.c | 43 +++++++++++++--------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index aece603bb763..01d023f80257 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1732,39 +1732,45 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; chanctx_conf->def.chan = chan; chanctx_conf->def.width = NL80211_CHAN_WIDTH_20_NOHT; - chanctx_conf->def.center_freq1 = chan->center_freq; - chanctx_conf->def.center_freq2 = 0; + chanctx_conf->def.center_freq1 = ieee80211_get_channel_center_freq1(ni->ni_chan); + chanctx_conf->def.center_freq2 = ieee80211_get_channel_center_freq2(ni->ni_chan); IMPROVE("Check vht_cap from band not just chan?"); KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC, ("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan)); #ifdef LKPI_80211_HT if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_40; - } else + else chanctx_conf->def.width = NL80211_CHAN_WIDTH_20; } #endif #ifdef LKPI_80211_VHT if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { #ifdef __notyet__ - if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_80P80; - chanctx_conf->def.center_freq2 = 0; /* XXX */ - } else -#endif - if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + else if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_160; - else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + else +#endif + if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; } #endif /* Responder ... */ - chanctx_conf->min_def.chan = chan; +#if 0 + chanctx_conf->min_def.chan = chanctx_conf->def.chan; chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20_NOHT; - chanctx_conf->min_def.center_freq1 = chan->center_freq; - chanctx_conf->min_def.center_freq2 = 0; - IMPROVE("currently 20_NOHT min_def only"); +#ifdef LKPI_80211_HT + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) || IEEE80211_IS_CHAN_VHT(ni->ni_chan)) + chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20; +#endif + chanctx_conf->min_def.center_freq1 = chanctx_conf->def.center_freq1; + chanctx_conf->min_def.center_freq2 = chanctx_conf->def.center_freq2; +#else + chanctx_conf->min_def = chanctx_conf->def; +#endif /* Set bss info (bss_info_changed). */ bss_changed = 0; @@ -1797,15 +1803,6 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width; vif->bss_conf.chanreq.oper.center_freq1 = chanctx_conf->def.center_freq1; -#ifdef LKPI_80211_HT - if (vif->bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_40) { - /* Note: it is 10 not 20. */ - if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) - vif->bss_conf.chanreq.oper.center_freq1 += 10; - else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) - vif->bss_conf.chanreq.oper.center_freq1 -= 10; - } -#endif vif->bss_conf.chanreq.oper.center_freq2 = chanctx_conf->def.center_freq2; } else { From nobody Wed Feb 26 23:46:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3B1z61Vhz5pBKk; Wed, 26 Feb 2025 23:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B1z2f52z3pVf; Wed, 26 Feb 2025 23:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4x/VpMiGv3LJo8Z4InmBKoZT11LKsdrQBGDpyJfWHE8=; b=Z7zE8eMmfb1826A/zr2qDGTH+mz5KFtYgObIEYPARl7//JsQJHCcfb1RGqvDGcYbiSegAR VBrrhJqPuMS2lDMl3SwWxgAPdRXuf8ThemklKf/6oHuSUFjs2KrxB+/S27Pdm0iuWSwGNR POa8j4pW4R7BLt30g7W7z/WW+U6Pz8HRW0YnwqF6FAeMkGD5Eo0fC8vpV32ICVpYa5S4Q7 mT6TN37PUs/0A9Hyb65BgN2zS21G5T791283CzSM4LXr8LlmsZaBGVMColfJFARpYBMGIt y3oK8b1Jk+2zHGNzyF9uToDgyEChdUatTQSww5naejf09Rn3VPFmpQoEmx3YZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613575; a=rsa-sha256; cv=none; b=Rx9SToQB5MvUtuV0s/K8EpduN1i3sQHIADdpsLWdN09pcNvRbXzv1W8eRqBxH5y1t5WlQT OLG7TgzHKMNe7oMWmBNH7hQZmWqe3Mxz9OkyrAdu3IujLloRVTvo9HBi+yK9mSkWicp9LG XM3y3JO4K+qfMARbupJ+NqLqMDnveEVvo2lzRM5V2XESZBhNTb+XZXzKhr+1UljKm2yLkJ MCP7IYdFyByVmiTgbzoVXZawV2ltL6ZYVKqfxJfn5OyAI0w5d24xtkufr2t51i8JHNLX0B DnyuUX+cWXRoxtu0Pq9bEDkcrj3Hz+BPPtbYFj7GXvu3rXAw3ybziGjPqACCGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4x/VpMiGv3LJo8Z4InmBKoZT11LKsdrQBGDpyJfWHE8=; b=PuNibdx+LYAy2h9NAr/qfArA0rfQonVxefflG7y2BqiBMgIupprQw0EoQcW5yuvL3vnWRC LWC5g/95O4A30n9U70AvEwGBjlNUJTfHuGOohP/pm1u3WW+tEMiceYnQGnpxGbJoyP5f74 WAIGhNspyZmaZ3Ta+0FAE50HPtPiliUb9Tsp6A+Uy0PBRIAcXo/BBd9TYn/gRi7++e+H02 9B6+gGnf2t/OqCarDvIN1Urb0MLdOao1jsCwn6ShkEkv9FecDr1GQmRYSHfE/C4eij7nLF yU65EZh3Gm3qy1M7SSaOiequ1er5I0vuRb3n32beNnwsvM6wVHiEbZ8hIdFNKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3B1z27Dvz315; Wed, 26 Feb 2025 23:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkF8p086589; Wed, 26 Feb 2025 23:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkFpR086586; Wed, 26 Feb 2025 23:46:15 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:15 GMT Message-Id: <202502262346.51QNkFpR086586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 56bc8d57d361 - stable/14 - LinuxKPI: 802.11: disable A-MDPU TX for now for LinuxKPI WiFi drivers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 56bc8d57d3614ad34098f3542126f978b3d34db2 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=56bc8d57d3614ad34098f3542126f978b3d34db2 commit 56bc8d57d3614ad34098f3542126f978b3d34db2 Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 02:24:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: disable A-MDPU TX for now for LinuxKPI WiFi drivers Clear IEEE80211_FHT_AMPDU_TX from iv_flags_ht to avoid doing A-MPDU TX. For Intel we need to support two different variations at least, both likely needing net80211 surgery first. The good news is that turning it off in net80211 will make it work for modern iwlwifi/mvm chipsets/fw. Realtek will need some mac80211 functions to be implemented at least. Once we've done all and tested one after the other we can remove this again. Sponsored by: The FreeBSD Foundation (cherry picked from commit ac2c7271b7c2624d7cf3af6bdaf82b00323edfd3) --- sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 01d023f80257..4504a8f4f513 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3529,6 +3529,10 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], if (!lkpi_hwcrypto && ieee80211_hw_check(hw, AMPDU_AGGREGATION)) vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX; #endif +#if defined(LKPI_80211_HT) + /* 20250125-BZ Keep A-MPDU TX cleared until we sorted out AddBA for all drivers. */ + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_TX; +#endif if (hw->max_listen_interval == 0) hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); From nobody Wed Feb 26 23:46:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3B205trdz5pBqc; Wed, 26 Feb 2025 23:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B2045nCz3pSR; Wed, 26 Feb 2025 23:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbhWmySCt2SlHn4mBXsM1tvQtILURnFo2v8BoUwmsQg=; b=nn4cnnDxohKrKbGm5+V/6Vx45WiXLncIXfuNzCFWyEjyYjYD/iiG4By28RpBhNH50YiCN5 nd1EFi0Rn17SY3zZeMDD7lLSFJdWKLG1XBE/WF4P6BSH+wYRxIk5oO0StucDdwE4Sj5XrO SFPkPp46dQbZlfc+y9YZexciLMaGl/LX6WdvWJhPvssfMFWjNu6Eq8+BMC97RR96D5maPD rZnIT5jN0BMm8BT1qsgLy/9HxvKGAofOIc0CIphMJQEBjUflKyCzTIxXrH9Ej/OnpgOk8Y RPySWGamlCRRUPZiu5DVPrsSYmEd6hlLKwAUyQ1NWR2xDHQ5yhwtef8PvFlutQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613576; a=rsa-sha256; cv=none; b=eNvr6E0Kf1tJFa/A5WmHOJ6QIFqjTjmqa4nngqM8YEVx7xkWn9mgIm5txaMulNIEYJZSFj m+A++LWxAb0/h03u9oo1IDjMi5L1lVVMnG5S9L1UCnVH9bocHGhZoM3k9e3Y2ig7pgc24m xxC1QzHWAIoEkL2S9iBKSoalpbjW7Tc7oKR7JGZu5CW0GRnmjL5rQZZHxt+vaFYtIlgvid bG3pexLWF41zOkzdjIjvdEAMTRR6gxbGgBslox5SbMo7ZBNBmwEDcX/71I10ukWnX7Rxet joKF7uaMpVo5OKdoB2NLt67TQbd6wGLArELlnAtzC+ZA1MPruNMTI0gIEAizuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbhWmySCt2SlHn4mBXsM1tvQtILURnFo2v8BoUwmsQg=; b=eYUHo6BG0AY9hDHJa4zFZubNYFRpR6dVY0HR+n4sfA+p3KdgQ9YrbH63E8kIYs6j/sh+U/ HCGaKHxd9xcOUIewUqjuoUa6YA8Ch2W4ywHolOu3VtPH+93Fh2CXEhfD578UAlExr8W7NR AhunJbfYCPD0u7Je5h+9luVd/7kzwuRjP/OiVF/xs5HqEI5roHvXy+cmHjIq6OzvuKAE3c 6xIf5A/+bmmAU6RoqGhj1zP2xISAa4TI2Uo91DMH8pp+P/+yQgD+wGY49uagFVIGhoaMTL XG+vTPEKyJvIhgllGg5AQeaewpOpI6867/YedGKDxKR9vsBoOew/8/Vogt7ZaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3B203PfJz2lb; Wed, 26 Feb 2025 23:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkGi9086628; Wed, 26 Feb 2025 23:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkGb7086625; Wed, 26 Feb 2025 23:46:16 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:16 GMT Message-Id: <202502262346.51QNkGb7086625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7117d83bae36 - stable/14 - LinuxKPI: 802.11: factor out dynamic_rx_chains computation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7117d83bae368d9240b2596d9db26423877ff4f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7117d83bae368d9240b2596d9db26423877ff4f0 commit 7117d83bae368d9240b2596d9db26423877ff4f0 Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 02:43:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: factor out dynamic_rx_chains computation For the moment we set dynamic_rx_chains to the rx_nss value which should be correct given we count from 1 there too and we call lkpi_get_max_rx_chains() after we synced ht/vht initially already. Long-term some of these counting bits should be further factored out into their own functions and used both here and for the sync code. This will likely want to change as well once more dyamic synncronization takes place. Sponsored by: The FreeBSD Foundation (cherry picked from commit 389265e3ca827ad88b3b8ad787251471161d6634) --- sys/compat/linuxkpi/common/src/linux_80211.c | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 4504a8f4f513..b7d3d7a298fc 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -509,6 +509,33 @@ lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) #endif } +static uint8_t +lkpi_get_max_rx_chains(struct ieee80211_node *ni) +{ + uint8_t chains; +#if defined(LKPI_80211_HT) || defined(LKPI_80211_VHT) + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); +#endif + + chains = 1; +#if defined(LKPI_80211_HT) + IMPROVE("We should factor counting MCS/NSS out for sync and here"); + if (sta->deflink.ht_cap.ht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + +#if defined(LKPI_80211_VHT) + if (sta->deflink.vht_cap.vht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + + return (chains); +} + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -1726,8 +1753,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf = &lchanctx->chanctx_conf; } - chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->rx_chains_static = 1; + chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->radar_enabled = (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; chanctx_conf->def.chan = chan; @@ -1758,6 +1785,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; } #endif + chanctx_conf->rx_chains_dynamic = lkpi_get_max_rx_chains(ni); /* Responder ... */ #if 0 chanctx_conf->min_def.chan = chanctx_conf->def.chan; From nobody Wed Feb 26 23:55:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3BDn1dJKz5pChK; Wed, 26 Feb 2025 23:55:37 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3BDn15f5z3w6f; Wed, 26 Feb 2025 23:55:37 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740614137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n7SW/UvcJkTk4xF4ffRVnl9NtcsbSYoaE/5bqjKcbf4=; b=R2RVTXqlnZsd07ym22PaNs+ogA8dp/0ICgegc+v/vhHaHnd4mvFv/vN0BMd90kfkf7TGoF jXOlAPGfDVuaxrPPPjr9wk4qzNaEIYLG+TnaA2Z0FkoLzGecVb1xWc29l4k11GyR8b7Z6F N459F9OQwP8mZVzs8Cw4ZXvouBZ/HvoAca73km3+RcTFJgHWW4BC/3Ac2IpPS1zqNkWNzk gKdN8lb6pr8up8G3F3E5suxbFxQcZwFkPyJB/vjQDSnE4rHl5n01UMhxMIHMugtaslQsoN heYV+6J9Zzf401FZP7T6dBcDYaAigIWGMdWqpCh7qgPHei3ww0p+uUbd8uai7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740614137; a=rsa-sha256; cv=none; b=RoeBRrczpp1ieRuRpSN3nKctfHVyYD8+1Z+Z8JA5OqTppinJoZAjzLDzzmmotzpUzmaAYP xEMWG/dWE5LMu/hOUVXzt8PwyuorGZmH4BQgHDKHHS3bfeaIC81GazQNu2UT0QT9Ds1fKp itSvMzl7jKOA6bl/lHf1W8Bn90AwMM+4/O/ToAgAgJzvKDQwi0d+YHW5uWA3Qx3iwNjrg6 NXfxZnfX1mZ20VzR7OMYKLZu3hVliY93l7wdM5ZmbtuFefrncrBOpK7nbiwT/t9dMEkmxY 7iSQPhH4W3v3kWxhdrOh/bbxKB2uU+MV/BKh84DJUFE+lcqdur5j7R6COsY9Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740614137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n7SW/UvcJkTk4xF4ffRVnl9NtcsbSYoaE/5bqjKcbf4=; b=jIFuAAw04kRKz1Jh+DzylAIErSKk3qQgctW4qt/qm/K4hP3x42M7YrYTeU7WZ4tXdCLaHc aZzWFY8ZNPTlt9aogt98CCaSkt2jo1MS2xDRMY1MZSguglaI9d9zbB+pm3C/w+ZbU8XzDI dQg/ikDa0I1MZLhZ1nrbHN0H+Byqrp2Z2seoGNDzen8I+V+4pg+SmExDRG4NFdzeJNfsn+ gHlS6nZDSnMcwmXrpnIISqBQIYqQU80yFgtZXmUsL2wBKpdEI50y81N9KDmvdtPg2hf+yA 9cChiVYb1nLV3vM9nC+3U/Nj3ECGtLtkWyJi9a80SHsvlVno+YVIX1gOm45pBg== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z3BDm3JxJz16Lp; Wed, 26 Feb 2025 23:55:36 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 26 Feb 2025 15:55:34 -0800 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Cc: Michael Tuexen , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0e58542fd246 - main - tcp: remove unused field from struct tcpcb Message-ID: References: <202502252048.51PKm4YX061305@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Feb 26, 2025 at 02:23:46AM +0000, Bjoern A. Zeeb wrote: B> > --- a/sys/netinet/tcp_var.h B> > +++ b/sys/netinet/tcp_var.h B> > @@ -452,7 +452,6 @@ struct tcpcb { B> > tcp_seq gput_seq; /* Outbound measurement seq */ B> > tcp_seq gput_ack; /* Inbound measurement ack */ B> > int32_t t_stats_gput_prev; /* XXXLAS: Prev gput measurement */ B> > - uint32_t t_maxpeakrate; /* max peak rate set by user, bytes/s */ B> B> Is the tcpcb no longer KBI relevant these days? B> In the old days we'd simply make this a spare and not move all offsets B> below around. In the old days tcpcb was visible to userland, that's why there was the spare habit. On FreeBSD CURRENT we don't provide KBI stability between core network stack and advanced TCP stacks as loadable modules, neither NIC driver modules that meddle with TCP. -- Gleb Smirnoff From nobody Thu Feb 27 00:32:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3C3G4LmSz5pHwK; Thu, 27 Feb 2025 00:32:26 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3C3G3hntz3QPp; Thu, 27 Feb 2025 00:32:26 +0000 (UTC) (envelope-from bz@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740616346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NSi1RwBnMCoCVaVDviJXgmBW1fXREFT0snSTgJZ3ijg=; b=G6rZwQxuUF+LE7XMROkujeUpc2F0O2NJA5d2bxp0TAy2ATzzxJMMGwnrYQPcy22tu4Wn8a oU3sbfGATvB71JvkBGG+zfWEddzE6HHvGiA1yLJuFjon6aHFX92Pdn+p4fEvuhHPCCm4J1 nEh1i74aiiL2K2bl2gvw5+g/vhh4PmJESrg3gQvmOu8BaoGia+1ui00vjLCq38tmSCKzZy +nJV2IfKep/ZRZp6MyQTx/acXQftGY7cH8/PRHjWAkbdrjcpgFcEuttR3y9FwL7DrwV0EA p8h0JNBL08ryF1KisnuLzoQWraOg++uBMaHN7PxwWah+kgzTUluJazMSeysc4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740616346; a=rsa-sha256; cv=none; b=cOGdCJm9q0Apuzep32m0tbnZoEal3M0TuRY+JqDNZjZUZyCfZlyR4lMhIDg9hWH6c6UsD/ +fsGWyDoWaoI8s2WCGqphS9Oo5BGVeXRosacDDit16cxnrDRhbilqvlQmLScwZSxgLlhp6 PKuVeYoVZJw5MA8tULYFddct9Tut2FkcvafbMGndsUfUGA6G3vJJnpHZOaGQfVYRCn3nFx gCcWSRhZmPqTK2dQgQG7HcRNOt6BcOaDzMWXxoF2Tth3zx4fRIusXg+htk0TR04yZwgIWH jlIMEqFE2sR1kUfbmnVgbdL70Jnzcc5dmPh4E317c8Xr+j+a4R7e5+UUlYNO0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740616346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NSi1RwBnMCoCVaVDviJXgmBW1fXREFT0snSTgJZ3ijg=; b=Pvj/6GX24pusdLBHTT71UmIwY0VZOLJOakuzzAxryF2wkOW4ZksCIpyaTlXvHxSvEezHkJ T0l2cFMtq8Kea8mopDcsr8H1NyBQrP/90MKaLrkVpcEkE+yAMbmIOtp+vJA8ZVdUppyK1G 5eH7fcnoEjyB6ko9Ew5PmbOTAPGFpOBh4+Zhe6p9hSpOKp3Y603qLRMOqXp6wLRnrJtPzI fnNKwtTqPLkyp9EmJD7s1aZkmZ6KdSFWKRg79cegWyu0EwE6tlwac0C6uFhcBV/sN5w3Pu 7Ja/7rKV/4R2aeeTbhhFzQ8f0rm8VIzGbju1GAK2yg6qKH9Mb9+iroDZFmYGjQ== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z3C3G27Dnz16Xy; Thu, 27 Feb 2025 00:32:26 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 144D9A64806; Thu, 27 Feb 2025 00:32:23 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8070E2D029D8; Thu, 27 Feb 2025 00:32:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id yXwISqJBOk23; Thu, 27 Feb 2025 00:32:23 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:da44:89ff:fedd:d5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A7EE02D029E1; Thu, 27 Feb 2025 00:32:23 +0000 (UTC) Date: Thu, 27 Feb 2025 00:32:22 +0000 (UTC) From: "Bjoern A. Zeeb" To: Gleb Smirnoff cc: Michael Tuexen , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0e58542fd246 - main - tcp: remove unused field from struct tcpcb In-Reply-To: Message-ID: References: <202502252048.51PKm4YX061305@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Wed, 26 Feb 2025, Gleb Smirnoff wrote: > On Wed, Feb 26, 2025 at 02:23:46AM +0000, Bjoern A. Zeeb wrote: > B> > --- a/sys/netinet/tcp_var.h > B> > +++ b/sys/netinet/tcp_var.h > B> > @@ -452,7 +452,6 @@ struct tcpcb { > B> > tcp_seq gput_seq; /* Outbound measurement seq */ > B> > tcp_seq gput_ack; /* Inbound measurement ack */ > B> > int32_t t_stats_gput_prev; /* XXXLAS: Prev gput measurement */ > B> > - uint32_t t_maxpeakrate; /* max peak rate set by user, bytes/s */ > B> > B> Is the tcpcb no longer KBI relevant these days? > B> In the old days we'd simply make this a spare and not move all offsets > B> below around. > > In the old days tcpcb was visible to userland, that's why there was > the spare habit. Yes, the problem really was with uitilities such as netstat. But I see you solved that ages ago with struct xtcpcb which has tons of spares to avoid that problem. Sorry for the noise. /bz -- Bjoern A. Zeeb r15:7 From nobody Thu Feb 27 00:51:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3CTR5zGkz5pKjR; Thu, 27 Feb 2025 00:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CTR5Jp6z3glm; Thu, 27 Feb 2025 00:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m85gEVlXRIxd3lIxL4yHaw515ojrbTnCEAfMpaxrv24=; b=aWq7ocGb+8L0e/bOtLk1DRIruYA9akmv2z1c7KjnNDN8QsGsBBmkNBCrnXdUFxCkMDlMl1 7PWhvzajzvJN9MjitakMZy7mQ5w2uhnV/042ZL8UWSPU+zE0DSUna9UaV8NxusxLy/LAzp 4Apg6eTE6fIzSEaKAtxjd2sED4Xc/WJrDKlqieEd4PiVwwK0xIkP1l33StybCTqKzfcVwI kYwwseeyE4LZbset+2nvV1pOE5Wd7OT6cIypNlqHS0tDVknSfi3OFzyh9ToS+XlypVaVC/ cml5htUntTCvb5d9PW8kIFgLOIz0+Yy0rGZ20PamRtWaZk4nXUYiC05qxgEpMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740617499; a=rsa-sha256; cv=none; b=jo+7VsWIApIr9MHMUhQAEREixRKs4qj7EKmy6lkbTlZmDGAXzF8eLRsmvJq6BEwbNr4bes XtCNFTXG1usMg1VWQAm4bCCKrJgigXcOxoXt8yB/YwWYfsqpTMHLeO8yE/ubwiXL8rwobc 2uI135KLWIiY31ZyRNbyNpGpffnE/JHBRUkcXVMWxR4lBX9PsOuhpOtpK18rHppOenpWTW o2vdUAVbkK/Mr3wXyYgzjUt/DMvcUNDM2HE+GU4aUkn4NMNhbuV88k8Pu/c3RgPpabCk0h R1xFU2ym6HrzN51Nt3aHX6AxFo7PtO0m2/lUQ0Eba2uX1gLDRAkTL/6vglxUkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m85gEVlXRIxd3lIxL4yHaw515ojrbTnCEAfMpaxrv24=; b=tSw5YZxArFCThxDTtMWyN1JFIAnoj+lEcDzthUZi+Q1OJxyZnNf1nN36roRVNVhjpuSw7U 9lvEiHVV3ADD0gfmxMqtTf1FM/EQircoKJl0ZKosYKN5EwuQcT+xvJFzRfD4Q3FT7ic/wI IdeQrkcwfFSZonwhwVVzDBqwPGCk68JnHMHWq8aWP/4K7HFmOrdFlBl7ifLjEbwmXIRoU/ cYCuvHMztlh04Q6ctYIi8Slx7rtMwtHi2tz0IYdb7+1lCWZAuO59eRlFDPvTu7kEFFIOC1 5QuU1S/UUlxNcQmR1lNO2ji4oFc4IFGVNf4QUjlBnnhm5D5y5/fqhmTYI11FwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3CTR4Qnxz5Cr; Thu, 27 Feb 2025 00:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R0pdpb011525; Thu, 27 Feb 2025 00:51:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R0pd1D011522; Thu, 27 Feb 2025 00:51:39 GMT (envelope-from git) Date: Thu, 27 Feb 2025 00:51:39 GMT Message-Id: <202502270051.51R0pd1D011522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 1ff76f6ddefa - stable/14 - gstat: Sync usage/synopsis + tag SPDX List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ff76f6ddefa66d9b37c6781943db143f0e2d29c Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=1ff76f6ddefa66d9b37c6781943db143f0e2d29c commit 1ff76f6ddefa66d9b37c6781943db143f0e2d29c Author: Alexander Ziaee AuthorDate: 2025-02-03 02:15:26 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:51:00 +0000 gstat: Sync usage/synopsis + tag SPDX Sort options using the slightly unusual convention used here as well. MFC after: 3 days Approved by: carlavilla (mentor), imp (src) Differential Revision: https://reviews.freebsd.org/D48800 (cherry picked from commit 8b35839346d0bd8d4244018489bfdef8fd48de53) --- usr.sbin/gstat/gstat.8 | 17 ++++++++++------- usr.sbin/gstat/gstat.c | 8 ++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/usr.sbin/gstat/gstat.8 b/usr.sbin/gstat/gstat.8 index d328d26be23c..02dbbbc54a3d 100644 --- a/usr.sbin/gstat/gstat.8 +++ b/usr.sbin/gstat/gstat.8 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2003 Giorgos Keramidas .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 1, 2021 +.Dd February 1, 2025 .Dt GSTAT 8 .Os .Sh NAME @@ -30,7 +33,7 @@ .Nd print statistics about GEOM disks .Sh SYNOPSIS .Nm -.Op Fl abBcdops +.Op Fl abBcCdops .Op Fl f Ar filter .Op Fl I Ar interval .Sh DESCRIPTION @@ -75,11 +78,6 @@ Only devices with the names matching will be displayed. The format of the regular expression is described in .Xr re_format 7 . -.It Fl o -Enable display of statistics for other operations -.Pq Dv BIO_FLUSH . -.It Fl s -Enable blocks' size statistics. .It Fl I Ar interval Refresh the .Nm @@ -92,8 +90,13 @@ or .Cm us (the default) indicates that the update interval is specified in seconds, milliseconds, or microseconds, respectively. +.It Fl o +Enable display of statistics for other operations +.Pq Dv BIO_FLUSH . .It Fl p Only display physical providers (those with rank of 1). +.It Fl s +Enable blocks' size statistics. .El .Sh INTERACTIVE COMMANDS These commands are currently recognized if diff --git a/usr.sbin/gstat/gstat.c b/usr.sbin/gstat/gstat.c index 887ae9dbee16..c650f7120a40 100644 --- a/usr.sbin/gstat/gstat.c +++ b/usr.sbin/gstat/gstat.c @@ -141,9 +141,6 @@ main(int argc, char **argv) "Invalid filter - see re_format(7)"); strlcpy(f_s, optarg, sizeof(f_s)); break; - case 'o': - flag_o = 1; - break; case 'I': p = NULL; i = strtoul(optarg, &p, 0); @@ -158,6 +155,9 @@ main(int argc, char **argv) i *= 1; flag_I = i; break; + case 'o': + flag_o = 1; + break; case 'p': flag_p = 1; break; @@ -615,7 +615,7 @@ out: static void usage(void) { - fprintf(stderr, "usage: gstat [-abBcCdps] [-f filter] [-I interval]\n"); + fprintf(stderr, "usage: gstat [-abBcCdops] [-f filter] [-I interval]\n"); exit(EX_USAGE); /* NOTREACHED */ } From nobody Thu Feb 27 00:52:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3CVQ2W3dz5pKTw; Thu, 27 Feb 2025 00:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CVP4TYRz3hT3; Thu, 27 Feb 2025 00:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CwJKxHWUrECuI6sKUvlOLQzv6bGUj4fCnoBnxa2p8PI=; b=igJtcga87VQhuQpSSK++K9NIKigtyL2c9b0bpx1R/kYmY0rGKEx35y06IGP0yJ83CKdpNo FgkEYQKJLUGm8s9UxVIRiL5t4tu6U3+Og/EB4Xz9MedkGTE7g6Auc38Vz7lOvSicvkTPQf ABQBMPdGv0o6istBO9aCFW2iBhqYvDUWZBNOPdTsCCFzqzuJx2Qw4o3KVFI9Vcf5pOaucH HcWNsSjdWn04YXqF0TftgluDyr0suquffh3pD2smW11Yp1zCxFuZmafA+3dIkngl2XDc01 jYHK+yxctjx1RmL3pw+sKSGer6IE1/t+ip8BS+T1rD8m/toQLftXqyKmpzuZsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740617549; a=rsa-sha256; cv=none; b=O7gV+zHdGhUNAhLO9A8TQtlGPnDePNu3KYg98wZWUHxJHc6YU0BaQDm64P7tQ08n/lnXvU 6iNKyuM84kNFt/aViYaS3zpVyqlQETLtx/zp9u6AQep+/XtsQpdeh2KiirXd8llO/UheDE jMKnx8pZeMkR/1WmKRuO4yOMh3U0a4HrWNrnUwCFb6QANZJ2wP8TvS7MlxPr/8z3I7MfTa 3B+e9WPKfFdAaFBa8A1e6qTBfGqW9WI8U5WU6oRz9v50T/F3uJRKaJEZxFYk8qymDeMTVL UEmEJX85o/E0A73izbFo3AwSQt4lzvyKqZT4hDl5u45b9dJ7n9vnAYTUtbsCHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CwJKxHWUrECuI6sKUvlOLQzv6bGUj4fCnoBnxa2p8PI=; b=Tn0LWAe7z50VK/MW6K7hza6x4Sijhaw8sq/nqyjPqXxzdmZPUrIgqwogkMaS59+U5dtirn sozUOItbgKkb+LQHcdx7IvjlUEY0T6obq/s2M0eetKT65XqR5Feu5z91syCw0b98Rvsbfm vmUKsxMWdycIXbtKPpAVkQtL+Nnxt7STP8kSVuPEvRqC+SJ5PyyH9GAjVwDpBKTlV95ao4 EuAtX8lnfjPQrn4p8fHc4IjizlSjn4nVr1vktp7p3LqbFmNMDJ1h2og9RMP3//yQWh05xs c5y/0+7wXo7BEulK7Vy9U3HZIv2s2IKyJEzWNytn7cPojeSUxvCsr1NZTEsvpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3CVP44mWz4dr; Thu, 27 Feb 2025 00:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R0qTph016114; Thu, 27 Feb 2025 00:52:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R0qTRp016092; Thu, 27 Feb 2025 00:52:29 GMT (envelope-from git) Date: Thu, 27 Feb 2025 00:52:29 GMT Message-Id: <202502270052.51R0qTRp016092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 3cedc5a9f14b - stable/14 - resizewin.1: Fix option list width typo + spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3cedc5a9f14b7ccd93448141ceb37434dfd15009 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3cedc5a9f14b7ccd93448141ceb37434dfd15009 commit 3cedc5a9f14b7ccd93448141ceb37434dfd15009 Author: Alexander Ziaee AuthorDate: 2025-02-03 20:24:32 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:52:19 +0000 resizewin.1: Fix option list width typo + spdx MFC after: 3 days Accepted by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48349 (cherry picked from commit 4a5d51e73e48b27d90b21ed26999b23208f603d8) --- usr.bin/resizewin/resizewin.1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/resizewin/resizewin.1 b/usr.bin/resizewin/resizewin.1 index f917209f2c90..ba4abe53ea1d 100644 --- a/usr.bin/resizewin/resizewin.1 +++ b/usr.bin/resizewin/resizewin.1 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" resizewin .\" .\" Query terminal for size and inform the kernel @@ -44,7 +47,7 @@ the size known to the kernel using the ioctl. .Pp The following options are available: -.Bl -tag -width ".Fl z" +.Bl -tag -width "-z" .It Fl z Do nothing unless the current kernel terminal size is zero. This is useful when run from a user's profile (shell startup) scripts: From nobody Thu Feb 27 00:53:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3CWz56zVz5pKRg; Thu, 27 Feb 2025 00:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CWz4bRjz3jbG; Thu, 27 Feb 2025 00:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bL4DZErqpG1xn/4Rc5/3toIQjVtgDfXe95BKi1PcBbI=; b=fpHLJLzoxwanWmIKO4nOYO+LHOWAMvA+TY674HW7PcIUMga5zqFvTSC+Ags9BTnBrNmxN7 X9mF2KxeciHksYb1L2ETdhK+J4eSZu5iWamU8tjaCic3yjjCVDVhfRO70F7U953R4TWyhY 9zuXc+scsZBqFkZmyMoCCdrxn6Ee/h8lqMx3tNNSfW767EzvHdvvNrBcIeOSGEZ7OO7uNA NTFwkxYSnGjhnddik3Tq6Ar+MLnjX+paPlVyOn5fLdLHUI7y7f36fOJdXlz9nhkBFULxq8 ioYbnWw5uaauyDCzuxunF4a8Tfb/+c2NKo4fRN5e10nJNbwvoekvXoFXPBrewQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740617631; a=rsa-sha256; cv=none; b=qeAONmA2JXvIu0wKSUz3JQL/37+sNfhibh7UCzIMKoikdzwk5H5vFiir6UGW6X5MLgItaB SnfvBMFiGDexKAiMsjZjybFIQ5NFHse/t670KfHa+adP8RgX+TEXA6XmaB2z5X9aQuyNNn 2IJSZQmbqOWmVfxJu1GoAWlGwjkWkljV10numczqXeyrI2okRYfO53HqSqJEtyNzQd5zAz 6Y/fbQb1wrXedb8Whuj/lS6kEtHbppBKCi5wLTLB1Uxhui6cjzFjtfUxf7896dd/fKxdbx a7ede4MNx9U84L9b3y+DGEGP7Z4J0NGjfyUfYvaqkpeNcoo8i/0vsHmcHCoE9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bL4DZErqpG1xn/4Rc5/3toIQjVtgDfXe95BKi1PcBbI=; b=Jyb9eNCyRFCNJjQRyZW7bfnGJq+giU9x23gq8P+MwBUrpdwSUvutM02G0NaBj0QZwET7Ur JYo47aqquWUXcjWm0J37S1VCJDyMWrlEvNcPu62Sa7rznUgNSemmXtuj64/PDx/E1vNi2V AiX+fgeJlgDSW3ElAQWN3JhEnePn2eTf8b5/YjKJBrfW5LWfh1AQ84xVzMlNh0SzXBBe7y LpOQJ+i9xQO7f9fJX5gjmJvUTH6JCohweAkXe0TNJzcGRdSkdz2qTB6kGF+hXz98xEpt2F Q4XDa0QLx6LGO8HNSbZypcKw3XQLetYCH3TGT3hP15gqhafdnFwP3AO1cSXg1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3CWz47PGz4r2; Thu, 27 Feb 2025 00:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R0rpXO016777; Thu, 27 Feb 2025 00:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R0rpgZ016774; Thu, 27 Feb 2025 00:53:51 GMT (envelope-from git) Date: Thu, 27 Feb 2025 00:53:51 GMT Message-Id: <202502270053.51R0rpgZ016774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 9d32e928c207 - stable/14 - motd.5: Mention /etc/motd + alignment polish List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d32e928c207154b4a1385284f537f2fcbdf6855 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=9d32e928c207154b4a1385284f537f2fcbdf6855 commit 9d32e928c207154b4a1385284f537f2fcbdf6855 Author: Alexander Ziaee AuthorDate: 2024-12-14 21:49:33 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:53:38 +0000 motd.5: Mention /etc/motd + alignment polish + description: Space example by writing a little cleaner + files: Align files list width + explain /etc/motd link MFC after: 3 days Reviewed by: mhorne, rpokala Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48085 (cherry picked from commit 404802777003b7fb37ca8013fe938eaa4de36103) --- share/man/man5/motd.5 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/share/man/man5/motd.5 b/share/man/man5/motd.5 index 5dce1ccd52ae..109fc4e56ca4 100644 --- a/share/man/man5/motd.5 +++ b/share/man/man5/motd.5 @@ -2,7 +2,7 @@ .\" .\" This file is in the public domain. .\" -.Dd October 18, 2020 +.Dd December 14, 2024 .Dt MOTD 5 .Os .Sh NAME @@ -25,9 +25,8 @@ and the contents are written to can be updated without a system reboot by manually restarting the motd service after updating .Pa /etc/motd.template : -.Bd -literal -offset indent -compact -service motd restart -.Ed +.Pp +.Dl service motd restart .Pp Individual users may suppress the display of this file by creating a file named @@ -35,7 +34,10 @@ creating a file named in their home directories or through .Xr login.conf 5 . .Sh FILES -.Bl -tag -width $HOME/.hushlogin -compact +.Bl -tag -width "/etc/motd.template" -compact +.It Pa /etc/motd +Symbolic link to +.Pa /var/run/motd . .It Pa /etc/motd.template The template file that system administrators can edit. .It Pa /var/run/motd From nobody Thu Feb 27 01:13:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3Cz91Ncyz5pMyY; Thu, 27 Feb 2025 01:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Cz90lBCz3vnG; Thu, 27 Feb 2025 01:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pSq+R4AmZ8UCHAxiYJRESisnLBUu7ewNb7AIXnzNBpE=; b=BlDiEUDqMXrvNoukObdrgAyHNFC+8+pYBZEfn6ltCoj+0Eyf8BfVhPIIMHSXNvW8zI+pKS V4m+lW1RnQLS7M7pUnVM97NaO9mON/dDI2MFBKs8QlQ6BFROytY3Mc0f/EgynwZfOg0lGT pveTMBm6qLCJD6dNGYdSrQ9dhqPbwFZOX9e3+jl6tpaSwCjCOggHqRLbY1zYXBhORMOILZ 23F0lwtA0k+dZelltG1a59Ki6dessR/60eeBF4kS+OrOq0CDtnmSMFP7pkT6+EMI+rpq5a NWP+py5Ey1r8BQnOA7zousLPPT176bUJBK5pnm0PhBO0am9j2EjddJhwPYw7yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740618837; a=rsa-sha256; cv=none; b=DV/0hNfngSwU5Ic/3b3niVoyoA40duU9GU9Wz6Wk1j2UQtV7wZjl7tIlKaJ1hhLXmWFXQA dcfjhwPOnINEAOu4XcqnC/dbQlpzRSFQ/1uz5oCktC0S1U8EF1N0nCGxeLUwu+WDuMNaEE tTyUv9YUihMOizEbZr+AseWVdVkZoBV7G3YwJhvxoJicp6VcyEKI3hK1+ORVUfuXYo5SPS PW89+4b5EdexjN74pPyxWgr85rlC9Xc3/SyfSC3LLSMmi/RFM+pSAo6u8tO5y7qMqV+n5d zL3LGZdYLFOwNuH338bvoLYkpR21FdatvDGiw6mh9RqQm6PYqDntgo1FMTbgKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pSq+R4AmZ8UCHAxiYJRESisnLBUu7ewNb7AIXnzNBpE=; b=hjdk/0yIPwY3ZqdB88jCuvzunukqugTsEbP9oYcQMvUG8oIofamUAuGgY5qeLlB8JkJrKz CY504zOWurLzNp3za4MoGNar2/gJOciXIStuveRGIjLUh9Ei6S0zXy22Lgp20qa7Ky9PvR /mNCnsmn4eDkJuaiVprYuNDRf98varDt4/zJYT0yelJal6kUZ5IYNdP7oeanpc7bwwv/WI K5OOtXRy9IEG4xROJkg57VgqrKRX/KP+DVBE1c/tMtM64qkDsL4B7uQ8Y/u5r14VVW17kr Jljt5sFzlnQzhNBYf2iTNr7Vhw6dsGqZ/Z+eG2pdvD3xIa9QrfkyhnGV+yXdqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3Cz90KjBz5rY; Thu, 27 Feb 2025 01:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1DuuM054713; Thu, 27 Feb 2025 01:13:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1DuQn054710; Thu, 27 Feb 2025 01:13:56 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:13:56 GMT Message-Id: <202502270113.51R1DuQn054710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 4e2ab411ce62 - stable/14 - make_dev.9: Fix mda_cr typo + polish List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4e2ab411ce6239d7918eacfd1c4725bfc9508fa5 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=4e2ab411ce6239d7918eacfd1c4725bfc9508fa5 commit 4e2ab411ce6239d7918eacfd1c4725bfc9508fa5 Author: Alexander Ziaee AuthorDate: 2025-02-11 20:42:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:55:14 +0000 make_dev.9: Fix mda_cr typo + polish The make_dev_args_init structure example said mda_cred, however the correct form is mda_cr according to the reporter and my git grep. A new document description has been contributed by jhb. While here, fix grammar and trivial typos (spacing, colons before examples, trailing delimiter) and spdx. MFC after: 3 days Reported by: jhb (much polish and document description) Reported by: Evgenii Ivanov on Community Discord Reviewed by: carlavilla, mhorne, jhb, kib Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48516 (cherry picked from commit c48ca725a83c0c8b27210d50977835c0b916bf07) --- share/man/man9/make_dev.9 | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/share/man/man9/make_dev.9 b/share/man/man9/make_dev.9 index 2beb38586593..052f9a0cfd87 100644 --- a/share/man/man9/make_dev.9 +++ b/share/man/man9/make_dev.9 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1999 Chris Costello .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 2, 2016 +.Dd January 19, 2025 .Dt MAKE_DEV 9 .Os .Sh NAME @@ -38,9 +41,7 @@ .Nm destroy_dev_sched_cb , .Nm destroy_dev_drain , .Nm dev_depends -.Nd manage -.Vt cdev Ns 's -and DEVFS registration for devices +.Nd create and destroy character devices including devfs registration .Sh SYNOPSIS .In sys/param.h .In sys/conf.h @@ -105,6 +106,7 @@ struct make_dev_args { void *mda_si_drv2; }; .Ed +.Pp Before use and filling with the desired values, the structure must be initialized by the .Fn make_dev_args_init @@ -166,10 +168,10 @@ member of the initialized The .Va args.mda_flags argument alters the operation of -.Fn make_dev_s. +.Fn make_dev_s . The following values are currently accepted: .Pp -.Bl -tag -width "It Dv MAKEDEV_CHECKNAME" -compact -offset indent +.Bl -tag -width "MAKEDEV_CHECKNAME" -compact -offset indent .It Dv MAKEDEV_REF reference the created device .It Dv MAKEDEV_NOWAIT @@ -200,12 +202,13 @@ is specified. .Pp The .Xr dev_clone 9 -event handler shall specify +event handler shall specify the .Dv MAKEDEV_REF -flag when creating a device in response to lookup, to avoid race where -the device created is destroyed immediately after -.Xr devfs_lookup 9 -drops his reference to cdev. +flag when creating a device in response to lookup, to avoid a race where +the created device is immediately destroyed after +.Fn devfs_lookup +drops its reference to +.Fa cdev . .Pp The .Dv MAKEDEV_ETERNAL @@ -226,13 +229,14 @@ and the device name is invalid or already exists. .Pp The .Fn make_dev_p -use of the form +use of the form: .Bd -literal -offset indent struct cdev *dev; int res; res = make_dev_p(flags, &dev, cdevsw, cred, uid, gid, perms, name); .Ed -is equivalent to the code +.Pp +is equivalent to the code: .Bd -literal -offset indent struct cdev *dev; struct make_dev_args args; @@ -241,7 +245,7 @@ int res; make_dev_args_init(&args); args.mda_flags = flags; args.mda_devsw = cdevsw; -args.mda_cred = cred; +args.mda_cr = cred; args.mda_uid = uid; args.mda_gid = gid; args.mda_mode = perms; @@ -250,10 +254,11 @@ res = make_dev_s(&args, &dev, name); .Pp Similarly, the .Fn make_dev_credf -function call is equivalent to +function call is equivalent to: .Bd -literal -offset indent - (void) make_dev_s(&args, &dev, name); +(void) make_dev_s(&args, &dev, name); .Ed +.Pp In other words, .Fn make_dev_credf does not allow the caller to obtain the return value, and in @@ -263,14 +268,14 @@ options, the function asserts that the device creation succeeded. .Pp The .Fn make_dev_cred -function is equivalent to the call +function is equivalent to the call: .Bd -literal -offset indent make_dev_credf(0, cdevsw, unit, cr, uid, gid, perms, fmt, ...); .Ed .Pp The .Fn make_dev -function call is the same as +function call is the same as: .Bd -literal -offset indent make_dev_credf(0, cdevsw, unit, NULL, uid, gid, perms, fmt, ...); .Ed @@ -377,7 +382,7 @@ is called, with argument .Fa arg . The .Fn destroy_dev_sched -function is the same as +function is the same as: .Bd -literal -offset indent destroy_dev_sched_cb(cdev, NULL, NULL); .Ed From nobody Thu Feb 27 01:13:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3CzB5zXVz5pMtj; Thu, 27 Feb 2025 01:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CzB2X3zz3vlM; Thu, 27 Feb 2025 01:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ZnVG3+val+8UZOnCZMiHqO2QKq9AMFBvh6Y3pJqEmc=; b=e5ZReXXf/mhXnzyJ3yCvhQxNxXcCurxdg8p0/Ar8xZmrLVtrEk1GeIdvzYS8xULwT5uRtQ Tn/Oc3g9tCmnlIzW5zYsz8XdhMlaOYg9db3A7yL14+F3wEvcDZR1pVHqgGQhpnYmBqZLUB 08MVKWwd37+wW51mCIAF6XITQJHYaiOrnaPgheeLZ+Uq2VztCIGoiwfbYReswc7cGbLAi7 YC2VFxFNIgeGbpApWg6fpFDikcE6hScUeCC/5eO3luu6b5COC+LHtIKMCN+qtItEBohvD2 2dsm/tOLpd589R00sXA/yQLN4G8ZEBk7IVTrW5aWosMisI1L88ENv9fSbUM7jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740618838; a=rsa-sha256; cv=none; b=vhke5NeCT0aL9AvcXC03JgsLk3aZtU8zQ68xWxm399KmBI8R3GMUkNlVfutFAl1MdFJhWy 3ukFCtO3v6T8hdAmOjn/8dljI2a/e6IzQen1J2zuM8lO3b1sPB33iyjht1xCC49DFNye7d cnpW30bZNj59q905bedixNeFSAsMIaRgzMuUwTOTmx1WGXB4OIouX+IxR6Ij0C+xhX5aTE faZNhQdWqm9k+h6pPl5L7RsCOTkQGf8oMBLPc4NTNi69l/bVm/X032d8n7q5AClqgZks+/ zkST5G+VPhD82MgDLOhSSsDC2rPuetpbhGW2EDfESoVBd9jkYcAJumMLp0shfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ZnVG3+val+8UZOnCZMiHqO2QKq9AMFBvh6Y3pJqEmc=; b=GRz1eDaHseIohmqSNlpHDI3o4MtPTDiUcq0pj58SgA9gXwT+fWtxO8/g02o4Aou5JQUQHe 9+2mUpvaLs/9nIw+DzGSKDWo2PlozDkfvUA3DrAnjJ/Jx3wR+ruEFy6FYaefW+iHb8dQK7 DEFadc4AL/hvl5GVI1CugJXxonAym6mA4xqxQkei0j5mlCtD2vjRv5GzdfX6tn18KeUG15 zq1rduyGPk+naS3DGRwhWq2VKLr3FLlNpBTEly4JJh4HuhSmOgVIc4HDumv2DdR+P9qyB/ rlXuukGNwaf9VYfNTuB9sY9JMTLkQTBQTpNNGgerg3cvWj/xOZw+ca1OrO3Xig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3CzB1Wzlz5YP; Thu, 27 Feb 2025 01:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1Dwe7054747; Thu, 27 Feb 2025 01:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Dwlf054744; Thu, 27 Feb 2025 01:13:58 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:13:58 GMT Message-Id: <202502270113.51R1Dwlf054744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 3b210577b85a - stable/14 - style.mdoc.5: maintenence List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b210577b85a6dee3d5fa0bd4ac48b45bcf6ce23 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3b210577b85a6dee3d5fa0bd4ac48b45bcf6ce23 commit 3b210577b85a6dee3d5fa0bd4ac48b45bcf6ce23 Author: Alexander Ziaee AuthorDate: 2024-04-12 22:28:12 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:13:30 +0000 style.mdoc.5: maintenence - description: increase visibility by s/file/manual page/ - examples: s/No Doing Something/Doing Something/ - examples: remove depreciated .Li macro - examples: remove extra newline (one display block) - see also: link roff language reference for mandoc Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1130 (cherry picked from commit e7ff917057eaf209c003660f02decb64ccb811da) --- share/man/man5/style.mdoc.5 | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/share/man/man5/style.mdoc.5 b/share/man/man5/style.mdoc.5 index c1592bf8b87f..42dbc940074c 100644 --- a/share/man/man5/style.mdoc.5 +++ b/share/man/man5/style.mdoc.5 @@ -1,4 +1,4 @@ -.\" +.\"- .\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2018-2022 Mateusz Piotrowski <0mp@FreeBSD.org> @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2022 +.Dd April 12, 2024 .Dt STYLE.MDOC 5 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd .Fx .Xr mdoc 7 -file style guide +manual page style guide .Sh DESCRIPTION This file specifies the preferred style for manual pages in the .Fx @@ -82,17 +82,17 @@ Format the section in the following way: .Bd -literal -offset indent \&.Bl -tag -width 0n -\&.It Sy Example 1\\&: No Doing Something +\&.It Sy Example 1\\&: Doing Something \&.Pp The following command does something. \&.Bd -literal -offset 2n -\&.Li # Ic make -VLEGAL +\&.Ic # make -VLEGAL \&.Ed -\&.It Sy Example 2\\&: No Doing Something Different +\&.It Sy Example 2\\&: Doing Something Different \&.Pp The following command does something different. \&.Bd -literal -offset 2n -\&.Li # Ic bectl list +\&.Ic # bectl list \&.Ed \&.Pp It is good to know this command. @@ -100,24 +100,22 @@ It is good to know this command. .Ed .Pp which renders as: -.Bd -filled -offset indent .Bl -tag -width 0n -.It Sy Example 1\&: No Doing Something +.It Sy Example 1\&: Doing Something .Pp The following command does something. .Bd -literal -offset 2n -.Li # Ic make -VLEGAL +.Ic # make -VLEGAL .Ed -.It Sy Example 2\&: No Doing Something Different +.It Sy Example 2\&: Doing Something Different .Pp The following command does something different. .Bd -literal -offset 2n -.Li # Ic bectl list +.Ic # bectl list .Ed .Pp It is good to know this command. .El -.Ed .El .Ss Lists .Bl -dash -width "" @@ -285,6 +283,7 @@ that would be rendered as: .Xr man 1 , .Xr mandoc 1 , .Xr mdoc 7 , +.Xr roff 7 , .Xr style 9 .Sh HISTORY This manual page first appeared in From nobody Thu Feb 27 01:13:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3CzC65nRz5pMdS; Thu, 27 Feb 2025 01:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CzC3GXDz3vnL; Thu, 27 Feb 2025 01:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YIMmYzkGYlBF/11HnlBiPQvq+lY359fPUzv0SddMXSQ=; b=vHRKrZipfOzVYHnvlKN42bJ/Ylmnnefty6F5GqpAIoXYVnYTpMduasz6MQkAorNuKSZCh9 tbtJys958rI5wv2/z/Mmsu/Mgjjd4v7fCoHtl+5kpaiLqRA9GD8MOiw+ihCa0Ibk/te1E0 NmlMcAEZiN9xfeRiZ6DfqzpzjXnbrAK/gFZyCYgqPaXVyW+QlxJcSZDjxUVHaMXX7OJZAK Nh+Epn6F2LEnyqq4Hfddj9IHnmBOe6x+qjlnzeBznUZUjmXnVHEe5DgXdQnUinMqanIjRi wZ5v80cgnZb3HSeMcXvAxY0ACDeIhLk5CpX2zuSQQ5bYDbj8DlGOB8cTBwKFYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740618839; a=rsa-sha256; cv=none; b=hi427+wfqtARxEKv4wDLgvaeeP+gi7hS0mln1VAzYCzsmA0YYhDtZeKArBQKfHe/KDSXqY QfBtffJ7W4khBCn2nDucX2FvjNELROjoGtbQgvyg8NIbxRbowGPnf9kjDAT3G/UswChf93 xwQnOzdpVo4qS/pLzi5A7IG1LTbmZk0Fjd3VFHJKPiv8qQJ4ByjB2jKm/tQG1OpdiCaeGS mcVdPE/3zPU+1Zw0E+TeidkE2ZKampIfTZUcuBhRVjOurDJvyl/WH8VFecSD25baG26vOU lWIxekx1xNYtGjtkwP4X0Q6f15pFxc6aU6/lb3jSLwAWSTF5m+c2J9I8UrYwfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YIMmYzkGYlBF/11HnlBiPQvq+lY359fPUzv0SddMXSQ=; b=naxjy45k/xLqHY7enOq+ofxoso6UEgOZGhCMzlZyacHDEH1qxswV8zw9Vho4JB0wMpAbgE tXJ4c/y+XjMBnbFXo2Cz5WZD2EIhWgDIcZZ/59LmgvrBTn978/VyqX1PbBCuqFVlq5s1J5 KDuK42Rz7lc7I0T4NMDLMzz26GAaQBcldSZReOMvGGx+yvkY7Gg+022UmIEVO1tyCzwbWX 4jTG/tL7+JxinEj5MBwarw3/Ra60D9nHv0J2exSHlCT20DTs0G9vxiI4CBF9ROZB5hWqL7 6KrwQlwSjNg5aRN/MWNFESWrFZswR3n2owNQ2WWtaA9dEZQNNlQcCcvMRc08DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3CzC2VMsz5wt; Thu, 27 Feb 2025 01:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1Dx8k054781; Thu, 27 Feb 2025 01:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Dx2O054778; Thu, 27 Feb 2025 01:13:59 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:13:59 GMT Message-Id: <202502270113.51R1Dx2O054778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 70858d8e20f1 - stable/14 - style.mdoc: fix list width alignment instructions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 70858d8e20f10d9f8775c9c887119f8ed63d8737 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=70858d8e20f10d9f8775c9c887119f8ed63d8737 commit 70858d8e20f10d9f8775c9c887119f8ed63d8737 Author: Alexander Ziaee AuthorDate: 2024-11-15 18:57:49 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:13:45 +0000 style.mdoc: fix list width alignment instructions MFC after: 3 days Reported by: imp Reviewed by: mhorne, imp Approved by: mhorne (mentor) Pull Request: https://github.com/freebsd/freebsd-src/pull/1530 (cherry picked from commit 4152ed2b999a0a8ccabfc085120e1c848d4f934a) --- share/man/man5/style.mdoc.5 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/man5/style.mdoc.5 b/share/man/man5/style.mdoc.5 index 42dbc940074c..dd4d8a1f5fdf 100644 --- a/share/man/man5/style.mdoc.5 +++ b/share/man/man5/style.mdoc.5 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 12, 2024 +.Dd December 12, 2024 .Dt STYLE.MDOC 5 .Os .Sh NAME @@ -124,7 +124,8 @@ The .Fl width argument to the .Sy \&.Bl -macro should match the length of the longest item in the list, e.g.: +macro should match the length of the longest rendered item in the list, +e.g.: .Bd -literal -offset indent \&.Bl -tag -width "-a address" \&.It Fl a Ar address From nobody Thu Feb 27 01:19:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3D5h4nggz5pNNv; Thu, 27 Feb 2025 01:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3D5h2Wyrz41VD; Thu, 27 Feb 2025 01:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jnjN/VEbnMZPLLRcsoDCWJTwQPssteCiP6qb9db1D4M=; b=heu8SmzGPQJ+iXXamWcOGvH8MFhHSiB2bkwRBgP7nZs9y8LCz4QWl+fPS3DR5bx3r8n7as s6W4MIv4qhPWbJFKtIBVUN87mRHHQk9jTm0lgYk+O+V6ez7CUiulRxmUlcvpJWaAzKkmoU lQDxuK0zOewWmRie8fHQAyn/YWSM5l6Ii/gngmN3ATK/fInKCg8EDV45ddV2ADa0tV+9cq UZzWRcy4Ml6AbdGjcVlhX+YFfFOFBuzgxlvioX+IEAAeZST8Vq47Cm2Ul/0HpmT9Ni4soi 3Dj4sG/Dd1rrFVDDa61f4LTaBKiF5Yk5gzJl2TmkS+y+8uYgwyJ8Q2JkkA7Xpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740619176; a=rsa-sha256; cv=none; b=TJGAMpSj9PU75SOGtWM+h5asAMEj7tPMa1Klt57fznRmSUiO1Fq03DZ6H0BF6/f6qDRNOd CY7u3M38CNE3uzti4nxxyTIK289GFjRIPfKoOyex3gTmYbaR62otZ32QhVpy/g3XFLrKLx xp6cyQrlItozq2SxWT8BlovINngQSkL7PyGwRC1Z61v5Hj6PTjhfk5xyDxDMMiZnJHfEOR wDqk9FJChFaOyZNiKGBU8YgvIPc/NrJN6k9m29g0+KUTC2lnluM0YDQHtEXRWozeCABqjL jmW9cJRwixO5UfyW56kAkV46b2XXA32te066Dr7bgQRmagtZNFxwUOB+cAoVuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jnjN/VEbnMZPLLRcsoDCWJTwQPssteCiP6qb9db1D4M=; b=gCUbyLtcrTQWZb5bWMGS2+g2cTxhJGF3NJnbrFutqseX7WGi4xmCv2lA0YvEVVAXMPVZTq ExGdJyZg+PsHdjsDmwGPBmB81y9qOFgnuAQA3V8Drted8a4z45mKD/60nKGg6L3U/JqFhi f+uIFKP3V9A9YY4b8EA43F9YVCEf8VzIR7uEEExAxDzEDBPFc4ZltDw404sGctyyV6Q59s qCANqgCuwFGDisuNIq42sguI0ChllSOzKjS1HiZq2WVmAADbYQcsqGC4kec7V99CO5HmgK 8i9PN+qfhj7mkyW1Qv0h6DmX1tYvOjUAIphi+PgdywbRa362KfiXblBsi4CMqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3D5h1ngfz5lV; Thu, 27 Feb 2025 01:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1JarN056415; Thu, 27 Feb 2025 01:19:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Ja6a056412; Thu, 27 Feb 2025 01:19:36 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:19:36 GMT Message-Id: <202502270119.51R1Ja6a056412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 7ba0d890903b - stable/14 - bridge.4: Remove incorrect line + polish List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7ba0d890903b6ad9ed17a873c373e68c2e763576 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7ba0d890903b6ad9ed17a873c373e68c2e763576 commit 7ba0d890903b6ad9ed17a873c373e68c2e763576 Author: Alexander Ziaee AuthorDate: 2025-02-24 17:28:51 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:15:07 +0000 bridge.4: Remove incorrect line + polish In an AMA on Community Discord, it was revealed that simply setting a bridge to up is not equivelant to setting it as "inet6 auto_linklocal". Remove the incorrect line, and while here: + reset sysctl list width to indent, saving 2/13 lines on MANWIDTH 59/80 + tag spdx + break two long lines over 80 characters MFC after: 3 days Reported by: Antranig Vartanian Reported by: Jan Bramkamp Reported by: Niclas Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48981 (cherry picked from commit 5a0d9605a44bf39402211e009365f1043faa2b0b) --- share/man/man4/bridge.4 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 31a0ce43a263..b741ec0b73c8 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-4-Clause +.\" .\" $NetBSD: bridge.4,v 1.5 2004/01/31 20:14:11 jdc Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. @@ -33,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 10, 2023 +.Dd April 10, 2024 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -125,7 +128,8 @@ variable to .Li 0 . .Pp -All the bridged member interfaces need to be up in order to pass network traffic. +All the bridged member interfaces need to be up +in order to pass network traffic. These can be enabled using .Xr ifconfig 8 or @@ -165,11 +169,6 @@ variable configures an IPv6 link-local address on .Li bridge0 interface: .Bd -literal -offset indent -ifconfig_bridge0_ipv6="up" -.Ed -.Pp -or in a more explicit manner: -.Bd -literal -offset indent ifconfig_bridge0_ipv6="inet6 auto_linklocal" .Ed .Pp @@ -261,7 +260,7 @@ the appropriate interfaces. Either stage can be disabled. The filtering behavior can be controlled using .Xr sysctl 8 : -.Bl -tag -width ".Va net.link.bridge.pfil_onlyip" +.Bl -tag -width indent .It Va net.link.bridge.pfil_onlyip Controls the handling of non-IP packets which are not passed to .Xr pfil 9 . @@ -470,8 +469,8 @@ ifconfig_fxp0="up" .Ed .Pp Consider a system with two 4-port Ethernet boards. -The following will cause a bridge consisting of all 8 ports with Rapid Spanning -Tree enabled to be created: +The following will cause a bridge consisting of all 8 ports with +Rapid Spanning Tree enabled to be created: .Bd -literal -offset indent ifconfig bridge0 create ifconfig bridge0 \e From nobody Thu Feb 27 01:19:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3D5g4Pdqz5pNJJ; Thu, 27 Feb 2025 01:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3D5g26p7z41Bn; Thu, 27 Feb 2025 01:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+n0tAVv2G/sag5FaqhLJOXYLN7CiS0/Te945vpOkqP0=; b=ZNFBiGByJirYo23OMZ8oOAwf1KgJGMWu7tYaCzVumevHjW95VAMGlN9OF1oVYUF+ierZ3c 69UMsbYPlVqyQH/XMuJStu2a/dMAd174I4IkIoqZiQYYuPKjoCYqlib7b9IZrJkGdXXO59 0u9GUspSS7lQHuq/cya4VJe31d1IFni8L89JahlwUY7PfWcpMNLLee3n1FfNN4WPxQPcXP RQ3MEptceVEd++nIOSALC6aBr7sqQvGKgN/UBA8vO671oSV9t08CaN9EcqpbiamQ/fuT1Y GQRjg1NZ7DjGLScaHgaEn6y/68qJTUo9TEMYzdt+zTkrJ7GsZy0OVeDkadBvQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740619175; a=rsa-sha256; cv=none; b=o72YcWinMCX4WM0TU8mubhDvJ79KhHBtQpbHJPNWvBYtr3sdK5yBSIyZVyxcalY09kH8qO P1t30Jg49fhpmVJLPAjwhkMjZfaIgxdtTJInrjcpC4PjH1X23bh+wKMifwKp/d0Zae1Gis ZzN+eYJynq9IsqPcKhwnn1A9Wt0NQQ2LEvwNwl2IyO8JCoee/afgpzp+8Ud24CIK/DWGH4 JT/iFVpSkJ6Sir7gkIoij1ZUvl+Pwhw6dwlCLkayFvHaXVlNbjR/qfxbjoem0veDK0OWe8 r6eCvfp0HbGWTt3NomFtVaj5H2fTnrFs6rRbaMQCEPIHJ58vMDubJpmNe0u8hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+n0tAVv2G/sag5FaqhLJOXYLN7CiS0/Te945vpOkqP0=; b=kC77NT8Jq2jOGFqEp+MBpjpJhJzqpb7//8jecDkZXnT3ZGPcuc3QGAlDBXx/0IgVWoTEtX 1Soih57TByqqgAcJeXqWSfzrOrYphRbKVz16evgrO6cAkBtGx1vd1RmMQM6Zpvtg2jtAVD yMd1DF5JjU0SQbpOotBaIKtTTG/1pC4ftmaHelXCAGaZmrsQjBJ7aZJKVAtNOk4foICI3J pVPJHUzE4e4bvmZPCXYtgkREtF4yVR+YbKdfrK3VzkLhUPi/zIvGWYtZT4diu9kZ5mnKQw TbS9xWsWwfOQvSfXRt9PDQBxF5LGngatWcgLhUK/vCV0DpdhGhsA8XsPJ5Etyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3D5g1Zj1z5YR; Thu, 27 Feb 2025 01:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1JZV6056378; Thu, 27 Feb 2025 01:19:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1JZbG056375; Thu, 27 Feb 2025 01:19:35 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:19:35 GMT Message-Id: <202502270119.51R1JZbG056375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: cf522ceef8fa - stable/14 - ports/filesystems: Fix fallout List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf522ceef8fa404dc1df865fb19f9a40e34e8c56 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=cf522ceef8fa404dc1df865fb19f9a40e34e8c56 commit cf522ceef8fa404dc1df865fb19f9a40e34e8c56 Author: Alexander Ziaee AuthorDate: 2025-01-27 19:59:17 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:14:37 +0000 ports/filesystems: Fix fallout A new filesystems category was created in the ports tree, with 142 filesystem related ports moved to there, some of them renamed. Update all references in the src tree to the new locations. PR: 283881 Fixes: ports:6e2da9672f79f44 (filesystems: add new category) MFC after: 1 month Reviewed by: fuz, mhorne, bapt Accepted by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48406 (cherry picked from commit 066ef2aec187ae93a9df01d25fa8e47d67ff972b) --- release/powerpc/generate-hfs.sh | 2 +- share/man/man4/ccd.4 | 2 +- share/man/man5/smbfs.5 | 2 +- stand/powerpc/boot1.chrp/generate-hfs.sh | 2 +- tools/test/stress2/misc/ext2fs.sh | 2 +- tools/test/stress2/misc/ext2fs2.sh | 2 +- tools/test/stress2/misc/ext2fs3.sh | 2 +- tools/test/stress2/misc/ext3fs.sh | 2 +- tools/test/stress2/misc/ext4fs.sh | 2 +- usr.sbin/autofs/autofs/special_media | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/release/powerpc/generate-hfs.sh b/release/powerpc/generate-hfs.sh index 50f77933f273..e88db0ad771e 100755 --- a/release/powerpc/generate-hfs.sh +++ b/release/powerpc/generate-hfs.sh @@ -1,7 +1,7 @@ #!/bin/sh # This script generates the dummy HFS filesystem used for the PowerPC boot -# blocks. It uses hfsutils (emulators/hfsutils) to generate a template +# blocks. It uses hfsutils (filesystems/hfsutils) to generate a template # filesystem with the relevant interesting files. These are then found by # grep, and the offsets written to a Makefile snippet. # diff --git a/share/man/man4/ccd.4 b/share/man/man4/ccd.4 index c44013dab11f..dfe66eed0a03 100644 --- a/share/man/man4/ccd.4 +++ b/share/man/man4/ccd.4 @@ -228,7 +228,7 @@ without mounting does not write anything to the .Tn Linux RAID. Then you do a -.Nm fsck.ext2fs Pq Pa ports/sysutils/e2fsprogs +.Nm fsck.ext2fs Pq Pa ports/filesystems/e2fsprogs on the .Nm device using the diff --git a/share/man/man5/smbfs.5 b/share/man/man5/smbfs.5 index 7be90c3ba882..9653be0e1bad 100644 --- a/share/man/man5/smbfs.5 +++ b/share/man/man5/smbfs.5 @@ -59,7 +59,7 @@ and may be removed from a future version of .Fx . Users are advised to evaluate the -.Pa sysutils/fusefs-smbnetfs +.Pa filesystems/smbnetfs port instead. .Ef .Sh SEE ALSO diff --git a/stand/powerpc/boot1.chrp/generate-hfs.sh b/stand/powerpc/boot1.chrp/generate-hfs.sh index c83306ed885d..dc2b12d8f826 100755 --- a/stand/powerpc/boot1.chrp/generate-hfs.sh +++ b/stand/powerpc/boot1.chrp/generate-hfs.sh @@ -1,7 +1,7 @@ #!/bin/sh # This script generates the dummy HFS filesystem used for the PowerPC boot -# blocks. It uses hfsutils (emulators/hfsutils) to generate a template +# blocks. It uses hfsutils (filesystems/hfsutils) to generate a template # filesystem with the relevant interesting files. These are then found by # grep, and the offsets written to a Makefile snippet. # diff --git a/tools/test/stress2/misc/ext2fs.sh b/tools/test/stress2/misc/ext2fs.sh index f4d33116faed..e93da12419b0 100755 --- a/tools/test/stress2/misc/ext2fs.sh +++ b/tools/test/stress2/misc/ext2fs.sh @@ -32,7 +32,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/tools/test/stress2/misc/ext2fs2.sh b/tools/test/stress2/misc/ext2fs2.sh index 748e45a33ffa..07ff5d5058fb 100755 --- a/tools/test/stress2/misc/ext2fs2.sh +++ b/tools/test/stress2/misc/ext2fs2.sh @@ -33,7 +33,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -x /usr/local/sbin/mke2fs ] || exit 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount -f $mntpoint mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart diff --git a/tools/test/stress2/misc/ext2fs3.sh b/tools/test/stress2/misc/ext2fs3.sh index f33b4cc73547..f2a68d060fd9 100755 --- a/tools/test/stress2/misc/ext2fs3.sh +++ b/tools/test/stress2/misc/ext2fs3.sh @@ -35,7 +35,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/tools/test/stress2/misc/ext3fs.sh b/tools/test/stress2/misc/ext3fs.sh index e5a0d9a09481..210008ce3942 100755 --- a/tools/test/stress2/misc/ext3fs.sh +++ b/tools/test/stress2/misc/ext3fs.sh @@ -33,7 +33,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/tools/test/stress2/misc/ext4fs.sh b/tools/test/stress2/misc/ext4fs.sh index ac5656ed7be0..2e2ac8d77440 100755 --- a/tools/test/stress2/misc/ext4fs.sh +++ b/tools/test/stress2/misc/ext4fs.sh @@ -36,7 +36,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/usr.sbin/autofs/autofs/special_media b/usr.sbin/autofs/autofs/special_media index b397a8889623..917abae05595 100755 --- a/usr.sbin/autofs/autofs/special_media +++ b/usr.sbin/autofs/autofs/special_media @@ -43,7 +43,7 @@ print_map_entry() { echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ - "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-exfat first" + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install filesystems/exfat first" exit 1 fi ;; @@ -52,7 +52,7 @@ print_map_entry() { echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ - "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install filesystems/ntfs first" exit 1 fi ;; From nobody Thu Feb 27 01:19:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3D5k2FQqz5pNJN; Thu, 27 Feb 2025 01:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3D5j33gfz41Q5; Thu, 27 Feb 2025 01:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5uI1vnbaec4RRLSuHkgfVLJ77om+tKK55xr4z1UNdc=; b=iY1Mf7u9XNFTatXHGSbhbSpVBaysBacubMwMRMrpdgFTenaW6ImutrbsrPlvhvk9etYXD0 XDIEMYBKT1TBONtw/ydGgadKaByVOjAPGNOotxB0fZfioW08UqCuIFKNA55S6RUCB92ZhL bSPkoJZqREZf+d0hTQJniL+o7T7y3wNsd1mh8lDJDyYj1lwKX6MhwNDtEvMuF3hSkVHPOh 23EZOTN1zp9BKyggzmBAxyIsv29lN3+3knMV7i4wfOCRw1HwdNo2Ja5FW8aKKJCA+nI3ZL q6/7fSKPpTRKotI0Vxx6oCATcGcSblTutM5vbrW5nUevVZle4ARpJQ/HrJnkkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740619177; a=rsa-sha256; cv=none; b=Vr7N36Hfl5YuZIwRDIJPf5gYqbnvju0v6Jg3HTNHDqAL2DXcs/O+kfV8p9QRDfjGYHH9Tw 8RUnKMyX1eWAGAA8KbmDEf/mWGZerNjnsJ4lCN0oU5n5pO0QjoZ5fsimhiuyM9N7KXisFy 7PNCKRMyOa/+Isk2jVc8fpDLLod4OCytaJupAgER3wEMXMvZ+NDVg+N1tndDqOfY6y6zcX L7hgZHGTwfcPGxL68aKv0kyg4eQYmEIoPcwFiNiIvZI8lq4RpmM2zOD8mzaI4gdP7VG4hk ktQACLrgtRGVcCVNrXmIo6zYhbeJ4AJD661v7YvKNT/M7csMzyqwXekooSgvbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5uI1vnbaec4RRLSuHkgfVLJ77om+tKK55xr4z1UNdc=; b=Z/16VPgJAbknqX5GMuY1kNWeXTb3gCQ/d1OLf0WhwjoAPYbAJGXjspbFd4q6QJtQiI5wUK i0kzeJCFXvxeaNAxFmlnIifc/RQyxRR/PETV/o8sYiQ7fzDHbSKE3NlIcSsh/vtap1tTCm 9ej1utmXc2mPYkKx5YV0Ug2yXWtcyRb9UIY1OFlybq7d7M4PsVZLekYq3LoFL3dWogFzuN rbEUpH73SnwBUXRtHR6EMKWhJ4kq6i5AILw+KtkWVhC1bHpsymbvpQoqfiiN/rMQwTLIbC UBjeHVQ5T90lmitmNk2wXuQZm85KDgyKwvtDpf+GfYrXmHOjEFYzKMYUt0rwhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3D5j2ZFyz60K; Thu, 27 Feb 2025 01:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1JbOV056449; Thu, 27 Feb 2025 01:19:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Jbo4056446; Thu, 27 Feb 2025 01:19:37 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:19:37 GMT Message-Id: <202502270119.51R1Jbo4056446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 78fa5b277a84 - stable/14 - safexel manuals: Improve apropos and HW relnotes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 78fa5b277a84285de554b8dfb8d306bcee265212 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=78fa5b277a84285de554b8dfb8d306bcee265212 commit 78fa5b277a84285de554b8dfb8d306bcee265212 Author: Alexander Ziaee AuthorDate: 2024-11-22 17:45:36 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:15:25 +0000 safexel manuals: Improve apropos and HW relnotes safe.4: Improve document description (Nd) for apropos. Remove Nm from sysctls in synopsis. This was causing this page to get pulled into results for `apropos sysctl`. Instead, use kernel declaration macros like vt(4). Convert the HARDWARE tagged list to a column list for better rendering in HW Relnotes. Tested in man(1) at MANWIDTH 59 and 80. safexcel.4: Nd: s/security packet/cryptographic offload/ for apropos. HARDWARE: Create this section for inclusion in the HW relnotes. SPDX: both tagged MFC after: 3 days MFC to: 13.5 Reported by: markj (cryptographic offload, Inside Secure) Reviewed by: jhb, markj, mhorne Accepted by: markj (src), mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D47706 (cherry picked from commit 26eeda7bd65603cdc6ff764349f55416b9766b43) --- share/man/man4/safe.4 | 34 +++++++++++++++++++--------------- share/man/man4/safexcel.4 | 13 ++++++++++--- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/share/man/man4/safe.4 b/share/man/man4/safe.4 index 61f2041ff333..89375d058bf7 100644 --- a/share/man/man4/safe.4 +++ b/share/man/man4/safe.4 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2003 Sam Leffler, Errno Consulting .\" All rights reserved. .\" @@ -22,13 +24,13 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.\"/ -.Dd July 29, 2020 +.\" +.Dd November 22, 2024 .Dt SAFE 4 .Os .Sh NAME .Nm safe -.Nd SafeNet crypto accelerator +.Nd SafeNet SafeXcel 1141/1741 crypto accelerator .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -46,11 +48,15 @@ module at boot time, place the following line in safe_load="YES" .Ed .Pp -.Nm sysctl Va hw.safe.debug -.Nm sysctl Va hw.safe.dump -.Nm sysctl Va hw.safe.rnginterval -.Nm sysctl Va hw.safe.rngbufsize -.Nm sysctl Va hw.safe.rngmaxalarm +In +.Xr sysctl.conf 5 : +.Bd -ragged -offset indent +.Cd hw.safe.debug +.Cd hw.safe.dump +.Cd hw.safe.rnginterval +.Cd hw.safe.rngbufsize +.Cd hw.safe.rngmaxalarm +.Ed .Sh DESCRIPTION The .Nm @@ -106,15 +112,13 @@ to dump the hardware interrupt registers. .Sh HARDWARE The .Nm -driver supports cards containing any of the following chips: -.Bl -tag -width "SafeNet 1141" -offset indent -.It SafeNet 1141 -The original chipset. +driver supports the following SafeXcel chips: +.Bl -column "SafeNet 1141" "The original chipset. Supports" -offset indent +.It SafeNet 1141 Ta The original chipset. Supports DES, Triple-DES, AES, MD5, and SHA-1 symmetric crypto operations, RNG, public key operations, and full IPsec packet processing. -.It SafeNet 1741 -A faster version of the 1141. +.It SafeNet 1741 Ta A faster version of the 1141. .El .Sh SEE ALSO .Xr crypt 3 , diff --git a/share/man/man4/safexcel.4 b/share/man/man4/safexcel.4 index d5e079822ecc..e14eebe40da2 100644 --- a/share/man/man4/safexcel.4 +++ b/share/man/man4/safexcel.4 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2020 Rubicon Communications, LLC (Netgate) .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,12 +24,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 2020 +.Dd November 22, 2024 .Dt SAFEXCEL 4 .Os .Sh NAME .Nm safexcel -.Nd Inside Secure SafeXcel-IP-97 security packet engine +.Nd Inside Secure SafeXcel-IP-97 cryptographic offload engine .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -69,6 +71,11 @@ AES-CCM .Nm also implements SHA1 and SHA2 transforms, and can combine AES-CBC and AES-CTR with SHA1-HMAC and SHA2-HMAC for encrypt-then-authenticate operations. +.Sh HARDWARE +The +.Nm +driver supports the cryptographic acceleration functions of the +Inside Secure EIP-97 device found on some Marvell systems-on-chip. .Sh SEE ALSO .Xr crypto 4 , .Xr ipsec 4 , From nobody Thu Feb 27 01:41:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3DZg4KVkz5pQfY; Thu, 27 Feb 2025 01:41:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3DZf6WFpz4Km0; Thu, 27 Feb 2025 01:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lgPS4N0dH1wzMFbbtgTNowVUl35XPFHw4N+xa2a0GXc=; b=txH07kOhnFwxS6xqI8lmQM2lT1ckykmfSQI3SrKft4Q5d4n8AtNO92AkDUWutZv/LZhA1s llOiqczXo2nrtoIBPQ/AH2YrOKLv+5Bbv2uydKUceJiRy2lOEiJDX//oJ4aceMwj43sOuW OAwlmuxyK/7BJGGXYZoBseEo5QA0pgvpqJ+W+ii+WI/lm7L/NcvutzuU09a+R8qPxTrMUi BvFf8bC7/EITvQ8rj9zwVJZa3c//wc4Fq3g41cRAus0HirBjggTdZRKqt1LPucZ+maBZoG gYFIhG5yekRzM4DbA8yxjk1VJ3Ob4N1xQMXWKFkZRVpV0WPVSNkXBjMvihIGdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740620474; a=rsa-sha256; cv=none; b=fwrAFQt0GG+GLKXUn1GQrMvTXifWYTerpnEbPovb9KReP8SLGdmLzFu2POVet1jacCmWx4 OtVjPqyf7Mxi86svVvcoQSKugJgWmqgxeG/SrvRw4uY71hCk7YqXyftcLvH3qKCP9LqKRr jZEQf7sNcjYdrCTf/DDQuQPVdIyqPPIJij5oXAqSOHMoBUbosClNgSpik3W3Xdjf+UXB84 bGtWw0qqjMTWFZNt+bq88p+jPv09G7mrDHYOjFItHcYTQj5iJy3v16GU7oUEm/19RjiWX5 ZX1w7Cdl8jSH+DFijBJcy/dHCdTIqFJfGRVyj1+Xyqe6uMlQtN33fm1QuDiBiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lgPS4N0dH1wzMFbbtgTNowVUl35XPFHw4N+xa2a0GXc=; b=HSBv5cRCMaqFklB3zGuAAHESryApA8m1Xu0U+HX2rrf7Zl5wspueHO/nMIlNkzf0xslR8E hVm8KnFZlg573SQIQun0Q5OLzOpmz6XLHWAy+A63SJcBmuJhdwTLFHO2Vki7oQJ8BfXpCE TauQS0WIUOq0EsaGu0wMgfp3bl9PFxkQ/8lwcXZrzgOAD79CHoHuV6k8e98QiPhMRz12v/ sDdrHpmOrj8ln6H9nAEY0p5qaYPBtovsgEyRiqDP6QRlcnif8nM3fqxggfG/xsPrtihZRF d0QazY4UEXXY657WyIbe//s1vu87l+ZVjNnCkypoQCyLTJf5UC4FlA1Skbs42A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3DZf64pQz5mt; Thu, 27 Feb 2025 01:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1fEd0008748; Thu, 27 Feb 2025 01:41:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1fEeA008745; Thu, 27 Feb 2025 01:41:14 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:41:14 GMT Message-Id: <202502270141.51R1fEeA008745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 77eacf827803 - stable/14 - sh.1: document optional arguments to `:` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 77eacf8278036353ead50e1317f8936dfc49186d Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=77eacf8278036353ead50e1317f8936dfc49186d commit 77eacf8278036353ead50e1317f8936dfc49186d Author: Alexander Ziaee AuthorDate: 2025-01-09 17:51:57 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:40:40 +0000 sh.1: document optional arguments to `:` TIL the `:` command accepts and discards arguments, and this is occasionally used to embed comments in interesting places. While here, fix another `...` argument that was not marked up. MFC after: 3 days Thanks: Community Discord Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48398 (cherry picked from commit f4727eca405763dd1feb4ca3e17be40c2da337de) --- bin/sh/sh.1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index b220cf550f52..a780d730642c 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -33,7 +33,7 @@ .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" -.Dd November 20, 2024 +.Dd January 10, 2025 .Dt SH 1 .Os .Sh NAME @@ -1937,8 +1937,9 @@ make it the first or last character listed. .Ss Built-in Commands This section lists the built-in commands. .Bl -tag -width indent -.It Ic \&: +.It Ic \&: Op Ar arg Ar ... A null command that returns a 0 (true) exit value. +Any arguments are discarded. .It Ic \&. Ar file The commands in the specified file are read and executed by the shell. The @@ -1960,7 +1961,7 @@ it is sought in the current working directory. .It Ic \&[ A built-in equivalent of .Xr test 1 . -.It Ic alias Oo Ar name Ns Oo = Ns Ar string Oc ... Oc +.It Ic alias Oo Ar name Ns Oo = Ns Ar string Oc Ar ... Oc If .Ar name Ns = Ns Ar string is specified, the shell defines the alias From nobody Thu Feb 27 01:45:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3DgR5rZhz5pQtY; Thu, 27 Feb 2025 01:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3DgR3t05z4PYh; Thu, 27 Feb 2025 01:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9RatGeKhvHw8DK47SniTjPhuitnxHK/tKgybTW3VUI=; b=Nxtu6i/aUs3IFreBeDw1g9SsRcDQSXu6t/cpHx6HYIon5Qgj8mrsOPIEQ9tXr0QM70rG5I brrYs7xpRENrL32Vd1ezbCg5pP1eRU+FR9bkARijvBgX56wuOs31NQj4/mC9Ya5pEGLy2w IGkcNe7lqamymyOBSKSQXn3b2N6yU62l99eoxLSEW3c1GVCAFaoaOzaIsAhudjfvCB+FRV Lari0I3aiISMcGo43JCnkL97WheeTM9yFktut3cR2Cv6pS0PYtVHTmIY5PRIIPBqlle5pu +1CJ8M8cqspwBSKN9DrsWi6eVBVu1YH4HnYIUBOL8VWd7wv7GRxpoMwpiHkYdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740620723; a=rsa-sha256; cv=none; b=sX2YTN7IXSVWHclzvZnskCfDFiy3dZCf8j+WtQoXWdNX10jiupikGUKAx/XtWYHlipwZj8 4ia2zpfPnsOQW5fiCg9oi6IJyNPsGLbyaNh1Jx/UvhzWTY6oPaw55A9bam3H5C/dga8Zca bBQ7SnIsIS1EDDucOin0JJri9QdQoPV+gG1jcuQ2Uxzbf+n6Mp/l96CK0k7DeWce2YTdu6 iEXWRSSkZNJ5sUc2EElQLhPY115KFSb5fK1gyCklhP2tF5DBhT/ddqTvvFXIpkwBCCr0+l 8u9Y166YbUCKJOtjVjq/ZcP+qW8FkpWt3R4z5sKtUx3+yCskrAqK3J77YEB5bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9RatGeKhvHw8DK47SniTjPhuitnxHK/tKgybTW3VUI=; b=wLTQVEElKSvd61otbtSD88vZgP63z0Tp/FNKxzA76sBRSvM+aXltIy2XyKKET1ZXnT8vJr M/htL6vbsf2XehmX7zKBErg/wWzkkUdV8A9qdRgZQ/SjqKCT3muUM1BHf7P4VOWGPfYKaE BrsZm6jkT7w5/CT5maOv5iirvL5y4BrwD2QoSrOQFrO3tBQGn+5cExhiAbFJxZe2YzdSRh k5hLvWSioLMGv2xaRIKUoEz657Dtrjfd2qBiW2NGFz+czgEyMvy+0i4+A7pUg9bxUQkiys nxiyQQo/EqlXPbSZUi77/LVWANMwGaXcnTmkAMqstHvwovhATnTQiXuBkZkV2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3DgR3Nb3z69Y; Thu, 27 Feb 2025 01:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1jNFr011399; Thu, 27 Feb 2025 01:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1jNFe011396; Thu, 27 Feb 2025 01:45:23 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:45:23 GMT Message-Id: <202502270145.51R1jNFe011396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 2200da5fe059 - stable/14 - recv.2: Explain how recv functions can return 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2200da5fe05929d8455435a178188efaab7ee85f Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=2200da5fe05929d8455435a178188efaab7ee85f commit 2200da5fe05929d8455435a178188efaab7ee85f Author: Felix Johnson AuthorDate: 2025-02-13 03:40:59 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:44:28 +0000 recv.2: Explain how recv functions can return 0 Clarify the RETURN VALUES section with improved structure, the condition of the return value 0, and the setting of errno. PR: 174581 Reviewed by: jhb, ziaee Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48955 (cherry picked from commit 571df2c64a3c1af1fe011303ec08e391e887ecbc) --- lib/libc/sys/recv.2 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 68dc70e14800..8d50086c3eb9 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -318,12 +318,19 @@ On data reception the .Fa msg_len field is updated to the length of the received message. .Sh RETURN VALUES -These calls except -.Fn recvmmsg +On successful completion, +.Fn recv , +.Fn recvfrom , +and +.Fn recvmsg return the number of bytes received. .Fn recvmmsg returns the number of messages received. -A value of -1 is returned if an error occurred. +If no messages are available to be received and the peer has +performed an orderly shutdown, 0 is returned. +Otherwise, -1 is returned and +.Va errno +is set to indicate the error. .Sh ERRORS The calls fail if: .Bl -tag -width Er From nobody Thu Feb 27 01:45:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3DgT1MmNz5pRGv; Thu, 27 Feb 2025 01:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3DgS4yM1z4Ppf; Thu, 27 Feb 2025 01:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCiNxW9IohHODS0dQpYhWK4UADm8zp9wbC02sg53X9o=; b=SIKbaAQ4z9Yh31q+8JR0mjSvRkzPTmyvTfFSyPHEI4gNKGY3ScMFrNxcYs0tF5/15Qnysk 3Mp/CTeqw+yuBLWDxPNPNLYqhst0knZyDblaELufnkyKKY5E+pcwrCuLu6Oe3jl91TbBIY N9sdNasPeNGnMvOYpbTY+Nd4opfnJPHqRS4ANd8gxCKZ2ed8rN+C8BCZtIYpgEEEAQI7NP hRHdN5U3kuex7wVHAEidgMBkKCnAMIvDebq1wqF851CFrmZpDVe/tQEOmhFefyJ6Th1uxD MaC/9jWAwcN2pB/XAj/1/OvWvCYuZTlnbDot4kA2RK1RRinKsx84sk+eGHm7jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740620724; a=rsa-sha256; cv=none; b=QTbXICeomW/S68E8DLS8Xbbm9nIL5yi3BaE/oPDByXT8h5Fv8MFzUQth0epo22uVJaP5Jq QKiZR8JrQlmqxdXg6aTIwCJZAVRBM2pOMvQPfVhdRBugo6uyEgyjFj5YTy/oeNdOE+Wh3L vhpl70zYM+3BcRMKrftoh5nV6QWLSPnuuT3xhyvPtLQMrY9g3E5oQJa1UxxDfiqpCeZoXk 7xGic4jHfGMt55/Z5rfsEOR0UHBsaSEE68AfMupaxNdtPtQmJUb+fuvNxbGiCmUUM/YwaF bomk68ZnTv0CLbZmYG/6pD/dI4ERQ+tD4uXLnZbTECjENLmYloUv5rHLlFG5Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCiNxW9IohHODS0dQpYhWK4UADm8zp9wbC02sg53X9o=; b=bNu8GJiuJHZuziE/TGZ1J8eu0KZGwyfrOxHn2lMCEfWnH+hfgIiWjP9BUc14Hv34v0MPC+ 7QgkrTUmE2YhCJwI5crROq8U6JaYTtJ5dBZJ0Uup13Ln9SvBr8YY6LA6N7h2fnvnmQPZvY YOB954GyXHtv1M+xc7mqwksGxUIr57+fJCCKiCVyNVmiqqrUxgPZcg/OCgiT+FAaQfEeGg s/SN4jwssYbWJjiCBwORtanz3OkdEp0b5cBCx+sC4Skw/d2ytbIaJHU7xM0zqUZi1kXAvo ZhXvrk63uVBjFLjo0lqvkGIh7qPnr+qiePYXoc3IMRmpUU6pbw5d4AovSpF/fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3DgS4Hfhz69Z; Thu, 27 Feb 2025 01:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1jO8L011441; Thu, 27 Feb 2025 01:45:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1jOTs011438; Thu, 27 Feb 2025 01:45:24 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:45:24 GMT Message-Id: <202502270145.51R1jOTs011438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 6875767cf2e2 - stable/14 - recv.2: Improve style in RETURN VALUES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6875767cf2e21b49769d5d78e2dffaaf655ca8b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=6875767cf2e21b49769d5d78e2dffaaf655ca8b4 commit 6875767cf2e21b49769d5d78e2dffaaf655ca8b4 Author: Alexander Ziaee AuthorDate: 2025-02-24 17:33:24 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:44:37 +0000 recv.2: Improve style in RETURN VALUES Reported by: des MFC after: 3 days Fixes: 571df2c64a3c1 (Explain how recv functions can) Reviewed by: mhorne, des Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48995 (cherry picked from commit 7c3c8605d62f5d27a5228a3787aae6e573f77d59) --- lib/libc/sys/recv.2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 8d50086c3eb9..8caef85db812 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -318,14 +318,14 @@ On data reception the .Fa msg_len field is updated to the length of the received message. .Sh RETURN VALUES -On successful completion, +On successful completion, the .Fn recv , .Fn recvfrom , and .Fn recvmsg -return the number of bytes received. +functions return the number of bytes received, while the .Fn recvmmsg -returns the number of messages received. +function returns the number of messages received. If no messages are available to be received and the peer has performed an orderly shutdown, 0 is returned. Otherwise, -1 is returned and From nobody Thu Feb 27 02:32:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3Fjg43ysz5pWHb; Thu, 27 Feb 2025 02:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Fjg2MyLz3hnf; Thu, 27 Feb 2025 02:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740623543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bht2IIMwZSmVYK8YFpVmyqO1jDcfRP1MujlUHruGX1I=; b=nkEbILFFTtQlcSfGF2GSHywhVGK3UV/bbcENKEswINBkaxrfn3KPVJLECUWvKa8BqB0sdF CdVDdnt9OrLsKgRMfbqy6L2jcLM7GrJyZplsQqQeBsnsuf930AX/VRwRBISWfjK2IXdkj+ BWJ1CsPA1Fl6M5lTXt32cfYmjlI11dGl+Z+yUfu1FA/Q4oEMbOwMlNmtZ1m0Pw+5AX1eCU /zkwP6nFO1b8yoZTLYwcM7Iqx46IZYzdaBmQ4BrD4uOuLo05T0YMiKs5WVrmI6AOyyrsaR IPeLCdmu66qLQD5ujRbZxNyozLkZmzrvGqxL78KrQ+wopAbQLApodMVERmcpuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740623543; a=rsa-sha256; cv=none; b=vptP7LwRvPStHpWm/Sxo8MOl7PkC3MKpKauSZ3aVdGQEGUgYBbh9Utm5nIJxsxW888K2VH T8+IpFvo7lF1Pzl8TcORhLy4dwei+2vI//1lCTB+L0fmJYVByF1zyJpYtibQGfFdSIECu3 uRkin62MIz2x86S7n7wCNCz3ea3qH1yT8ppRPPul/BYKrjbHIp1QSpFs12ycGwvWZsH+X5 oLamSTfPmIBC1XMopA2k7m+FPYtc3+fttWhID1SKDeXY0xkjuHY5brHqt2C+AFX9r91DLY 2N0P/68dZSJ1Gtj0NRDn1wsXTetNMlhx2KneTOxUptAgxW3Tj4yn1Xk9QEpAvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740623543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bht2IIMwZSmVYK8YFpVmyqO1jDcfRP1MujlUHruGX1I=; b=kspFIZqIl1rdRXADHCu5KsMloURPNkUBziJMvkUd83Z0nXAQWXYzYjmuHVR4IxCjUSD5/5 wcRZrJU+vS5cZx4gYFs96ruruFJcRSH5iSpUvnYCmMNQdWswyDj4ZRKVp06vyjPmja3e+S RkUUXBgtXP2FPgXhNw7tMbcdwZ0mZjPlYtTp9aQrF6K8hDnIMGELeSRg+HNEmb8PFWC6G4 t92pFcXwHI5SNaGlIBdQ8I9xDmxY8ktSgBddshzuqV57gu3nae0YOhwCROfDQ8KD+AucPp RisUcb51VNTBsOGro/yZZfDD7OLh8pyGognKUqoG3xJDkA4idim1+sWFESNDAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3Fjg1t8Xz7yk; Thu, 27 Feb 2025 02:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R2WNTF004154; Thu, 27 Feb 2025 02:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R2WN9R004151; Thu, 27 Feb 2025 02:32:23 GMT (envelope-from git) Date: Thu, 27 Feb 2025 02:32:23 GMT Message-Id: <202502270232.51R2WN9R004151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 8ac895f924e7 - stable/14 - nfscl: Fix setting of mtime for the NFSv4.n client List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ac895f924e719be32a6173e06a6ee5d3e507932 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8ac895f924e719be32a6173e06a6ee5d3e507932 commit 8ac895f924e719be32a6173e06a6ee5d3e507932 Author: Rick Macklem AuthorDate: 2025-02-24 20:58:27 +0000 Commit: Rick Macklem CommitDate: 2025-02-27 02:31:01 +0000 nfscl: Fix setting of mtime for the NFSv4.n client It was reported on freebsd-fs@ that unrolling a tarball failed to set the correct modify time if delegations were being issued. This patch fixes the problem. This bug only affects NFSv4 mounts where delegations are being issued. Not running the nfscbd or disabling delegations on the NFSv4 server avoids the problem. (cherry picked from commit b616d997cb48eaafe13069eecd95f0495b2358eb) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clstate.c | 7 +++++-- sys/fs/nfsclient/nfs_clvnops.c | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 950e0c097457..c726d956fee2 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -626,7 +626,7 @@ int nfscl_renamedeleg(vnode_t, nfsv4stateid_t *, int *, vnode_t, nfsv4stateid_t *, int *, NFSPROC_T *); void nfscl_reclaimnode(vnode_t); void nfscl_newnode(vnode_t); -void nfscl_delegmodtime(vnode_t); +void nfscl_delegmodtime(struct vnode *, struct timespec *); void nfscl_deleggetmodtime(vnode_t, struct timespec *); int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, struct nfsmount *, NFSPROC_T *); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 0a1eb51e279f..a666792c17f9 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5104,7 +5104,7 @@ nfscl_newnode(vnode_t vp) * to the local clock time. */ void -nfscl_delegmodtime(vnode_t vp) +nfscl_delegmodtime(struct vnode *vp, struct timespec *mtime) { struct nfsclclient *clp; struct nfscldeleg *dp; @@ -5128,7 +5128,10 @@ nfscl_delegmodtime(vnode_t vp) } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) { - nanotime(&dp->nfsdl_modtime); + if (mtime != NULL) + dp->nfsdl_modtime = *mtime; + else + nanotime(&dp->nfsdl_modtime); dp->nfsdl_flags |= NFSCLDL_MODTIMESET; } NFSUNLOCKCLSTATE(); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index bf24a161b94b..a0bb781e5e5d 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1120,7 +1120,7 @@ nfs_setattr(struct vop_setattr_args *ap) * Call nfscl_delegmodtime() to set the modify time * locally, as required. */ - nfscl_delegmodtime(vp); + nfscl_delegmodtime(vp, NULL); } else NFSUNLOCKNODE(np); /* @@ -1158,6 +1158,8 @@ nfs_setattr(struct vop_setattr_args *ap) NFSUNLOCKNODE(np); } } + if (vap->va_mtime.tv_sec != VNOVAL && error == 0) + nfscl_delegmodtime(vp, &vap->va_mtime); return (error); } From nobody Thu Feb 27 02:36:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3Fpd1hCNz5pWLc; Thu, 27 Feb 2025 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Fpd16wVz3kN4; Thu, 27 Feb 2025 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740623801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41uQjnDGcUgzRKieSpbPT4yz0SXH7uDix2aFrxi/5vs=; b=v1rWjzo2qyNlJbG5pm33GaZEFeKjergZtsfWi9TYQcgQ2w2I+stXj/RJQl2c53snt4nBNO /vzuszeUc4vqVLDezOnBZ0dDXTYlHjDKAB3nxFJr6zfGlRxEDa3neClVgNgbmRkc7no3vN w4R8Ac+P3RtCj/bu+9rBuvCJ81baCJLu1tKz9pxY2rXWhU8y2Mbikwow0HWdqMRLAVbpov IUTrFxnFohlH4vGF/dhoJ1kcAldaWJ6o9TdSU0eF67ZMrsZ1o2mQqYgA/ms52L4RqqfE6E YqUS0qiADewNIy9sRlVn9kOiGaxXY/Gf/8mKR3Nlh/ba58Zb0R+90lHFt6cO0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740623801; a=rsa-sha256; cv=none; b=nZXt7wgchihcuusOg+Iy77irh8r6mDKd+cTDzBzs23iSdJSUneHVHvkvW5oDJ8jD1gYADG J9B/d08Wwltr9WJKxpZPam4lGzSLOC3vhErSBICTbCi8cye6uWsthiwuHTyD47EJUeGkZ8 Hf1TxhtFyrYvhllqyTKZ97tDivoUFxPycUhZ1dUZ1pSAgjLg1rALNrcoc1uBrBE0gDO8Qx Jwyu9kE3FEK0ugEv0w4vQmMLqcoV4Pshd7Hu7dnSVgZpdjFPrjMXr7XbOd7MZsqcbqtqhQ 0dK+CL+vDMsS+JDL5I1m4uzOQrdKkVXEizsnaEinE32XFcI0dYaXStLKPvGIcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740623801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41uQjnDGcUgzRKieSpbPT4yz0SXH7uDix2aFrxi/5vs=; b=dDXEApTTqzSht2lDnuAZEbnNp4a1w5whR+ptsWQmgOBE1Y70Xwt7K1W2pdK6FYUNFdeTDz mdCLT2Hbkwbfof4AHu6O/6ahX0HtLby0WFCmN/ldU75y6glv4sjqAI4QVXIUUXFy3TbQHi QnMDqBeGhbo9rFKpwuzgUvfLJt7v75yoZbWwFcfOt9UwjmmCtmEWckHy3mf4duI4C1GU4L 6dFDpN5iMpk3qjJai4kTHBnNTAdV1udK6bFIKtUH7SSHcpbU51USJRCeENDp5v9mBjnOtv IzdKx48JrEeTFV0ozBpuIZWATv3zJkzZ9jo+XR3yf8XuAHkze1hoNNMkXyyPUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3Fpd0L39z7Zw; Thu, 27 Feb 2025 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R2ae9N005593; Thu, 27 Feb 2025 02:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R2aegH005590; Thu, 27 Feb 2025 02:36:40 GMT (envelope-from git) Date: Thu, 27 Feb 2025 02:36:40 GMT Message-Id: <202502270236.51R2aegH005590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 319b59fbde2f - stable/13 - nfscl: Fix setting of mtime for the NFSv4.n client List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 319b59fbde2fb90bd4e41d1f66aa59e56f66f1fe Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=319b59fbde2fb90bd4e41d1f66aa59e56f66f1fe commit 319b59fbde2fb90bd4e41d1f66aa59e56f66f1fe Author: Rick Macklem AuthorDate: 2025-02-24 20:58:27 +0000 Commit: Rick Macklem CommitDate: 2025-02-27 02:35:54 +0000 nfscl: Fix setting of mtime for the NFSv4.n client It was reported on freebsd-fs@ that unrolling a tarball failed to set the correct modify time if delegations were being issued. This patch fixes the problem. This bug only affects NFSv4 mounts where delegations are being issued. Not running the nfscbd or disabling delegations on the NFSv4 server avoids the problem. (cherry picked from commit b616d997cb48eaafe13069eecd95f0495b2358eb) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clstate.c | 7 +++++-- sys/fs/nfsclient/nfs_clvnops.c | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 083a974516b0..b5e2cd78749e 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -622,7 +622,7 @@ int nfscl_renamedeleg(vnode_t, nfsv4stateid_t *, int *, vnode_t, nfsv4stateid_t *, int *, NFSPROC_T *); void nfscl_reclaimnode(vnode_t); void nfscl_newnode(vnode_t); -void nfscl_delegmodtime(vnode_t); +void nfscl_delegmodtime(struct vnode *, struct timespec *); void nfscl_deleggetmodtime(vnode_t, struct timespec *); int nfscl_tryclose(struct nfsclopen *, struct ucred *, struct nfsmount *, NFSPROC_T *, bool); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9ab0a29e9c5d..282e9e39536f 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5083,7 +5083,7 @@ nfscl_newnode(vnode_t vp) * to the local clock time. */ void -nfscl_delegmodtime(vnode_t vp) +nfscl_delegmodtime(struct vnode *vp, struct timespec *mtime) { struct nfsclclient *clp; struct nfscldeleg *dp; @@ -5107,7 +5107,10 @@ nfscl_delegmodtime(vnode_t vp) } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) { - nanotime(&dp->nfsdl_modtime); + if (mtime != NULL) + dp->nfsdl_modtime = *mtime; + else + nanotime(&dp->nfsdl_modtime); dp->nfsdl_flags |= NFSCLDL_MODTIMESET; } NFSUNLOCKCLSTATE(); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 38a2f6c8f4f1..f4569068972f 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1119,7 +1119,7 @@ nfs_setattr(struct vop_setattr_args *ap) * Call nfscl_delegmodtime() to set the modify time * locally, as required. */ - nfscl_delegmodtime(vp); + nfscl_delegmodtime(vp, NULL); } else NFSUNLOCKNODE(np); /* @@ -1157,6 +1157,8 @@ nfs_setattr(struct vop_setattr_args *ap) NFSUNLOCKNODE(np); } } + if (vap->va_mtime.tv_sec != VNOVAL && error == 0) + nfscl_delegmodtime(vp, &vap->va_mtime); return (error); } From nobody Thu Feb 27 08:08:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3P9X4Wtlz5ppVD; Thu, 27 Feb 2025 08:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3P9X3nhjz3WX3; Thu, 27 Feb 2025 08:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740643712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bo4mVmuGMjlB+sK03YUTJxTUaS97EHtFlVTSvdlzbdA=; b=dL+nQ2BJ2b9UqFkH8I7lwtZVWbzFqx5Ef8UxHkJDsivFY6buj8n7bOOOWysYh9R98JrqDy 8GOrGfmP5Mwc+GCK6DBNgAjUpEzbxmrcOutLXbHU6JUbQnzg67iD3dqoVgqPq5UrZBCxU1 KT3NYc4aQriJutWR6Lfj7HiekV5lwA5ER6Rae9QubrT3Hwji0ubMaa9ILvglujeOGUMRsL b0VmxENjzAhs8vHallcQepsocWDiX0oU6rCq67PsaFbhJIXhBZ81pBfRcHEUMhL8BKarvZ 9FHIe5Gsi9LkmwLhgQWvAjOta5fywQCokEcmelj7Z4VJZH6aIiXyDhAIka8O7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740643712; a=rsa-sha256; cv=none; b=c5AXfwcy0yIjTdNIxYJ/xYmjjJDJIOfnZVgIH9xGGfV7wMr3elpPSnCulL0Xrj9pWM6JZQ kBjnyL6nud3VsCoGSovoLgf5dfaH7XHNvwhOAkfJXbRSdzFkYpbD/Gkvy3QljXvvoAUCkl EpoNuTS+nCvRjl+iaZTeyumQIK51wGY/jbYIkjg0mz6LZRt5tLfV9TEgmb1UpDOJ6YBOzo UMk1bE1O0MdE9wVeY5eTgaZJRJih1qRSNqurSwCpK2o4HmgMb/pzf+DoCCUTs0ffWRKIKD j70RgwilqEb0RSlC9Df8tRZ4spfT4dRvP5/tmfDyFJKHwn1Kspdg+A2fW5ziTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740643712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bo4mVmuGMjlB+sK03YUTJxTUaS97EHtFlVTSvdlzbdA=; b=ggZMVClCPPi03hzGAFhMIPmS9f+IuT1cwT7XbLhfyv5P/79mcU8V14Dcy+SaHRfcsfhYc/ gfZy6K/XG3YtLHvpwzKDz94LRNZXJpI7tlFQTC84D5amF+WhRfPJmZdH5XuASyYYG9Q+4S SOowafWZVsS5PPubXwqXvTn6aQdvEbHEcfI4bM+aqvQjY9800VBAK0HZOwtI7T5FtnhUaF ny33AXdxBC+L/ZCImhKl3rrvC/7IXSxw6z7qmxFyfKWeBn98hsJnpzVCj+WzHWeb8I78Wj kedzA2s20sEPuJc2DnYYcR8BpoZtpwTEQenlc162KIRUdJh6M1vdctvOE9/gbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3P9X38sqzbGS; Thu, 27 Feb 2025 08:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R88WtP024548; Thu, 27 Feb 2025 08:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R88WAF024545; Thu, 27 Feb 2025 08:08:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 08:08:32 GMT Message-Id: <202502270808.51R88WAF024545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: 9b8701b81f14 - main - mana: refill the rx mbuf in batch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b8701b81f14f0fa0787425eb9761b765d5faab0 Auto-Submitted: auto-generated The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=9b8701b81f14f0fa0787425eb9761b765d5faab0 commit 9b8701b81f14f0fa0787425eb9761b765d5faab0 Author: Wei Hu AuthorDate: 2025-02-27 08:02:46 +0000 Commit: Wei Hu CommitDate: 2025-02-27 08:08:13 +0000 mana: refill the rx mbuf in batch Set the default refill threshod to be one quarter of the rx queue length. User can change this value with hw.mana.rx_refill_thresh in loader.conf. It improves the rx completion handling by saving 10% to 15% of overall time with this change. Tested by: whu MFC after: 2 weeks Sponsored by: Microsoft --- sys/dev/mana/mana.h | 10 ++++ sys/dev/mana/mana_en.c | 127 ++++++++++++++++++++++++++++++++++----------- sys/dev/mana/mana_sysctl.c | 7 +++ 3 files changed, 114 insertions(+), 30 deletions(-) diff --git a/sys/dev/mana/mana.h b/sys/dev/mana/mana.h index a805aa047b9d..a037eb3f05c7 100644 --- a/sys/dev/mana/mana.h +++ b/sys/dev/mana/mana.h @@ -149,6 +149,7 @@ struct mana_stats { counter_u64_t collapse_err; /* tx */ counter_u64_t dma_mapping_err; /* rx, tx */ counter_u64_t mbuf_alloc_fail; /* rx */ + counter_u64_t partial_refill; /* rx */ counter_u64_t alt_chg; /* tx */ counter_u64_t alt_reset; /* tx */ counter_u64_t cqe_err; /* tx */ @@ -441,6 +442,8 @@ struct mana_rxq { uint32_t num_rx_buf; uint32_t buf_index; + uint32_t next_to_refill; + uint32_t refill_thresh; uint64_t lro_tried; uint64_t lro_failed; @@ -711,6 +714,13 @@ struct mana_cfg_rx_steer_resp { #define MANA_SHORT_VPORT_OFFSET_MAX ((1U << 8) - 1) +#define MANA_IDX_NEXT(idx, size) (((idx) + 1) & ((size) - 1)) +#define MANA_GET_SPACE(start_idx, end_idx, size) \ + (((end_idx) >= (start_idx)) ? \ + ((end_idx) - (start_idx)) : ((size) - (start_idx) + (end_idx))) + +#define MANA_RX_REFILL_THRESH 256 + struct mana_tx_package { struct gdma_wqe_request wqe_req; struct gdma_sge sgl_array[MAX_MBUF_FRAGS]; diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index a1d2d1015b89..94cca4fa50c7 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -69,6 +69,7 @@ static int mana_down(struct mana_port_context *apc); extern unsigned int mana_tx_req_size; extern unsigned int mana_rx_req_size; +extern unsigned int mana_rx_refill_threshold; static void mana_rss_key_fill(void *k, size_t size) @@ -638,8 +639,7 @@ mana_xmit(struct mana_txq *txq) continue; } - next_to_use = - (next_to_use + 1) % tx_queue_size; + next_to_use = MANA_IDX_NEXT(next_to_use, tx_queue_size); (void)atomic_inc_return(&txq->pending_sends); @@ -1527,7 +1527,7 @@ mana_poll_tx_cq(struct mana_cq *cq) mb(); next_to_complete = - (next_to_complete + 1) % tx_queue_size; + MANA_IDX_NEXT(next_to_complete, tx_queue_size); pkt_transmitted++; } @@ -1592,18 +1592,11 @@ mana_poll_tx_cq(struct mana_cq *cq) } static void -mana_post_pkt_rxq(struct mana_rxq *rxq) +mana_post_pkt_rxq(struct mana_rxq *rxq, + struct mana_recv_buf_oob *recv_buf_oob) { - struct mana_recv_buf_oob *recv_buf_oob; - uint32_t curr_index; int err; - curr_index = rxq->buf_index++; - if (rxq->buf_index == rxq->num_rx_buf) - rxq->buf_index = 0; - - recv_buf_oob = &rxq->rx_oobs[curr_index]; - err = mana_gd_post_work_request(rxq->gdma_rq, &recv_buf_oob->wqe_req, &recv_buf_oob->wqe_inf); if (err) { @@ -1722,6 +1715,68 @@ mana_rx_mbuf(struct mbuf *mbuf, struct mana_rxcomp_oob *cqe, counter_exit(); } +static int +mana_refill_rx_mbufs(struct mana_port_context *apc, + struct mana_rxq *rxq, uint32_t num) +{ + struct mana_recv_buf_oob *rxbuf_oob; + uint32_t next_to_refill; + uint32_t i; + int err; + + next_to_refill = rxq->next_to_refill; + + for (i = 0; i < num; i++) { + if (next_to_refill == rxq->buf_index) { + mana_warn(NULL, "refilling index reached current, " + "aborted! rxq %u, oob idx %u\n", + rxq->rxq_idx, next_to_refill); + break; + } + + rxbuf_oob = &rxq->rx_oobs[next_to_refill]; + + if (likely(rxbuf_oob->mbuf == NULL)) { + err = mana_load_rx_mbuf(apc, rxq, rxbuf_oob, true); + } else { + mana_warn(NULL, "mbuf not null when refilling, " + "rxq %u, oob idx %u, reusing\n", + rxq->rxq_idx, next_to_refill); + err = mana_load_rx_mbuf(apc, rxq, rxbuf_oob, false); + } + + if (unlikely(err != 0)) { + mana_dbg(NULL, + "failed to load rx mbuf, err = %d, rxq = %u\n", + err, rxq->rxq_idx); + counter_u64_add(rxq->stats.mbuf_alloc_fail, 1); + break; + } + + mana_post_pkt_rxq(rxq, rxbuf_oob); + + next_to_refill = MANA_IDX_NEXT(next_to_refill, + rxq->num_rx_buf); + } + + if (likely(i != 0)) { + struct gdma_context *gc = + rxq->gdma_rq->gdma_dev->gdma_context; + + mana_gd_wq_ring_doorbell(gc, rxq->gdma_rq); + } + + if (unlikely(i < num)) { + counter_u64_add(rxq->stats.partial_refill, 1); + mana_dbg(NULL, + "refilled rxq %u with only %u mbufs (%u requested)\n", + rxq->rxq_idx, i, num); + } + + rxq->next_to_refill = next_to_refill; + return (i); +} + static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, struct gdma_comp *cqe) @@ -1731,8 +1786,8 @@ mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, if_t ndev = rxq->ndev; struct mana_port_context *apc; struct mbuf *old_mbuf; + uint32_t refill_required; uint32_t curr, pktlen; - int err; switch (oob->cqe_hdr.cqe_type) { case CQE_RX_OKAY: @@ -1785,29 +1840,24 @@ mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, /* Unload DMA map for the old mbuf */ mana_unload_rx_mbuf(apc, rxq, rxbuf_oob, false); - - /* Load a new mbuf to replace the old one */ - err = mana_load_rx_mbuf(apc, rxq, rxbuf_oob, true); - if (err) { - mana_dbg(NULL, - "failed to load rx mbuf, err = %d, packet dropped.\n", - err); - counter_u64_add(rxq->stats.mbuf_alloc_fail, 1); - /* - * Failed to load new mbuf, rxbuf_oob->mbuf is still - * pointing to the old one. Drop the packet. - */ - old_mbuf = NULL; - /* Reload the existing mbuf */ - mana_load_rx_mbuf(apc, rxq, rxbuf_oob, false); - } + /* Clear the mbuf pointer to avoid reuse */ + rxbuf_oob->mbuf = NULL; mana_rx_mbuf(old_mbuf, oob, rxq); drop: mana_move_wq_tail(rxq->gdma_rq, rxbuf_oob->wqe_inf.wqe_size_in_bu); - mana_post_pkt_rxq(rxq); + rxq->buf_index = MANA_IDX_NEXT(rxq->buf_index, rxq->num_rx_buf); + + /* Check if refill is needed */ + refill_required = MANA_GET_SPACE(rxq->next_to_refill, + rxq->buf_index, rxq->num_rx_buf); + + if (refill_required >= rxq->refill_thresh) { + /* Refill empty rx_oobs with new mbufs */ + mana_refill_rx_mbufs(apc, rxq, refill_required); + } } static void @@ -2349,6 +2399,23 @@ mana_create_rxq(struct mana_port_context *apc, uint32_t rxq_idx, mana_dbg(NULL, "Setting rxq %d datasize %d\n", rxq_idx, rxq->datasize); + /* + * Two steps to set the mbuf refill_thresh. + * 1) If mana_rx_refill_threshold is set, honor it. + * Set to default value otherwise. + * 2) Select the smaller of 1) above and 1/4 of the + * rx buffer size. + */ + if (mana_rx_refill_threshold != 0) + rxq->refill_thresh = mana_rx_refill_threshold; + else + rxq->refill_thresh = MANA_RX_REFILL_THRESH; + rxq->refill_thresh = min_t(uint32_t, + rxq->num_rx_buf / 4, rxq->refill_thresh); + + mana_dbg(NULL, "Setting rxq %d refill thresh %u\n", + rxq_idx, rxq->refill_thresh); + rxq->rxobj = INVALID_MANA_HANDLE; err = mana_alloc_rx_wqe(apc, rxq, &rq_size, &cq_size); diff --git a/sys/dev/mana/mana_sysctl.c b/sys/dev/mana/mana_sysctl.c index acb3628f09bc..c2916f9004cd 100644 --- a/sys/dev/mana/mana_sysctl.c +++ b/sys/dev/mana/mana_sysctl.c @@ -36,6 +36,7 @@ int mana_log_level = MANA_ALERT | MANA_WARNING | MANA_INFO; unsigned int mana_tx_req_size; unsigned int mana_rx_req_size; +unsigned int mana_rx_refill_threshold; SYSCTL_NODE(_hw, OID_AUTO, mana, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "MANA driver parameters"); @@ -44,6 +45,9 @@ SYSCTL_UINT(_hw_mana, OID_AUTO, tx_req_size, CTLFLAG_RWTUN, &mana_tx_req_size, 0, "requested number of unit of tx queue"); SYSCTL_UINT(_hw_mana, OID_AUTO, rx_req_size, CTLFLAG_RWTUN, &mana_rx_req_size, 0, "requested number of unit of rx queue"); +SYSCTL_UINT(_hw_mana, OID_AUTO, rx_refill_thresh, CTLFLAG_RWTUN, + &mana_rx_refill_threshold, 0, + "number of rx slots before starting the refill"); /* * Logging level for changing verbosity of the output @@ -329,6 +333,9 @@ mana_sysctl_add_queues(struct mana_port_context *apc) SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "mbuf_alloc_fail", CTLFLAG_RD, &rx_stats->mbuf_alloc_fail, "Failed mbuf allocs"); + SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, + "partial_refill", CTLFLAG_RD, + &rx_stats->partial_refill, "Partially refilled mbuf"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "dma_mapping_err", CTLFLAG_RD, &rx_stats->dma_mapping_err, "DMA mapping errors"); From nobody Thu Feb 27 09:36:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3R765YMBz5pxrW; Thu, 27 Feb 2025 09:36:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3R764yjdz3hZJ; Thu, 27 Feb 2025 09:36:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740648994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A9+skjn7P+VOPRvkeS2Hs+C++L8xiLxBJjOwDLtWTp4=; b=dgphkpWnPisQoXLfmxvJ3IT+zC2zjzcOqIRCtf7ItlqrgaJ/HQ4cUjLc5Jrrf4/PuNvjkO WW0z3mKpl9Vok4ktQIo4E8hQfLcQH73BFo0l6Lvp/Bh12AFH/vQiRNXh7Xzml8fSKsuNWc A21vN255oztGLuaGD+KWhA42EzwWFS4hZ+ijuhpJjvDFb5B+k3dxRT6QgWQtZnRjiWVJsP UhrNJdVhxillkrmCIEUSKqxObEduSVqWqcr7zPDfQUuK8TJSlZb0g9WV2jUlOUTAkxOats Cughy4L/4KRnw2EtV+SmtKaS2pcuu+pMGTs0zrqta6K6gt+QoTTfz14EAEvdSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740648994; a=rsa-sha256; cv=none; b=bmmhwwn2MchDkESsnKCRQEdkuniDFeeG3Q6ZJ0GjDygTtiP5i20RnKH7QuZEjC3RiNEC2p MFjIbs6xoEycre/XZ/acVONnu9u9qRRaugkJ6Z8zdxAWr62HMZPm9gBVx4o0cBiaUw4oNA bwTeG0/BoSPvhAQpuSOWB9wA/0SZbiyi2yVC1Cb3ZqreGXj4tLa4lmkvpdObQErGpR8Yau raFELTB/tjOXJGpB9Bg03cyamy0UVOv8YEBHw/EV4k4z3mIq1+aEsWZpHOH0gbc5qPPwmH BpxwSIfKeBxLtM9byKkU0ifNOzGyGbxkK6hXYBgUouX3q2VhMZ4PyRE2B5jziw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740648994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A9+skjn7P+VOPRvkeS2Hs+C++L8xiLxBJjOwDLtWTp4=; b=f+nVHz8OsemLMchAHAE/zlt8/AjKUMTnynmsgUARJpQRCtvVk9Uq58CekM9t+rFCI1BqZ9 Wq4CzioYjKZ9qReKQsPRnUyf/fiOkeAt3+rFGabJUwr7JUdoLFM5CNzhAQP8DxqzT0EPQZ yflvGM0Hh+PIWkS7qVlEKqepgJSOxoRRDlqsXtQjRAFHWCbpHZjOeKx7AdPFkiKv5nxLH+ BW9mz1m//37c0r+vpUHczMTtUz2OfyrANMfKJvX9qVBvm/wxRTG5rP5TtP99LS8gKnydkY 7ka8iNFinX/FX/iO44eTJSJurDIRul8cX+SPVu3reB2FCHVLh1bbcMQTK5qTGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3R764G1Lzcwt; Thu, 27 Feb 2025 09:36:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R9aYqP091779; Thu, 27 Feb 2025 09:36:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R9aYg1091776; Thu, 27 Feb 2025 09:36:34 GMT (envelope-from git) Date: Thu, 27 Feb 2025 09:36:34 GMT Message-Id: <202502270936.51R9aYg1091776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: ab6a311c720e - main - libc/gen/fts.c: fix assignment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab6a311c720e93c860d3dd4a335264d725db7a0d Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=ab6a311c720e93c860d3dd4a335264d725db7a0d commit ab6a311c720e93c860d3dd4a335264d725db7a0d Author: Stefan Eßer AuthorDate: 2025-02-27 09:29:17 +0000 Commit: Stefan Eßer CommitDate: 2025-02-27 09:29:17 +0000 libc/gen/fts.c: fix assignment Fix typo in commit e59991206b ("==" instead of "=" for the assignment of st_ino). Reported by: Coverity Scan CID 1592442 Approved by: kib Fixes: e59991206b fts(3): be less strict when automount does its job under us walking autofs mount --- lib/libc/gen/fts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index bd193c7c6cfc..80f98a993123 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -1153,7 +1153,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) } /* autofs might did the mount under us, accept. */ p->fts_dev = sb.st_dev; - p->fts_ino == sb.st_ino; + p->fts_ino = sb.st_ino; } ret = fchdir(newfd); bail: From nobody Thu Feb 27 14:16:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLd1wcDz5qGFT; Thu, 27 Feb 2025 14:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLd1Jjrz3xGf; Thu, 27 Feb 2025 14:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YKKjoliDg9VWxUIn4MkkUIsQESL1kgcm7HdG9GmGQWM=; b=OtxH0Xu4s4M+iom6Q6Re1CXQgOaEUV+UB57tfGx6XSZgwBsCrdG0kRqCI1nwZc1SEL/sx5 I7llgCXgvabG7KamNerKk4eEopNhPlv930WD/2tiVwlyMhusyiFfYBENUzHLIfOt8rYp2T e5+mECEq3v48cL2MV4zNMs7TR9/GBvJ4ofMZTqOayQ85NoCNyJo+uXve3EAdf+67oEFgDc 9xbx/BA1R03zbHk7dlfGSPcyZlpFXYtuR8xDRNk9pR78wiXYFoOmN7ezX0ZPZ7TdLVrsOL dmZU7+ZDbauxpqxCaEGsNriAdRv6zYtjsaWgv2fbQjs94EZZM1awRh8NBjA1Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665817; a=rsa-sha256; cv=none; b=IqTTE8/fCerzGn2dyWOdmfETgbteGD9xkLx8lL2R+KbzoqjR1WxGrYE7sle8hjr4FCovIl j88icJU7PVdZwwuoLPds+UWoEhp5CugH/qPMlZkzMdVxBUbc1KVjDuHj2KVzTOhke71bST sAjCAn35eFWzaGJhrm303WugM2K07xPsfsNBNt+pxGncs1LsnydBwEePlOHy9V1Blm+qmm LGUBFzuIZOZwkxEcJmdCXBQugIJSs/KUV59Y9gJmcAGTvIp73cylNs1sLGBZ44bUWxo9/y 8Uqekcc5uY2QLA2wQHXGSf1XxGiFm94/lH0ro32vqzaC551KaN14ad5b89wuDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YKKjoliDg9VWxUIn4MkkUIsQESL1kgcm7HdG9GmGQWM=; b=sLRVqopGpqb/77IcHSGiqxl7vGUxNApWurcoBYcWaYh2yOqNS3ZxMvDL9hbPW/0FzTvcZV 7sZhxMbLSFBkEX6LwjKYiDmo2vKUgX1ZVtnL7P6Ge2f5GDP0QwKj5rWucYbIWm0kr57cok u0+xr64AHTtNqbPHL2KDtfOE0fa29VInFOJzc29Mz5X8NOaNfsYJqtW9bdo7KalBxedyaR m5bFc3bT3JhO4wRNVwtZTiNaGpe6g6joJAslrl/Uzfp3nY2jYiB2i8gRmLmsOcwqtIbUXr 15kdQAtjeOgTd/adkkrjEi5WP5ETSI9iNnHaJfJRNEOnkk7SQvDFXAvgx2Lehg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLd0lvpzmdv; Thu, 27 Feb 2025 14:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGv29016455; Thu, 27 Feb 2025 14:16:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGvF7016452; Thu, 27 Feb 2025 14:16:57 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:57 GMT Message-Id: <202502271416.51REGvF7016452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 555691ca601d - stable/14 - pci_pci: Remove obsolete comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 555691ca601dc4efe390a7a4034bdec1906b705d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=555691ca601dc4efe390a7a4034bdec1906b705d commit 555691ca601dc4efe390a7a4034bdec1906b705d Author: John Baldwin AuthorDate: 2024-02-15 02:04:34 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_pci: Remove obsolete comment This comment referred to the layering violation fixed in commit b377ff8110e3489eb6e6b920b51a2384dfc4eb0b. (cherry picked from commit 57d312b8eac9862ae60da32a9aecb6d9ccf08171) --- sys/dev/pci/pci_pci.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 02fa8cf1fb9e..cda1597ac76e 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -1931,11 +1931,6 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w, pcib_child_name(child)); rman_set_rid(res, *rid); - /* - * If the resource should be active, pass that request up the - * tree. This assumes the parent drivers can handle - * activating sub-allocated resources. - */ if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, res) != 0) { rman_release_resource(res); From nobody Thu Feb 27 14:17:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLp29sqz5qG2H; Thu, 27 Feb 2025 14:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLp1jZKz3xMW; Thu, 27 Feb 2025 14:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1bLAbX33IFRPyJYDhH3VaZjYh0LuIroFg8uDl6SpS4=; b=I/mUq5wXBpHiDhB3WUI7vF5m61OdcgMbwFoqw4z/hxEVmixdL5b/hApSUNPPvUZHRQkrmQ AGs4LAaAqbmvT3oRUW6FxsTAHfJcHM4qOFo1USaJByx0b232QFOqojEPnw1AsNfuXFe8Ow o6gkTijDjynfahzkmYstUWHKs7sKzxFcYZRnt+J89CqCnGBgIhVEF53PuK9klf+8iFi8o8 SMrAUOXcbB1C/jVz4Rv58jpdhvBmL8j++5mFdc614qW4+bPd+I+buj4qVqaFtbQ19RUlpR wnYrMWHURj+dR2U1dtXkYpX5ikyoxtD989RpR92w4EgZQuol2MX9Q2BZmmc9VA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665826; a=rsa-sha256; cv=none; b=PVHCwzkMRpJfZwQPwcQpVQa5rv20kV/Uuk3DcIevG8Od1fzu0RCALDSdaVnyiQJO7B+Vkx cE5tgH/gnvrZgEHlHKjuTUvTJuSyins6i0lRL1cRRxs2H5i/Udedt7n07v304TEULh89cN NPoaNphaZm1BjDS/UyCKzREndUSN/jQgABPF89dyz3SVL62d7LSEJ6kfv4IKEqMBgEUaQ3 vyQTUeGGp6XTeL3HCKLjaK1632Gf/Hs1naoFoRnfo4b7ZN20xnMiNC0yg8YiTIthRBO8NY iW0W1bC/dO/TSMjWQpgHAoAFEVKspeYXdGIMjfdbipvo/hOFrzIUk1cuxcjbdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1bLAbX33IFRPyJYDhH3VaZjYh0LuIroFg8uDl6SpS4=; b=l4rrCihzkhvqWTnPpf+7a7q+DGH1LluZQuVkFOf46HyMo9QsGj7bTVbia7joJimAzULigl FZLHhCtAMdj/KDSVpra1jhAldk2osfHsRGk0h2Uce57HS7QcMm9wJ/Ix29UYSC9xcw1NJE 7Zc25UHel+AVJATFOpiKmlTB8H+ILhLahcKVdVFyRjvPGxmErIyHeSTz4IyAQtPJQT4yH/ yu456T8Aygvmlr9X2OlByS1zvHIwwptGltVyxgunJLou44FbZPUPFcAdu7NMvfZWLyp/X6 B98vAwR3fYB9pMGicz+YX7vjg/6KDiXdBdlJn8AJwMq8IWXjXRVGn9BaDoX8uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLp12ZRzmqP; Thu, 27 Feb 2025 14:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH6cO016746; Thu, 27 Feb 2025 14:17:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH6Mt016743; Thu, 27 Feb 2025 14:17:06 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:06 GMT Message-Id: <202502271417.51REH6Mt016743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2abfb125a565 - stable/14 - powerpc mpc85xx: Fix infinite recursion in multiple bus methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2abfb125a5658491ad899a41e38f234cc1035632 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2abfb125a5658491ad899a41e38f234cc1035632 commit 2abfb125a5658491ad899a41e38f234cc1035632 Author: John Baldwin AuthorDate: 2024-02-17 07:15:52 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 powerpc mpc85xx: Fix infinite recursion in multiple bus methods Similar to 68a3ff041129208ea98a3bd5142061176ab4165e, the default case needs to call bus_generic_* to pass the request up the tree, not bus_* which will just call this method again. Fixes: 5a7e717fb790 powerpc mpc85xx: Use bus_generic_rman_* (cherry picked from commit cd9d26ed91c049dd60919c71badced89e18a882a) --- sys/powerpc/mpc85xx/lbc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c index 1e17d613438a..47b2f60177b0 100644 --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -793,7 +793,7 @@ lbc_release_resource(device_t dev, device_t child, int type, int rid, return (bus_generic_rman_release_resource(dev, child, type, rid, res)); case SYS_RES_IRQ: - return (bus_release_resource(dev, type, rid, res)); + return (bus_generic_release_resource(dev, child, type, rid, res)); default: return (EINVAL); } @@ -811,7 +811,7 @@ lbc_activate_resource(device_t bus, device_t child, int type, int rid, return (bus_generic_rman_activate_resource(bus, child, type, rid, r)); case SYS_RES_IRQ: - return (bus_activate_resource(bus, type, rid, r)); + return (bus_generic_activate_resource(bus, child, type, rid, r)); default: return (EINVAL); } @@ -829,7 +829,7 @@ lbc_deactivate_resource(device_t bus, device_t child, int type, int rid, return (bus_generic_rman_deactivate_resource(bus, child, type, rid, r)); case SYS_RES_IRQ: - return (bus_deactivate_resource(bus, type, rid, r)); + return (bus_generic_deactivate_resource(bus, child, type, rid, r)); default: return (EINVAL); } From nobody Thu Feb 27 14:16:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YL51xsKz5qGJd; Thu, 27 Feb 2025 14:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL51Mdcz3wx3; Thu, 27 Feb 2025 14:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSthiYhtrbHcclTcLw0XB8zN6U9/x+yQ52PxCo38lEE=; b=knyQsjhgHgFdLi7YCKOKrQ9iuWhMkZRDyA6oPgxU3hX9uIN6K3Pf1Z/4AGTNMpK8acfZrM C6fuQbEEvNNG6BOFzZeW/0GH+CeS3lDgLa+oeQbPOEFZ6io24aHu91jwCwGC+e5Z4NQ7ho 2vHD6/sjMg0wrl6JfaLzgYSLOGdkt5qDgccRYA02vSzcB2cTqpei+A3oo3oQW46/H/2GuU /qFVbvTE48+m0kyMFlnUd7AZYxwUWbdcZYyICI2N/NiyB1D0f85CcQpghhgbjE0WbDDhhM XYpRnPdSGxwuSnRN5/whAd8rkfuZEkXbD5Ti7PEjN4TE36D42bdLY07OlDO/qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665789; a=rsa-sha256; cv=none; b=hNB+2mdMUKHyI2XT7ZzeD0B9TaGbPOOwg25420jBYwG81RG8VBZjpMXp2IkviolgA3FVKn 6qSphlZHPtsW7YwZvV8J7vmoibYdVHRczu8/hGs0872qDDFa7T9LfeK1oPoI/5knNmiCec xUrQJ3tPUhtQ3JnOLA/tzern0TfAAkd/f+n0fxO53z1IIrpWtLos4aJF9t+kX7lz4IuKTr EmgAjiy1Jf0tScxagFG74OyMI4/pq9fgQW32pZaFm3uPL0Y7rOj9AdAS43eGt/YDazxK2f Ww69yzNqq4LWTvnikvFopSQQZptM9kMn77E117z0t70jyX0HN1mN3M57zIkU6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSthiYhtrbHcclTcLw0XB8zN6U9/x+yQ52PxCo38lEE=; b=XIWs1C+2mWFDbUxxTTspvGDy4OblBUTZ3GxbNOxaHOn1qgzipMHA4//+cwekKIHD7E8Jm9 XjluMAKWli7Uh1n9cyZ7POk43wIOknTD4BVMnbwVHgsJgjfKlMYb4kLuj4zknhbUemoTWp 8Nzz2YohhiPsMXODu30OHtoxIdmy8awlT9XIuCYwNjRMYsfBw+HL+DnB349n4lzc55QNNm wVKeQfE3EHWiLlg4/fjhvCa54NwlIA6zX5e9lpDf8jbx+/s6c18XCiCH3Yty8/6A88Ay+4 Bvfy7AOMTAyYwIM27U1eNVxMe77YMTj5+yLcrmuDzVtnBeDUfON7dGbGWlZLXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YL50fz8zmpW; Thu, 27 Feb 2025 14:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGSvT015551; Thu, 27 Feb 2025 14:16:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGSDh015548; Thu, 27 Feb 2025 14:16:28 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:28 GMT Message-Id: <202502271416.51REGSDh015548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 959c3d77be1f - stable/14 - acpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 959c3d77be1ff1146cfee8da1bdcacc15cdaf0c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=959c3d77be1ff1146cfee8da1bdcacc15cdaf0c7 commit 959c3d77be1ff1146cfee8da1bdcacc15cdaf0c7 Author: John Baldwin AuthorDate: 2024-01-23 17:35:22 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:19 +0000 acpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43428 (cherry picked from commit c2d4fef658e0dfd998115f1395cd8705b432e3c8) --- sys/dev/acpica/acpi_pcib_acpi.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c index 06e6bc233720..451a8d8b736d 100644 --- a/sys/dev/acpica/acpi_pcib_acpi.c +++ b/sys/dev/acpica/acpi_pcib_acpi.c @@ -103,6 +103,12 @@ static int acpi_pcib_acpi_adjust_resource(device_t dev, static int acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +static int acpi_pcib_acpi_activate_resource(device_t dev, + device_t child, int type, int rid, + struct resource *r); +static int acpi_pcib_acpi_deactivate_resource(device_t dev, + device_t child, int type, int rid, + struct resource *r); #endif #endif static int acpi_pcib_request_feature(device_t pcib, device_t dev, @@ -128,11 +134,13 @@ static device_method_t acpi_pcib_acpi_methods[] = { #endif #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_release_resource, acpi_pcib_acpi_release_resource), + DEVMETHOD(bus_activate_resource, acpi_pcib_acpi_activate_resource), + DEVMETHOD(bus_deactivate_resource, acpi_pcib_acpi_deactivate_resource), #else DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), @@ -764,6 +772,31 @@ acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, return (pci_domain_release_bus(sc->ap_segment, child, rid, r)); return (bus_generic_release_resource(dev, child, type, rid, r)); } + +int +acpi_pcib_acpi_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct acpi_hpcib_softc *sc; + + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(sc->ap_segment, child, rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +int +acpi_pcib_acpi_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + struct acpi_hpcib_softc *sc; + + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(sc->ap_segment, child, rid, + r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} #endif #endif From nobody Thu Feb 27 18:58:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3gbY1tcDz59PtQ; Thu, 27 Feb 2025 18:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gbY1Fwvz3QV8; Thu, 27 Feb 2025 18:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f4+G13Xe9YAPGU1LlskTBsv5F4ErFOcQfjPCz3V16YU=; b=mFoRXFLhTFe+tkIwZxDgJmHZEFmu0n+6MDC/L0R05iNhq3D7ictOvkUCMORCTnGgL0f1BN 3fxYwiFNiPz7P22bBNxh5cVcfW0f44xEm0VP9eOzmDrGZlwZQHCcrNarIOb+dtn0ibFgIM vygiN/krlTO1DR/Q+oXpFgjmA1cUupEXCvgLIHWRuS9IwAsfrnrUHBUOKVd6NSNGNw0Ycm NAtz9k7nziOqJ4lV2RPxgK7zTS5PXrFA+hUyldzP92HEFatzEPDesck20DfjlNteNGKWyO 1/1Olq+m10sbfFt4q1SH89+X7buZdAVHJYe5rSWPZn6Ay+mUB8N7xvUgArDwwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682713; a=rsa-sha256; cv=none; b=MjJ11UUSwekX+KJJNOiXgSh4iaOTcU8SF2boBdW8PirDkjabZKwvAHgsx3mtf515mxv8ZM QFfMDPUEqZJx8I1Zm1V6j8QWw0pUoDMU3ZrtR+/0X10Q/tNRwktn2D3pw/diaZ+dkkLdht 8ujGZqHLz+E0pORhEWeFLUojBMFl4ctd3UxgjNsDoZ3TJXxsYrDPanGqcXiPd0BoHj6HDf FRJQRU9HrZb/WiJHG9aSYnYB/QQduoQZFbMwJIfQN3DI/14GlST2n9BO9Z22oH/ympALqy Qt6AJUSl1q+LqMQ2J2gHx/zJexcnXqLDiNNViWpWCd0dmEzbaVU2old4aQ1lfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f4+G13Xe9YAPGU1LlskTBsv5F4ErFOcQfjPCz3V16YU=; b=uX+UulHOMu7WEdpo3q1RNkqwZHpQ27dwAqLHjCJZAa3Hul0eYMSSatCd/PaBd/x7PyyjOY U/5/XC2rlvcza/DFRj+cVIBME/2ddRxEkZ1Q6l8dhY42q/YFLjp8Fnh9yTmZVCkelFbs7j I2sDz/lBdP/HfO0/v/TGH1rvFSNRjpUguoe4oim0Kwexda63sjFiKUN4KcEYUc4bv+g4vq eKR5QhYn4gcGWxO0WgtXrjC4EZgZoTbb8Y7m1unN71oCxfxBQqK6Yw+3IvSLviO7WUboE1 DVJUuvZUESfZ00mejK4LzkUI03UpVdjQe61q/fjODE9uPuDE1/RatbplR5Q1NA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3gbY0MTZzvgl; Thu, 27 Feb 2025 18:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIwWAC042743; Thu, 27 Feb 2025 18:58:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIwWsF042740; Thu, 27 Feb 2025 18:58:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:58:32 GMT Message-Id: <202502271858.51RIwWsF042740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a424624f2775 - stable/14 - .cirrus: Add manual amd64 and aarch64 jobs using GCC 14 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a424624f27758ab87f72ffd86018329681288ac7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a424624f27758ab87f72ffd86018329681288ac7 commit a424624f27758ab87f72ffd86018329681288ac7 Author: John Baldwin AuthorDate: 2025-01-03 15:44:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 18:53:56 +0000 .cirrus: Add manual amd64 and aarch64 jobs using GCC 14 Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48290 (cherry picked from commit 40ed89ffc32353bf50f832635ef767aeb432c0fd) --- .cirrus.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 2a1a8b6cbf3b..ae83c7d4cd9b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -95,6 +95,15 @@ task: TOOLCHAIN: amd64-gcc13 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s + - name: amd64-gcc14 World and kernel build and boot smoke test (manual) + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' + trigger_type: manual + env: + TARGET: amd64 + TARGET_ARCH: amd64 + TOOLCHAIN: amd64-gcc14 + TOOLCHAIN_PKG: ${TOOLCHAIN} + EXTRA_MAKE_FLAGS: -s - name: aarch64-gcc12 World and kernel build and boot smoke test (manual) only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual @@ -113,6 +122,15 @@ task: TOOLCHAIN: aarch64-gcc13 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s + - name: aarch64-gcc14 World and kernel build and boot smoke test (manual) + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' + trigger_type: manual + env: + TARGET: arm64 + TARGET_ARCH: aarch64 + TOOLCHAIN: aarch64-gcc14 + TOOLCHAIN_PKG: ${TOOLCHAIN} + EXTRA_MAKE_FLAGS: -s - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' && $CIRRUS_BRANCH =~ 'pull/.*' env: From nobody Thu Feb 27 14:16:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLP704Hz5qG25; Thu, 27 Feb 2025 14:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLP6Gflz3xJ4; Thu, 27 Feb 2025 14:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3gUgE+7Y6seLd2p/X3RhT+WdF08qwLGyPuvz8wlBwc4=; b=dRK/EHEw88MScUK8p2vEw6TbdwtLpvH9ERbLmJ1zC3PhTIH74s23VBIx7S026ONzx0BOUL xgZDbIHeVFxZObyZlS6nvYrm4zfdNlnZdZI5noLpUwPfqqxXUOxbZQsfuDEpkUlJeZcqB6 RlFeERrLki/E9g2paMqP6WWOthYp25S/mOrSky1sCU51IaGCsnYA81OhB7B69kxd427URU ALg17yyadvpIZKHD4o2ZwTLd6iGMKnj9z57tndEVUnL8+Al8l97Nb1ZA3RW46mZRX04rNr e0gpLh3kZjcrivcQ0ozqVvdCjmqHmGNc0bV4zhKOxW69EBXpb1nuTq2Rg4dYRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665805; a=rsa-sha256; cv=none; b=yfg/Yv0z2Hi4NuXHZWsVCxIvGJlRFRSrxmlUDLRHefRDCq1VI3zo/N7M7W/VdpDsHwNFdU yejKpS4CVGzyG+zdUyo/WpoXQTBf/QhZvlyPUqUFaVYE6IxzRFViE75iCdK4yTcjY6HvFe atJzdKvfJjQZ/HaEX6GlVo4MMIub6zt4EpzNMu+AU2UI0voL3mWPtYdShj3x3UdbvbvzS2 7SG/VX3InX31sOeZKW9yBm0laOL2EktWoah2FeoZzke789lU3w00HxbhTgm5/Liuqyq7/p iax6aFxNtRx42LFnFzx4GKmULNiD0L2UIAltCwVbXMJ5xX06AGlIWGT5ZRxVeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3gUgE+7Y6seLd2p/X3RhT+WdF08qwLGyPuvz8wlBwc4=; b=D18CvxGhnLwlPflQw120Jr+bk6rMxKlpgP5SoiPDqYT69K2akh2w6Ez7R/os9lc/Tc6vh8 egx2BJPcdl5X9EHrA+WDj5YEhRAsORXzAxX7D18bRGHJqgmG4dNn5nm/rrDGwdFYvK0Ax0 Md3v6lrSm4iX859dP7P3fjiy2ibqA0c+dE/6ITIHUCc15WtdVt4rd07UhxoNY3Sv8sPduu S/E1QZfsfRpy2jV9Qg1fKB/QUTmajiyNhvx4JhO7UUxJcIVDkEmWBaB2aStbYviurFvvSU UJ7a7bF4sx+e9NY/YtRyGUWbwCx94QNCMshqfPNyyms8UP4mSH6W4hFyqQfbQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLP5s3mzmbW; Thu, 27 Feb 2025 14:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGj8R016094; Thu, 27 Feb 2025 14:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGjtd016091; Thu, 27 Feb 2025 14:16:45 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:45 GMT Message-Id: <202502271416.51REGjtd016091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 672a0a76ed4a - stable/14 - simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 672a0a76ed4ab2fbcad7bc668b1f2dd1a8f09766 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=672a0a76ed4ab2fbcad7bc668b1f2dd1a8f09766 commit 672a0a76ed4ab2fbcad7bc668b1f2dd1a8f09766 Author: John Baldwin AuthorDate: 2024-01-23 17:38:25 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43442 (cherry picked from commit 3cf553288b968106e40882bb73b30da652614ba0) --- sys/dev/fdt/simplebus.c | 90 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 7 deletions(-) diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index db357b190d9e..273e77abd642 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -47,6 +47,19 @@ static int simplebus_probe(device_t dev); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int simplebus_adjust_resource(device_t bus, device_t child, + int type, struct resource *r, rman_res_t start, rman_res_t end); +static int simplebus_release_resource(device_t bus, device_t child, + int type, int rid, struct resource *r); +static int simplebus_activate_resource(device_t bus, + device_t child, int type, int rid, struct resource *r); +static int simplebus_deactivate_resource(device_t bus, + device_t child, int type, int rid, struct resource *r); +static int simplebus_map_resource(device_t bus, device_t child, + int type, struct resource *r, struct resource_map_request *args, + struct resource_map *map); +static int simplebus_unmap_resource(device_t bus, device_t child, + int type, struct resource *r, struct resource_map *map); static void simplebus_probe_nomatch(device_t bus, device_t child); static int simplebus_print_child(device_t bus, device_t child); static device_t simplebus_add_child(device_t dev, u_int order, @@ -84,10 +97,12 @@ static device_method_t simplebus_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, simplebus_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_release_resource, simplebus_release_resource), + DEVMETHOD(bus_activate_resource, simplebus_activate_resource), + DEVMETHOD(bus_deactivate_resource, simplebus_deactivate_resource), + DEVMETHOD(bus_adjust_resource, simplebus_adjust_resource), + DEVMETHOD(bus_map_resource, simplebus_map_resource), + DEVMETHOD(bus_unmap_resource, simplebus_unmap_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), @@ -433,6 +448,9 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, sc = device_get_softc(bus); + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + /* * Request for the default allocation with a given rid: use resource * list stored in the local device info. @@ -441,9 +459,6 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, if ((di = device_get_ivars(child)) == NULL) return (NULL); - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - rle = resource_list_find(&di->rl, type, *rid); if (rle == NULL) { if (bootverbose) @@ -481,6 +496,67 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, count, flags)); } +static int +simplebus_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_adjust_resource(bus, child, type, r, start, end)); +} + +static int +simplebus_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_release_resource(bus, child, type, rid, r)); +} + +static int +simplebus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_activate_resource(bus, child, type, rid, r)); +} + +static int +simplebus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_deactivate_resource(bus, child, type, rid, r)); +} + +static int +simplebus_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *args, + struct resource_map *map) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_map_resource(bus, child, type, r, args, map)); +} + +static int +simplebus_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_unmap_resource(bus, child, type, r, map)); +} + static int simplebus_print_res(struct simplebus_devinfo *di) { From nobody Thu Feb 27 14:17:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YMD52ttz5qG2P; Thu, 27 Feb 2025 14:17:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMD4cCvz3xK0; Thu, 27 Feb 2025 14:17:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJ7ta0+92bzUKcleG8yPLOrjskquxU+muF24B3pNXk4=; b=eo2pBRAssAe0WSe0yAfnPuCVLgBs/zhhOmfM4QyGg8XoZ4KxyyqB3elZUJB5eB00wdusS4 8lHy5MD+9SKGQGAQS0TrEv13KpKQgSaILP73RLzPrW4M3W5iN1ym8Q8DWf7yGXQv5lp3ZV raIIto0TRkewCQ2sWM+rSZPz6FdB9Fgh9ZGppAEjgZFLDni+bmiETbphzpmXjHeaTBWlDf oL8NO+a8tuDFTQvrLf5vobjT/fHXNJXRhSGNc0+iRplacvQiEaVXU/d74JChm+9PaU1JSR gEB/WXR8oKtTv6yMWDsNfVwVKgIoD2oDBm48e4PMMvaeHal/xGSk+4weP9EWew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665848; a=rsa-sha256; cv=none; b=l67tdmb/EqBhfanoH/rRFFUdFsc3C4CW8Fggva9foHVirvkoUvwebICxlH2n5AP8Xdatq9 7e8bkrlRI4xrH7l6qc+X61Vc07icS858tlqD+Q48PHy1mOnHijWW9DZQ0iLo3Anw1kQTe9 AEsiYsYcEYfDZCC+GUJq1K0LCDf2TUrz4gOPS4OM4R6VB4Y+PWmTdmR9nV/JsltIGMH4es SlOHqgzXPGiTVO6WM00RtizQrRMq+NjowfEbniBvWYCHlyg0m0d+XtLlcdLOnh2DF0k0KH JoW7BYM/Y1e9r0TJHz719jRBa9VruHgy2R6PXdQarp6fJJZWfGXhdEhJBRH9Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJ7ta0+92bzUKcleG8yPLOrjskquxU+muF24B3pNXk4=; b=oeO7MuKtx2J9gURrKddqxlGCsguS6oj6Gu6ZM+iMju/MAvjyUROerFLTjXEWnfxmazviQ2 iOHjvUQ4ncf3EFvYdpTZMCL4Fqh1MITq8Djs/2ey4ur6Jscz2g9ykZrGA2b6iSmOBlRsv6 Q04JESEmZkttOOoQPNehU/ROLNo/GYYkGbAEteL1aOQSN6qwSWSvWU98iQQxtdxodMmjzr iq+UQeaatRNcM26XRBE4sI+K3JubVrOwB/5UvIZDD3ZoF6LGRwymvHCEOjxb97ieqzyEBP BsEfcWvJQUf/LSQDegS8mbMQWejqo7JDHxyzObbywenzykqV9jRDnMyWh9J2+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YMD45GxzmQJ; Thu, 27 Feb 2025 14:17:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHSmg017433; Thu, 27 Feb 2025 14:17:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHSl1017430; Thu, 27 Feb 2025 14:17:28 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:28 GMT Message-Id: <202502271417.51REHSl1017430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1c3996e87f09 - stable/14 - acpi/pci/vmd: Fix a nit with nested resource mapping requests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c3996e87f09a5e67ebbd4e7e73a38848127c99e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1c3996e87f09a5e67ebbd4e7e73a38848127c99e commit 1c3996e87f09a5e67ebbd4e7e73a38848127c99e Author: John Baldwin AuthorDate: 2024-06-04 23:50:56 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 acpi/pci/vmd: Fix a nit with nested resource mapping requests Some bus drivers use rmans to suballocate resources to child devices. When the driver for a child device requests a mapping for a suballocated resource, the bus driver translates this into a mapping request for a suitable subrange of the original resource the bus driver allocated from its parent. This nested mapping request should look like any other resource mapping request being made by the bus device (i.e. as if the bus device had called bus_map_resource() or bus_alloc_resource() with RF_ACTIVE). I had slightly flubbed this last bit though since the direct use of bus_generic_map/unmap_resource passed up the original child device (second argument to the underlying kobj interface). While this is currently harmless, it is not strictly correct as the resource being mapped is owned by the bus device, not the child and can break for other bus drivers in the future. Instead, use bus_map/unmap_resource for the nested request where the requesting device is now the bus device that owns the parent resource. Reviewed by: imp Fixes: 0e1246e33461 acpi: Cleanup handling of suballocated resources Fixes: b377ff8110e3 pcib: Refine handling of resources allocated from bridge windows Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Fixes: d714e73f7895 vmd: Use bus_generic_rman_* for PCI bus and memory resources Differential Revision: https://reviews.freebsd.org/D45433 (cherry picked from commit 98056127ddfa36720bcf46edc09843c867784bcb) --- sys/dev/acpica/acpi.c | 17 ++++++++++------- sys/dev/pci/pci_host_generic.c | 17 ++++++++--------- sys/dev/pci/pci_pci.c | 16 +++++++++------- sys/dev/vmd/vmd.c | 9 +++++---- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index de6520331644..2ba2b2c8c642 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1671,19 +1671,22 @@ acpi_map_resource(device_t bus, device_t child, int type, struct resource *r, args.offset = start - rman_get_start(sysres); args.length = length; - return (bus_generic_map_resource(bus, child, type, sysres, &args, map)); + return (bus_map_resource(bus, sysres, &args, map)); } static int acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r, struct resource_map *map) { - if (acpi_is_resource_managed(bus, r)) { - r = acpi_managed_resource(bus, type, r); - if (r == NULL) - return (ENOENT); - } - return (bus_generic_unmap_resource(bus, child, type, r, map)); + struct resource *sysres; + + if (!acpi_is_resource_managed(bus, r)) + return (bus_generic_unmap_resource(bus, child, type, r, map)); + + sysres = acpi_managed_resource(bus, type, r); + if (sysres == NULL) + return (ENOENT); + return (bus_unmap_resource(bus, sysres, map)); } /* Allocate an IO port or memory resource, given its GAS. */ diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 4b7a1cb8ab39..4fd8c3b42250 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -654,8 +654,7 @@ generic_pcie_map_resource(device_t dev, device_t child, int type, args.offset = start - range->pci_base; args.length = length; - return (bus_generic_map_resource(dev, child, type, range->res, &args, - map)); + return (bus_map_resource(dev, range->res, &args, map)); } static int @@ -671,16 +670,16 @@ generic_pcie_unmap_resource(device_t dev, device_t child, int type, #endif case SYS_RES_IOPORT: case SYS_RES_MEMORY: - range = generic_pcie_containing_range(dev, type, - rman_get_start(r), rman_get_end(r)); - if (range == NULL || range->res == NULL) - return (ENOENT); - r = range->res; break; default: - break; + return (bus_generic_unmap_resource(dev, child, type, r, argsp, map)); } - return (bus_generic_unmap_resource(dev, child, type, r, map)); + + range = generic_pcie_containing_range(dev, type, rman_get_start(r), + rman_get_end(r)); + if (range == NULL || range->res == NULL) + return (ENOENT); + return (bus_unmap_resource(dev, range->res, map)); } static bus_dma_tag_t diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index da09a917b9bc..06e8c2bc8433 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -2553,7 +2553,7 @@ pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, args.offset = start - rman_get_start(pres); args.length = length; - return (bus_generic_map_resource(dev, child, type, pres, &args, map)); + return (bus_map_resource(dev, pres, &args, map)); } static int @@ -2562,14 +2562,16 @@ pcib_unmap_resource(device_t dev, device_t child, int type, struct resource *r, { struct pcib_softc *sc = device_get_softc(dev); struct pcib_window *w; + struct resource *pres; w = pcib_get_resource_window(sc, r); - if (w != NULL) { - r = pcib_find_parent_resource(w, r); - if (r == NULL) - return (ENOENT); - } - return (bus_generic_unmap_resource(dev, child, type, r, map)); + if (w == NULL) + return (bus_generic_unmap_resource(dev, child, type, r, map)); + + pres = pcib_find_parent_resource(w, r); + if (pres == NULL) + return (ENOENT); + return (bus_unmap_resource(dev, pres, map)); } #else /* diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index d513d3ea5a5a..b5a77cd5ad4e 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -552,7 +552,7 @@ vmd_map_resource(device_t dev, device_t child, int type, struct resource *r, args.offset = start - rman_get_start(pres); args.length = length; - return (bus_generic_map_resource(dev, child, type, pres, &args, map)); + return (bus_map_resource(dev, pres, &args, map)); } static int @@ -560,11 +560,12 @@ vmd_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map *map) { struct vmd_softc *sc = device_get_softc(dev); + struct resource *pres; - r = vmd_find_parent_resource(sc, r); - if (r == NULL) + pres = vmd_find_parent_resource(sc, r); + if (pres == NULL) return (ENOENT); - return (bus_generic_unmap_resource(dev, child, type, r, map)); + return (bus_unmap_resource(dev, pres, map)); } static int From nobody Thu Feb 27 14:16:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YL94rK7z5qG9f; Thu, 27 Feb 2025 14:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL949Zkz3wx4; Thu, 27 Feb 2025 14:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kcypdrBxlprMdll+pfzwIlrM3y/Jv6EI2PB7JCScsLY=; b=c9YML9kF+3PwSIZNglzX2kGm1el0mF7+M6ongjLm7RI9NBv14oLT0sIT1c4NYyjg2UlFZZ VPlpkXq3qNyfipriiaKeoLqcZMswW1WEhJfARCk4tErS5X3rveqev/LJMcyqXVV4zt6tiC T6cQupxSkb1EZ98aJe8AoD0Gv0rHcRjbe/EAMxWTSvQEeEI0KzEwT3NKk3Yy5qD9VhMNil 1ncBlNYsmXLo8HyuH+HSUO63cMkFWHM/NmWCHI/i8Bodf2P1eSm3jgdsVS6WpAkrtjJNQI fB8Z5oJZolN6UglcT8dYFqG88K8MK3j8a/do2/DEQqp/wmkAwX+2eZ9U8FHA9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665793; a=rsa-sha256; cv=none; b=ZjyxgOaWhkGLuO97LpE2mxV69ZsvUmFWWMUP2Cdg7Db577f+k5oxMo9NSEXYpXPPgXl1+A lUn3jFrDzbq/QRZnT+m3+VO19plm8zh9SpRj8aamwNEbySJ1FndfnhDxaoAk2f/WCO7IE/ NyxSvbE8jcOh4yxKNBOvSfxYreeFvUxHfkclfOmk1Jch2h2ntg7sa3e00G6vJ7z4d3JITO 1f9ls6nkzi7dJVkgd2uy2N2YEA0WENJzPgeMR3KS8Vasyc50l2UQQrXaSX6v0FUAS/4kGO TB+BjnpW4656MPnt2hUf/+1mWcC9JJcrhhQhsX2E5bka+USvtZMHv35bb4eWag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kcypdrBxlprMdll+pfzwIlrM3y/Jv6EI2PB7JCScsLY=; b=JbVqzOZNxaladVyD1k+kAC/Xl4m5XNwz9weyIq4N/YsibsMDh0Ic6Lulz31WR31XA1TAEF p9iFus197uIy/uDZyO8Y5vgiXEZzNAGglvYFg7SYvP72hvlEkDiOPmkxJ6qhK9cmxLc8ax vwPgIwgYInPHPhaviOAlCxV9KEP2kcDrekREUzzJPPFQQRKjNas0jKgvmChBRfo6Nrimd5 kiwLqPckR5L37ZiSqD8JF94iZ0eSwpMmIZzdVIeEGkes1a5w+kBG9j4f0i/FkC9LbfetnI WjDqDVTHdqExe623KNa/Bq//boN5qadMIhqLYNXic98QrR8g5OxwL8kaPuWS1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YL93jXszm7J; Thu, 27 Feb 2025 14:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGX40015692; Thu, 27 Feb 2025 14:16:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGXWi015689; Thu, 27 Feb 2025 14:16:33 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:33 GMT Message-Id: <202502271416.51REGXWi015689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f645d34fbbce - stable/14 - powerpc ps3bus: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f645d34fbbce7b106319a2c4b10cb3ff21a5bf9c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f645d34fbbce7b106319a2c4b10cb3ff21a5bf9c commit f645d34fbbce7b106319a2c4b10cb3ff21a5bf9c Author: John Baldwin AuthorDate: 2024-01-23 17:36:12 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc ps3bus: Use bus_generic_rman_* - Split out part of ps3bus_activate_resource into a ps3bus_map_resource method. - Implement ps3bus_unmap_resource via pmap_unmapdev. - Use bus_generic_rman_* to add bus_adjust_resource, bus_deactivate_resource, and bus_release_resource methods. Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43432 (cherry picked from commit 3dd55df98282293c41bb0d98fa54312a9cf2aba5) --- sys/powerpc/ps3/ps3bus.c | 130 +++++++++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 56 deletions(-) diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c index 90374c168cf3..81a5efe01fed 100644 --- a/sys/powerpc/ps3/ps3bus.c +++ b/sys/powerpc/ps3/ps3bus.c @@ -58,13 +58,18 @@ static int ps3bus_attach(device_t); static int ps3bus_print_child(device_t dev, device_t child); static int ps3bus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result); +static struct rman *ps3bus_get_rman(device_t bus, int type, u_int flags); static struct resource *ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); -static int ps3bus_activate_resource(device_t bus, device_t child, int type, - int rid, struct resource *res); +static int ps3bus_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map); +static int ps3bus_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map); static bus_dma_tag_t ps3bus_get_dma_tag(device_t dev, device_t child); -static int ps3_iommu_map(device_t dev, bus_dma_segment_t *segs, int *nsegs, bus_addr_t min, bus_addr_t max, bus_size_t alignment, +static int ps3_iommu_map(device_t dev, bus_dma_segment_t *segs, int *nsegs, + bus_addr_t min, bus_addr_t max, bus_size_t alignment, bus_addr_t boundary, void *cookie); static int ps3_iommu_unmap(device_t dev, bus_dma_segment_t *segs, int nsegs, void *cookie); @@ -110,8 +115,14 @@ static device_method_t ps3bus_methods[] = { DEVMETHOD(bus_get_dma_tag, ps3bus_get_dma_tag), DEVMETHOD(bus_print_child, ps3bus_print_child), DEVMETHOD(bus_read_ivar, ps3bus_read_ivar), + DEVMETHOD(bus_get_rman, ps3bus_get_rman), DEVMETHOD(bus_alloc_resource, ps3bus_alloc_resource), - DEVMETHOD(bus_activate_resource, ps3bus_activate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), + DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), + DEVMETHOD(bus_map_resource, ps3bus_map_resource), + DEVMETHOD(bus_unmap_resource, ps3bus_unmap_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -520,22 +531,31 @@ ps3bus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) return (0); } +static struct rman * +ps3bus_get_rman(device_t bus, int type, u_int flags) +{ + struct ps3bus_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + return (&sc->sc_mem_rman); + case SYS_RES_IRQ: + return (&sc->sc_intr_rman); + default: + return (NULL); + } +} + static struct resource * ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct ps3bus_devinfo *dinfo; - struct ps3bus_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; rman_res_t adjstart, adjend, adjcount; struct resource_list_entry *rle; - sc = device_get_softc(bus); dinfo = device_get_ivars(child); - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; switch (type) { case SYS_RES_MEMORY: @@ -562,13 +582,10 @@ ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, adjend = end; adjcount = adjend - adjstart; - - rm = &sc->sc_mem_rman; break; case SYS_RES_IRQ: rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, *rid); - rm = &sc->sc_intr_rman; adjstart = rle->start; adjcount = ulmax(count, rle->count); adjend = ulmax(rle->end, rle->start + adjcount - 1); @@ -579,58 +596,59 @@ ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, return (NULL); } - rv = rman_reserve_resource(rm, adjstart, adjend, adjcount, flags, - child); - if (rv == NULL) { - device_printf(bus, - "failed to reserve resource %#lx - %#lx (%#lx)" - " for %s\n", adjstart, adjend, adjcount, - device_get_nameunit(child)); - return (NULL); - } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); + return (bus_generic_rman_alloc_resource(bus, child, type, rid, adjstart, + adjend, adjcount, flags)); } static int -ps3bus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +ps3bus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) { - void *p; + struct resource_map_request args; + rman_res_t length, start; + int error; - if (type == SYS_RES_IRQ) - return (bus_activate_resource(bus, type, rid, res)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - if (type == SYS_RES_MEMORY) { - vm_offset_t start; + /* Mappings are only supported on memory resources. */ + switch (type) { + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } - start = (vm_offset_t) rman_get_start(res); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); - if (bootverbose) - printf("ps3 mapdev: start %zx, len %ld\n", start, - rman_get_size(res)); + if (bootverbose) + printf("ps3 mapdev: start %jx, len %jd\n", start, length); - p = pmap_mapdev(start, (vm_size_t) rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_be_tag); - rman_set_bushandle(res, (rman_res_t)p); - } + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_be_tag; + map->r_bushandle = (vm_offset_t)map->r_vaddr; + map->r_size = length; + return (0); +} + +static int +ps3bus_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) +{ - return (rman_activate_resource(res)); + switch (type) { + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + return (0); + default: + return (EINVAL); + } } static bus_dma_tag_t From nobody Thu Feb 27 14:17:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM24hcFz5qG9t; Thu, 27 Feb 2025 14:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM24Ht2z3xBP; Thu, 27 Feb 2025 14:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzL2x8rGvCCpI1PTazPvqS5qt/qs2GDw1050wu1xiQA=; b=iWzGjwbMsfSUck4uy9bPUH3CmVKijlUY0t+Sg2dvE+IMsbIqRs7GHchQPFPczX2wPPsqsn HgG/wUEa2mT+utd892F8tHfFy7KG315dDAoQW77AnXujuyPBFLMH+GVBri1257Ja98mZ09 nAmstG2DkvKwsXbSqYuQyWqCp+ZAOsbif5I+UX34XYHRUpAbNeFx8WtdcJeBSIAGTY+lPl Ss43db3S2Q3XhiOlNo0yG/cSqTFYkPTsAY4u+LVXrDwzukgZw+B7vn08G9iGF7Pj8yc35y Mfz1csdMJwFDWuWZCkpjuVBA2sRw3sOkN2TiTJTY7lO/uYRpP4LWxN2eWFQxOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665838; a=rsa-sha256; cv=none; b=O9nDI45dFa06GUPD5+6SfwAo92k3lOZPGRict6yYk4+hORM4rVg9aaExQ9eoTM37pretPp TuRCzxQUIVKW3OvgbEZU7BiKxYz55iqAYEiG7rSRcndGYEEjuPmZp6ApgIqNooWuLioizj onKlMxsWcVOqrJjc647oS90dRV9SaiL3eeJKmbBxJvNPjb1C2xNk1iFQk6VfB/5qNj2d4/ Puj82+dCY1MXIWIpnxDpcJYQwcXNo/wRTMbs37HoD3wewXwkUiuUbDZy8aYeGXvpabk+/r yYNVeOTeSRoPA10l1omrAr8fW/EfO9m/rSVptCDJ5FIYLVRvFzwthMsk8w3/EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzL2x8rGvCCpI1PTazPvqS5qt/qs2GDw1050wu1xiQA=; b=bhr+TEQJM1rFGqWzGvlXlagqhfhdDeYAWs0WGUwNq8xRuR2w6f0F5yht1xArEzjYl3uoNk t9h7/wvMnHSYuvudl65zNDJyW5gG899vfHdO8pWp0kq2RVitCvO7TMUpFYY2mLghhf8SmN uugxAuHLyyeIeytbc6TdPbRbKYilwZSQAERP8Exicp6+KzV/pkgKN1Ld3LPnqg/a4BhnD6 wPr9W+f7rPAFREn/3djP89YtmwiR3UmWPEJx0p33CR779jaL336tb5ejLR8p/Nhj6eYPRo A5X2JKSEZFPVx5OqlQ/FfA8NpjNKutaENNrD3mRIBV2Vk/o3wAaQzn4gZYXjSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM23sPNzmdy; Thu, 27 Feb 2025 14:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHIuM017119; Thu, 27 Feb 2025 14:17:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHI9s017115; Thu, 27 Feb 2025 14:17:18 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:18 GMT Message-Id: <202502271417.51REHI9s017115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a69089343057 - stable/14 - sys: Set the type of allocated bus resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a69089343057c837c9fd6f7ae6e67a73c2f91983 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a69089343057c837c9fd6f7ae6e67a73c2f91983 commit a69089343057c837c9fd6f7ae6e67a73c2f91983 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 sys: Set the type of allocated bus resources Use rman_set_type to set the type of allocated resources everywhere rman_set_rid is currently called. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44123 (cherry picked from commit 1b9bcffff39a817b77401d1b975f374781adfaf8) --- sys/dev/bhnd/bhndb/bhndb.c | 1 + sys/dev/dpaa/fman.c | 1 + sys/dev/pci/pci_iov.c | 1 + sys/dev/pci/pci_pci.c | 2 ++ sys/dev/pci/pci_subr.c | 1 + sys/kern/subr_bus.c | 1 + 6 files changed, 7 insertions(+) diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c index 4e631f85b3b6..978ad9c3e62b 100644 --- a/sys/dev/bhnd/bhndb/bhndb.c +++ b/sys/dev/bhnd/bhndb/bhndb.c @@ -1005,6 +1005,7 @@ bhndb_alloc_resource(device_t dev, device_t child, int type, return (NULL); rman_set_rid(rv, *rid); + rman_set_type(rv, type); /* Activate */ if (flags & RF_ACTIVE) { diff --git a/sys/dev/dpaa/fman.c b/sys/dev/dpaa/fman.c index 7b82a0fbc1fd..f14ca45e1fc1 100644 --- a/sys/dev/dpaa/fman.c +++ b/sys/dev/dpaa/fman.c @@ -192,6 +192,7 @@ fman_alloc_resource(device_t bus, device_t child, int type, int *rid, if (res == NULL) return (NULL); rman_set_rid(res, *rid); + rman_set_type(res, type); if ((flags & RF_ACTIVE) != 0 && bus_activate_resource( child, type, *rid, res) != 0) { rman_release_resource(res); diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 60325e8cd491..ee1387966b00 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -1050,6 +1050,7 @@ pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, } rman_set_rid(res, *rid); + rman_set_type(res, SYS_RES_MEMORY); if (flags & RF_ACTIVE) { error = bus_activate_resource(child, SYS_RES_MEMORY, *rid, res); diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index cda1597ac76e..68eab2a6633b 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -727,6 +727,7 @@ pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid, rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); rman_set_rid(res, *rid); + rman_set_type(res, PCI_RES_BUS); return (res); } @@ -1930,6 +1931,7 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w, w->name, rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); rman_set_rid(res, *rid); + rman_set_type(res, type); if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, res) != 0) { diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c index d0f6c9500b17..e2583a75e303 100644 --- a/sys/dev/pci/pci_subr.c +++ b/sys/dev/pci/pci_subr.c @@ -344,6 +344,7 @@ pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start, return (NULL); rman_set_rid(res, *rid); + rman_set_type(res, PCI_RES_BUS); return (res); } diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index bd54977cc6f1..ffad54c34925 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4305,6 +4305,7 @@ bus_generic_rman_alloc_resource(device_t dev, device_t child, int type, if (r == NULL) return (NULL); rman_set_rid(r, *rid); + rman_set_type(r, type); if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, r) != 0) { From nobody Thu Feb 27 21:04:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3kNl52FBz59VvH; Thu, 27 Feb 2025 21:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNl4W96z43kB; Thu, 27 Feb 2025 21:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LddyQsiXfCsAbcVSpJwSY78u4nURqawyoEcam+Qwg+Y=; b=u+J7pUoAZHwce6IU0CajTIs68pmaZlwDgaahdyr5/FhrktC6sqfccV0dX9p+TPQ2eVrqit 5PCOXmZr8YO1Zv/7OpwD1SSIuHywvSMu5Ue62SmIb+KtgBRsQj7LsGnOPmaDOsPkRqnZbV wXgp7dinKQ7ZWYVYljucylqu1P/JhG7/rGfH23QPlE1moxgW5UyZSU8ZrukYbGHUSJhVpb z7+/vz8O3E2AoAsIiTYXiIGjTkOexaDnPTCWCxCVQe8KcCJTTyOq/D11OmB/4Hca0SV6Jr SJgMCsYGPggrDq8fDG5JJq2fI6eakjAKIq+uvLwAbPh0ihV+n1KPvJ/p9SZobg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690263; a=rsa-sha256; cv=none; b=AvizbR5R5VNJwvDCq+wrDZF7nPZQTkIBxomXLDEPkZmsltNSVbb6BvaSeMNiVoxT+CJ1n7 NqC6HLSB2Ywt0dR/N7FoPSLbFEzIMq4x5ZZ/FCm+H7KPUZ0XbyHcWU+wJ9JAUtk8WL+Ghs p7A8K3zBVQCBDI0Rz2T6uLzr501KfqherdD74e/EpWGurXSlz7eWtIKlfTDI0biQtRkYh9 mVd/7rUjmkMOkqPi+xK85niaiFOjSp71+Mu2w69xzcoRJq/ciC11gOSPOKl7pMs3Av1I2+ BWyp/F5U+MSKWA1a2CbgqEqO90DMot9WmxOCN1pqdrQ5LF9mMuSTDzAtKpwUEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LddyQsiXfCsAbcVSpJwSY78u4nURqawyoEcam+Qwg+Y=; b=MF3lpj2O3cyRrgc476vEZwJoTn3x1SPhAzWGN+p8eVUi9fwoI8jalr9JJNvgJu8MdYzMRD RUrlTNw1bThzNssZoeBbL3bczuMItUKp9Zouvh7YIaUBVmZSCtBU5nXjC+ZZsh/pV3QgqM WqHLpjmhpiS32kELcJ3QULnoIBe8Aj2i4/4xSi9ay7SsTlfOKZYHNTQ2HeUpcW6ZQHL/3/ WTB94ck1ouxh0o/Sv541SU4KAhVangB45pvGSuqAAweqiLanflraRWQj4HO7iBpY+eIV/N PTnCSPUqBHqIDVpFo5/miTXPNCEvFWFPHvTr3RT3cMB1jjyQe1NO6RQ3LqwjYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3kNl3nChz102M; Thu, 27 Feb 2025 21:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4NPf085547; Thu, 27 Feb 2025 21:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Nrv085544; Thu, 27 Feb 2025 21:04:23 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:23 GMT Message-Id: <202502272104.51RL4Nrv085544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 63c197298957 - stable/14 - LinuxKPI: 802.11: compile in VHT compat code by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 63c197298957c89fe3e7bd0c3392da74ed72a24b Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=63c197298957c89fe3e7bd0c3392da74ed72a24b commit 63c197298957c89fe3e7bd0c3392da74ed72a24b Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 02:27:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 LinuxKPI: 802.11: compile in VHT compat code by default Compile in the VHT compat code by default even though no one will make use of it yet. Sponsored by: The FreeBSD Foundation Tested with: iwlwifi AX210 (NOHT, HT20, HT40, VHT20, VHT40, VHT80) (cherry picked from commit 2c44f1ff6935e93f7774e526f2f1ab0a2812eab5) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b684bd76bacf..88bbc9fa52a7 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -80,7 +80,7 @@ #define LKPI_80211_WME #define LKPI_80211_HW_CRYPTO #define LKPI_80211_HT -/* #define LKPI_80211_VHT */ +#define LKPI_80211_VHT #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) #define LKPI_80211_HT From nobody Thu Feb 27 19:45:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3hf64g6nz59Ryq; Thu, 27 Feb 2025 19:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3hf63p2Dz3dcx; Thu, 27 Feb 2025 19:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740685550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjmf0EcewgID0csO6vdnBMABE8rDjcL8GN8OipRNq8Y=; b=GPde1yRctB5LeXaL/nsUolxCcSbjYirCG1e5z5esVi20cqk5hKtOCQXVwNOqwWtV36RRAY sI//bfc6h4LpbbFPj0pjflrM6DgY2G0wTm/YKl7LTnX99wIvIDlx/LhEg2SPugLvIdybcY kUNxmJEPfCEze2t9p9YSI0DP0gCBLEFRKu3734XxG4yukopewp5EfJhd5hO5GLtvpyLPzq nlnyFQVSRb1Ys+rmFGPp0t6VDPh5tL/YdvABXxopF/qUL1H5ht3GmJzWDl8xDWL9qyyUyN OwS+YB6ia1Z7wcxcQImqlDMqkmGscDIg7EesSrDgbrHRfZs/6+zayZZcVJsqPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740685550; a=rsa-sha256; cv=none; b=va48OKF2Mt9ZJz3W4GkrF3Wonscj1ikHS9TRqsOqRdc9Yw2uJwLjPVzI+eyqxYEdKvOPBD WA9IOQLnDjXQgNBXEZOn7T9LHsFqylCMI7ldY7sZkp+dLG7U4K7U7R2HKwxz7/dnT2LvPA YqMg2vCdJWERhj1vQS0blqhLW/LsBkWott6f4MQ++qz4BAaiCkBJ5luy9gYGaUrjg4Z03W dAyObHzuX8p6CBS3+unevGI+0eZ4n2qFTPLGXJGogPNfTI4rA+tR5CK5JAecvmT1LYENf/ +poVZuPvanJAC3AixkPDY2322bPsosA03feEMEafCmmUOe794oQtyyVKBSoStA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740685550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjmf0EcewgID0csO6vdnBMABE8rDjcL8GN8OipRNq8Y=; b=rqKvkd2PVjW+1AvJKGQ0PGPDk573uAMkQ1PMK7IV/GTY//UHcbNV+PNNYmPUbhk0K36Gj5 ZWZ62J0Cc3SWg8tJvlbYZX4jD2GQYpZHsL14HihamdJccxM90qqHGkxF1PPoaE07rJ8+fw R0Ua20d1KwPHLEzGKzeL+V/8wFVrt3cRRmZ02ml16qXQae9xDQvNpviSSJ1SlKqzsGWbwW qxdBM7CuK8PXCyHD1aHy+o9WdPR/qqTTd6JDhDKuSWjK1jN3ZGjCsvI/z4dDaXGAQkxJ/g zeYMK8wPd01Mss4qV9w22Y310ZFl20Q9f7+ZJZiWLuvYAqb+u3TDb4BQibX6iA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3hf62y4tzvlw; Thu, 27 Feb 2025 19:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RJjo1t035058; Thu, 27 Feb 2025 19:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RJjoG9035055; Thu, 27 Feb 2025 19:45:50 GMT (envelope-from git) Date: Thu, 27 Feb 2025 19:45:50 GMT Message-Id: <202502271945.51RJjoG9035055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f183965bb8f5 - stable/14 - pkgbase: fix inclusion of tests in ssh, bsnmp, clibs-dev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f183965bb8f5cf68edbd60a7c39e20ad211d6bd5 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f183965bb8f5cf68edbd60a7c39e20ad211d6bd5 commit f183965bb8f5cf68edbd60a7c39e20ad211d6bd5 Author: Isaac Freund AuthorDate: 2024-12-23 21:54:29 +0000 Commit: Ed Maste CommitDate: 2025-02-27 19:45:40 +0000 pkgbase: fix inclusion of tests in ssh, bsnmp, clibs-dev Currently, files that belong in the tests package are included in the ssh, bsnmp, and clibs-dev packages: ssh.plist 24:@dir(root,wheel,0755,) /usr/tests/secure/libexec 25:@(root,wheel,0444,) /usr/tests/secure/libexec/Kyuafile bsnmp.plist 82:@dir(root,wheel,0755,) /usr/tests/lib/libbsnmp 83:@(root,wheel,0444,) /usr/tests/lib/libbsnmp/Kyuafile 84:@(root,wheel,0555,) /usr/tests/lib/libbsnmp/bsnmpd_test clibs-dev.plist 2518:@dir(root,wheel,0755,) /usr/tests/lib/csu 2519:@(root,wheel,0444,) /usr/tests/lib/csu/Kyuafile This is caused by the PACKAGE=foo assignment in foo/Makefile.inc which overrides the default PACKAGE?=tests in bsd.test.mk. To fix this, instead use PACKAGE?=foo in foo/Makefile.inc and set PACKAGE=tests in foo/tests/Makefile. PR: 249144 Reviewed by: bapt, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47025 (cherry picked from commit 3a56015a2f5d630910177fa79a522bb95511ccf7) --- lib/csu/Makefile.inc | 2 +- lib/csu/tests/Makefile | 1 + lib/libbsnmp/Makefile.inc | 2 +- lib/libbsnmp/tests/Makefile | 2 ++ secure/libexec/Makefile.inc | 2 +- secure/libexec/tests/Makefile | 1 + 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc index 1509a1ece2c3..1c9d3853b0d4 100644 --- a/lib/csu/Makefile.inc +++ b/lib/csu/Makefile.inc @@ -1,4 +1,4 @@ -PACKAGE= clibs-dev +PACKAGE?= clibs-dev NO_WMISSING_VARIABLE_DECLARATIONS= # Can't instrument these files since that breaks non-sanitized programs. diff --git a/lib/csu/tests/Makefile b/lib/csu/tests/Makefile index 3f95193420ea..c9a0e6eff5da 100644 --- a/lib/csu/tests/Makefile +++ b/lib/csu/tests/Makefile @@ -1,3 +1,4 @@ +PACKAGE= tests SUBDIR= dso TESTS_SUBDIRS= dynamic diff --git a/lib/libbsnmp/Makefile.inc b/lib/libbsnmp/Makefile.inc index 80478f392410..d9ae6f7deb8c 100644 --- a/lib/libbsnmp/Makefile.inc +++ b/lib/libbsnmp/Makefile.inc @@ -1,5 +1,5 @@ INCSDIR= ${INCLUDEDIR}/bsnmp -PACKAGE= bsnmp +PACKAGE?= bsnmp .include "../Makefile.inc" diff --git a/lib/libbsnmp/tests/Makefile b/lib/libbsnmp/tests/Makefile index 529622104449..ca8bcda8401f 100644 --- a/lib/libbsnmp/tests/Makefile +++ b/lib/libbsnmp/tests/Makefile @@ -1,6 +1,8 @@ .include +PACKAGE= tests + ATF_TESTS_C+= bsnmpd_test SRCS.bsmpd_test= bsnmpd_test.c diff --git a/secure/libexec/Makefile.inc b/secure/libexec/Makefile.inc index e5beeed87cac..6cb7a9096b7b 100644 --- a/secure/libexec/Makefile.inc +++ b/secure/libexec/Makefile.inc @@ -1,5 +1,5 @@ BINDIR?= /usr/libexec -PACKAGE= ssh +PACKAGE?= ssh .include "../Makefile.inc" diff --git a/secure/libexec/tests/Makefile b/secure/libexec/tests/Makefile index b8996030aafc..b8e8a3828b9c 100644 --- a/secure/libexec/tests/Makefile +++ b/secure/libexec/tests/Makefile @@ -1,5 +1,6 @@ .PATH: ${SRCTOP}/tests KYUAFILE= yes +PACKAGE= tests .include From nobody Thu Feb 27 18:58:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3gbZ54PNz59PxC; Thu, 27 Feb 2025 18:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gbZ4Gdhz3QZC; Thu, 27 Feb 2025 18:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XwXP5imPNbbCRNZIsBE01D0z8xYblnX4q2bT862EG3w=; b=FJm5bkbA9P5s9U6sc/5SymX4XERwvwG7opkxWYTGakEkO1JvlOOiZNkvM9DmF15RMkxaAW fq0f58qL1pUmaghn7QfcgcNbZSgYT2RmEV4ag44RdCaQ3FNY929NM2RN9IvP1muQk8doXe Ma8dpmwcA1uBF9UG9eu3wg6UrYWyPAdmyXUmiaSL70ZVn66oQEcut8DkTlqhVXk0/nTwg7 tNOLzsPLCJrFFQeRGLDNhY8ZCtKI+qKtAyRid3Ra4g7uj42YpJYa5LZjFNOrb2IRAfzBaV pih1oo9e3hEdh5uwo9vrkSEzfUWgcFpk+kIhf/xb+bXWDHpvYvm49WoGAH/lyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682714; a=rsa-sha256; cv=none; b=PQPmmmM1rlEEUvYRjlrkjcvHnH8bgNUEdJ+3e5ROau9++/XBa+azCFXA1BwhYSJcx+Fh82 MEyAjEZN3TTm9zDWLc2aAsYWNcVZuhAkQGuU/C1ts3q3F+n9dm1Kxgzw9wHdYG/NUe6qEX BzXAUEYKgA3lYgnWoLgw8J/+H/+zcUqWMnnzX7YBAhNex0+LoAhLWSY7vBqwyYF+3qOx4q 5Edmq/j9VZBwk/IGMiRoOPRjA3eoTifQBtUkLSbfwCpDhBCEAswy1UDnsQy7zz+bSZjQgc Pxq/4RGI3xCStBUonIOCccysHr7CCqObp85dTvBvzW6OeDnHHYBln894Hi2J1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XwXP5imPNbbCRNZIsBE01D0z8xYblnX4q2bT862EG3w=; b=vPgkUDM4pq9TY7vkBF8o5LoeTzlnSE0h7WWIg8dsUdAJ148qpOZ49bbnfPyZbY6+MnGgpZ ObmTvK4WCF4N8xT2TPElr0DAK3DCnM5XzTx3J3AjCgN9mw7qth2tlqU8LSUmCAEVljByx4 kKr8ztLt2+i+hi90AK8iSrawaQlsxoM2QLaolfmjkEIxrGKbmu7Zt/N49zSGpfHOX9vlqi 55riVlup/wStX+7fx3FDHCb9us2+zKeDyJszhftwuUG3bbq5YmSb+HLEUduafUu/bJRzBW gpirA8xJ8h4LjMrrQYcdB55eAPvsYNMvZrvBB+rp06AGf6HwYsuRs+D2niZSbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3gbZ1476zvmL; Thu, 27 Feb 2025 18:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIwYg0042777; Thu, 27 Feb 2025 18:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIwYTk042774; Thu, 27 Feb 2025 18:58:34 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:58:34 GMT Message-Id: <202502271858.51RIwYTk042774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 00df1242ecb0 - stable/14 - .cirrus-ci: Update the non-manual GCC build job to GCC 13 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00df1242ecb0de7b2b789a398e534907c5194efc Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=00df1242ecb0de7b2b789a398e534907c5194efc commit 00df1242ecb0de7b2b789a398e534907c5194efc Author: John Baldwin AuthorDate: 2025-01-03 15:44:44 +0000 Commit: John Baldwin CommitDate: 2025-02-27 18:54:00 +0000 .cirrus-ci: Update the non-manual GCC build job to GCC 13 Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48291 (cherry picked from commit f586d52599499f254f0dd6053c811df4031514ca) --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ae83c7d4cd9b..8daaef148ca7 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -131,12 +131,12 @@ task: TOOLCHAIN: aarch64-gcc14 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s - - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo) + - name: amd64-gcc13 World and kernel build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' && $CIRRUS_BRANCH =~ 'pull/.*' env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN: amd64-gcc12 + TOOLCHAIN: amd64-gcc13 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s timeout_in: 120m From nobody Thu Feb 27 14:16:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLW4ftfz5qGJs; Thu, 27 Feb 2025 14:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLW44f0z3xP4; Thu, 27 Feb 2025 14:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=74q+D3gW5myxB2ffB4WItcGOkJaklBSZ72t1uxTyOjE=; b=rEEVZsebaNsxQOC3zcqRlFj/5t50u/MQNz7Y8tiXeQyZwCN3Zc00PVw4FQiixab3pcp4dU h8DisZYqYqRs7jnxVDDRMIGS4d3S07Jl4YEGvdFYfr/uVOUCPa3Nfyj4tOk7Vra9k+j6yf M0TD6NkAPhK8i+SFxImY1t195BYL4QZgjQwEN7RZzl8mSSjCb3cwft8ZdXihaF2/Z5I/9i PIgN7f5+TemmhG/hlZJqXe9H7ba3UvrUEZ6gEA3ID1TWkz+oY2nbxl79hsWzG8ezyGVmPT 70nb5xNlP7besCM+HsBDZYqA6cGwodmFvfp5LATf1EL4XnSvdPtGPZ+9qJQa2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665811; a=rsa-sha256; cv=none; b=vM4gmnFfaj4nEU6XZQcE7ewkYOTrmkJ3Jk1ydI7PWLLUxFuDpTSFmXEtoW6eNvRf4gIEtT NQvJktdDg+pyg9mt9ov6L9Q3S975w+OcI30/Fz5jca+TzcICqFYZKW4pybrfEOcgGrVI1e HTxWNsotxw5ZBk+xvMeSTd7Fu0FfT1NusoOQY67lEjOzrousckc9h620RycBxPTvNx0nfV AnvCbulC1MhU0ghSs97K/0MWnr2OzeNlVVngDhfOMb5auvtBg1BU/3YlCYo6qQgvDBFRcR ygzqCrjMUX61bU8Sy47GYJNlqnwe8TUgyIHgSNZ9t73A9QD296rSRLFugQeiaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=74q+D3gW5myxB2ffB4WItcGOkJaklBSZ72t1uxTyOjE=; b=JlS0M64iiUIjlrUNKE9aIPHTHx+g0XdX8eMgH9UYFwlMcfmX6iA35xJtQenquz8k6OzwD6 yaRet4WO5tq9EGmz7DRor5wNmmtRUHc57wJ5ZEeXkiqKtkW0ggKDall6x4cQcZeYo/XR/5 a5jCeHSqGI65BWWZrNfHYIpFs6D/KDuSHdNwtvnj9ShEynG2H7TYtIFIWh62Tmthze7sxh 5/QeW4NTMQA2HekBCpNkmc7B/KCxRWZq/jcWue0trJflwOT5CEVJECkzpNNqTBWSIy8wIs 4c/M3I52yTMSMuMkp0Ci3qgn9rBLQ6ffG81QVZYXvGcRYz6yAHhYQ6Fystig/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLW3gjXzmpY; Thu, 27 Feb 2025 14:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGpfR016275; Thu, 27 Feb 2025 14:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGpQ8016272; Thu, 27 Feb 2025 14:16:51 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:51 GMT Message-Id: <202502271416.51REGpQ8016272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a818e65ec2bd - stable/14 - gpiobus: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a818e65ec2bda220f163c3a041710ef1533918b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a818e65ec2bda220f163c3a041710ef1533918b9 commit a818e65ec2bda220f163c3a041710ef1533918b9 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 gpiobus: Use bus_generic_rman_* Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43887 (cherry picked from commit 5bda26333a8ebf34190e3a9124895e6a18e58e93) --- sys/dev/gpio/gpiobus.c | 57 +++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index db18703606aa..18129c32133d 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -805,20 +805,29 @@ gpiobus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) return (0); } +static struct rman * +gpiobus_get_rman(device_t bus, int type, u_int flags) +{ + struct gpiobus_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_IRQ: + return (&sc->sc_intr_rman); + default: + return (NULL); + } +} + static struct resource * gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct gpiobus_softc *sc; - struct resource *rv; struct resource_list *rl; struct resource_list_entry *rle; int isdefault; - if (type != SYS_RES_IRQ) - return (NULL); isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); - rle = NULL; if (isdefault) { rl = BUS_GET_RESOURCE_LIST(bus, child); if (rl == NULL) @@ -826,40 +835,12 @@ gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, rle = resource_list_find(rl, type, *rid); if (rle == NULL) return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); start = rle->start; count = rle->count; end = rle->end; } - sc = device_get_softc(bus); - rv = rman_reserve_resource(&sc->sc_intr_rman, start, end, count, flags, - child); - if (rv == NULL) - return (NULL); - rman_set_rid(rv, *rid); - if ((flags & RF_ACTIVE) != 0 && - bus_activate_resource(child, type, *rid, rv) != 0) { - rman_release_resource(rv); - return (NULL); - } - - return (rv); -} - -static int -gpiobus_release_resource(device_t bus __unused, device_t child, int type, - int rid, struct resource *r) -{ - int error; - - if (rman_get_flags(r) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); - } - - return (rman_release_resource(r)); + return (bus_generic_rman_alloc_resource(bus, child, type, rid, start, + end, count, flags)); } static struct resource_list * @@ -1056,9 +1037,9 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_alloc_resource, gpiobus_alloc_resource), - DEVMETHOD(bus_release_resource, gpiobus_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), DEVMETHOD(bus_add_child, gpiobus_add_child), DEVMETHOD(bus_child_deleted, gpiobus_child_deleted), From nobody Thu Feb 27 14:17:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM71kyLz5qFxC; Thu, 27 Feb 2025 14:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM717mdz3xBf; Thu, 27 Feb 2025 14:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkhK1BPH84nMllfwGmc0dnU8ctHJn0RND7aJcUJFVnw=; b=fc4YWA6gWbU/bY2wBSYTTKnwuwlzBWEaoaq8aNZcmAzrodz8Y/pI0N/B0nEpc2bEQh+2ds V60xk1FJnEuwUJTdb0W8zbpamyLJDa+OEYWhskg9HSp+c8A+yHx7yoNSehWRhbfJwL9wX1 DMiBiBE+DiuZjONdHWd565S7/91NGEGQ1ACDpPPNCtZ8fGHxHdm2VEKCPDE31vxrengg65 1I06e/VNcmIKANBMRIIvO0VhXA/b5owl8TPgcY6sHgm/c3q5DBGzWACSomk4Ro3CEWYCdy pBGJQhhkPEYxsAHuXn7wfsrxFecHG595H51539+fajP3Sble1Ks4IK4iDwUMBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665843; a=rsa-sha256; cv=none; b=mnRwvNO9d3/X+M7A/jpTEjjQVOiPBRqUnpq51AeJTKFWE/v5PT0GsTcqWXsLyDfGNOKAEf BZ+DmR3hXMmyb3ssBXuf3hcbawO8nkWT7t0pH8IUfquElvH1h3n7DE32dBJ4DeVpzgPbx1 jZs34Dx9VmACKbhTmrZn9nYHNQL+XFB3w5jyjUuKEsT6SiHUSdw1sG4ZiRxbjYJtbrI3UE QHQ2IISPnqqwBy0TGRnn5FcSykl5jIn49zcD/b3VKSq+kGl/R5iwTwHx2zGTDCtHEzqbTd eePtSSRQS6UWGXeVGQfY+f51Z9wx6KlfTpkSAksovqVdt7wvwu1S7Vwv3QXspg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkhK1BPH84nMllfwGmc0dnU8ctHJn0RND7aJcUJFVnw=; b=e6kJKK3iQvDSLChZE0gB/oWihh9xYcJFXY4L9XExOgf+Y6TFMth3vegYn13iCXWMljwd+V ere3ikrTycLSudNfgxH5/79L3Rea5jMkhQgo7gFcd4H/rkW2U8II1i4NU63LNRMjGBkn4A MaHPoaefXNR/b3lzspJX9fkOjXAzH0wACKa8q6brK9rGSEykhSZtYNF4ku6Oj/zt5zbRz6 mad2K7cvaz+EtmSlJqm4XjVFnOltQtmqiW3Pe1wewM/4sAgMG43JiuV0H6nEMZdpM69h94 qUAhL4KLuowHllc2zW8/yiNLk6ydWhdT/XtRbyf48oBslBrZL5mLc3w7LRtIWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM70l13zmf1; Thu, 27 Feb 2025 14:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHNdd017258; Thu, 27 Feb 2025 14:17:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHMs1017255; Thu, 27 Feb 2025 14:17:22 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:22 GMT Message-Id: <202502271417.51REHMs1017255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 385ad72523fe - stable/14 - pcib: Use rman_get_type in internal functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 385ad72523febc812f5f7b8b9b2ca167e7df6914 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=385ad72523febc812f5f7b8b9b2ca167e7df6914 commit 385ad72523febc812f5f7b8b9b2ca167e7df6914 Author: John Baldwin AuthorDate: 2024-03-13 22:05:54 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pcib: Use rman_get_type in internal functions Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44127 (cherry picked from commit 582b84cd252d56f06556134b1103da3a0425fdbd) --- sys/dev/pci/pci_pci.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 68eab2a6633b..da09a917b9bc 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -164,9 +164,9 @@ SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, * sub-allocated from one of our window resource managers. */ static struct pcib_window * -pcib_get_resource_window(struct pcib_softc *sc, int type, struct resource *r) +pcib_get_resource_window(struct pcib_softc *sc, struct resource *r) { - switch (type) { + switch (rman_get_type(r)) { case SYS_RES_IOPORT: if (rman_is_region_manager(r, &sc->io.rman)) return (&sc->io); @@ -188,14 +188,14 @@ pcib_get_resource_window(struct pcib_softc *sc, int type, struct resource *r) * resource managers? */ static int -pcib_is_resource_managed(struct pcib_softc *sc, int type, struct resource *r) +pcib_is_resource_managed(struct pcib_softc *sc, struct resource *r) { #ifdef PCI_RES_BUS - if (type == PCI_RES_BUS) + if (rman_get_type(r) == PCI_RES_BUS) return (rman_is_region_manager(r, &sc->bus.rman)); #endif - return (pcib_get_resource_window(sc, type, r) != NULL); + return (pcib_get_resource_window(sc, r) != NULL); } static int @@ -2386,7 +2386,7 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, * If the resource wasn't sub-allocated from one of our region * managers then just pass the request up. */ - if (!pcib_is_resource_managed(sc, type, r)) + if (!pcib_is_resource_managed(sc, r)) return (bus_generic_adjust_resource(bus, child, type, r, start, end)); @@ -2411,7 +2411,7 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, * Resource is managed and not a secondary bus number, must * be from one of our windows. */ - w = pcib_get_resource_window(sc, type, r); + w = pcib_get_resource_window(sc, r); KASSERT(w != NULL, ("%s: no window for resource (%#jx-%#jx) type %d", __func__, rman_get_start(r), rman_get_end(r), type)); @@ -2447,7 +2447,7 @@ pcib_release_resource(device_t dev, device_t child, int type, int rid, int error; sc = device_get_softc(dev); - if (pcib_is_resource_managed(sc, type, r)) { + if (pcib_is_resource_managed(sc, r)) { if (rman_get_flags(r) & RF_ACTIVE) { error = bus_deactivate_resource(child, type, rid, r); if (error) @@ -2466,7 +2466,7 @@ pcib_activate_resource(device_t dev, device_t child, int type, int rid, struct resource_map map; int error; - if (!pcib_is_resource_managed(sc, type, r)) + if (!pcib_is_resource_managed(sc, r)) return (bus_generic_activate_resource(dev, child, type, rid, r)); @@ -2495,7 +2495,7 @@ pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource_map map; int error; - if (!pcib_is_resource_managed(sc, type, r)) + if (!pcib_is_resource_managed(sc, r)) return (bus_generic_deactivate_resource(dev, child, type, rid, r)); @@ -2533,7 +2533,7 @@ pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t length, start; int error; - w = pcib_get_resource_window(sc, type, r); + w = pcib_get_resource_window(sc, r); if (w == NULL) return (bus_generic_map_resource(dev, child, type, r, argsp, map)); @@ -2563,7 +2563,7 @@ pcib_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct pcib_softc *sc = device_get_softc(dev); struct pcib_window *w; - w = pcib_get_resource_window(sc, type, r); + w = pcib_get_resource_window(sc, r); if (w != NULL) { r = pcib_find_parent_resource(w, r); if (r == NULL) From nobody Thu Feb 27 14:16:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLc1Qk4z5qG2F; Thu, 27 Feb 2025 14:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLc0wmpz3x07; Thu, 27 Feb 2025 14:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3z8AtzWYFJVv6/UM0gN7cZSEH4NjmfLowLhVFlGwf88=; b=TR8o8Ges0TnWPcWf1q3RbFWWu3Sw70NDkZXDvBalDRwrCbgDdIXAnNJgnFzRZPGEt9rMK7 e/7Pzb218WlWpkg9JjHeNuPiwXmCOBt2U4167I32FHtELHDly+erBVt0K1Y448MkD74zwi UL+p8IlOZmZ8ev0O3LIjNLOoP0LbxQT/rENHJHBizmAJ1DBa/RMk+wo+xuCpXucyMUA9Cs +ptop2UHV+zykQWsWuknBcKez3Eo9yhQU7Oh4tM00bajQNyDD/gUW2eAvnt1uBeXMRHHMO 9i1fCg1S24uL1trpvEumk0Cqrtn+Dym7v8/ON6Gz/rUjaa5nfVYxTbFQt4PlHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665816; a=rsa-sha256; cv=none; b=yNvk/J2cek06Ptzx5dUhSbIqvqU0KrGJkfeQ7zfY7+kgwdysP/Sr/GFJmWkFZyC67ngCnt J2c4dg5cr4HIDHhwStJZ2JFGicii0Yd2ypoMc0JndZffxqDdcaCl1GxUq7LMQIlSB0PNZu i4GCZyCaNxoOpUqe41DeGjQbAJPvklqVReFVrOFLprl4rYhkIaOMh7gwiFV2j4LMUsbAAH BUGY3wU/QFXohesOtjv1AtflmDk4kU9Eult/Pkb+iCPbIFwHeTwWqdSKBtSVJZEDd8qbYM uZIF7F403yevCQp7F2A0O61HhekJYP8du67+r4C9cl4cxEIOm7nLUCunnexS7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3z8AtzWYFJVv6/UM0gN7cZSEH4NjmfLowLhVFlGwf88=; b=eYDoKZe93zlEndKnMPVURID8gz1Rr57k5n6GvAowPA3PtdfJ0/2gcgaDu696pzOKjVmy8t 9ufKD/QIbyDUW95AFnaZMbMOhgc1LAFqNq3eEqZUk/TtC9ZcC5VeVaQEAaVIQM/Bxp8SOX XgCt2H24J9CNJ6swI9MjMxw9mRJl4xwxjFHMQg3fQufrNBROa5C+dgpARfCH4k9J32L8xs /6XdwoeULLenpu08xryeYg6WqtxEhj76D/OjofhQDPyEi1nP0awWhujG4rJqdkPot+Vu4v mk5xx6Figm9R817Ui738jYsa2uoSYlWZQjD4RhWxzb/FjWSZ3M8lj4Yeusd1cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLc05vyzmpb; Thu, 27 Feb 2025 14:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGtt3016420; Thu, 27 Feb 2025 14:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGt0n016417; Thu, 27 Feb 2025 14:16:55 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:55 GMT Message-Id: <202502271416.51REGt0n016417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e5936d602858 - stable/14 - vmd: Use bus_generic_rman_* for PCI bus and memory resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e5936d602858378e649b49fdef8b909b3a20695b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e5936d602858378e649b49fdef8b909b3a20695b commit e5936d602858378e649b49fdef8b909b3a20695b Author: John Baldwin AuthorDate: 2024-02-15 20:26:40 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 vmd: Use bus_generic_rman_* for PCI bus and memory resources While here, add custom bus_map/unmap_resource methods to request mappings via the window memory resources allocated from the parent bus. Tested by: emaste Differential Revision: https://reviews.freebsd.org/D43886 (cherry picked from commit d714e73f789515963a22fe64417bf3883cdb599c) --- sys/dev/vmd/vmd.c | 133 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index 7fc045032dc6..d513d3ea5a5a 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -419,47 +419,53 @@ vmd_get_dma_tag(device_t dev, device_t child) return (sc->vmd_dma_tag); } +static struct rman * +vmd_get_rman(device_t dev, int type, u_int flags) +{ + struct vmd_softc *sc = device_get_softc(dev); + + switch (type) { + case SYS_RES_MEMORY: + return (&sc->psc.mem.rman); + case PCI_RES_BUS: + return (&sc->psc.bus.rman); + default: + /* VMD hardware does not support I/O ports. */ + return (NULL); + } +} + static struct resource * vmd_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct vmd_softc *sc = device_get_softc(dev); struct resource *res; - switch (type) { - case SYS_RES_IRQ: + if (type == SYS_RES_IRQ) { /* VMD hardware does not support legacy interrupts. */ if (*rid == 0) return (NULL); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags | RF_SHAREABLE)); - case SYS_RES_MEMORY: - res = rman_reserve_resource(&sc->psc.mem.rman, start, end, - count, flags, child); - if (res == NULL) - return (NULL); - if (bootverbose) + } + res = bus_generic_rman_alloc_resource(dev, child, type, rid, start, + end, count, flags); + if (bootverbose && res != NULL) { + switch (type) { + case SYS_RES_MEMORY: device_printf(dev, "allocated memory range (%#jx-%#jx) for rid %d of %s\n", rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); - break; - case PCI_RES_BUS: - res = rman_reserve_resource(&sc->psc.bus.rman, start, end, - count, flags, child); - if (res == NULL) - return (NULL); - if (bootverbose) + break; + case PCI_RES_BUS: device_printf(dev, "allocated bus range (%ju-%ju) for rid %d of %s\n", rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); - break; - default: - /* VMD hardware does not support I/O ports. */ - return (NULL); + break; + } } - rman_set_rid(res, *rid); return (res); } @@ -472,7 +478,8 @@ vmd_adjust_resource(device_t dev, device_t child, int type, return (bus_generic_adjust_resource(dev, child, type, r, start, end)); } - return (rman_adjust_resource(r, start, end)); + return (bus_generic_rman_adjust_resource(dev, child, type, r, start, + end)); } static int @@ -484,7 +491,80 @@ vmd_release_resource(device_t dev, device_t child, int type, int rid, return (bus_generic_release_resource(dev, child, type, rid, r)); } - return (rman_release_resource(r)); + return (bus_generic_rman_release_resource(dev, child, type, rid, r)); +} + +static int +vmd_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == SYS_RES_IRQ) { + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + } + return (bus_generic_rman_activate_resource(dev, child, type, rid, r)); +} + +static int +vmd_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == SYS_RES_IRQ) { + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + } + return (bus_generic_rman_deactivate_resource(dev, child, type, rid, r)); +} + +static struct resource * +vmd_find_parent_resource(struct vmd_softc *sc, struct resource *r) +{ + for (int i = 1; i < 3; i++) { + if (rman_get_start(sc->vmd_regs_res[i]) <= rman_get_start(r) && + rman_get_end(sc->vmd_regs_res[i]) >= rman_get_end(r)) + return (sc->vmd_regs_res[i]); + } + return (NULL); +} + +static int +vmd_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct vmd_softc *sc = device_get_softc(dev); + struct resource_map_request args; + struct resource *pres; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + pres = vmd_find_parent_resource(sc, r); + if (pres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(pres); + args.length = length; + return (bus_generic_map_resource(dev, child, type, pres, &args, map)); +} + +static int +vmd_unmap_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + struct vmd_softc *sc = device_get_softc(dev); + + r = vmd_find_parent_resource(sc, r); + if (r == NULL) + return (ENOENT); + return (bus_generic_unmap_resource(dev, child, type, r, map)); } static int @@ -648,13 +728,16 @@ static device_method_t vmd_pci_methods[] = { /* Bus interface */ DEVMETHOD(bus_get_dma_tag, vmd_get_dma_tag), + DEVMETHOD(bus_get_rman, vmd_get_rman), DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, vmd_alloc_resource), DEVMETHOD(bus_adjust_resource, vmd_adjust_resource), DEVMETHOD(bus_release_resource, vmd_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_activate_resource, vmd_activate_resource), + DEVMETHOD(bus_deactivate_resource, vmd_deactivate_resource), + DEVMETHOD(bus_map_resource, vmd_map_resource), + DEVMETHOD(bus_unmap_resource, vmd_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 14:16:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLS1dRtz5qFXw; Thu, 27 Feb 2025 14:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLS1Qv0z3xRP; Thu, 27 Feb 2025 14:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+ngnPAMVZDydp3i+uvWqKEqilcqHIicCaidhq1xH5E=; b=I6Pfho7ZL8SrxrEmfj9sWaimeQdIQqUaIkVucRbvxnGGqD//iGGxByqAyPrMh+KX8Npyrb t15eVPaL/acgj8xFniz5ipuavPxJQSj/LljVbr8OyfSXX683yFv0fy/cmrYknAgz3fEt+V 8E598YIdOT4limSoo/VpSlyMiUqJTEQSnd14c9IG2KFtIxMnnzzOaoZCd+SToiB7wUg3pL Abvn1NDE0MIZe1U39lanIaU6RBiI3x8NbME0lG8UbTuKPpZbpv8wDNoFPx0UFCNNpfDu1i /+DRicnXF+yUN2La4f6s0f9BCS/Jodfx6UHsAsNH1W/IJVRkGrLxBphZWJzv4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665808; a=rsa-sha256; cv=none; b=TzjHHiCf0tH/EHHUrXkbvJoCx/KVTBJlPU/PT/pdDg47KYqHU7iMaN30toycIxczwZhYhF MgzIErtTG9yTF/8bnB66dBHLF1U0qzUJkMGCcumDUjZG8v4SEwlUgyAC0/hZrL8GRKMMdm V9ksxWjlUtNXx5wUWhNzGYzkNGoK2THVVNNSyd+OuD7AfsS+SFhe+MqXdesAhlfZNPY3x5 yaYsF5bXJJ/jXJbXf/xNSyu6wbgfOrqRrm96Db1XsS80PS8vQ+NyWqt0myCNRrBUHU8tia bV0yVKn3smlQh2fj8iNHedRif6oJCtb0Kaj7MwPL1dOStOcrSUToUDBPm+BOzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+ngnPAMVZDydp3i+uvWqKEqilcqHIicCaidhq1xH5E=; b=XwuOKopDinO7u3KlyJ5a2N5BuwrpfckWQumkIoMpXOawAIbJU139L9fGDQR9QsC13Sp99N YedYauVvlWgLQnLWjCVpM8fsYsb4cDQaclummReuGuSovTs+QL98LdJQPz6/RLkkgq+26l 2N/oGxL87UfWfezsAxd4Mm+ykcpHYn+DkLeuAmkWsW9iWF/br1cf/7tgJSpU5MPaQLO8LG 6FXAKtYfiZltuQoKwk3VPCEK+QNda/YolnD/XfuLGioXyHI3Uj4mOPVvXpi63rCu95U4wB hEugH3CL5oWLTGHvT+qQN0pISHP8OfYb4nf7QUPQ4Y/8I8m+AUcdWC1d+M3/7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLS10VLzm7M; Thu, 27 Feb 2025 14:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGmf0016160; Thu, 27 Feb 2025 14:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGmqp016157; Thu, 27 Feb 2025 14:16:48 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:48 GMT Message-Id: <202502271416.51REGmqp016157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 57f378aacdc1 - stable/14 - acpi: Cleanup handling of suballocated resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57f378aacdc129c20479543617cf670626766919 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=57f378aacdc129c20479543617cf670626766919 commit 57f378aacdc129c20479543617cf670626766919 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 acpi: Cleanup handling of suballocated resources For resources suballocated from the system resource rmans, handle those in the ACPI bus driver without passing them up to the parent. This means using bus_generic_rman_* for several bus methods for operations on suballocated resources. For bus_map/unmap_resource, find the system resource allocated from the parent bus (nexus) that contains the range being mapped and request a mapping of that parent resource. This avoids a layering violation where nexus drivers were previously asked to manage the activation and mapping of resources created belonging to the ACPI resource managers. Note that this does require passing RF_ACTIVE (with RF_UNMAPPED) when allocating system resources from the parent. While here, don't assume that the parent bus (nexus) provides a resource list that sysres resources are placed on. Instead, create a dedicated resource_list in the ACPI bus driver's softc to hold sysres resources. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43687 (cherry picked from commit 0e1246e3346107b56b52d605a10f763c307e0889) --- sys/dev/acpica/acpi.c | 198 +++++++++++++++++++++++++---------------- sys/dev/acpica/acpi_resource.c | 8 +- sys/dev/acpica/acpivar.h | 6 +- 3 files changed, 130 insertions(+), 82 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index cbb454a52099..ee2494debae7 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -127,11 +127,16 @@ static bus_child_deleted_t acpi_child_deleted; static bus_read_ivar_t acpi_read_ivar; static bus_write_ivar_t acpi_write_ivar; static bus_get_resource_list_t acpi_get_rlist; +static bus_get_rman_t acpi_get_rman; static bus_set_resource_t acpi_set_resource; static bus_alloc_resource_t acpi_alloc_resource; static bus_adjust_resource_t acpi_adjust_resource; static bus_release_resource_t acpi_release_resource; static bus_delete_resource_t acpi_delete_resource; +static bus_activate_resource_t acpi_activate_resource; +static bus_deactivate_resource_t acpi_deactivate_resource; +static bus_map_resource_t acpi_map_resource; +static bus_unmap_resource_t acpi_unmap_resource; static bus_child_pnpinfo_t acpi_child_pnpinfo_method; static bus_child_location_t acpi_child_location_method; static bus_hint_device_unit_t acpi_hint_device_unit; @@ -198,16 +203,19 @@ static device_method_t acpi_methods[] = { DEVMETHOD(bus_read_ivar, acpi_read_ivar), DEVMETHOD(bus_write_ivar, acpi_write_ivar), DEVMETHOD(bus_get_resource_list, acpi_get_rlist), + DEVMETHOD(bus_get_rman, acpi_get_rman), DEVMETHOD(bus_set_resource, acpi_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_alloc_resource, acpi_alloc_resource), DEVMETHOD(bus_adjust_resource, acpi_adjust_resource), DEVMETHOD(bus_release_resource, acpi_release_resource), DEVMETHOD(bus_delete_resource, acpi_delete_resource), + DEVMETHOD(bus_activate_resource, acpi_activate_resource), + DEVMETHOD(bus_deactivate_resource, acpi_deactivate_resource), + DEVMETHOD(bus_map_resource, acpi_map_resource), + DEVMETHOD(bus_unmap_resource, acpi_unmap_resource), DEVMETHOD(bus_child_pnpinfo, acpi_child_pnpinfo_method), DEVMETHOD(bus_child_location, acpi_child_location_method), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_hint_device_unit, acpi_hint_device_unit), @@ -485,6 +493,8 @@ acpi_attach(device_t dev) if (rman_init(&acpi_rman_mem) != 0) panic("acpi rman_init memory failed"); + resource_list_init(&sc->sysres_rl); + /* Initialise the ACPI mutex */ mtx_init(&acpi_mutex, "ACPI global lock", NULL, MTX_DEF); @@ -1307,6 +1317,20 @@ acpi_get_domain_method(device_t dev, device_t child, int *domain) return (ENOENT); } +static struct rman * +acpi_get_rman(device_t bus, int type, u_int flags) +{ + /* Only memory and IO resources are managed. */ + switch (type) { + case SYS_RES_IOPORT: + return (&acpi_rman_io); + case SYS_RES_MEMORY: + return (&acpi_rman_mem); + default: + return (NULL); + } +} + /* * Pre-allocate/manage all memory and IO resources. Since rman can't handle * duplicates, we merge any in the sysresource attach routine. @@ -1314,8 +1338,8 @@ acpi_get_domain_method(device_t dev, device_t child, int *domain) static int acpi_sysres_alloc(device_t dev) { + struct acpi_softc *sc = device_get_softc(dev); struct resource *res; - struct resource_list *rl; struct resource_list_entry *rle; struct rman *rm; device_t *children; @@ -1333,28 +1357,21 @@ acpi_sysres_alloc(device_t dev) } free(children, M_TEMP); - rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); - STAILQ_FOREACH(rle, rl, link) { + STAILQ_FOREACH(rle, &sc->sysres_rl, link) { if (rle->res != NULL) { device_printf(dev, "duplicate resource for %jx\n", rle->start); continue; } /* Only memory and IO resources are valid here. */ - switch (rle->type) { - case SYS_RES_IOPORT: - rm = &acpi_rman_io; - break; - case SYS_RES_MEMORY: - rm = &acpi_rman_mem; - break; - default: + rm = acpi_get_rman(dev, rle->type, 0); + if (rm == NULL) continue; - } /* Pre-allocate resource and add to our rman pool. */ - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, rle->type, - &rle->rid, rle->start, rle->start + rle->count - 1, rle->count, 0); + res = bus_alloc_resource(dev, rle->type, + &rle->rid, rle->start, rle->start + rle->count - 1, rle->count, + RF_ACTIVE | RF_UNMAPPED); if (res != NULL) { rman_manage_region(rm, rman_get_start(res), rman_get_end(res)); rle->res = res; @@ -1531,63 +1548,39 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, * from our system resource regions. */ if (res == NULL && start + count - 1 == end) - res = acpi_alloc_sysres(child, type, rid, start, end, count, flags); + res = bus_generic_rman_alloc_resource(bus, child, type, rid, start, end, + count, flags); return (res); } -/* - * Attempt to allocate a specific resource range from the system - * resource ranges. Note that we only handle memory and I/O port - * system resources. - */ -struct resource * -acpi_alloc_sysres(device_t child, int type, int *rid, rman_res_t start, - rman_res_t end, rman_res_t count, u_int flags) +static bool +acpi_is_resource_managed(device_t bus, int type, struct resource *r) { - struct rman *rm; - struct resource *res; - - switch (type) { - case SYS_RES_IOPORT: - rm = &acpi_rman_io; - break; - case SYS_RES_MEMORY: - rm = &acpi_rman_mem; - break; - default: - return (NULL); - } + struct rman *rm; - KASSERT(start + count - 1 == end, ("wildcard resource range")); - res = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); - if (res == NULL) - return (NULL); - - rman_set_rid(res, *rid); - - /* If requested, activate the resource using the parent's method. */ - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res) != 0) { - rman_release_resource(res); - return (NULL); - } - - return (res); + rm = acpi_get_rman(bus, type, 0); + if (rm == NULL) + return (false); + return (rman_is_region_manager(r, rm)); } -static int -acpi_is_resource_managed(int type, struct resource *r) +static struct resource * +acpi_managed_resource(device_t bus, int type, struct resource *r) { + struct acpi_softc *sc = device_get_softc(bus); + struct resource_list_entry *rle; - /* We only handle memory and IO resources through rman. */ - switch (type) { - case SYS_RES_IOPORT: - return (rman_is_region_manager(r, &acpi_rman_io)); - case SYS_RES_MEMORY: - return (rman_is_region_manager(r, &acpi_rman_mem)); - } - return (0); + KASSERT(acpi_is_resource_managed(bus, type, r), + ("resource %p is not suballocated", r)); + + STAILQ_FOREACH(rle, &sc->sysres_rl, link) { + if (rle->type != type || rle->res == NULL) + continue; + if (rman_get_start(r) >= rman_get_start(rle->res) && + rman_get_end(r) <= rman_get_end(rle->res)) + return (rle->res); + } + return (NULL); } static int @@ -1595,7 +1588,7 @@ acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { - if (acpi_is_resource_managed(type, r)) + if (acpi_is_resource_managed(bus, type, r)) return (rman_adjust_resource(r, start, end)); return (bus_generic_adjust_resource(bus, child, type, r, start, end)); } @@ -1604,20 +1597,12 @@ static int acpi_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - int ret; - /* * If this resource belongs to one of our internal managers, * deactivate it and release it to the local pool. */ - if (acpi_is_resource_managed(type, r)) { - if (rman_get_flags(r) & RF_ACTIVE) { - ret = bus_deactivate_resource(child, type, rid, r); - if (ret != 0) - return (ret); - } - return (rman_release_resource(r)); - } + if (acpi_is_resource_managed(bus, type, r)) + return (bus_generic_rman_release_resource(bus, child, type, rid, r)); return (bus_generic_rl_release_resource(bus, child, type, rid, r)); } @@ -1638,6 +1623,69 @@ acpi_delete_resource(device_t bus, device_t child, int type, int rid) resource_list_delete(rl, type, rid); } +static int +acpi_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + if (acpi_is_resource_managed(bus, type, r)) + return (bus_generic_rman_activate_resource(bus, child, type, + rid, r)); + return (bus_generic_activate_resource(bus, child, type, rid, r)); +} + +static int +acpi_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + if (acpi_is_resource_managed(bus, type, r)) + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, r)); + return (bus_generic_deactivate_resource(bus, child, type, rid, r)); +} + +static int +acpi_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + struct resource *sysres; + rman_res_t length, start; + int error; + + if (!acpi_is_resource_managed(bus, type, r)) + return (bus_generic_map_resource(bus, child, type, r, argsp, + map)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + sysres = acpi_managed_resource(bus, type, r); + if (sysres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(sysres); + args.length = length; + return (bus_generic_map_resource(bus, child, type, sysres, &args, map)); +} + +static int +acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + if (acpi_is_resource_managed(bus, type, r)) { + r = acpi_managed_resource(bus, type, r); + if (r == NULL) + return (ENOENT); + } + return (bus_generic_unmap_resource(bus, child, type, r, map)); +} + /* Allocate an IO port or memory resource, given its GAS. */ int acpi_bus_alloc_gas(device_t dev, int *type, int *rid, ACPI_GENERIC_ADDRESS *gas, diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index 8d81d61989a8..eec7d32bf276 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -792,8 +792,6 @@ acpi_res_set_end_dependent(device_t dev, void *context) * private rman. */ -static int acpi_sysres_rid = 100; - static int acpi_sysres_probe(device_t dev); static int acpi_sysres_attach(device_t dev); @@ -835,6 +833,7 @@ static int acpi_sysres_attach(device_t dev) { device_t bus; + struct acpi_softc *bus_sc; struct resource_list_entry *bus_rle, *dev_rle; struct resource_list *bus_rl, *dev_rl; int done, type; @@ -849,7 +848,8 @@ acpi_sysres_attach(device_t dev) */ bus = device_get_parent(dev); dev_rl = BUS_GET_RESOURCE_LIST(bus, dev); - bus_rl = BUS_GET_RESOURCE_LIST(device_get_parent(bus), bus); + bus_sc = acpi_device_get_parent_softc(dev); + bus_rl = &bus_sc->sysres_rl; STAILQ_FOREACH(dev_rle, dev_rl, link) { if (dev_rle->type != SYS_RES_IOPORT && dev_rle->type != SYS_RES_MEMORY) continue; @@ -889,7 +889,7 @@ acpi_sysres_attach(device_t dev) /* If we didn't merge with anything, add this resource. */ if (bus_rle == NULL) - bus_set_resource(bus, type, acpi_sysres_rid++, start, count); + resource_list_add_next(bus_rl, type, start, end, count); } /* After merging/moving resources to the parent, free the list. */ diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 80ea18e782ac..668d0b51a1f3 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -78,6 +78,9 @@ struct acpi_softc { struct apm_clone_data *acpi_clone; /* Pseudo-dev for devd(8). */ STAILQ_HEAD(,apm_clone_data) apm_cdevs; /* All apm/apmctl/acpi cdevs. */ struct callout susp_force_to; /* Force suspend if no acks. */ + + /* System Resources */ + struct resource_list sysres_rl; }; struct acpi_device { @@ -461,9 +464,6 @@ ACPI_STATUS acpi_lookup_irq_resource(device_t dev, int rid, struct resource *res, ACPI_RESOURCE *acpi_res); ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set, void *arg); -struct resource *acpi_alloc_sysres(device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, - u_int flags); /* ACPI event handling */ UINT32 acpi_event_power_button_sleep(void *context); From nobody Thu Feb 27 21:04:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3kNh1ZyPz59X13; Thu, 27 Feb 2025 21:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNh0vg5z43Xr; Thu, 27 Feb 2025 21:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oHNptMEzykBwA7dR8uc45FetKWAsdZe5/MkYVOji5FA=; b=OPteFxgqrvUEHuKrfypKOZBZqXJrBNmu1jgmn0SIBzh0oinyDrREmRCSTUrMP7+IH833rv vA79A9Mv8HjBVVYpFZRGIvBKBckMPL2Xtqdl/0Cw/wHI/GFNvnzLWOYVH7G0HfZoYnX1t3 ioG5BbH0mh2Qyd6losrg8ia1DJLxMDDJv8M1F2AXZfjhbSElAmYHLIta+GV9G8Av0lrvQf uks+UoaM6WNzVk5GaoIPKlfGqXo489wBNWd5QiYLs/HoEHZMhJ61K4CqJq0g8yWG8e0Ekj NMrcEV2sidUG0YjQLDdtuTtDN42VCQENwh2P4ti63Tq2CpMSzY2Z6X9Bi0OOtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690260; a=rsa-sha256; cv=none; b=lPAB7zNvbm3Xpv7FqI5ugTJtNnBwXWvK62AziBNGCGkdL4+3f8tTX3yxJmL16yrshc69HZ GI3ccUT5LbHPcMqi2YXYLvhAhRt9/Eb4RRmGnas4l2L+6qGGqCwioTyYt8du2pnrQQ3Ucg 2+hposfsN7a1HOzfVnN+a4Ks/7CIz9FaL1lePbNSE0+nHEPNAQG/s5SymFhY/jmduU6d4W NCpS5JqXDekzOCKZcVGYF/NfZlNb7xWVaqymAVL+n2Cv93661q5DtpbyKlU7Oxk3ruwyl3 W97gIQqHKyvTMg5FZwm8pemHOqqhqddpfrLa8DirXPE3rfUxWEbKLlIz5pYvgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oHNptMEzykBwA7dR8uc45FetKWAsdZe5/MkYVOji5FA=; b=aLchttryzvZUL1Jek0FQix4r6WUO3AaKWzOWot0iOdRnQOieEUhVrgB6MC3Iam8Gsq/mL9 TU6Timxgiw4BhQt3uC8gtLVlAJIl6eGnjHoVe66QUSnztM8/mjZcioLmGhwg8GmkDJ4AJ5 WNufI/6Tp2kGWYWX5ToYz73p/iIo4fxDFXdJ8tucQ4FAXwxJ3HtK1Ghik8ukiTLN/pN2Hy asOvBa9wnIsjdKDabaUQk4aksPSuecvbL75/KYaxqNDd7LmPm/8GrjwhOR7Pnkhev6nxCm qOpvHaZh3tYjxtUCNbxfb4W8mdUmjHawbJ+9m3GdT2wyI49xvtM3teLPhp+kNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3kNh0JMQzyVm; Thu, 27 Feb 2025 21:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4JwN085439; Thu, 27 Feb 2025 21:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Jf3085436; Thu, 27 Feb 2025 21:04:19 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:19 GMT Message-Id: <202502272104.51RL4Jf3085436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8e406d580ceb - stable/14 - iwlwifi: bring in some of the rs code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e406d580ceb4e19b00039d39918e38abc0366c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8e406d580ceb4e19b00039d39918e38abc0366c0 commit 8e406d580ceb4e19b00039d39918e38abc0366c0 Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 11:00:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 iwlwifi: bring in some of the rs code Bring in code to call into rs-fw.c functionality for firmware supported rate select. Anything before AX200 (firmware matching iwlwiif-[0-9]*.ucode) will still need further implementation, and so does iwl_mvm_rs_tx_status(). These bits marked with compat.linuxkpi.80211.debug TODO()s for now. Implement some lindebugfs bits to gather more statistical information. Sponsored by: The FreeBSD Foundation (cherry picked from commit 3f8cfb8a3a3b9fbe6d4aebde81aee80f8e89e2ea) --- sys/contrib/dev/iwlwifi/mvm/rs.c | 133 +++++++++++++++++++++++++++++++++++---- sys/contrib/dev/iwlwifi/mvm/rs.h | 9 ++- 2 files changed, 128 insertions(+), 14 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/mvm/rs.c b/sys/contrib/dev/iwlwifi/mvm/rs.c index 981686e66920..f460624871ee 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rs.c +++ b/sys/contrib/dev/iwlwifi/mvm/rs.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2021 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -33,42 +33,123 @@ * This file is left as a wrapper to make mvm compile and we will only * deal with it on a need basis. Most newer chipsets do this in firmware. */ +#include +#include /* LinuxKPI 802.11 TODO() calls. */ -#include - +#include "rs.h" #include "mvm.h" #ifdef CONFIG_IWLWIFI_DEBUGFS +/* + * Fill struct iwl_mvm_frame_stats. + * Deal with various RATE_MCS_*_MSK. See rx.c, fw/api/rs.h, et al. + * XXX-BZ consider calling iwl_new_rate_from_v1() in rx.c so we can also + * use this in rxmq.c. + */ void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg) { - + uint8_t nss; + + spin_lock_bh(&mvm->drv_stats_lock); + mvm->drv_rx_stats.success_frames++; + + if (rate & RATE_MCS_HT_MSK_V1) { + mvm->drv_rx_stats.ht_frames++; + nss = 1 + ((rate & RATE_HT_MCS_NSS_MSK_V1) >> RATE_HT_MCS_NSS_POS_V1); + } else if (rate & RATE_MCS_VHT_MSK_V1) { + mvm->drv_rx_stats.vht_frames++; + nss = 1 + FIELD_GET(RATE_MCS_NSS_MSK, rate); + } else { + mvm->drv_rx_stats.legacy_frames++; + nss = 0; + } + + switch (rate & RATE_MCS_CHAN_WIDTH_MSK_V1) { + case RATE_MCS_CHAN_WIDTH_20: + mvm->drv_rx_stats.bw_20_frames++; + break; + case RATE_MCS_CHAN_WIDTH_40: + mvm->drv_rx_stats.bw_40_frames++; + break; + case RATE_MCS_CHAN_WIDTH_80: + mvm->drv_rx_stats.bw_80_frames++; + break; + case RATE_MCS_CHAN_WIDTH_160: + mvm->drv_rx_stats.bw_160_frames++; + break; + } + + if ((rate & RATE_MCS_CCK_MSK_V1) == 0 && + (rate & RATE_MCS_SGI_MSK_V1) != 0) + mvm->drv_rx_stats.sgi_frames++; + else + mvm->drv_rx_stats.ngi_frames++; + + switch (nss) { + case 1: + mvm->drv_rx_stats.siso_frames++; + break; + case 2: + mvm->drv_rx_stats.mimo2_frames++; + break; + } + + if (agg) + mvm->drv_rx_stats.agg_frames++; + + /* ampdu_count? */ + /* fail_frames? */ + + mvm->drv_rx_stats.last_rates[mvm->drv_rx_stats.last_frame_idx] = rate; + mvm->drv_rx_stats.last_frame_idx++; + mvm->drv_rx_stats.last_frame_idx %= + ARRAY_SIZE(mvm->drv_rx_stats.last_rates); + + spin_unlock_bh(&mvm->drv_stats_lock); } void iwl_mvm_reset_frame_stats(struct iwl_mvm *mvm) { - + /* Apply same locking rx.c does; debugfs seems to read unloked? */ + spin_lock_bh(&mvm->drv_stats_lock); + memset(&mvm->drv_rx_stats, 0, sizeof(mvm->drv_rx_stats)); + spin_unlock_bh(&mvm->drv_stats_lock); } #endif int iwl_mvm_rate_control_register(void) { - + TODO("This likely has to call into net80211 unless we gain compat code in LinuxKPI"); return (0); } -int -iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *sta, bool enable) +void +iwl_mvm_rate_control_unregister(void) { + TODO("This likely has to call into net80211 unless we gain compat code in LinuxKPI"); +} - return (0); +int +iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, bool enable) +{ + if (iwl_mvm_has_tlc_offload(mvm)) + return (rs_fw_tx_protection(mvm, mvmsta, enable)); + else { + TODO(); + return (0); + } } -void -iwl_mvm_rate_control_unregister(void) +static void +iwl_mvm_rs_sw_rate_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_bss_conf *link_conf, struct ieee80211_link_sta *link_sta, + enum nl80211_band band) { + TODO(); } void @@ -77,18 +158,28 @@ iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf, struct ieee80211_link_sta *link_sta, enum nl80211_band band) { + if (iwl_mvm_has_tlc_offload(mvm)) + iwl_mvm_rs_fw_rate_init(mvm, vif, sta, link_conf, link_sta, band); + else + iwl_mvm_rs_sw_rate_init(mvm, vif, sta, link_conf, link_sta, band); } void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, int tid, struct ieee80211_tx_info *ba_info, bool t) { + TODO(); } void -rs_update_last_rssi(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, +rs_update_last_rssi(struct iwl_mvm *mvm __unused, struct iwl_mvm_sta *mvmsta, struct ieee80211_rx_status *rx_status) { + struct iwl_lq_sta *lq_sta; + int i; + + if (mvmsta == NULL || rx_status == NULL) + return; /* * Assumption based on mvm/sta.h is that this should update @@ -96,12 +187,28 @@ rs_update_last_rssi(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, * access in that struct so nowhere to put rssi information. * So the only thing would be if this is required internally * to functions in this file. + * The "FW" version accesses more fields. We assume they + * are the same for now. */ + + lq_sta = &mvmsta->deflink.lq_sta.rs_drv; + + lq_sta->pers.last_rssi = S8_MIN; + lq_sta->pers.chains = rx_status->chains; + + for (i = 0; i < nitems(lq_sta->pers.chain_signal); i++) { + if ((rx_status->chains & BIT(i)) == 0) + continue; + + lq_sta->pers.chain_signal[i] = rx_status->chain_signal[i]; + if (rx_status->chain_signal[i] > lq_sta->pers.last_rssi) + lq_sta->pers.last_rssi = rx_status->chain_signal[i]; + } } int rs_pretty_print_rate_v1(char *buf, int bufsz, const u32 rate) { - + TODO(); return (0); } diff --git a/sys/contrib/dev/iwlwifi/mvm/rs.h b/sys/contrib/dev/iwlwifi/mvm/rs.h index a9b10b841f95..71c0744f017c 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rs.h +++ b/sys/contrib/dev/iwlwifi/mvm/rs.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2021 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -69,6 +69,13 @@ struct iwl_lq_sta { struct { spinlock_t lock; uint16_t max_agg_bufsize; + /* + * Based on the assumption that these are in "FW" too and + * there is a f() to set last_rssi add them here too. + */ + uint8_t chains; + uint8_t chain_signal[IEEE80211_MAX_CHAINS]; + uint8_t last_rssi; } pers; }; From nobody Thu Feb 27 18:53:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3gV01lQBz59PSl; Thu, 27 Feb 2025 18:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gV0110yz3Nmp; Thu, 27 Feb 2025 18:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8XedvfhyPcC/dUXTv8vfMc8rpcejCnFn5d0ZWi4PVaQ=; b=Tq1Uu/4vgWCkZRrOGRIA1Udgx9rJh/WR9ZRhaimeQ4rb23T/kXqZR+04KvpLu+6BGaiG9X XNBeUPOvhRnk2lYzbGvoOXVAkfQ39YbBoXbnwG2UM9me5qvBAKe6Nh4NS+3TqRhnwiiQG+ fGFeqOEtqWBPXQaCI/Bmd5mOfMdEHzqR7VBgnGRalKoRWLzBYlnc6m8XO1E5E6Q3UWPExI V4p/Do54FkwoW+rfO/ZvcomHJFRtx8w27xQcPGAYSuTHkAxPloQg6SNpeoB0yelvQjmqDR jiVPNAs5YLVoqvOky0zE/9DeV2XXyFuqoQWy1waPwIF7eUZ8MnDoZrbupFlJZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682424; a=rsa-sha256; cv=none; b=ZwKbOrvUYfdWjUQh8akA+dspb+wMGh1mi/FoxBPQkJw3W5I6uslP77Dyf+WtJvTFY/xqfu K7rdSNVIEqW9NGmsECkzNaFr/VRo/kCiDI57tJaodPPJQx5CJedMii7rirUiV4eFv8TUTm khE5iKYNQZeaK64440CoEwjVPGqSIGl28OJWqb8Yspnc48tJKBz9SuPfCVmB+CXTYj8qiS rrgT/v/3HwuXicHBwoB499RKHIZ9aYkuTQQ5qkorNNJyXQvJydGDicS1ODKjY6zH1YIpBb 06BwMbGC7c4mADppTghtM6BnXenpG24oUHynlWrhRGmoXs1y3ozRYJjlEkzXzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8XedvfhyPcC/dUXTv8vfMc8rpcejCnFn5d0ZWi4PVaQ=; b=AYxDD5wETFdkxE2sKGD0MMRoiFUv/NDUApDBL8w+VyZELkvv9h44MK6+vda4pKTWa2giBp X3TUkWRSW+9pNuU9/f43e8KaCHiuIVOb6LXM4ONLgtO05zhEhibpXfBDnAZqavNAtJl2Ot aTGgEPrLddIxEPf/x/QdQQIaF7km5EFJLWoBm7bW1WE+ciYSoMxkw+gcS4kznvgnTIwyyu WJNdsgF2kvCmryMdCV9j3uprUr2piRAsT0MnCLx/6hogofjevMqqzIO6sQQsE5dp471Dj0 838t2zUgWqQK6H/q7K4h92LnadlpMn4vkBE/GECZGNgaA3XRGv1UDu9DKYnr0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3gV00YCRzw1k; Thu, 27 Feb 2025 18:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIrhIe041146; Thu, 27 Feb 2025 18:53:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIrhnu041143; Thu, 27 Feb 2025 18:53:43 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:53:43 GMT Message-Id: <202502271853.51RIrhnu041143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 067de34b8e10 - stable/14 - pmcannotate: Add a '-m' mode option to control per-line annotations. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 067de34b8e10448307fa402db6e83ff413f95e78 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=067de34b8e10448307fa402db6e83ff413f95e78 commit 067de34b8e10448307fa402db6e83ff413f95e78 Author: John Baldwin AuthorDate: 2025-01-14 15:39:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:19:26 +0000 pmcannotate: Add a '-m' mode option to control per-line annotations. - "block" (the default mode) displays per-block percentages in front of each annotated line. - "global" displays a global percentage in front of each line. - "raw" displays the raw count of sample hits in front of each line. Reviewed by: Pau Amma , mav Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D35401 (cherry picked from commit de11299323e0a647ae2164f74ca966862e7c4dd8) --- usr.sbin/pmcannotate/pmcannotate.8 | 15 ++++++++++- usr.sbin/pmcannotate/pmcannotate.c | 54 ++++++++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/usr.sbin/pmcannotate/pmcannotate.8 b/usr.sbin/pmcannotate/pmcannotate.8 index 9a89c40db1e7..e2fae0a7a7e0 100644 --- a/usr.sbin/pmcannotate/pmcannotate.8 +++ b/usr.sbin/pmcannotate/pmcannotate.8 @@ -25,7 +25,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.Dd November 20, 2008 +.Dd January 14, 2025 .Dt PMCANNOTATE 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl h .Op Fl k Ar pathname .Op Fl l Ar level +.Op Fl m Ar mode .Ar pmcout.out binaryobj .Sh DESCRIPTION The @@ -84,6 +85,18 @@ This directory specifies where should look for the kernel and its modules. The default is .Pa /boot/kernel . +.It Fl m Ar mode +Format to use when annotating source or assembly lines. +One of: +.Bl -tag -width indent +.It Cm block +Display percentage of matching samples relative to samples +falling in the current block. +.It Cm global +Display percentage of matching samples relative to all samples. +.It Cm raw +Display the raw count of matching samples. +.El .El .Sh LIMITATIONS As long as diff --git a/usr.sbin/pmcannotate/pmcannotate.c b/usr.sbin/pmcannotate/pmcannotate.c index 32138aa6c3a7..c00e4b2a33bc 100644 --- a/usr.sbin/pmcannotate/pmcannotate.c +++ b/usr.sbin/pmcannotate/pmcannotate.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -59,7 +60,7 @@ exit(EXIT_FAILURE); \ } while (0) -#define PERCSAMP(x) ((x) * 100 / totalsamples) +#define PERCSAMP(x) ((float)(x) * 100 / totalsamples) struct entry { TAILQ_ENTRY(entry) en_iter; @@ -109,7 +110,9 @@ static TAILQ_HEAD(, aggent) fqueue = TAILQ_HEAD_INITIALIZER(fqueue); * Use a float value in order to automatically promote operations * to return a float value rather than use casts. */ -static float totalsamples; +static u_int totalsamples; + +static enum { RAW, BLOCK_PERCENT, GLOBAL_PERCENT } print_mode; /* * Identifies a string cointaining objdump's assembly printout. @@ -501,6 +504,30 @@ general_insertent(struct entry *entry) TAILQ_INSERT_TAIL(&mainlst, entry, en_iter); } +/* + * Return a string either holding a percentage or the raw count value. + */ +static const char * +print_count(u_int nsamples, u_int totsamples) +{ + static char buf[16]; + + switch (print_mode) { + case RAW: + snprintf(buf, sizeof(buf), "%u", nsamples); + break; + case BLOCK_PERCENT: + snprintf(buf, sizeof(buf), "%.2f%%", (float)nsamples * 100 / + totsamples); + break; + case GLOBAL_PERCENT: + snprintf(buf, sizeof(buf), "%.2f%%", (float)nsamples * 100 / + totalsamples); + break; + } + return (buf); +} + /* * Printout the body of an "objdump -d" assembly function. * It does simply stops when a new function is encountered, @@ -529,8 +556,8 @@ general_printasm(FILE *fp, struct aggent *agg) if (obj == NULL) printf("\t| %s", buffer); else - printf("%.2f%%\t| %s", - (float)obj->en_nsamples * 100 / agg->ag_nsamples, + printf("%7s | %s", + print_count(obj->en_nsamples, agg->ag_nsamples), buffer); } } @@ -623,8 +650,8 @@ printblock(FILE *fp, struct aggent *agg) printf("\t| %s", buffer); else { done = 1; - printf("%.2f%%\t| %s", - (float)tnsamples * 100 / agg->ag_nsamples, buffer); + printf("%7s | %s", + print_count(tnsamples, agg->ag_nsamples), buffer); } } @@ -657,7 +684,7 @@ usage(const char *progname) { fprintf(stderr, - "usage: %s [-a] [-h] [-k kfile] [-l lb] pmcraw.out binary\n", + "usage: %s [-a] [-h] [-k kfile] [-l lb] [-m mode] pmcraw.out binary\n", progname); exit(EXIT_SUCCESS); } @@ -682,7 +709,8 @@ main(int argc, char *argv[]) kfile = NULL; asmsrc = 0; limit = 0.5; - while ((cget = getopt(argc, argv, "ahl:k:")) != -1) + print_mode = BLOCK_PERCENT; + while ((cget = getopt(argc, argv, "ahl:m:k:")) != -1) switch(cget) { case 'a': asmsrc = 1; @@ -693,6 +721,16 @@ main(int argc, char *argv[]) case 'l': limit = (float)atof(optarg); break; + case 'm': + if (strcasecmp(optarg, "raw") == 0) + print_mode = RAW; + else if (strcasecmp(optarg, "global") == 0) + print_mode = GLOBAL_PERCENT; + else if (strcasecmp(optarg, "block") == 0) + print_mode = BLOCK_PERCENT; + else + errx(1, "Invalid mode %s", optarg); + break; case 'h': case '?': default: From nobody Thu Feb 27 14:17:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YMK1RWTz5qGFW; Thu, 27 Feb 2025 14:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMK0mfMz3xNG; Thu, 27 Feb 2025 14:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ev9fEKAzgXv8MQZNY/U3XGHknOPtJ13fRPeBFA3v0R4=; b=gDrmAngIsC0I5wkvFdmkz24MJSOMCEJyr0m3OQ7G6C2UlQ23ZAyArjh5wWr4CXIB72oa98 LCAJCDXWD//Qb9D7Rpl/Rim+nHheIqe3Nso7vfFPB4rksp5o4I17+MAZredFTR5LH1RZQZ N/GG9nz7h4Pbd/VcGTecH1ZYAlxLFgGvG/JYlqK+3UJRdOrm5QloQzF9GkzHXt47w06rwL Bu/xzUFvmo8LHQY0a4eJPhNpGygvGxhAi6UIWfZbuBvK/ZnVbqeRC7ym1Yh3q9p0BHcKPv zprqu8gKkaqUXqdWP8U2yoAZWo84NihPOD/XJvSDYbVJim77oJZK9oQ+OQJGPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665853; a=rsa-sha256; cv=none; b=RPmV3sG6xwYppSaPBqknX32mI65Xpzbo7i1pJjYA+N0hd7MjFcIPxUMB1BfSrXH1cw+e1w ELR8aZoRd0x5QBuCF+2UQiD/2vhoWaBy7vX5gf+FiRiwjl/3DXVFnfY7dshLghbf8nThEQ wPXje2ts8RdZ2P9P0QGqlE8GN1n9KQrjL4Ccjp1d/X76/hGNtI2jOn8oSbBJTd9hvqQ16M pn7dT1Lm5hZfj3jtsBcmSk7MWUa8cs2o/oWmfLxlmT1nHZm2uHtvpx61N7zniQNWxHrg+8 f45ThQcFWsU4TFxmLM8QL/0MnCE7+Ck2bZPfn0dVON5/tZjfmLrbFWuAtbuAOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ev9fEKAzgXv8MQZNY/U3XGHknOPtJ13fRPeBFA3v0R4=; b=TaypuihtIssC9rXGepBAIiCTR2cxWfq5JORdNctt5T19EorDORo9zuP72foL+6HDAR8C+0 KXO3o+6JMLkBErp73+2HAiD+YdIe7ek3AzFsYRfkU2+gBniyzWsCzdELAJaYNOnOKPVjml BdeJkkC5su8OrND1d3HQ0s8ytSn/neZoI+RbrtVhDcomuW8brH8SSlq7Iu2CvC7KsCKDfG 6IJq3MKr1VAw33pRoz9Rrj2JmkPAeTjEmc3l2QfJyhmDs/MRJaLYzkQcKFOKRqW5XrSN0S KrakdltM+C0Th77cI5B3GvqZHOZDqZxY3Lm00kO4zpMXEoN8iGzqdTqy+p9zBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YMK0NZXzmf2; Thu, 27 Feb 2025 14:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHWQh017573; Thu, 27 Feb 2025 14:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHWrI017570; Thu, 27 Feb 2025 14:17:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:32 GMT Message-Id: <202502271417.51REHWrI017570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a27c361e0503 - stable/14 - pci: Narrow the scope of recently-added PCI_IOV #ifdefs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a27c361e050331cd50d5fc1a7230fce62eee536c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a27c361e050331cd50d5fc1a7230fce62eee536c commit a27c361e050331cd50d5fc1a7230fce62eee536c Author: John Baldwin AuthorDate: 2024-08-08 19:05:23 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:24 +0000 pci: Narrow the scope of recently-added PCI_IOV #ifdefs Push the #ifdefs down into the function body instead of defining functions conditionally for ease of readability. These aren't critical paths, so one extra branch in the !PCI_IOV case is not a big deal. Requested by: jrtc27 Differential Revision: https://reviews.freebsd.org/D45877 (cherry picked from commit 971c9f57d7e6b55161fecc008e19f00ccaba8060) --- sys/dev/pci/pci.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 4be3210840fc..b40a352a4818 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -164,18 +164,12 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_delete_resource, pci_delete_resource), DEVMETHOD(bus_alloc_resource, pci_alloc_resource), -#ifdef PCI_IOV DEVMETHOD(bus_adjust_resource, pci_adjust_resource), -#else - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), -#endif DEVMETHOD(bus_release_resource, pci_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), -#ifdef PCI_IOV DEVMETHOD(bus_map_resource, pci_map_resource), DEVMETHOD(bus_unmap_resource, pci_unmap_resource), -#endif DEVMETHOD(bus_child_deleted, pci_child_deleted), DEVMETHOD(bus_child_detached, pci_child_detached), DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), @@ -5784,11 +5778,11 @@ pci_deactivate_resource(device_t dev, device_t child, int type, return (0); } -#ifdef PCI_IOV int pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5808,6 +5802,7 @@ pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_adjust_resource(dev, child, type, r, start, end)); } @@ -5816,6 +5811,7 @@ int pci_map_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map_request *argsp, struct resource_map *map) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5835,6 +5831,7 @@ pci_map_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_map_resource(dev, child, type, r, argsp, map)); } @@ -5843,6 +5840,7 @@ int pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map *map) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5860,10 +5858,10 @@ pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_unmap_resource(dev, child, type, r, map)); } -#endif void pci_child_deleted(device_t dev, device_t child) From nobody Thu Feb 27 22:22:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3m6K1hjhz5JlFf; Thu, 27 Feb 2025 22:22:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3m6J2w2Pz3YR3; Thu, 27 Feb 2025 22:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740694920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/iz2HSFOjdLlCsk3DUmwOze5MmXUzK/94QMwU1DgOGo=; b=IbsK9MJKbYA5APL8fgxtyjd2wF7nn4YEcInM8ny/X/nbhplN+sKJrc3SrAOKKeiDb5mayq 93ow2j0SGwGo85QCUSlC8bRqH35Utse0natUPzaFHqxj2JmYEY23auH8kubiwyRfx0geLA mOS+VU01V9YrxM/jHdWlDTMhSm2up8Zz/jj4+LESIjASUWF55s+l0sz4xkTWpaUxRg7cO6 LmGeGJ6eemwVrP8oKmSpNTgexKQ9j+W3d0zAeRBpF78HLDmMs4z7pkNHEeDKKA40Qa1x3Q WmhEFaGm3Cflxb4Zj90gkMZ7u/PodtIi6xHELcfr3PLm/dopDXYwsHwJ8mqnDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740694920; a=rsa-sha256; cv=none; b=mo3y/l1JHxhJZItkycnFtZJsLcBZiz4dgxBzd4bjZnAbVZ/kyaRbZoYuT/eRNYJMsLcZU2 hqy31Mf3aJiyF0Q7/98ehGbpOCyuZV0lQaKQxuA0/7TlsvhlSa6hod9af3La7B1aFKIqPm 0gA70lIleTFGrFMx14ihv+w+XEPHawJa6uT+o8DDhVipnTsy1ovXLMeR98ZELDt3zyk0Fi 4puuLiODPm3RaBzYAqMQcTbhgRLLNlzdeiQrRSszX+aSRWWEQ8i9P4CXvQHyb06uWfsm1m b1v+HZ7lHGI5Tipt9UjXWhbJywEHP2yGcRvwuoYr1osPQl2gwVtQN3NQlh+sKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740694920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/iz2HSFOjdLlCsk3DUmwOze5MmXUzK/94QMwU1DgOGo=; b=W+WtHTVLceQyF2rLOQI6HMEfv+qoQPno+0QJyRwUQKNDImU1LBnR2/LpiV5at/29STeXL+ 2IUCoMq5Bmlla/DG3elk8tR2r3wmWQKQaM1emJyjO6LaLrFzWpIzGsidjrF7VNu7N6U3gA sBiqORIBlaYFVdS1tN3rkcmej5d/AvA5D03Bz1LRhBL2Q4v951VzVmihRZiITlarDXYPV6 jSakssFXDUZX861BohUE/1r+ymQlDfFeDa3P0QUiO4xPP9uqM66taxTrO8gBwacY9seMKn w2MZIgO9+ylyohrVZT24IMQHkPXDg7es/iBAokdGHb0nLA4q/z6tJwmOaisM8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3m6J1vM3z11QL; Thu, 27 Feb 2025 22:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RMM0sn033516; Thu, 27 Feb 2025 22:22:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RMM0fg033513; Thu, 27 Feb 2025 22:22:00 GMT (envelope-from git) Date: Thu, 27 Feb 2025 22:22:00 GMT Message-Id: <202502272222.51RMM0fg033513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4262dbc57982383eb61a8b7806de6dd4b7802da8 Auto-Submitted: auto-generated 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 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 22:20:22 +0000 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 MLINKS+=rue.4 if_rue.4 MLINKS+=scsi.4 cam.4 MLINKS+=scsi.4 scbus.4 diff --git a/share/man/man4/uath.4 b/share/man/man4/uath.4 index 7d9632fe8e0f..865f04b84232 100644 --- a/share/man/man4/uath.4 +++ b/share/man/man4/uath.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: ISC +.\" .\" Copyright (c) 2006 .\" Damien Bergamini .\" @@ -19,7 +21,7 @@ .Os .Sh NAME .Nm uath -.Nd Atheros USB IEEE 802.11a/b/g wireless network device +.Nd Atheros USB IEEE 802.11a/b/g wireless network driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 508c87c6a925..5d4ada1d1a1f 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -54,7 +54,7 @@ .Sh NAME .Nm upgt .Nd Conexant/Intersil PrismGT SoftMAC USB IEEE 802.11b/g wireless network -device +driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your From nobody Thu Feb 27 16:55:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3csz4Ygbz5qNdC; Thu, 27 Feb 2025 16:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3csz3mfZz45wm; Thu, 27 Feb 2025 16:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zljk37+rKd1B3nI71W6ANQTt3Q09/nBHVvaMPm9MOWM=; b=l6L3FtGUxmLVja1yz6B28coGeTydkrjniCIAcTEszDnDCA2i8lGFC7kYPD1zblXKkq9CxM TEgzuGPvHWwTAp3LFHf37um8y3rUNKvu3hVrBAstG0mtPUS3NNqjlnYgPgOeGPFrU5ikiI cdAeyCxl0ehuzoyl9+eIrqPl0E5w01xLZ40vs9UyuGE+4uoIZ4j+gB/EmFuwdkt86BqshE YelohQ73CTujIWZe50e0+kx8WuotWk+koDgvc+a/LmebVMq8oHrYZ/r6A3k35WBuVMc5b7 JPantLh8wXP2iKDj4mALctUYye80xCWP/3vuL5SIatjRxC+fTmMgrQsOfn1HxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675351; a=rsa-sha256; cv=none; b=muHxVVLGLvCMId4uXnficsYR89A7AvtFm4MhUUraOt4CnBisNHmX6ZsJhSECVw6yuMVcBc RspcWbBg8meYQd8oGy1UHk9zRzt6Ft8FQpuhKaCvkxcfsUAWz02GIN9cChM9o0dY3LXk4X YaADoY5dPJ8xHRATuwBtpQHqhLEg+uW6WvwQpZpe3O4DuQWDtJLCdGSPE9Hq7Os5ASjrKb z8CuQHpVT7bREkG9B7Gr654RMkqMz81i4WhVKxZBeM//8vGbnZtozC3ysHy/hwbS5jh23s LemZpNm7+CFDWo0xHAhjPj5odehfWaVagse2am8qr+oURcuODVV5HaIOxMUvLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zljk37+rKd1B3nI71W6ANQTt3Q09/nBHVvaMPm9MOWM=; b=K7n5KN6XYnbwMpLv2wZW6805cG5Hyt79f+KpH4ZHOWbkKTmgPG/oWVnyWbIa4uFBVlIlDA kJQncXIaPvOFw6ZFCMyIP27Qe2sKWv0/xnnzW0ZwmoRTELgB1Yyfcftf3B7v5scCOqcZwx PynV8qb+hsZDd0xSA+9e92kYn6YydYhXN13mzCLW36AaGx7p6ZyNUiJ2Sxctf2j/35YOPB LsHessm7Lg2CyDN6170bSr/JGZj6ecJyuUY4PUXLWq7Lz8+/NPmMZZu46rAu+RtDEIm6Ps 538tT/xyDfmkA8k7jr0FBnRE/JWbjHIsPqTAvNYTGvPlO28fpjCLthJHca+7PQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3csz3CPkzrGm; Thu, 27 Feb 2025 16:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtpvq016917; Thu, 27 Feb 2025 16:55:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtpY9016914; Thu, 27 Feb 2025 16:55:51 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:51 GMT Message-Id: <202502271655.51RGtpY9016914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7a88ac783b97 - stable/14 - dpaa2_mc: Check for error the first time bus_generic_detach is called List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a88ac783b97acf59209a96eae49f367b0afefad Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7a88ac783b97acf59209a96eae49f367b0afefad commit 7a88ac783b97acf59209a96eae49f367b0afefad Author: John Baldwin AuthorDate: 2024-11-05 01:30:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:17:57 +0000 dpaa2_mc: Check for error the first time bus_generic_detach is called This removes the need for the second call. Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D47388 (cherry picked from commit 24d5a8e6eec2b9eed9591971f223d79b8d7044c9) --- sys/dev/dpaa2/dpaa2_mc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index a6b56be10432..792745a535b3 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -281,7 +281,9 @@ dpaa2_mc_detach(device_t dev) struct dpaa2_devinfo *dinfo = NULL; int error; - bus_generic_detach(dev); + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->rcdev) @@ -292,10 +294,6 @@ dpaa2_mc_detach(device_t dev) if (dinfo) free(dinfo, M_DPAA2_MC); - error = bus_generic_detach(dev); - if (error != 0) - return (error); - return (device_delete_children(dev)); } From nobody Thu Feb 27 14:17:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLh4cSbz5qFrP; Thu, 27 Feb 2025 14:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLh40wPz3xPJ; Thu, 27 Feb 2025 14:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/kv/rreLgajWkXqvR25Ui+NGxtXosQ7u3Fr6f9HcRps=; b=Fku0anIY+xGzYp4jOY+ASTloVAJ+nzRBJ+1owjLFonO85eXBwqx4K4kbVYUtme+/sheG1i lpt9hFO8SSzyic7FX1ATyda0r67wt2VYs2iX9sSEHs+TpPSQ5jkvF7/AuqZ35/DxrqkX8w lb9NDjPAlWuHNREIxqDqoo1yrq7eh83IISNn9U4T11f9N0LC4jz7RLFFuY8ldvESW9k7VX A3r2YeH3aBwZFIwDS22ZxzZ0E1sJ22ooeFZSTUYDkXgFYRdnglowdKVv9tuEjbfUco2yCW eLyRN1mv4PPCcWyC/UtJlkaQrkev4XkMhwvifL7F0wCMYJ80XrdtqhT2A8xvog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665820; a=rsa-sha256; cv=none; b=jte6D/SeImr+UkIEqSCO8FsOxvOO7X0BvfeIEWbzLtvbcJrbqLEGL+09bWWzoiRw2Ia8bN D4dqWYyTQ1D2ITfooNMN/t1MIcEbqDfeGiHK1oh+aMmEqYnhJA8IV0nJByprzGb44I2ndt Ng7P52szITYTCh/TrjuIrBJjtiVY+mT1o3g4apJx5Auuk4TRDoB0XzSA9UVet5P0VTKdSa 44E59eLkZhelWN4wGk2gqft/k/aHyorauhbUb3nvCT0oTtDGWCi/vRHpwSVVkYJucda06h 0Yb4xeCdlQ1PHlObsBQUsN8i3rFUT/EDdJ+o0/5RIpVOT0KW6Wjvh+fpoJgy+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/kv/rreLgajWkXqvR25Ui+NGxtXosQ7u3Fr6f9HcRps=; b=hGbJUER+qIDdBU5D2uH40KjcXjbJ5rOf/5loMdHXc1hZxIB7lCYu1DxSyDwmIVdP49I7l5 t53nWRgisQ1ucBjRMXGtpS2qdrGx0UISmqiMv51LLAHSO9UgyuMWBzzEuOHBWCSNfGH88n 5m7Or0XVcFObwQuagKouc6EJKZUFE1eAlg+yS20p1T3uBWvTlyyCwnnz5ri45T1+AggKC+ BV/LerRrxdmfaP6mMrkTko4sOJb2DHkznDZo1McSbiLqM2v4k4v1dc7zUC6jHGbQuNwtb/ n9HW4zIGwPy/JrI1aofDMOAD1u+ObLflKxbEv68wPP/zCYKlxzt9Q+Q5NFt3xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLh3cXvzmZS; Thu, 27 Feb 2025 14:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH020016567; Thu, 27 Feb 2025 14:17:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH02i016564; Thu, 27 Feb 2025 14:17:00 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:00 GMT Message-Id: <202502271417.51REH02i016564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c8e37e38080d - stable/14 - pci_host_generic: Set a valid error if allocating a range resource fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c8e37e38080dac3287578ab05d4d8e28046a2493 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c8e37e38080dac3287578ab05d4d8e28046a2493 commit c8e37e38080dac3287578ab05d4d8e28046a2493 Author: John Baldwin AuthorDate: 2024-02-16 00:05:09 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Set a valid error if allocating a range resource fails Previously pci_host_generic_attach was returning 0 (success) incorrectly if allocating a range failed. The error value was 0 from the previously successful call to bus_set_resource in this case. Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation (cherry picked from commit 992f5b16afa73d0ea63c8a886a78ad2eda928e37) --- sys/dev/pci/pci_host_generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 45a478634d20..ca384d9a1483 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -216,6 +216,7 @@ pci_host_generic_core_attach(device_t dev) if (sc->ranges[tuple].res == NULL) { device_printf(dev, "failed to allocate resource for range %d\n", tuple); + error = ENXIO; goto err_rman_manage; } } From nobody Thu Feb 27 14:16:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLg3frPz5qG2G; Thu, 27 Feb 2025 14:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLg37BGz3xMG; Thu, 27 Feb 2025 14:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8V/ijkAOSN0CezVXAmbSDBhcG1ZzmR63eoHSkv/430=; b=Hr+O2zBRvu9YmAfU1Fu1wXRrhnmCdMaiEgQj3S0KYavdUPRPcvV02ha1ihCBQF0gm52w/L eCB9TGYF+4T2KHjiRJS3UKZN3QqSy+7njFbPxTeTs0uFpVVOrUIIA6aoAp2BIEdKz1oK4F /rv1qnv5W/9sNUFHMWaO1qUFjtHs1tHhfHcSlJUbekoAyfAP5KGcGbHTgigzd+WDTdLa/H WPvz9F9aLN+1V3CMwz1lU5kadc85zw3W1J9NzU11uNiYSBmWo/QSIm8vF+4iIjLxaKztH9 uM22T4EyEELf3cX9JOWnalE9Kw3IlBpQxYITH9cHCQf6vmJocak7jpvcmOONZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665819; a=rsa-sha256; cv=none; b=Rc+hv87LCRmF/ZXsbdhdVCjBU2RlxZzPNfkPzRXfWOMAH6evdu/0ewSuF4ygPbO6Ao05ix vu79vNyl3AENjGwXSoIMZNRz5ZdlJ0KeQNCN4eyYSuX3CnKrVNmkcm/HWaEJwTErvnSmNh 9NBQLPjQxN08rWvMw12UjqEtatHAtWE1ytBAZYHrPJiikl0/h2r/52MMJqxnfFJORVTVVL HN/Azwl35VmGpz2OHNzj9JK5UXQ7FrtviZWrXjpWa7pM8HeQSOawbWKNNumoNmjBNEpTzU SpiThV1WYDlxCyfDh8RifeUQAKTs9MzN2m4/kHEWrypO0qdUfN7om9+AVjRNpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8V/ijkAOSN0CezVXAmbSDBhcG1ZzmR63eoHSkv/430=; b=UOqDytlFiYUzo9fzTuf0GsM2zJJy0Nea4QBgyw2qt41N9E0yvCfMk1cLojmFpwxO68Oey8 FeoZKPCrdHV121PAOcDwoddv7mefQ4k5oxztwZ0I6Nd00ytx+u7l9+T5L1gh26uaIo/4cy M2BRiZuS4rmo22qr7LkMpeNqnEuVtw/0DKyVtdz2VI4KYIktZzOm3CqqCCdhhXQ/DDx3zK ApAFGIojvkrzuEDJm078OBDbejYYRJAeomrYJiYykck/oym1c16W0UqJw7KaBZSUWDilJQ Fcro+LkNNvUI5PW2CkmN8cZyHLQdewEFlbvimC2qse6rhxzSX4Se+vhjbH2vCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLg2h6pzmQG; Thu, 27 Feb 2025 14:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGx2M016526; Thu, 27 Feb 2025 14:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGxle016523; Thu, 27 Feb 2025 14:16:59 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:59 GMT Message-Id: <202502271416.51REGxle016523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a18502645663 - stable/14 - simplebus: Implement bus_delete_resource List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a185026456636915d727465ae87a70697cc8deaa Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a185026456636915d727465ae87a70697cc8deaa commit a185026456636915d727465ae87a70697cc8deaa Author: John Baldwin AuthorDate: 2024-02-16 00:05:00 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 simplebus: Implement bus_delete_resource (cherry picked from commit e89d0785ff1332d234ae4382a849f3c23e23573a) --- sys/dev/fdt/simplebus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index 854494eb4899..4c6f5921b713 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -105,6 +105,7 @@ static device_method_t simplebus_methods[] = { DEVMETHOD(bus_unmap_resource, simplebus_unmap_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), DEVMETHOD(bus_get_property, simplebus_get_property), From nobody Thu Feb 27 14:16:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YL73Wv5z5qFx4; Thu, 27 Feb 2025 14:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL72hBFz3x99; Thu, 27 Feb 2025 14:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHKh8uYdlXjAEVPiBgccxPW0jGILV307YUInqI7OXuI=; b=Vgs7QbshnSzZiX8j0bPdRLE3oSO3Zn002qPTtM+xPm/6jA/NekMo2EzGw63vwMjD5yBqzj u5Lyg/9bZEktyM//N/Fn9FyATEqDtN4mJe6ck5RL9/i8/khG5zsGo/4MMXgRnfqxEJpmMI yTT0qwfoYagv3P9Uqrnj0R2tdVvud7Ah2Rvm4iSP77tJiL0lC8ihdWSrifsj357FOt4D9t 7AKlEsmEU8MLrg5QhtUZsMED55oP39nChaEZHvzJQHFRhalVZ5iMzRCBAIZu9OiVcxSjMB hGhPkmjjCnVQKkUzwhRlLSsb/BelTzJ8i9TT78cLTnv3KOeMvaFyx9j5yyD+wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665791; a=rsa-sha256; cv=none; b=YtYPsnJeaNdsfb4YxJv5LcAhzr7oXU72e1eg4JmreHqEWrIDntP7M6LmtxgU+/FCfpo7k0 Vh5jtX86EMYdRqVQ9ymv+pHLjJohQZouVXLBDpe9uFU1ocOp+6aOpNz8aiyiCBMDIF424g gkdHZTrz9DOgB2qAyf5zUHRc8DrA1I4raGIljiLTbnKAd569LExM6qQHUIJL2/uNmEXqoS WEVv7mQ+ehV5Ju87XtFPGOX9bkzHe0ijWMBmtOWjomPo3GkcajXdN42mGX7VfEziRhb2IR u2U58m7g8Sd9mC6+1iAILIHjgPo6lyVIE+NbkfpuAmpCvCdxDFtf+qVedH/zyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHKh8uYdlXjAEVPiBgccxPW0jGILV307YUInqI7OXuI=; b=Ef/VmohYQzOMJ4Q/ePBH23x6El6+0TQgaX7pd7moPqCZ1kX9+NeaLKkYxBj0iOijA4rZr4 X6utePr00gRpe1yB66xRDi/A/pt1i9eGBwjCXTxhHwF0rSgS2XGh6JLbB9QGz5AFnN9Era rXS/V21GUcvHw16WB2N3ApmGufquGp9697yZjQS52pfuH+a6npIvwSthGCGPR/W1pAX+JN 4oSbo8gV//sm2s3NIgHvkDHSgJCA/32ToTmr0mW/XF5uyQWqp0t2nv6CbBMfSBjjSOI2HD TKGfU+J8lghv4YOnfbaLxbGYlMiY3ntrTIO1hEZSKuCkMFaagby82via3ZCGdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YL72DcvzlsR; Thu, 27 Feb 2025 14:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGVsY015617; Thu, 27 Feb 2025 14:16:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGVA6015614; Thu, 27 Feb 2025 14:16:31 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:31 GMT Message-Id: <202502271416.51REGVA6015614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7007ee0b58e1 - stable/14 - x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7007ee0b58e13cbc9ed6d3c044ffca022ce2200e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7007ee0b58e13cbc9ed6d3c044ffca022ce2200e commit 7007ee0b58e13cbc9ed6d3c044ffca022ce2200e Author: John Baldwin AuthorDate: 2024-01-23 17:35:47 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43430 (cherry picked from commit 31e15e531c51be35c6907bbb6b1a5ab125f08a0d) --- sys/x86/include/legacyvar.h | 4 ++++ sys/x86/pci/pci_bus.c | 22 +++++++++++++++++++++- sys/x86/pci/qpi.c | 4 +++- sys/x86/x86/mptable_pci.c | 4 +++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/x86/include/legacyvar.h b/sys/x86/include/legacyvar.h index 2c9cf1391934..5627e9b90306 100644 --- a/sys/x86/include/legacyvar.h +++ b/sys/x86/include/legacyvar.h @@ -62,6 +62,10 @@ int legacy_pcib_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end); int legacy_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +int legacy_pcib_activate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); +int legacy_pcib_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); int legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); int legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq); diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c index ecca10dd2606..cdb9c770b847 100644 --- a/sys/x86/pci/pci_bus.c +++ b/sys/x86/pci/pci_bus.c @@ -625,6 +625,24 @@ legacy_pcib_release_resource(device_t dev, device_t child, int type, int rid, return (pci_domain_release_bus(0, child, rid, r)); return (bus_generic_release_resource(dev, child, type, rid, r)); } + +int +legacy_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(0, child, rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +int +legacy_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(0, child, rid, r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} #endif static device_method_t legacy_pcib_methods[] = { @@ -643,12 +661,14 @@ static device_method_t legacy_pcib_methods[] = { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c index 6aea8992a420..237ed315e53a 100644 --- a/sys/x86/pci/qpi.c +++ b/sys/x86/pci/qpi.c @@ -285,12 +285,14 @@ static device_method_t qpi_pcib_methods[] = { DEVMETHOD(bus_alloc_resource, qpi_pcib_alloc_resource), DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/x86/x86/mptable_pci.c b/sys/x86/x86/mptable_pci.c index 80cc7af948dd..a1b93a927c8d 100644 --- a/sys/x86/x86/mptable_pci.c +++ b/sys/x86/x86/mptable_pci.c @@ -175,11 +175,13 @@ static device_method_t mptable_hostb_methods[] = { #endif #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 14:17:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLs4YrZz5qG2L; Thu, 27 Feb 2025 14:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLs3vNPz3xH5; Thu, 27 Feb 2025 14:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b021BCpLlT95Oh4krmjiBb2JbDJQlC3bxtOpDTbSeCo=; b=gFq8DFJrxlf82YozbaNVUnVx4P0i6VJ+GNHLAfUcn8I140nGhSIzsWBtN/wO4exH6+2tOl M1ftAs8ujQ6lFBBNtRKeVYMwcaozbrRrjtg/8lzUz0eGZkyrEtsjY8eKQR+iICbIG607yt 65Yj7TdrsMUUunwHGMncJdV/xv+rVW1iRz/7MFa0NmDt4ZZrUfYpH4WWQtiCYL/kUTzOHP RvsTXDeHTD8eo43eYcdZUGVo0NqpDZpkjxWhDa+Kife0t5Sa2toUaHN+er5jwt966QWrZJ y1aqMK4JzCh8qdI0BDFiF6HFOHOqtV7fErD2YJVIsZiBBFYWA85enwbAALG5og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665829; a=rsa-sha256; cv=none; b=JqRS5f7fWq+iCXjF6hxo9KmfSA2xygayaKXyMtLS5VC4HS2WFZAzM5EgOoyilHoTOXvvKR dd4HNR7NrK7arWioF0/1NNxWKIP+OaCNDJZ3PwULAkrCzj/IEL9AhJ0r7pszqz+MQPpAs5 OaSbyxT/ERBX3Mpt5Ub4/EV1XNt90seWRUQui+8KiY3de2xxqPhu2tuY7LwvaUe0L1Muzs fVFEeqf3ZT47u0G/cjUTsah2Z4khEiV2LA8oBD5u2BV2mh1wZmKD1jOcmps/MZu6RPTXV0 UF8fAti8Zo8Jo2WAVLusOtErIckrgLMA8etiK2k7UZUaK7gU3V0JtgDCpuDbAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b021BCpLlT95Oh4krmjiBb2JbDJQlC3bxtOpDTbSeCo=; b=bTZ9QB/tnNSz4yjg2nxOzxRhnaRJ1yfS52R2DQLMgWcldASgAV/9rgyEJ9PHZbYBEYkiMT Xql9ET+C3mv5Dj5jhXtjAP4xkCiR0fu86qswwYqmqTVE3BGMuuyuMz8gBkps6XuomFx6no 5tA+L9sNg/rtyFHUOaJhalCoPE+tafSL3BOpxMt1VP5i7baELfuatYoS0EgWxhs89iEYV6 FtBdwE1ioHQvYkLsb5tRgS9tP7XnRnfpBl5Xg2lAK6JitMeJT1igek+HT+OYOoIm4N1FZw S3TV+XnZca0NbFe/8PEC7/3x0reYRWlW6BR7aBb7shOLGQhHOWw+XJqlni0IgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLs3WM7zmZV; Thu, 27 Feb 2025 14:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH9YW016852; Thu, 27 Feb 2025 14:17:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH9lA016849; Thu, 27 Feb 2025 14:17:09 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:09 GMT Message-Id: <202502271417.51REH9lA016849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3ebdf18d5a75 - stable/14 - dpaa2: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3ebdf18d5a75f6b878cb2f29befc312380b9d68f Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3ebdf18d5a75f6b878cb2f29befc312380b9d68f commit 3ebdf18d5a75f6b878cb2f29befc312380b9d68f Author: John Baldwin AuthorDate: 2024-02-27 19:43:50 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 dpaa2: Use bus_generic_rman_* Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D43937 (cherry picked from commit 9b619f0e9082b8f97f0e20ec5176fe40ba8565f8) --- sys/dev/dpaa2/dpaa2_mc.c | 76 +++++++++++++++++-------------------------- sys/dev/dpaa2/dpaa2_mc.h | 1 + sys/dev/dpaa2/dpaa2_mc_acpi.c | 1 + sys/dev/dpaa2/dpaa2_mc_fdt.c | 1 + 4 files changed, 33 insertions(+), 46 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index 02470a3efd6e..a6b56be10432 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -115,7 +115,6 @@ static struct resource_spec dpaa2_mc_spec[] = { static u_int dpaa2_mc_get_xref(device_t, device_t); static u_int dpaa2_mc_map_id(device_t, device_t, uintptr_t *); -static struct rman *dpaa2_mc_rman(device_t, int); static int dpaa2_mc_alloc_msi_impl(device_t, device_t, int, int, int *); static int dpaa2_mc_release_msi_impl(device_t, device_t, int, int *); @@ -312,10 +311,10 @@ dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid, struct rman *rm; int error; - rm = dpaa2_mc_rman(mcdev, type); - if (!rm) - return (BUS_ALLOC_RESOURCE(device_get_parent(mcdev), child, - type, rid, start, end, count, flags)); + rm = dpaa2_mc_rman(mcdev, type, flags); + if (rm == NULL) + return (bus_generic_alloc_resource(mcdev, child, type, rid, + start, end, count, flags)); /* * Skip managing DPAA2-specific resource. It must be provided to MC by @@ -331,24 +330,10 @@ dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid, } } - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (!res) { - device_printf(mcdev, "rman_reserve_resource() failed: " - "start=%#jx, end=%#jx, count=%#jx\n", start, end, count); + res = bus_generic_rman_alloc_resource(mcdev, child, type, rid, start, + end, count, flags); + if (res == NULL) goto fail; - } - - rman_set_rid(res, *rid); - - if (flags & RF_ACTIVE) { - if (bus_activate_resource(child, type, *rid, res)) { - device_printf(mcdev, "bus_activate_resource() failed: " - "rid=%d, res=%#jx\n", *rid, (uintmax_t) res); - rman_release_resource(res); - goto fail; - } - } - return (res); fail: device_printf(mcdev, "%s() failed: type=%d, rid=%d, start=%#jx, " @@ -363,9 +348,10 @@ dpaa2_mc_adjust_resource(device_t mcdev, device_t child, int type, { struct rman *rm; - rm = dpaa2_mc_rman(mcdev, type); + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); if (rm) - return (rman_adjust_resource(r, start, end)); + return (bus_generic_rman_adjust_resource(mcdev, child, type, r, + start, end)); return (bus_generic_adjust_resource(mcdev, child, type, r, start, end)); } @@ -375,12 +361,10 @@ dpaa2_mc_release_resource(device_t mcdev, device_t child, int type, int rid, { struct rman *rm; - rm = dpaa2_mc_rman(mcdev, type); - if (rm) { - KASSERT(rman_is_region_manager(r, rm), ("rman mismatch")); - rman_release_resource(r); - } - + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); + if (rm) + return (bus_generic_rman_release_resource(mcdev, child, type, + rid, r)); return (bus_generic_release_resource(mcdev, child, type, rid, r)); } @@ -388,26 +372,26 @@ int dpaa2_mc_activate_resource(device_t mcdev, device_t child, int type, int rid, struct resource *r) { - int rc; - - if ((rc = rman_activate_resource(r)) != 0) - return (rc); + struct rman *rm; - return (BUS_ACTIVATE_RESOURCE(device_get_parent(mcdev), child, type, - rid, r)); + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); + if (rm) + return (bus_generic_rman_activate_resource(mcdev, child, type, + rid, r)); + return (bus_generic_activate_resource(mcdev, child, type, rid, r)); } int dpaa2_mc_deactivate_resource(device_t mcdev, device_t child, int type, int rid, struct resource *r) { - int rc; - - if ((rc = rman_deactivate_resource(r)) != 0) - return (rc); + struct rman *rm; - return (BUS_DEACTIVATE_RESOURCE(device_get_parent(mcdev), child, type, - rid, r)); + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); + if (rm) + return (bus_generic_rman_deactivate_resource(mcdev, child, type, + rid, r)); + return (bus_generic_deactivate_resource(mcdev, child, type, rid, r)); } /* @@ -496,7 +480,7 @@ dpaa2_mc_manage_dev(device_t mcdev, device_t dpaa2_dev, uint32_t flags) if (flags & DPAA2_MC_DEV_ALLOCATABLE) { /* Select rman based on a type of the DPAA2 device. */ - rm = dpaa2_mc_rman(mcdev, dinfo->dtype); + rm = dpaa2_mc_rman(mcdev, dinfo->dtype, 0); if (!rm) return (ENOENT); /* Manage DPAA2 device as an allocatable resource. */ @@ -521,7 +505,7 @@ dpaa2_mc_get_free_dev(device_t mcdev, device_t *dpaa2_dev, return (EINVAL); /* Select resource manager based on a type of the DPAA2 device. */ - rm = dpaa2_mc_rman(mcdev, devtype); + rm = dpaa2_mc_rman(mcdev, devtype, 0); if (!rm) return (ENOENT); /* Find first free DPAA2 device of the given type. */ @@ -747,8 +731,8 @@ dpaa2_mc_map_id(device_t mcdev, device_t child, uintptr_t *id) * @internal * @brief Obtain a resource manager based on the given type of the resource. */ -static struct rman * -dpaa2_mc_rman(device_t mcdev, int type) +struct rman * +dpaa2_mc_rman(device_t mcdev, int type, u_int flags) { struct dpaa2_mc_softc *sc; diff --git a/sys/dev/dpaa2/dpaa2_mc.h b/sys/dev/dpaa2/dpaa2_mc.h index 9a21c9724b82..40b318c4c9e7 100644 --- a/sys/dev/dpaa2/dpaa2_mc.h +++ b/sys/dev/dpaa2/dpaa2_mc.h @@ -179,6 +179,7 @@ int dpaa2_mc_detach(device_t dev); /* For bus interface. */ +struct rman *dpaa2_mc_rman(device_t mcdev, int type, u_int flags); struct resource * dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); diff --git a/sys/dev/dpaa2/dpaa2_mc_acpi.c b/sys/dev/dpaa2/dpaa2_mc_acpi.c index 75cbfcb0791f..1042ea56d8cf 100644 --- a/sys/dev/dpaa2/dpaa2_mc_acpi.c +++ b/sys/dev/dpaa2/dpaa2_mc_acpi.c @@ -356,6 +356,7 @@ static device_method_t dpaa2_mc_acpi_methods[] = { DEVMETHOD(device_detach, dpaa2_mc_detach), /* Bus interface */ + DEVMETHOD(bus_get_rman, dpaa2_mc_rman), DEVMETHOD(bus_alloc_resource, dpaa2_mc_alloc_resource), DEVMETHOD(bus_adjust_resource, dpaa2_mc_adjust_resource), DEVMETHOD(bus_release_resource, dpaa2_mc_release_resource), diff --git a/sys/dev/dpaa2/dpaa2_mc_fdt.c b/sys/dev/dpaa2/dpaa2_mc_fdt.c index 8e9ab10dec9d..a6babfc89ca9 100644 --- a/sys/dev/dpaa2/dpaa2_mc_fdt.c +++ b/sys/dev/dpaa2/dpaa2_mc_fdt.c @@ -355,6 +355,7 @@ static device_method_t dpaa2_mc_fdt_methods[] = { DEVMETHOD(device_detach, dpaa2_mc_detach), /* Bus interface */ + DEVMETHOD(bus_get_rman, dpaa2_mc_rman), DEVMETHOD(bus_alloc_resource, dpaa2_mc_alloc_resource), DEVMETHOD(bus_adjust_resource, dpaa2_mc_adjust_resource), DEVMETHOD(bus_release_resource, dpaa2_mc_release_resource), From nobody Thu Feb 27 17:19:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3dP43KxNz59JmS; Thu, 27 Feb 2025 17:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3dP42YFyz46nQ; Thu, 27 Feb 2025 17:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740676760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r4qZeAC7IdAfAy0Q0KRkoojlhn5VxatjbzOdNJKB6mI=; b=Py0k19wDYiChQKXCC/Ed5sSTPXO2dPc0IN06j4SOmiXkrJQV6sbDoTt5IIoNQoi8MRBgxf Q6Qon/G5X33VWN0RGHm6QlRy7br3ffnosY0J+OmUgHdmBoX038n34ermuTR48JOlAXQe+o AAoKzzE3GVdrq8DdDBBOLEw45ppNIhnsgrlNb7Cpl86kxYpF10plMn7qbHCzb65LWakaU2 KZlzb6jytlIFv9eKeAU/Kmua2ROejLdFj4YmXx2OUAQA+5K+VpfzGbrnArt636ENx30yE4 ovtdUPB7agcyAtYZg1mh6XRTSaGK2XM2IJvmypdbSPl9DgZWfx40gO/zCw14lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740676760; a=rsa-sha256; cv=none; b=WQQUQKOa43drt90qkfXTp/hP5BzD28OH9GTbfTVXql9wh6tide2NiQ3lRVet8msGoQ9V44 W6rY7+wQhGj2n2xngsYge8kDrjVJHY7/H/+BUpj2ya27GLR1Tn0+wwRnvD0TTNTKFRKOeH b3t0+Yw+G8KfAoSUTklaHogM4NPnbIsSaCfkE0Q+B+xl7CHSTcuTE/m1YZ3p5bF1KX9pLG UUB1x7O4kUQE2m2R5E12ChTZB0ZOrbRimfMp9hdRpDgPN8XTKm67i3d4Nz52m9g5RwXNdz 3QMO5ay0ItfJ5Ey6BP0smRpq5nFJT4p9ASxXluLQQlhXRa+LOnIaEqfpx/ypgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740676760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r4qZeAC7IdAfAy0Q0KRkoojlhn5VxatjbzOdNJKB6mI=; b=sHg4CfWV1pDo4rMP8qTqWgi5FR/OTRj3t2NN/sp/uK5qKVibNhICG6hwpBnECxXUUihKT7 MxCBEXglChTExb4kgxbm6xc68iQiaKYQlFzyz1Qa5FqjtLNoEqYz5kESuZgsHbXvuH6UkJ tjcOQv4inGDpRPwanjf4wNmQSOjbCk6RRZhH3R9f4nkvqXtXWAledmSxKYCTclWb5wdMVh wSuEtHkLOjnRVOFjTUx2JdUNtX8eh1hmXomeL8oq3th9bjgbH3fngAopamumtbY3h1ivaz zA8TPpZ4J+1Nbla3qxUXapphxOrrvU2+gTVeFYVfT4PCtFsQpcAoIbMTf2z6Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3dP421S3zs0Q; Thu, 27 Feb 2025 17:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RHJKg5056813; Thu, 27 Feb 2025 17:19:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RHJKGC056810; Thu, 27 Feb 2025 17:19:20 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:19:20 GMT Message-Id: <202502271719.51RHJKGC056810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 08f22bb41f08 - stable/14 - cxgbe tom: Make t4_push_frames static to t4_cpl_io.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 08f22bb41f08b8f8344eb92ac4c44bf085ae6187 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=08f22bb41f08b8f8344eb92ac4c44bf085ae6187 commit 08f22bb41f08b8f8344eb92ac4c44bf085ae6187 Author: John Baldwin AuthorDate: 2025-01-14 15:34:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:17:51 +0000 cxgbe tom: Make t4_push_frames static to t4_cpl_io.c This function is not used outside of this file. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47760 (cherry picked from commit c2cd12b7ae28a34e551d1b96906620249a860bc0) --- sys/dev/cxgbe/tom/t4_cpl_io.c | 2 +- sys/dev/cxgbe/tom/t4_tom.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 0a40bbda3f3f..836d32360b1e 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -633,7 +633,7 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbuf *stop, int nsegs, int n) * stalls). When drop is set this function MUST drop the bytes and wake up any * writers. */ -void +static void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) { struct mbuf *sndptr, *m, *sb_sndptr; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 1f97dd81a0bc..6295a3484b9f 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -525,7 +525,6 @@ int t4_send_fin(struct toedev *, struct tcpcb *); int t4_send_rst(struct toedev *, struct tcpcb *); void t4_set_tcb_field(struct adapter *, struct sge_wrq *, struct toepcb *, uint16_t, uint64_t, uint64_t, int, int); -void t4_push_frames(struct adapter *, struct toepcb *, int); void t4_push_pdus(struct adapter *, struct toepcb *, int); /* t4_ddp.c */ From nobody Thu Feb 27 15:05:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3ZQD3Y1cz5qJ2c; Thu, 27 Feb 2025 15:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ZQD2KKRz41K0; Thu, 27 Feb 2025 15:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740668708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d7xvxFzzZVLbxG2O8fiWgfOcsjryP85FMbIbEBbbVDQ=; b=QNtfLDvevWwkEp4u3yrf7DUbWPpPg+WGPyt5j0lSte6lrylQFlK7tEILuH5kfF6anXQqq4 aOAm8f/xoHpnt15Etx8+QRt99de3bRFhsBvM9OelbCYVUKtjxDkrztksU5VRQLar8NsJbg sMWChkMIbmeeqt/QcjhjpkzPqUbbJuFW2iCmYzigTwAkhKl1P/h8bpAMrIkFwZ/rXCDm/o +A9GFTWCMR3KLgnosgJamfBdDWmyFGlr1QOPPGzD9Dwvea9+oter5guC8y9ZYe55XS+Na0 gQNHaX0VN6Daz+ATgOhXt7g35VfHQDhjPAtQtFYc8dTUit0uFRyjuy+sBzu6hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740668708; a=rsa-sha256; cv=none; b=n0A1mMlM3hkrD8fGJ4X8WCPWT5zsR1IlBRKM88DBcv47vpd3+jpk1YXrVED2O6WOQtPDPo pgPntKCmGu9cHfeRIGlo8O/bbHK/gr2+cBSUHU1f4+E1B5NfiOqKCOwK//ZJXSx40bQVNA 4D1kmpVyU4Fd7gR17WVTfyLAonmxLJhPUGsLOLsfnSqZy2CqJ/PXSJCnPpYqNWIrlU6oi4 9lcGCAkDhKd1QPYx7oGsg1DiJG7YHBvqL67nQvTk37qyT9lyeVmzCXYHTFAJ9hWpCcMcDP g5a4xZCBj8MujYdXYz6ZJGAw/FBM7tfT3zYFEoqXcQiTHHum1+cw1ae7WSJpHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740668708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d7xvxFzzZVLbxG2O8fiWgfOcsjryP85FMbIbEBbbVDQ=; b=cVV5Hfd0zk49SRqG1IQjfyGE++fapt6B7Ey4q4/9DYtZ6Zc5qZjT2CZVQ9iqkL14i4Iwm5 z/oaZx2CsCYj1ILXHVxYeE5XE+krnvlB/fbqBJvxIsav2Eh88bGTlzMh1OQcQJlJs9P3Ff t2EKDLBKZBJ8jnVS++GABTG9w0I4mVgood4mqecl1Cta/ht7uurRnsxy2XJ1SzeElgUFeG 7rhWWXsVYHvpgjN8Bjv/591wfmdyFCpBuym2bf5qtfITIjZNuQBkUlciYTyncfCn6ik9sg avGhh1BHlXaH6Hn5tvvvGgRLRWdmG2jetrq4UHI7KqTT2CX4XrEb+qqATRoM3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3ZQD1b8Mzp8v; Thu, 27 Feb 2025 15:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RF58Ap010381; Thu, 27 Feb 2025 15:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RF58VP010378; Thu, 27 Feb 2025 15:05:08 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:05:08 GMT Message-Id: <202502271505.51RF58VP010378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e75ef6dece8d - stable/14 - twe.4: Remove manpage for previously-removed driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e75ef6dece8db52fc85765e76a460c0556199bdf Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e75ef6dece8db52fc85765e76a460c0556199bdf commit e75ef6dece8db52fc85765e76a460c0556199bdf Author: John Baldwin AuthorDate: 2025-01-10 02:09:52 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:04:59 +0000 twe.4: Remove manpage for previously-removed driver Reviewed by: ziaee, imp Fixes: 062a7b918fac twe: Remove driver Differential Revision: https://reviews.freebsd.org/D48403 (cherry picked from commit ed49d3b31d425a0add04aff6eb721a474937b7da) --- ObsoleteFiles.inc | 3 + share/man/man4/Makefile | 1 - share/man/man4/twe.4 | 278 ------------------------------------------------ 3 files changed, 3 insertions(+), 279 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 8eec739cd89c..244089fd2d4f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -1921,6 +1921,9 @@ OLD_FILES+=usr/share/certs/trusted/TrustCor_ECA-1.pem OLD_FILES+=usr/share/certs/trusted/TrustCor_RootCert_CA-1.pem OLD_FILES+=usr/share/certs/trusted/TrustCor_RootCert_CA-2.pem +# 20230510: twe(4) driver removed +OLD_FILES+=usr/share/man/man4/twe.4.gz + # 20230505: md5 tests are now self-contained OLD_FILES+=usr/tests/sbin/md5/1.inp OLD_FILES+=usr/tests/sbin/md5/1.sha512-p.chk diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5bbf718911d7..979dc37d7db4 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -563,7 +563,6 @@ MAN= aac.4 \ tslog.4 \ tty.4 \ tun.4 \ - twe.4 \ tws.4 \ udp.4 \ udplite.4 \ diff --git a/share/man/man4/twe.4 b/share/man/man4/twe.4 deleted file mode 100644 index 03a51b7b6a50..000000000000 --- a/share/man/man4/twe.4 +++ /dev/null @@ -1,278 +0,0 @@ -.\" -.\" Copyright (c) 2000 Michael Smith -.\" Copyright (c) 2000 BSDi -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.Dd May 7, 2023 -.Dt TWE 4 -.Os -.Sh NAME -.Nm twe -.Nd 3ware 5000/6000/7000/8000 series PATA/SATA RAID adapter driver -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device pci" -.Cd "device twe" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -twe_load="YES" -.Ed -.Sh DEPRECATION NOTICE -The -.Nm -driver is not present in -.Fx 14.0 . -.Sh DESCRIPTION -The -.Nm -driver provides support for AMCC's 3ware 5000/6000/7000/8000 series -PATA/SATA RAID adapters. -These adapters were formerly known as -.Dq 3ware Escalade . -.Pp -These devices support 2, 4, 8, or 12 ATA disk drives -and provide RAID0 (striping) and RAID1 (mirroring) functionality. -.Sh HARDWARE -The -.Nm -driver supports the following PATA/SATA RAID -controllers: -.Pp -.Bl -bullet -compact -.It -AMCC's 3ware 5000 series -.It -AMCC's 3ware 6000 series -.It -AMCC's 3ware 7000-2 -.It -AMCC's 3ware 7006-2 -.It -AMCC's 3ware 7500-4LP -.It -AMCC's 3ware 7500-8 -.It -AMCC's 3ware 7500-12 -.It -AMCC's 3ware 7506-4LP -.It -AMCC's 3ware 7506-8 -.It -AMCC's 3ware 7506-12 -.It -AMCC's 3ware 8006-2LP -.It -AMCC's 3ware 8500-4LP -.It -AMCC's 3ware 8500-8 -.It -AMCC's 3ware 8500-12 -.It -AMCC's 3ware 8506-4LP -.It -AMCC's 3ware 8506-8 -.It -AMCC's 3ware 8506-8MI -.It -AMCC's 3ware 8506-12 -.It -AMCC's 3ware 8506-12MI -.El -.Sh DIAGNOSTICS -.Ss Controller initialisation phase -.Bl -diag -.It twe%d: microcontroller not ready -.Pp -The controller's onboard CPU is not reporting that it is ready; -this may be due to either a board or system failure. -Initialisation has failed. -.It twe%d: no attention interrupt -.It twe%d: can't drain AEN queue -.It twe%d: reset not reported -.It twe%d: controller errors detected -.It twe%d: can't drain response queue -.It twe%d: reset %d failed, trying again -.Pp -The controller is not responding correctly to -the driver's attempts to reset and initialise it. -This process is retried several times. -.It twe%d: can't initialise controller, giving up -.Pp -Several attempts to reset and initialise the controller have failed; -initialisation has failed -and the driver will not attach to this controller. -.El -.Ss Driver initialisation/shutdown phase -.Bl -diag -.It twe%d: register window not available -.It twe%d: can't allocate register window -.It twe%d: can't allocate parent DMA tag -.It twe%d: can't allocate interrupt -.It twe%d: can't set up interrupt -.It twe%d: can't establish configuration hook -.Pp -A resource allocation error occurred while initialising the driver; -initialisation has failed -and the driver will not attach to this controller. -.It twe%d: can't detect attached units -.Pp -Fetching the list of attached units failed; initialisation has failed. -.It twe%d: error fetching capacity for unit %d -.It twe%d: error fetching state for unit %d -.It twe%d: error fetching descriptor size for unit %d -.It twe%d: error fetching descriptor for unit %d -.It twe%d: device_add_child failed -.It twe%d: bus_generic_attach returned %d -.Pp -Creation of the disk devices failed, either due to communication -problems with the adapter or due to resource shortage; -attachment of one or more units may have been aborted. -.El -.Ss Operational phase -.Bl -diag -.It twe%d: command completed - %s -.El -.Pp -A command was reported completed with a warning by the controller. -The warning may be one of: -.Bl -diag -.It redundant/inconsequential request ignored -.It failed to write zeroes to LBA 0 -.It failed to profile TwinStor zones -.El -.Bl -diag -.It twe%d: command failed - %s -.El -.Pp -A command was reported as failed by the controller. -The failure message may be one of: -.Bl -diag -.It aborted due to system command or reconfiguration -.It aborted -.It access error -.It access violation -.It device failure -.It controller error -.It timed out -.It invalid unit number -.It unit not available -.It undefined opcode -.It request incompatible with unit -.It invalid request -.It firmware error, reset requested -.Pp -The command will be returned to the operating system after a -fatal error. -.El -.Bl -diag -.It twe%d: command failed submission - controller wedged -.Pp -A command could not be delivered to the controller because -the controller is unresponsive. -.It twe%d: AEN: <%s> -.El -.Pp -The controller has reported a change in status using an AEN -(Asynchronous Event Notification). -The following AENs may be reported: -.Bl -diag -.It queue empty -.It soft reset -.It degraded mirror -.It controller error -.It rebuild fail -.It rebuild done -.It incomplete unit -.It initialisation done -.It unclean shutdown detected -.It drive timeout -.It drive error -.It rebuild started -.It aen queue full -.Pp -AENs are also queued internally for use by management tools. -.El -.Bl -diag -.It twe%d: error polling for signalled AENs -.Pp -The controller has reported -that one or more status messages are ready for the driver, -but attempting to fetch one of these has returned an error. -.It twe%d: AEN queue overflow, lost AEN <%s> -.Pp -A status message was retrieved from the controller, -but there is no more room to queue it in the driver. -The message is lost (but will be printed to the console). -.It twe%d: missing expected status bits %s -.It twe%d: unexpected status bits %s -.Pp -A check of the controller's status bits -indicates an unexpected condition. -.It twe%d: host interrupt -.Pp -The controller has signalled a host interrupt. -This serves an unknown purpose and is ignored. -.It twe%d: command interrupt -.Pp -The controller has signalled a command interrupt. -This is not used, and will be disabled. -.It twe%d: controller reset in progress... -.Pp -The controller is being reset by the driver. -Typically this is done when the driver has determined that the -controller is in an unrecoverable state. -.It twe%d: can't reset controller, giving up -.Pp -The driver has given up on resetting the controller. -No further I/O will be handled. -.It controller reset done, %d commands restarted -.Pp -The controller was successfully reset, -and outstanding commands were restarted. -.El -.Sh AUTHORS -.An -nosplit -The -.Nm -driver and manual page were written by -.An Michael Smith Aq Mt msmith@FreeBSD.org . -.Pp -Extensive work done on the driver by -.An Vinod Kashyap Aq Mt vkashyap@FreeBSD.org -and -.An Paul Saab Aq Mt ps@FreeBSD.org . -.Sh BUGS -The controller cannot handle I/O transfers -that are not aligned to a 512-byte boundary. -In order to support raw device access from user-space, -the driver will perform alignment fixup on non-aligned data. -This process is inefficient, -and thus in order to obtain best performance -user-space applications accessing the device -should do so with aligned buffers. From nobody Thu Feb 27 14:17:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM13j3dz5qGFn; Thu, 27 Feb 2025 14:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM13GGDz3xHK; Thu, 27 Feb 2025 14:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7juZ/A3c+p6WOOdjFpKMdzsnMZi/TqV2ju86j3Y/6k=; b=LdQzuVDMWCRmy/4mqOJGdcZoZLS577VQQfaauqNH8/FeUWgn6TOl9X0bSbOcJ1MqPIyGye cQBHojUTGIca51/dSwy4GHZQIfLxSVEfg+7k+oH28rczSlsSX7UvX1oc5SeXceSbqzszVF LGCj3b7TZuYQ4pfMZPtgqedfTYSBCtdWxD+9IuiWFJpE1kalvYghvW+sTgedIxhsIT/m+H Ba4LBcI7G9Ra5MXEFN8fThLFMcBIaEZC46tU6h1O2TK2wo6vbRWge+KHjPFP0G3z3uo61W QQpo1LDisl3IF7l2UH7zQtRWz/4o4opdhdd2zJ5dEPjr+8EsnUxcnfNnE/ue9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665837; a=rsa-sha256; cv=none; b=rLCCNSqn39FvHgQuCxFh7AeHXeXtac3vqZ7M1ifNSO3d5Bs2fsx2DKlLI4xgj1Y145fRmk aY9/PSsTuhi7pj+ZBNCI1Fb578FT3Vxd8t0YRV+aZIL1U9vILkeDKmMqaWIBuDTTd7zCqM HdqDhHzwR9DByr7JknaVVr/Yvwd9PS0f87xCNppmOYaE6r6bfDWy6j30pPUlZxV3hbawAe owT+iAuLT5MaENuXEMjmXCWJg6E65QxoBTtrTvP5StrwcbpSr8g/hVMxynpPeSgWKItecd oJcl3GomFhduOcCHDN1Y3hJPItIcCYMoyqpijuzrRAVWsI8S1ns+SXDD3p6t2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7juZ/A3c+p6WOOdjFpKMdzsnMZi/TqV2ju86j3Y/6k=; b=px6dQLlUWjrhdy3rFU1nj8xVLvMIE+ToNuXqywUsl8iUyDPP8mfeD3rDN73iUJdmI2FXkz HRRWu5fgnb4sS/FxDe879upZzhZv77DOD5hkwy9AY3IWECAhBvGenlAi08l6QpPDV0YHU5 EeKD4SOGUIdMUyu9OzvqnplhPhd9YbdTVNwh31cAfcKsA/Z7s1UawVQbxh5D5dPv5fQKDM QQSCFDGyanXmzn07++Tal7HrGSs7fxKMas51lz/tjHraLhnEeWu2KpJWHleUI1xxVLx5+0 hZVDNOOhaZb8JLKcVt3TgNAVzQl7Ogur3qNNbUvBM7rqdeExhwq0CR+pIKM25g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM12q5tzm7Q; Thu, 27 Feb 2025 14:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHHle017082; Thu, 27 Feb 2025 14:17:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHHGE017079; Thu, 27 Feb 2025 14:17:17 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:17 GMT Message-Id: <202502271417.51REHHGE017079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f3a90481145e - stable/14 - rman: Add rman_get/set_type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3a90481145e531a56363b6f2193aa9221aac0a5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f3a90481145e531a56363b6f2193aa9221aac0a5 commit f3a90481145e531a56363b6f2193aa9221aac0a5 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 rman: Add rman_get/set_type This permits associating a resource type (e.g. SYS_RES_MEMORY) with a struct resource. I considered adding a new field to struct rman to store the type and only providing rman_get_type as an accessor. However, changing 'struct rman' is an ABI breakage. I might revisit this in main, but the current approach is MFC'able. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44122 (cherry picked from commit b30a80b65587fb9fd4a5f012d606dbd0c6239a46) --- share/man/man9/Makefile | 2 ++ share/man/man9/rman.9 | 18 ++++++++++++++++-- sys/kern/subr_rman.c | 13 +++++++++++++ sys/sys/rman.h | 2 ++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index c2e145eaeb08..abf7ba82e6b3 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1874,6 +1874,7 @@ MLINKS+=rman.9 rman_activate_resource.9 \ rman.9 rman_get_rid.9 \ rman.9 rman_get_size.9 \ rman.9 rman_get_start.9 \ + rman.9 rman_get_type.9 \ rman.9 rman_get_virtual.9 \ rman.9 rman_init.9 \ rman.9 rman_init_from_resource.9 \ @@ -1888,6 +1889,7 @@ MLINKS+=rman.9 rman_activate_resource.9 \ rman.9 rman_set_bustag.9 \ rman.9 rman_set_mapping.9 \ rman.9 rman_set_rid.9 \ + rman.9 rman_set_type.9 \ rman.9 rman_set_virtual.9 MLINKS+=rmlock.9 rm_assert.9 \ rmlock.9 rm_destroy.9 \ diff --git a/share/man/man9/rman.9 b/share/man/man9/rman.9 index 095cd2760b8c..35a2d176233c 100644 --- a/share/man/man9/rman.9 +++ b/share/man/man9/rman.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 20, 2016 +.Dd March 13, 2024 .Dt RMAN 9 .Os .Sh NAME @@ -56,7 +56,9 @@ .Nm rman_set_bushandle , .Nm rman_get_bushandle , .Nm rman_set_rid , -.Nm rman_get_rid +.Nm rman_get_rid , +.Nm rman_set_type , +.Nm rman_get_type .Nd resource management functions .Sh SYNOPSIS .In sys/types.h @@ -125,6 +127,10 @@ .Fn rman_set_rid "struct resource *r" "int rid" .Ft int .Fn rman_get_rid "struct resource *r" +.Ft void +.Fn rman_set_type "struct resource *r" "int type" +.Ft int +.Fn rman_get_type "struct resource *r" .Sh DESCRIPTION The .Nm @@ -457,6 +463,14 @@ The function retrieves this RID. .Pp The +.Fn rman_set_type +function associates a resource type with a resource +.Fa r . +The +.Fn rman_get_type +function retrieves this type. +.Pp +The .Fn rman_get_device function returns a pointer to the device which reserved the resource .Fa r . diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 3e91fc40150a..f5a782a00dce 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -92,6 +92,7 @@ struct resource_i { device_t r_dev; /* device which has allocated this resource */ struct rman *r_rm; /* resource manager from whence this came */ int r_rid; /* optional rid for this resource. */ + int r_type; /* optional type for this resource. */ }; static int rman_debug = 0; @@ -942,6 +943,18 @@ rman_get_rid(struct resource *r) return (r->__r_i->r_rid); } +void +rman_set_type(struct resource *r, int type) +{ + r->__r_i->r_type = type; +} + +int +rman_get_type(struct resource *r) +{ + return (r->__r_i->r_type); +} + void rman_set_device(struct resource *r, device_t dev) { diff --git a/sys/sys/rman.h b/sys/sys/rman.h index bb63c4dfb100..e116ff5ed1c3 100644 --- a/sys/sys/rman.h +++ b/sys/sys/rman.h @@ -134,6 +134,7 @@ void rman_get_mapping(struct resource *, struct resource_map *); int rman_get_rid(struct resource *); rman_res_t rman_get_size(struct resource *); rman_res_t rman_get_start(struct resource *); +int rman_get_type(struct resource *); void *rman_get_virtual(struct resource *); int rman_deactivate_resource(struct resource *r); int rman_fini(struct rman *rm); @@ -158,6 +159,7 @@ void rman_set_irq_cookie(struct resource *_r, void *_c); void rman_set_mapping(struct resource *, struct resource_map *); void rman_set_rid(struct resource *_r, int _rid); void rman_set_start(struct resource *_r, rman_res_t _start); +void rman_set_type(struct resource *_r, int _type); void rman_set_virtual(struct resource *_r, void *_v); extern struct rman_head rman_head; From nobody Thu Feb 27 18:58:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3gbb3PN2z59PtS; Thu, 27 Feb 2025 18:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gbb2dm4z3QZH; Thu, 27 Feb 2025 18:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J5uuuTcbiLzvUo7yS2CCkuusAIzCLhWDbPbpsm5eDrE=; b=q+G56jPLyeiPXmqyaiV4z9zelI7VQA1rTf0JUHiMcdevnp9r91bJ48qnEGNGY6dAJm24jg F7h2n2Rf3pVa67BeghxbEsHEJfiDgeHY6e2qvpT/eCChTRUtNZVH3h1dIZ9HQK4Nv81AWF q2mo/z7tqx9/1tqxIyEc6f+TmQUeahx4Merlt791YE4jkG+JPVtKm90LPFG1Jqe+tzvG9q IcMZex8ZwUBEiwTOLQl04H/ZpcpIYcBZQEeQCbjUURbRGgcje6aGeibV4TlO8HDVpbCbjx Dt/bG4yUR0T2is4Mpj6rcC+aOfOQquK2Nk8zUXNpuPri+3WixR1xQC66ka65pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682715; a=rsa-sha256; cv=none; b=s6Tls+AxyhitkIzRLznxUIupH5ox1qxqOYUNn5JjusY7+5UTOI6CAGQqoq554pOCkf7bBU G7CTCq82dHHPmvDuGIJUfSUk1Iv7uJC0RUA08tQ7kWrwvAhjnstIe3Ir9rA0MqyZrf3SUI WYuMoIkHcgsZ+7bF2/rBXCpAV6qxVsymFlyKmj15rQFK+ClLO/WE7Fb85kr2DRkaEjuhIn /FHnSzR8xG/Hcvd+4zwNXS7VPJDPBjciY4BrqkFJ8NX93gSAUhXekKawDV7Psx+mFJryAB gGrq6XaFHZhTyWR3X0PdGuAeEjHojUyBlTOaVaM4N/8gcUTll0VymyZ1OXYtMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J5uuuTcbiLzvUo7yS2CCkuusAIzCLhWDbPbpsm5eDrE=; b=rxXWKOQdPzROyXKP5EPFJcEtTaLav0Bjr6ZxH6NB2Lc0SAr/NrqnJojJBQjGXUwdCUGpME axeWnFwSHMdFIlMK/4XxJ/70ahOfrUNyvp+/nWXZpOTMDo+CzhJIqjvtWBxvqUUgoklcPz C9flC4L6gtnWtAEQer+yN2PQTAzT+HmgJIpHx8+KrcB2fGK7KTpXKyMV7/7aLO4IGcE5HO eyuQKHMiL7SnR52RLAVWjDiOO3CWoFBqcUzXuNDx8y/fmDQeCl/DXAsaWKfAythYn1OhaQ WXtg9KsMYeaZEv2IEiYCUdz1vwFWtmUYFuOBNhDwc2JiW2MO0i3q8ENeaufI/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3gbb1h3Fzw0n; Thu, 27 Feb 2025 18:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIwZAq042817; Thu, 27 Feb 2025 18:58:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIwZrN042814; Thu, 27 Feb 2025 18:58:35 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:58:35 GMT Message-Id: <202502271858.51RIwZrN042814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: dd48b36aa295 - stable/14 - universe: Permit requesting a specific version of GCC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd48b36aa295a81cffe55095c9e404f7471728f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dd48b36aa295a81cffe55095c9e404f7471728f7 commit dd48b36aa295a81cffe55095c9e404f7471728f7 Author: John Baldwin AuthorDate: 2025-01-11 03:49:59 +0000 Commit: John Baldwin CommitDate: 2025-02-27 18:57:03 +0000 universe: Permit requesting a specific version of GCC If USE_GCC_TOOLCHAINS is set to a value matching the pattern 'gcc*', use that as the GCC version. For example, USE_GCC_TOOLCHAINS=gcc16 would use amd64-gcc16 for amd64, etc. If the variable is set to a value that doesn't match that pattern, use the default version. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48418 (cherry picked from commit 550137eab24ab6bdf05bfbb986927004b9f2f34e) --- Makefile | 18 ++++++++++-------- share/man/man7/build.7 | 7 ++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 60639f908b98..5880347e1261 100644 --- a/Makefile +++ b/Makefile @@ -551,14 +551,16 @@ TARGET_ARCHES_${target}= ${MACHINE_ARCH_LIST_${target}} .endfor .if defined(USE_GCC_TOOLCHAINS) -TOOLCHAINS_amd64= amd64-gcc12 -TOOLCHAINS_arm= armv6-gcc12 armv7-gcc12 -TOOLCHAIN_armv7= armv7-gcc12 -TOOLCHAINS_arm64= aarch64-gcc12 -TOOLCHAINS_i386= i386-gcc12 -TOOLCHAINS_powerpc= powerpc-gcc12 powerpc64-gcc12 -TOOLCHAIN_powerpc64= powerpc64-gcc12 -TOOLCHAINS_riscv= riscv64-gcc12 +_DEFAULT_GCC_VERSION= gcc12 +_GCC_VERSION= ${"${USE_GCC_TOOLCHAINS:Mgcc*}" != "":?${USE_GCC_TOOLCHAINS}:${_DEFAULT_GCC_VERSION}} +TOOLCHAINS_amd64= amd64-${_GCC_VERSION} +TOOLCHAINS_arm= armv6-${_GCC_VERSION} armv7-${_GCC_VERSION} +TOOLCHAIN_armv7= armv7-${_GCC_VERSION} +TOOLCHAINS_arm64= aarch64-${_GCC_VERSION} +TOOLCHAINS_i386= i386-${_GCC_VERSION} +TOOLCHAINS_powerpc= powerpc-${_GCC_VERSION} powerpc64-${_GCC_VERSION} +TOOLCHAIN_powerpc64= powerpc64-${_GCC_VERSION} +TOOLCHAINS_riscv= riscv64-${_GCC_VERSION} .endif # If a target is using an external toolchain, set MAKE_PARAMS to enable use diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 4bff6164dd56..a1da9dce4bec 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 13, 2024 +.Dd January 10, 2025 .Dt BUILD 7 .Os .Sh NAME @@ -879,6 +879,11 @@ This variable implies Use external GCC toolchains to build the requested targets. If the required toolchain package for a supported architecture is not installed, the build for that architecture is skipped. +.Pp +A specific version of GCC can be used by setting the value of this variable +to the desired version +.Pq for example, Dq gcc14 ; +otherwise a default version of GCC is used. .It Va TARGETS Only build the listed targets instead of each supported architecture. .It Va EXTRA_TARGETS From nobody Thu Feb 27 14:16:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLJ3JWVz5qFXt; Thu, 27 Feb 2025 14:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLJ1ZN0z3x9N; Thu, 27 Feb 2025 14:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B0MCZGAK/fh3evAkGMx01yoZdj4k7PUaMez+BetqgDI=; b=Ye0YGc2UB8S+/ETbzcuOuZJRoz+OTi1YQ5ums3mXaruGvlC3LLjTnOVzSbK5qF32AsDv51 weEL2RsP0DOjQeTuPTWDn4luEOf3DvCJj8drEs/ncurHRircDMnQpB1LnMe+7VBAP99AN3 3jzDMuEHSqiOzl2i2YjOXftTTnVDpdLCN2EIY2+XVIZhYsSqjDAD07mz0ogWXvi4KlpPoi +rkC1WivXQhdnDUXxN6kC0MOzro5IuESrLYQ7QtNHQangERZkDArkWcCIzq5H5+lFRjSZf sf8CJ79w+zYlsk/McZys71Vd0u5PSpWSTaJtGQx/5fGj+ekvC4Fv8DeaMO3Z9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665800; a=rsa-sha256; cv=none; b=Lz49TV1timyg2PNSQT/WCc+F+C1fkPaVGyAeIR2/QnsZG/nEICQWzsmb41pk/iLh1W11Lw HvvgaO//Ft8qJM3QMklWz6CQ3lEJXNjF0Bft84x+mvfEAPqLqoNM+I6pkqqh5UgE6EB9oG Qrqv3TEijCJYK84MwvJdDYyGbNnnN1MWSIcZ92hezeVgbVcGp94ZKbCk3nOfjDv9IWFqHI esRGjfcZbC4UJBTTtoUdWxIGfr2qqhkC3tZBc3iq7p9hrjOkBrJyt/1mc6yx3YpBHmG1jN aYRQVnMsdxGnFbn3qdppmopiziB4Oba833ydvsvtONqNQ01vkskXIX4SMr4Pwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B0MCZGAK/fh3evAkGMx01yoZdj4k7PUaMez+BetqgDI=; b=hLitzjRYajV6RLCK4k3H5EtqbtJo9nCpUGYTq5KW63LRhEYsUoAi3Os53kxikYRSV2zSaL SJcghtCeHie1CRAyFjAZOGTUMgPsWkopq6OhXKLKFcdzU7k0fSopd8T1NGkcfJVvvPOkkV 1jOyt9ywtfhyxq6NoFKFMbYp9/pPgHvU3rjPZkJm46Mzb+NuGu/ByNKA6JRPMzMgv/12iU UTbjoiA0bXXdZ0j9YgUK4bST6ro49Pq4v7J0XBZUTUOgf/0DfULPXEb/xv1Yr4aIN/x20p fGfEySktndGgvg2KzfrPFzX4NL0XZAPjEIvf/oreNphF7zaCIMyuXz5BajFokQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLJ17J9zm7K; Thu, 27 Feb 2025 14:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGefC015913; Thu, 27 Feb 2025 14:16:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGe8Q015910; Thu, 27 Feb 2025 14:16:40 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:40 GMT Message-Id: <202502271416.51REGe8Q015910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a7febc75da2f - stable/14 - arm nexus: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7febc75da2f84c03d991c9c8c4562438803e5e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a7febc75da2f84c03d991c9c8c4562438803e5e0 commit a7febc75da2f84c03d991c9c8c4562438803e5e0 Author: John Baldwin AuthorDate: 2024-01-23 17:37:13 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 arm nexus: Use bus_generic_rman_* - Implement bus_get_rman pulling bits from nexus_alloc_resource. - Implement bus_map/unmap_resource pulling bits from nexus_activate/deactivate_resource. - Use bus_generic_rman_* for bus_alloc/adjust/activate/deactivate/release_resource except for custom interrupt activate/deactivate logic still in nexus_activate/deactivate_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43437 (cherry picked from commit faeb273e7a8ec57d87de8d4337598fb11ae305c3) --- sys/arm/arm/nexus.c | 220 +++++++++++++++++++++++----------------------------- 1 file changed, 97 insertions(+), 123 deletions(-) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 108771db6301..0d37aa07f342 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -84,10 +84,10 @@ static bus_add_child_t nexus_add_child; static bus_print_child_t nexus_print_child; static bus_activate_resource_t nexus_activate_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_alloc_resource_t nexus_alloc_resource; static bus_deactivate_resource_t nexus_deactivate_resource; -static bus_release_resource_t nexus_release_resource; +static bus_get_rman_t nexus_get_rman; +static bus_map_resource_t nexus_map_resource; +static bus_unmap_resource_t nexus_unmap_resource; #ifdef SMP static bus_bind_intr_t nexus_bind_intr; @@ -120,10 +120,13 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), + DEVMETHOD(bus_alloc_resource, bus_generic_rman_alloc_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_get_rman, nexus_get_rman), + DEVMETHOD(bus_map_resource, nexus_map_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), + DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif @@ -217,83 +220,18 @@ nexus_add_child(device_t bus, u_int order, const char *name, int unit) return (child); } -/* - * Allocate a resource on behalf of child. NB: child is usually going to be a - * child of one of our descendants, not a direct child of nexus0. - */ -static struct resource * -nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +static struct rman * +nexus_get_rman(device_t bus, int type, u_int flags) { - struct resource *rv; - struct rman *rm; - int needactivate = flags & RF_ACTIVE; - - flags &= ~RF_ACTIVE; - switch (type) { case SYS_RES_IRQ: - rm = &irq_rman; - break; - + return (&irq_rman); case SYS_RES_MEMORY: case SYS_RES_IOPORT: - rm = &mem_rman; - break; - + return (&mem_rman); default: return (NULL); } - - rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == NULL) - return (NULL); - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv)) { - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); -} - -static int -nexus_adjust_resource(device_t bus __unused, device_t child __unused, int type, - struct resource *r, rman_res_t start, rman_res_t end) -{ - struct rman *rm; - - switch (type) { - case SYS_RES_IRQ: - rm = &irq_rman; - break; - case SYS_RES_MEMORY: - rm = &mem_rman; - break; - default: - return (EINVAL); - } - if (rman_is_region_manager(r, rm) == 0) - return (EINVAL); - return (rman_adjust_resource(r, start, end)); -} - -static int -nexus_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - int error; - - if (rman_get_flags(res) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, res); - if (error) - return (error); - } - return (rman_release_resource(res)); } static bus_space_tag_t @@ -372,73 +310,109 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; - - if ((err = rman_activate_resource(r)) != 0) - return (err); - /* - * If this is a memory resource, map it into the kernel. - */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); -#ifdef FDT - err = bus_space_map(fdtbus_bs_tag, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + err = rman_activate_resource(r); + if (err != 0) return (err); - } - rman_set_bustag(r, fdtbus_bs_tag); -#else - vaddr = (bus_space_handle_t)pmap_mapdev((vm_paddr_t)paddr, - (vm_size_t)psize); - if (vaddr == 0) { - rman_deactivate_resource(r); - return (ENOMEM); - } - rman_set_bustag(r, (void *)1); -#endif - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); - return (0); - } else if (type == SYS_RES_IRQ) { err = intr_activate_irq(child, r); if (err != 0) { rman_deactivate_resource(r); return (err); } + return (0); + default: + return (EINVAL); } - return (0); } static int -nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) { - bus_size_t psize; - bus_space_handle_t vaddr; + struct resource_map_request args; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + break; + default: + return (EINVAL); + } - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); - if (vaddr != 0) { #ifdef FDT - bus_space_unmap(fdtbus_bs_tag, vaddr, psize); + error = bus_space_map(fdtbus_bs_tag, start, length, 0, + &map->r_bushandle); + if (error) + return (error); + map->r_bustag = fdtbus_bs_tag; + map->r_vaddr = (void *)map->r_bushandle; #else - pmap_unmapdev((void *)vaddr, (vm_size_t)psize); + map->r_vaddr = pmap_mapdev(start, length); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = (void *)1; + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; #endif - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); - } - } else if (type == SYS_RES_IRQ) { - intr_deactivate_irq(child, r); + map->r_size = length; + return (0); +} + +static int +nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: +#ifdef FDT + bus_space_unmap(map->r_bustag, map->r_bushandle, map->r_size); +#else + pmap_unmapdev(map->r_vaddr, map->r_size); +#endif + return (0); + default: + return (EINVAL); } +} + +static int +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + int error; - return (rman_deactivate_resource(r)); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + error = rman_deactivate_resource(r); + if (error) + return (error); + intr_deactivate_irq(child, r); + return (0); + default: + return (EINVAL); + } } #ifdef FDT From nobody Thu Feb 27 14:16:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLT3QvVz5qFrM; Thu, 27 Feb 2025 14:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLT2ltgz3x9Z; Thu, 27 Feb 2025 14:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BOQu/7inv7eHloO7QgUqS2kHVvV1v9ihzLkeTpI8cvQ=; b=qnxp1k5Rld1AosUu/ultVxNM3nVDmZfrxuTJRkwM0ss4mELD2yQStVSnck1cc9hhU9yO3k bNx+E6a090z7h025dAJtmBpuHP8l+gSujYKP6Ys+kmEiy7ktsZJw3iflDPpFy0EHwEw2Wo aW/9RXKfTDWDF80SfgWZKnwWIepG5UXXGUIzcGohm+87tq9AUKy/t1yXDKnnlo9Sn5eYQf sL7DZRmsfQ1nBYHLpsCIcMlefSkVLTwTddhm96uj1OzgwXzXzefX8ijkemECgEcobvnvQV 5Uvr6jRl7Ne/7a8uxMN7UZ68fMSccG4At0NhlnlWmqsA7ve02mflaEUI8X7hQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665809; a=rsa-sha256; cv=none; b=WKGVlaMEcadmk4DeWgzJqGuYYFgiM1g7xkOgQsPffdWOnx/fcfGZERwXu52z2HuI4hAcdx xDCosJ2iF6M0xZU7SVwlSbVrOxgQ85Nq6r+utCluPxsX6LhCX4bgizYyi7tv2EMahfr1VT 4japDZGZepVqRNQ/kf+tgyoEf0so+nCFroZ7isRkfdFw0aPufBeTjutXrmfWfI7j+4Hnqe 6PF1fwsuiOt8ThO5EYvTYjQrLhUmApEZcgdPCr3qT5oPGbMdkpjm6T4cZjCaQodseaK3bb Y3ksVLk70EnPTZQPo/SvMGPSqIIriKbHcYv2xV4i30VEuRDMHp6Aipj2D4e+6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BOQu/7inv7eHloO7QgUqS2kHVvV1v9ihzLkeTpI8cvQ=; b=RRBszEUwy3Oy1JioGfuVf2e0/g7W7LeRElyr5C47wa9TDYAevpgtbvqCriYcry+F8tN52c VYUb40MPir3rhmdkQk0sOUO6MpZUOd8m+6ntzEcblpIxvOVHIKG3se73pW6v9m12NSLxMZ qx3L+1cmh6tPXQi6RjH8U8YUwI/tEJDHp6/4Kq10XbnrMhy3QYL7ce1OqXnbXaGA/z3hFO mn2l5uaF//sMQoGBQUEWb6ULanA7oIPcbTeSZNRLjpti77N8s6CiThoZvZX4Bdsj4EJOul eOR1D0EsIFiaqFWG9gDeESD+2W5kvuVprObr0QFUQsO1re122W/EgPp8yZTaBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLT24zlzlsS; Thu, 27 Feb 2025 14:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGnjx016193; Thu, 27 Feb 2025 14:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGnLk016190; Thu, 27 Feb 2025 14:16:49 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:49 GMT Message-Id: <202502271416.51REGnLk016190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: df96f1db4a20 - stable/14 - pcib: Allocate PCI_RES_BUS resources with RF_ACTIVE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: df96f1db4a201ccf97d6655b6f3b3254190c5311 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df96f1db4a201ccf97d6655b6f3b3254190c5311 commit df96f1db4a201ccf97d6655b6f3b3254190c5311 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pcib: Allocate PCI_RES_BUS resources with RF_ACTIVE The allocated bus numbers are in use so should be activated when allocated. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43689 (cherry picked from commit 36efc64a6bc6318eefd9baf88cbf511e91db80c8) --- sys/dev/pci/pci_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 2659e64f364d..5286d4e82e53 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -654,14 +654,14 @@ pcib_setup_secbus(device_t dev, struct pcib_secbus *bus, int min_count) */ rid = 0; bus->res = bus_alloc_resource_anywhere(dev, PCI_RES_BUS, &rid, - min_count, 0); + min_count, RF_ACTIVE); if (bus->res == NULL) { /* * Fall back to just allocating a range of a single bus * number. */ bus->res = bus_alloc_resource_anywhere(dev, PCI_RES_BUS, &rid, - 1, 0); + 1, RF_ACTIVE); } else if (rman_get_size(bus->res) < min_count) /* * Attempt to grow the existing range to satisfy the From nobody Thu Feb 27 14:17:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLr3R2gz5qG2K; Thu, 27 Feb 2025 14:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLr2z5qz3xRl; Thu, 27 Feb 2025 14:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z3yfyAX47SE60UfLQ6Auh5dz7Reh4GTNzlm5HYtIiu8=; b=R+4ScDPucovCurfQ6gS73W1xkwfz74VYCESh1/rLEzR9KwH4dnMRZzzarmbgD8xF+Tyye+ uvAqLIRbg6N4a9k/sc/Qhlmh1YuREXCCLM3HEBfBVWcZ75lSbsSeDvETxUQ7uuUKCilv84 9E+6adbyrBVSSBz6YhvfpcVrfdFyJKcwFOy5Ln6ZGeSRHDCkochKGc0fftDFlQrbxsE4ko Jr3nWMS5NsHZZECF4VsvHDRuT/WB47l8JpZ9DGTBfkrQhibKOGmfMyj53x9TxFPnLfU0HL j21/LHzt3Tt/7iAOuDeBdiCBCpCvbTNG4aoXIAU6u3S/sXEZVCKPiQY9oIN6JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665828; a=rsa-sha256; cv=none; b=y3XQeZthO3eb8CbdlQDsyd88rSkcYJMH3oX7kjWEBOhO55Xhl3M5jDCOvNdDgbNPSyz2LI ceIz3PwADM07hTAGdg98AXMAOtYew6NCE1gc7HmmO2KWt9oXLnVCFra3KUo0VmBvPjc+uB pN4dHB8l0/c+4Z5CcF1sIMm8Ngio6JimMMZ5rnYckRfikcTS/UNBzClIc/rSH4upbqDcHJ nPqRPPP/LgQc5IfcQX4pYFiWAp4kzl14hWWqQM/pBqIifnXeVM8R1HqVURMxXzV/3ltkdP 8vDxofGjFTYXEeobEAr4BHqpc+NHWNwPOtapHrG7eR7IWe6m5pPl9RdulgNquw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z3yfyAX47SE60UfLQ6Auh5dz7Reh4GTNzlm5HYtIiu8=; b=O7WgGnz+MHqJoWquEN/c2w2Sfk8U5eBFwwcM67766NH/sWTIFKuPMqZ/uLVEur/Q8hMF35 gsQCLFN3MA8MUfFxbbEBPkLe5NxuPY5KS5Pk7jO+Uvve8ESe+rc/mCI4S0Ynid8bM1j8LT dTY+LrG8AFV0bH27z3/MbRPmYQcFPoTLF+reSevxYe3+KxSxPdnPP+3jAwx7D98uxKTkuF rijGF8adv9MgPJVx8NBuySM8Z6TQCCfuop6/iTrANgqCUtrFMo2bMqxEIT41trmhdVY66V WuvHnIyikaqGVww40jN+71XnadvQQFECELcmEkFieQ9utLRPC5s00xA9r4i66w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLr2W81zmqR; Thu, 27 Feb 2025 14:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH8DU016818; Thu, 27 Feb 2025 14:17:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH8YX016815; Thu, 27 Feb 2025 14:17:08 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:08 GMT Message-Id: <202502271417.51REH8YX016815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b53a0db0cb41 - stable/14 - gpiobus: Add missing DEVMETHOD for bus_get_rman List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b53a0db0cb41678330685c620facb828941ed237 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b53a0db0cb41678330685c620facb828941ed237 commit b53a0db0cb41678330685c620facb828941ed237 Author: John Baldwin AuthorDate: 2024-02-23 00:14:58 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 gpiobus: Add missing DEVMETHOD for bus_get_rman Reported by: andrew Fixes: 5bda26333a8e gpiobus: Use bus_generic_rman_* (cherry picked from commit 04eca69323111986b262eef3135d804361b60d17) --- sys/dev/gpio/gpiobus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 18129c32133d..a8dd8a753676 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -1041,6 +1041,7 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), + DEVMETHOD(bus_get_rman, gpiobus_get_rman), DEVMETHOD(bus_add_child, gpiobus_add_child), DEVMETHOD(bus_child_deleted, gpiobus_child_deleted), DEVMETHOD(bus_rescan, gpiobus_rescan), From nobody Thu Feb 27 17:04:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3d3N6fvgz5qNLk; Thu, 27 Feb 2025 17:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3d3N61Swz46G8; Thu, 27 Feb 2025 17:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHhHUAX25fJ7ZZkEENM2sV4y5bRzczSGi2JIyBxyLi0=; b=H29PxnE7a3vfUokglF07dJ/oMRf6RiGAndXh1vIrFeXJqV/vuojM6hEIhqeQHTUsO7AFDh Tg5cMLTe0hl/4M24KDh1aqnXreUSMkTl9INRcruOdMnNAJ/L/yh/YFuBqb/wH8DRUCqpm7 YbAHOL0PbXpa14+fWBTvwR1rZpf3yL95pkMcE4Rl3X2pkiAHaBGZZUJM2jKKXBrUJnJdyt 6/AHv50VLMfZfwXh5GW5F4HtnXX40wiQA8BKlYqO2q9C8ixNnWk6/J1ptVx4okxJapiNiv wRd/sxMkN+UAbAALbkhjEWKo7Nzh6a4oTafgoe6GoPmLWQCIMjJcJhZFwTkIvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675840; a=rsa-sha256; cv=none; b=LoVRCYTd7Jb0Ig311NOIfcMXMFv0uAhoOW1/BjgIWNO5nMwkLbLGmPClsjIHS6lCO4y6JR +koZyn9LBVDK4eMzGL3GjJuL5pvqRNeCAoZcuELq4e6jmEyyZTi5qQmQ18NLvGkaEuKdWg w4wz35aKoDO9MY4NiB736ommRTq9DBONW/1XjuaR963kl4yu2ecWFYf5L/BprjM5gpsZCX IQDjG+0adJ1CIrHyCjkU24oOtYYrIO8NrGVTS6wI5LZ9ObkjUhd0k11aehElRrRpxOTnct HuaNB2NwI1uMP92cy4Ald6DveZ4WX8xq9GUzCRkmFlsSoHivn2rn38Ua1/0b9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHhHUAX25fJ7ZZkEENM2sV4y5bRzczSGi2JIyBxyLi0=; b=H2LaIFSHotUgWOlqqgQzFSvMyvgrLwRaIzABcBfzwE5DNU/Gnv00fmDruS7ds76v5ZeQel Y8aqayO4TF5zOhcoX3rTWFjxKgL4WTATeqtsYd6reFeaqvanby7TQ56JvTKaGgvhdZhp76 k36Jmog0ALBwSUA/wP+kruwdUWOy1BpkGcJg3y70P/U1jFvurEo65rDqSPRHbuCxO2L0+K PUxMNoIl6E1ATwiA1QBn3nYZ/RJSS304Nj8wxgJPRBB1CXdwOrlXmO5TJRQpCJSF8IOsZT hFP07THzgLX36saltbD9sLDvpKmS4chDsxrA7s8X0iITl6tOCT9LgxjHoxRayQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3d3N5YbYzs9F; Thu, 27 Feb 2025 17:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RH40dQ037036; Thu, 27 Feb 2025 17:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RH404P037033; Thu, 27 Feb 2025 17:04:00 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:04:00 GMT Message-Id: <202502271704.51RH404P037033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 53662f9c6690 - stable/14 - cxgbetool.8: Consistently use .Cm for loader tunables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 53662f9c66901d100c6e6ddd98da43ebadb49234 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=53662f9c66901d100c6e6ddd98da43ebadb49234 commit 53662f9c66901d100c6e6ddd98da43ebadb49234 Author: John Baldwin AuthorDate: 2024-12-10 20:34:10 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:03:27 +0000 cxgbetool.8: Consistently use .Cm for loader tunables Sponsored by: Chelsio Communications (cherry picked from commit 34fbc9e421e7fbb382a644d8d289311455681734) --- usr.sbin/cxgbetool/cxgbetool.8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/cxgbetool/cxgbetool.8 b/usr.sbin/cxgbetool/cxgbetool.8 index 995a4146deb3..a5f345c6b781 100644 --- a/usr.sbin/cxgbetool/cxgbetool.8 +++ b/usr.sbin/cxgbetool/cxgbetool.8 @@ -531,7 +531,9 @@ List all filters programmed into the hardware. Install the firmware configuration file contained in .Ar fw-config.txt to the card. -Set hw.cxgbe.config_file="flash" in loader.conf to get +Set +.Cm hw.cxgbe.config_file="flash" +in loader.conf to get .Xr cxgbe 4 to use the on-flash configuration. .It Cm loadcfg Cm clear From nobody Thu Feb 27 14:17:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLk6b3Bz5qFrQ; Thu, 27 Feb 2025 14:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLk5vk0z3x9n; Thu, 27 Feb 2025 14:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h7Wd3oeJn3BJr6+ayToR04QQRUmSq/NV9s4mMpucBJ0=; b=PdCsRe+NIP0iS/Fsnbfq49tI9gUL4qsJivssJQLAzRN0jtFt+JeyY3Uv0LwK0utMzVI+TW NPM7eKinSshXZxxY7T98vmB9lj3G+a+/Fhc2sBUhu+il1Z+U2sVuQCDMrbKfDgHaJ/Guw0 4t9HrEJwszsTBveOT0Tbdsw3/O/1dx6QhA1ZlTKMBo9zDTtpr41Tig4A5jzZoD4YIb1LZz 8DXLrrvy+OFHQ5Unx3IllC5FGz07ZrPM6nY1E7KhYkdmLe65XeJ/3Vj1DkwHBLaSSuc05z P1JBVmuescXDkUe02T5dCkF6pEKvf2c5SboItouyZiwBt7GLfDJ2rcfswxV/SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665822; a=rsa-sha256; cv=none; b=hlvRAoBuYchgM96/74sd01QN+LXNBVHgLQJ4+lDsvzEHE2HYJWn7dlLZ/uS8vuMHXJlKKO JEr1dlzSAtKlXDv49FykxlZu/X2fWf1vdem+a0+8nkwLT2eCmFqo122AgmSaombUdXdM4C ToxCzmHprLwaurTcTwmFyAgXcE3EeRizFpWMK/5L9ImOuDyuUn5yEMiflzN2Hws+rb2ji/ nX/pIYp7dtBT4v3pGC6lIOH0Tsvnsxgh4cHNclbHEgKQhAxnnCNAhYPYA96NSoKTyVVdE7 tEfd/IHMcdiCeCeD/fvlOQws26VuFT6rqfb69H9Jp+BLDsqC1HRzLPyCQ3lADw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h7Wd3oeJn3BJr6+ayToR04QQRUmSq/NV9s4mMpucBJ0=; b=diZOX5yNYgwz3BbDc6Ftokw1f6rLFlx2lWGMaIpCirqXoNtXUrOM+vA18Lvq4iCUKs3HGO TPuTuFCTfaBOIzOo0/VotJ6fDe65QspCQjrsYPFIE/SkeLsk2qA8zK534v/T5yZl/y/EGg cgc34qBeu8RxdfBE9MVNlWbySi6+FaQR5bLw2r0UKP1ID/3NLBi90zeOhvq8RYJMz+nrqE QSgowlXG5mNsnlXEcnV7V0pSqb3R6ZJ0eKD4kQSBW+0uI1ABt4Efh3Ov9Z3qyXsasoDO1m 6+n5PLgAb/vx2fszd7k+XwnUMREnWcII3NfowoMrCqfgbo7KeDcnXcCkrlZvZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLk5WGZzmQH; Thu, 27 Feb 2025 14:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH2vv016641; Thu, 27 Feb 2025 14:17:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH23f016638; Thu, 27 Feb 2025 14:17:02 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:02 GMT Message-Id: <202502271417.51REH23f016638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4a0f4ccf6ae7 - stable/14 - powerpc mpc85xx: Fix infinite recursion in bus_adjust_resource method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4a0f4ccf6ae7b0428da5015cc35eeafe01a5442d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4a0f4ccf6ae7b0428da5015cc35eeafe01a5442d commit 4a0f4ccf6ae7b0428da5015cc35eeafe01a5442d Author: John Baldwin AuthorDate: 2024-02-16 17:40:34 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 powerpc mpc85xx: Fix infinite recursion in bus_adjust_resource method The default case needs to call bus_generic_adjust_resource to pass the request up the tree, not bus_adjust_resource which will just call this method again. Fixes: 5a7e717fb790 powerpc mpc85xx: Use bus_generic_rman_* (cherry picked from commit 68a3ff041129208ea98a3bd5142061176ab4165e) --- sys/powerpc/mpc85xx/lbc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c index 52e28a5fb1cb..1e17d613438a 100644 --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -774,7 +774,8 @@ lbc_adjust_resource(device_t dev, device_t child, int type, struct resource *r, return (bus_generic_rman_adjust_resource(dev, child, type, r, start, end)); case SYS_RES_IRQ: - return (bus_adjust_resource(dev, type, r, start, end)); + return (bus_generic_adjust_resource(dev, child, type, r, start, + end)); default: return (EINVAL); } From nobody Thu Feb 27 14:16:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLY6XwQz5qG2D; Thu, 27 Feb 2025 14:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLY61Rdz3xJJ; Thu, 27 Feb 2025 14:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jkzlIoJOQkbn/PnHWN4S0Zf10ZhLrngl872L5Cuu0yQ=; b=H5nw92MR2iWPIr4A62XyZZ8depojSQXNwRFgFaTI0xRMWsa5g2zkXfQDO7ho+FbTpQqKtt l3XY+d0biKHZb17wYEtVxk8eLVPJDmyxeJPWl0bPoRAJ8UvGAj2RVgnVzJLmCtz/Jpc2Zn +MNaup9JMs83RptHo86denMu3qbajNDYvi10latQo5Npdccec2sjn8WZuiZbkvBxS5+JTl zI3MAAoQ4PYirvzuDBFGQ87e8GovEZzyBUKaYqxmrOm9eJHin+FwXIOUEWxlHlLeKNqkFq mhgQTYzLqjSHjcjVYv/tUMPzuyuOFNpUcK0a6c/6F70XdHIiDvWze4CidOqjAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665813; a=rsa-sha256; cv=none; b=jtEkb2tH6bYH8klbqKXvU7CzrKQ03yeCWJz4WKreGn597CxLFV/h8tHbPpVQyveot2YB+7 SbyLlP26Wq05dxIAkIUmC78rRKivYTLIkvngqT3UG4jkB9MO/035gR60mTy7TFwLjzB3J+ vIbeY5rkNR0e1GeZkHvWn+Wr1ACThoSfDSotZRvNKdQCsq6uQnCTYbTsLqyYEduM8T/0EQ oRfsD4Rq1wPgvHiegqSGIJWNWyasa5jFetlFLZK0HwIY7G4rOh4aolJRinEwt2YM+e2u6c OItWRyynHAZLJGPP8G4r+Vo4uCpf5upgCslTqbKqaOQ70iDbWSVyRAZqi2UNow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jkzlIoJOQkbn/PnHWN4S0Zf10ZhLrngl872L5Cuu0yQ=; b=AYDAuw2KPdLOdR1LfCrgbQaydHLFQn32k5MCGqp2j2IImH0yBO7qSkckDMwU20HjTESPl9 VCmD7rVE96MeNnOermCW0+uSPd2TPEg40f6bFFz9aDFaOC/T19ZAmot94RSRyME7J+zF5j SRb8dYGX7pqtSNRJyijb93obb5D3RsGbFkQGQbnnNltEbKt9pYCBYhzwN9WKc20qz4AMfb C9vK/nbXo98SsP4jRq2tQhZ+JDrpZvIq955p7CqwrQOvQyDGr1J2/AOJBqjlM5scY+ESjt ya+A3Ju020pUeE4+vZYVoVk5aMlQQeilWYI3BKZpBwFwh1zwktIrB0e2A2Nctw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLY5cSNzmpZ; Thu, 27 Feb 2025 14:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGrLf016345; Thu, 27 Feb 2025 14:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGrgh016342; Thu, 27 Feb 2025 14:16:53 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:53 GMT Message-Id: <202502271416.51REGrgh016342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3756a1c62af2 - stable/14 - physmem ram: Don't reserve excluded regions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3756a1c62af2f326419572d6fc5789c52567e32e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3756a1c62af2f326419572d6fc5789c52567e32e commit 3756a1c62af2f326419572d6fc5789c52567e32e Author: John Baldwin AuthorDate: 2024-02-14 22:07:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 physmem ram: Don't reserve excluded regions These regions can conflict with I/O resources and prevent allocation of those regions by other drivers. It may make sense to reserve them after the boot-time probe of devices has concluded (or after an initial pass to reserve firmware-assigned resources before "wildcard" resources are allocated), but that would require additional changes. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43893 (cherry picked from commit add99c9c4bae2769cba14a88b83377ec9c04cad9) --- sys/kern/subr_physmem.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index e74a11f47c2c..51af2e896877 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -583,7 +583,6 @@ ram_attach(device_t dev) { vm_paddr_t avail_list[PHYS_AVAIL_COUNT]; rman_res_t start, end; - struct region *hwp; int rid, i; rid = 0; @@ -609,30 +608,6 @@ ram_attach(device_t dev) rid++; } - /* Now, reserve the excluded memory regions. */ - for (i = 0, hwp = exregions; i < excnt; i++, hwp++) { - start = hwp->addr; - end = hwp->addr + hwp->size; - - if (bootverbose) - device_printf(dev, - "reserving excluded region: %jx-%jx\n", - (uintmax_t)start, (uintmax_t)(end - 1)); - - /* - * Best-effort attempt to reserve the range. This may fail, as - * sometimes the excluded ranges provided by the device tree - * will cover or overlap some I/O range. - */ - if (bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, end, - end - start, 0) == NULL) { - if (bootverbose) - device_printf(dev, "failed to reserve region\n"); - continue; - } - rid++; - } - return (0); } From nobody Thu Feb 27 14:16:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLD6vP3z5qGFM; Thu, 27 Feb 2025 14:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLD6hgpz3x9J; Thu, 27 Feb 2025 14:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ra+VPyIqgaCH3BWP++UH4I1aUfTGatnh+1wZDmfoGz4=; b=bX+Y0E5NNinSxSiazmqcORwGO3jHn0Gr3bwxL7K0CHc0RaYsRb8+PeabTZbZmeXH9fvTk+ 6ZWTtXdhWDBMxzlCLmKXDNXtVYVYNLdhVcoE9zek6jiKH0Mtm3cf6vuefVzfNnRePrWnQQ UaTnrKcOOzMHiVjUAPRhp28JNA5n+OqctfFc5MJPCdaD4l/nrz8ZYr8UPzChLQMpJHBDqv o+WEZcPLoSvGbObXMIXbiPl/AEmhVN9XtBIZn0sZN0ieZ0tUbT6kQ1jMFGYDmKaSGJsbLy RurUuBO0ip1C+Xg25zsasctnw9tw5XmlJDJu07abfde/R4BrwJbk+NM5cZXyIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665796; a=rsa-sha256; cv=none; b=fluh7kIZ7pnsx5nzmXWsDL6FRD5I2zaQStkvmRgV0HfT3XNuXnAcxSXkqD7XViQBRFs6/e OJ+a1GCIvDtURHgkCLMz+RCUe2DXbIOVhCbDINLsWeppqh+J4+iwpM8xrVb98hGSQS50v1 jc6osji0dhbbUCLFvPnQ7GphTfVwnGDzaW5G24ff1AFcWTr35em0xx3mdl4+bt3wmKpGW9 hHphwx5MQJzkI47jFxLUL42gjJIIHdR0R1vb61HW805WP4NQgVqsDs1XuP75eOfHCWOU8J inXYFEdvVPnY8mEFtGcPnobDGcIEhUdbSGoSAp1zbXdOknnBnBGPBYE2PEOhAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ra+VPyIqgaCH3BWP++UH4I1aUfTGatnh+1wZDmfoGz4=; b=gJFMIGTJ3EcQqsrXevQyRXmHAX24f9bxrgpWm9ca78YXQtBNe6dZjnr2Et+tVMwGO7CstO QUffNTpMjYcA/1elTB7vFdwe8Bfdxb6qpV1dnJVSmf8zN+mK6loW2V69fzin9tL1Qb1QTy ssxhk7mayOlRACJZQ0cIgp+JozaUwGH8/cFiB9MB5spf3UTAbtDxfGOThoKycVcenP+/qw fFji/Y+i0L/YEof+IdN3Gzsi+zsGpXVjYvockVAb7t4PMFF9/IiwVFBjRDp3ctt1elkmoS fo/lwQ353D22nE0zYdEAMhgw3iXUZm0hgyj6NKVlcH7qhq/V9CGbMVeKeYApZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLD6DwdzmZM; Thu, 27 Feb 2025 14:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGaUf015799; Thu, 27 Feb 2025 14:16:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGaix015796; Thu, 27 Feb 2025 14:16:36 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:36 GMT Message-Id: <202502271416.51REGaix015796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 387c7a712264 - stable/14 - powerpc powermac: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 387c7a712264a764d85d94d0b87f464f6bcf4945 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=387c7a712264a764d85d94d0b87f464f6bcf4945 commit 387c7a712264a764d85d94d0b87f464f6bcf4945 Author: John Baldwin AuthorDate: 2024-01-23 17:36:49 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc powermac: Use bus_generic_rman_* Implement bus_map/unmap_resource and add bus_get_rman for use by bus_generic_rman_*. Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43435 (cherry picked from commit af081ec6f7cf4b764a1b417135440cf05cf1a174) --- sys/powerpc/powermac/macio.c | 197 ++++++++++++++++++++++++++------------- sys/powerpc/powermac/uninorth.c | 200 ++++++++++++++++++++++++++-------------- 2 files changed, 264 insertions(+), 133 deletions(-) diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c index 76ae844e50fe..f6ad815064e8 100644 --- a/sys/powerpc/powermac/macio.c +++ b/sys/powerpc/powermac/macio.c @@ -80,15 +80,23 @@ static int macio_probe(device_t); static int macio_attach(device_t); static int macio_print_child(device_t dev, device_t child); static void macio_probe_nomatch(device_t, device_t); +static struct rman *macio_get_rman(device_t, int, u_int); static struct resource *macio_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int macio_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int macio_activate_resource(device_t, device_t, int, int, struct resource *); static int macio_deactivate_resource(device_t, device_t, int, int, struct resource *); static int macio_release_resource(device_t, device_t, int, int, struct resource *); +static int macio_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, + struct resource_map *); +static int macio_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static struct resource_list *macio_get_resource_list (device_t, device_t); static ofw_bus_get_devinfo_t macio_get_devinfo; #if !defined(__powerpc64__) && defined(SMP) @@ -113,10 +121,14 @@ static device_method_t macio_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, macio_get_rman), DEVMETHOD(bus_alloc_resource, macio_alloc_resource), + DEVMETHOD(bus_adjust_resource, macio_adjust_resource), DEVMETHOD(bus_release_resource, macio_release_resource), DEVMETHOD(bus_activate_resource, macio_activate_resource), DEVMETHOD(bus_deactivate_resource, macio_deactivate_resource), + DEVMETHOD(bus_map_resource, macio_map_resource), + DEVMETHOD(bus_unmap_resource, macio_unmap_resource), DEVMETHOD(bus_get_resource_list, macio_get_resource_list), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), @@ -495,25 +507,32 @@ macio_probe_nomatch(device_t dev, device_t child) } } +static struct rman * +macio_get_rman(device_t bus, int type, u_int flags) +{ + struct macio_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * macio_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct macio_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; - u_long adjstart, adjend, adjcount; + rman_res_t adjstart, adjend, adjcount; struct macio_devinfo *dinfo; struct resource_list_entry *rle; - sc = device_get_softc(bus); dinfo = device_get_ivars(child); - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - switch (type) { case SYS_RES_MEMORY: case SYS_RES_IOPORT: @@ -541,8 +560,8 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid, adjcount = adjend - adjstart; - rm = &sc->sc_mem_rman; - break; + return (bus_generic_rman_alloc_resource(bus, child, type, rid, + adjstart, adjend, adjcount, flags)); case SYS_RES_IRQ: /* Check for passthrough from subattachments like macgpio */ @@ -574,84 +593,134 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid, device_get_nameunit(child)); return (NULL); } +} - rv = rman_reserve_resource(rm, adjstart, adjend, adjcount, flags, - child); - if (rv == NULL) { - device_printf(bus, - "failed to reserve resource %#lx - %#lx (%#lx) for %s\n", - adjstart, adjend, adjcount, device_get_nameunit(child)); - return (NULL); +static int +macio_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_generic_adjust_resource(bus, child, type, r, start, + end)); + default: + return (EINVAL); } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); } static int macio_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - if (rman_get_flags(res) & RF_ACTIVE) { - int error = bus_deactivate_resource(child, type, rid, res); - if (error) - return error; + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + case SYS_RES_IRQ: + return (bus_generic_rl_release_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); } - - return (rman_release_resource(res)); } static int macio_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - struct macio_softc *sc; - void *p; - - sc = device_get_softc(bus); - - if (type == SYS_RES_IRQ) - return (bus_activate_resource(bus, type, rid, res)); - - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - p = pmap_mapdev((vm_paddr_t)rman_get_start(res) + sc->sc_base, - (vm_size_t)rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_le_tag); - rman_set_bushandle(res, (u_long)p); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_activate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); } - - return (rman_activate_resource(res)); } static int macio_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - u_int32_t psize; + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_deactivate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); + } +} + +static int +macio_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct macio_softc *sc; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); } - return (rman_deactivate_resource(res)); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + if (bootverbose) + printf("nexus mapdev: start %jx, len %jd\n", + (uintmax_t)start, (uintmax_t)length); + + sc = device_get_softc(bus); + map->r_vaddr = pmap_mapdev_attr((vm_paddr_t)start + sc->sc_base, + length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_le_tag; + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); +} + +static int +macio_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + /* + * If this is a memory resource, unmap it. + */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + break; + default: + return (EINVAL); + } + return (0); } static struct resource_list * diff --git a/sys/powerpc/powermac/uninorth.c b/sys/powerpc/powermac/uninorth.c index 1e22e0f92855..b64bbc8ade62 100644 --- a/sys/powerpc/powermac/uninorth.c +++ b/sys/powerpc/powermac/uninorth.c @@ -71,13 +71,22 @@ static int unin_chip_attach(device_t); */ static int unin_chip_print_child(device_t dev, device_t child); static void unin_chip_probe_nomatch(device_t, device_t); +static struct rman *unin_chip_get_rman(device_t, int, u_int); static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int unin_chip_adjust_resource(device_t, device_t, int, + struct resource *, rman_res_t, + rman_res_t); static int unin_chip_activate_resource(device_t, device_t, int, int, struct resource *); static int unin_chip_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int unin_chip_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, + struct resource_map *); +static int unin_chip_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int unin_chip_release_resource(device_t, device_t, int, int, struct resource *); static struct resource_list *unin_chip_get_resource_list (device_t, device_t); @@ -109,10 +118,14 @@ static device_method_t unin_chip_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, unin_chip_get_rman), DEVMETHOD(bus_alloc_resource, unin_chip_alloc_resource), + DEVMETHOD(bus_adjust_resource, unin_chip_adjust_resource), DEVMETHOD(bus_release_resource, unin_chip_release_resource), DEVMETHOD(bus_activate_resource, unin_chip_activate_resource), DEVMETHOD(bus_deactivate_resource, unin_chip_deactivate_resource), + DEVMETHOD(bus_map_resource, unin_chip_map_resource), + DEVMETHOD(bus_unmap_resource, unin_chip_unmap_resource), DEVMETHOD(bus_get_resource_list, unin_chip_get_resource_list), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), @@ -449,25 +462,32 @@ unin_chip_probe_nomatch(device_t dev, device_t child) } } +static struct rman * +unin_chip_get_rman(device_t bus, int type, u_int flags) +{ + struct unin_chip_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct unin_chip_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; - u_long adjstart, adjend, adjcount; + rman_res_t adjstart, adjend, adjcount; struct unin_chip_devinfo *dinfo; struct resource_list_entry *rle; - sc = device_get_softc(bus); dinfo = device_get_ivars(child); - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - switch (type) { case SYS_RES_MEMORY: case SYS_RES_IOPORT: @@ -497,9 +517,8 @@ unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid, adjcount = adjend - adjstart; - rm = &sc->sc_mem_rman; - break; - + return (bus_generic_rman_alloc_resource(bus, child, + SYS_RES_MEMORY, rid, adjstart, adjend, adjcount, flags)); case SYS_RES_IRQ: /* Check for passthrough from subattachments. */ if (device_get_parent(child) != bus) @@ -532,89 +551,132 @@ unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid, device_get_nameunit(child)); return (NULL); } +} - rv = rman_reserve_resource(rm, adjstart, adjend, adjcount, flags, - child); - if (rv == NULL) { - device_printf(bus, - "failed to reserve resource %#lx - %#lx (%#lx)" - " for %s\n", adjstart, adjend, adjcount, - device_get_nameunit(child)); - return (NULL); +static int +unin_chip_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_generic_adjust_resource(bus, child, type, r, start, + end)); + default: + return (EINVAL); } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); } static int unin_chip_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - if (rman_get_flags(res) & RF_ACTIVE) { - int error = bus_deactivate_resource(child, type, rid, res); - if (error) - return error; + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + case SYS_RES_IRQ: + return (bus_generic_rl_release_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); } - - return (rman_release_resource(res)); } static int unin_chip_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - void *p; - - if (type == SYS_RES_IRQ) - return (bus_activate_resource(bus, type, rid, res)); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_activate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); + } +} - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - vm_offset_t start; +static int +unin_chip_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_deactivate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); + } +} - start = (vm_offset_t) rman_get_start(res); +static int +unin_chip_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t length, start; + int error; - if (bootverbose) - printf("unin mapdev: start %zx, len %jd\n", start, - rman_get_size(res)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - p = pmap_mapdev(start, (vm_size_t) rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_be_tag); - rman_set_bushandle(res, (u_long)p); + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); } - return (rman_activate_resource(res)); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + if (bootverbose) + printf("nexus mapdev: start %jx, len %jd\n", + (uintmax_t)start, (uintmax_t)length); + + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_be_tag; + map->r_size = length; + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); } static int -unin_chip_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +unin_chip_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) { - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - u_int32_t psize; - - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); + /* + * If this is a memory resource, unmap it. + */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + break; + default: + return (EINVAL); } - - return (rman_deactivate_resource(res)); + return (0); } static struct resource_list * From nobody Thu Feb 27 15:17:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3Zhg6gbfz5qJkm; Thu, 27 Feb 2025 15:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Zhg5pNfz41t8; Thu, 27 Feb 2025 15:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740669459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zFWZbPcpkKrWQBzwNBetpgCURWqNKMiOiv3e4uvBVtU=; b=u+7fSj91XuBXh041Ysm2K16TZjYnw/7E2CIZ5devkDzm3y28biU/5ZgVS17Wg4w4xIm9zO W7l07qbq7usrE9AGKIGUKDGrmmp55RrN8v42F6CHf8dJelSnBBzH886rSkcv3sYKA8B1+C TRlsMJzDbhm+7KvssjNOocWXwd3MwwzJUodSPiI1BAzGVnhHyut48Vh6PIsViPa7Lb7S2X n+Zw36acFK1/lEU/OfdnNSoZnRnktaKoUrT+NrYapB0DUz/0jrmKYRDx0+h4Eqv39CvWK5 ko7J3lOPuaujm+qysmDSiF4/R0DGG38zqy7RIr9ChyGXRAn/8vqjOaUgL/+Ovg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740669459; a=rsa-sha256; cv=none; b=Uc6ds1d3XgG1HszNdRtYF7w4f1OPsYscF+2xwSzcjgKPcpA2EdAZrPE+0Ka6bEaqp2W2oe Nbgn+CiE5HU/jVTQBrDOJ+QOXkrMDiaoNS/ZauzrRKwqB4Ew/xY3+qID5e8WlQDNrQk8Q5 1CskY/BrnBivTVwEi4Sm3ao1Mxua9oG58sV3/wXOWS5Ue49CtB8c3KtY22WlS4toinQz6R 3ZGajX+4sTfXbmG2W2OLJelUE2l2qwCK85fRD5d7mBGeDlDypT+nd59rN+4vb/oh7cvW6y fMhuINX3OfMJJaaDC7Ds55w5Eh3Z7MOVopy9gc/6Ts2yzsOL9APufFFCltqAnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740669459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zFWZbPcpkKrWQBzwNBetpgCURWqNKMiOiv3e4uvBVtU=; b=kBerW5DLJlH6DKwUOakHt83CaFrpt3mTZmkEZzugzar1f/mfK3cpWm6DtYTKMTraMtiUKd PoJuiHbdmz9CSrybNXx+PdkaWwYWipqwIvjfa2bYo9Ozy4hovPZHWIwDhPk7KA1UawLHSf ROi9OfiuD7YzTJH3V87VUhfl42dHdMu/hF5TR0hAurTg5qizr6EwV1znZkvHd3f5Yo2bLs 10wY/9vUlfiBn/7g/29hbgM6yX4cm82ID8bm1LFbGPPx5wIk2BJsXqDIzGYEA2unQ31yuR sFYVKclYS56wCAbnXjbwjis5uxyhlhsDDwbtsMVkYXIy6+6Wkk47JRfYxTnqcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3Zhg4rdMzp9K; Thu, 27 Feb 2025 15:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RFHdiN030133; Thu, 27 Feb 2025 15:17:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RFHd1k030130; Thu, 27 Feb 2025 15:17:39 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:17:39 GMT Message-Id: <202502271517.51RFHd1k030130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 38ed49b0f927 - stable/14 - sound: Use bus_child_deleted methods to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38ed49b0f9276a349323f5fddebf02ec47b356ac Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=38ed49b0f9276a349323f5fddebf02ec47b356ac commit 38ed49b0f9276a349323f5fddebf02ec47b356ac Author: John Baldwin AuthorDate: 2024-11-01 14:09:11 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:16:56 +0000 sound: Use bus_child_deleted methods to free ivars for children Note that hdsp and hdspe were just leaking the ivars on detach previously. While here, use M_WAITOK to allocate ivars since attach routines are sleepable. hdsp and hdspe were using M_NOWAIT without checking the return value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47366 (cherry picked from commit a17a41ffde0d1c579dcd7cef7900c3b44be0ec81) hsdp(4) doesn't exist in stable/14 so is not patched --- sys/dev/sound/pci/csa.c | 26 +++------ sys/dev/sound/pci/emu10kx.c | 134 ++++++++++---------------------------------- sys/dev/sound/pci/hdspe.c | 9 ++- 3 files changed, 46 insertions(+), 123 deletions(-) diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index f293a8fc8af8..aa682bf43071 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -274,22 +274,14 @@ csa_attach(device_t dev) /* Attach the children. */ /* PCM Audio */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto err_teardown; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); func->varinfo = &scp->binfo; func->func = SCF_PCM; scp->pcm = device_add_child(dev, "pcm", -1); device_set_ivars(scp->pcm, func); /* Midi Interface */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto err_teardown; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); func->varinfo = &scp->binfo; func->func = SCF_MIDI; scp->midi = device_add_child(dev, "midi", -1); @@ -310,34 +302,33 @@ err_io: return (error); } +static void +csa_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static int csa_detach(device_t dev) { csa_res *resp; sc_p scp; - struct sndcard_func *func; int err; scp = device_get_softc(dev); resp = &scp->res; if (scp->midi != NULL) { - func = device_get_ivars(scp->midi); err = device_delete_child(dev, scp->midi); if (err != 0) return err; - if (func != NULL) - free(func, M_DEVBUF); scp->midi = NULL; } if (scp->pcm != NULL) { - func = device_get_ivars(scp->pcm); err = device_delete_child(dev, scp->pcm); if (err != 0) return err; - if (func != NULL) - free(func, M_DEVBUF); scp->pcm = NULL; } @@ -1062,6 +1053,7 @@ static device_method_t csa_methods[] = { DEVMETHOD(device_resume, csa_resume), /* Bus interface */ + DEVMETHOD(bus_child_deleted, csa_child_deleted), DEVMETHOD(bus_alloc_resource, csa_alloc_resource), DEVMETHOD(bus_release_resource, csa_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index 0f938597e06c..2cd5a881c653 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -3211,16 +3211,8 @@ emu_pci_attach(device_t dev) sc->pcm[i] = NULL; /* FRONT */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_FRONT; @@ -3231,16 +3223,8 @@ emu_pci_attach(device_t dev) if (!(sc->mch_disabled)) { /* REAR */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_REAR; @@ -3250,16 +3234,8 @@ emu_pci_attach(device_t dev) device_set_ivars(sc->pcm[RT_REAR], func); if (sc->has_51) { /* CENTER */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_CENTER; @@ -3268,16 +3244,8 @@ emu_pci_attach(device_t dev) sc->pcm[RT_CENTER] = device_add_child(dev, "pcm", -1); device_set_ivars(sc->pcm[RT_CENTER], func); /* SUB */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_SUB; @@ -3288,16 +3256,8 @@ emu_pci_attach(device_t dev) } if (sc->has_71) { /* SIDE */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_SIDE; @@ -3309,16 +3269,8 @@ emu_pci_attach(device_t dev) } /* mch_disabled */ if (sc->mch_rec) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_MCHRECORD; @@ -3335,16 +3287,8 @@ emu_pci_attach(device_t dev) #if 0 /* Midi Interface 1: Live!, Audigy, Audigy 2 */ if ((sc->is_emu10k1) || (sc->is_emu10k2) || (sc->is_ca0102)) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (midiinfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_WAITOK | M_ZERO); midiinfo->card = sc; if (sc->is_emu10k2 || (sc->is_ca0102)) { midiinfo->port = EMU_A_MUDATA1; @@ -3361,16 +3305,8 @@ emu_pci_attach(device_t dev) } /* Midi Interface 2: Audigy, Audigy 2 (on AudigyDrive) */ if (sc->is_emu10k2 || (sc->is_ca0102)) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (midiinfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_WAITOK | M_ZERO); midiinfo->card = sc; midiinfo->port = EMU_A_MUDATA2; @@ -3401,11 +3337,22 @@ bad: return (error); } +static void +emu_pci_child_deleted(device_t dev, device_t child) +{ + struct sndcard_func *func; + + func = device_get_ivars(child); + if (func != NULL) { + free(func->varinfo, M_DEVBUF); + free(func, M_DEVBUF); + } +} + static int emu_pci_detach(device_t dev) { struct emu_sc_info *sc; - struct sndcard_func *func; int devcount, i; device_t *childlist; int r = 0; @@ -3414,35 +3361,17 @@ emu_pci_detach(device_t dev) for (i = 0; i < RT_COUNT; i++) { if (sc->pcm[i] != NULL) { - func = device_get_ivars(sc->pcm[i]); - if (func != NULL && func->func == SCF_PCM) { - device_set_ivars(sc->pcm[i], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->pcm[i]); if (r) return (r); } } if (sc->midi[0] != NULL) { - func = device_get_ivars(sc->midi[0]); - if (func != NULL && func->func == SCF_MIDI) { - device_set_ivars(sc->midi[0], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->midi[0]); if (r) return (r); } if (sc->midi[1] != NULL) { - func = device_get_ivars(sc->midi[1]); - if (func != NULL && func->func == SCF_MIDI) { - device_set_ivars(sc->midi[1], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->midi[1]); if (r) return (r); } @@ -3450,12 +3379,6 @@ emu_pci_detach(device_t dev) if (device_get_children(dev, &childlist, &devcount) == 0) for (i = 0; i < devcount - 1; i++) { device_printf(dev, "removing stale child %d (unit %d)\n", i, device_get_unit(childlist[i])); - func = device_get_ivars(childlist[i]); - if (func != NULL && (func->func == SCF_MIDI || func->func == SCF_PCM)) { - device_set_ivars(childlist[i], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } device_delete_child(dev, childlist[i]); } if (childlist != NULL) @@ -3488,6 +3411,7 @@ static device_method_t emu_methods[] = { DEVMETHOD(device_attach, emu_pci_attach), DEVMETHOD(device_detach, emu_pci_detach), /* Bus methods */ + DEVMETHOD(bus_child_deleted, emu_pci_child_deleted), DEVMETHOD(bus_read_ivar, emu_read_ivar), DEVMETHOD(bus_write_ivar, emu_write_ivar), diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 0b378cc3d8f4..a9543cbfbebb 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -491,7 +491,7 @@ hdspe_attach(device_t dev) return (ENXIO); for (i = 0; i < HDSPE_MAX_CHANS && chan_map[i].descr != NULL; i++) { - scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); + scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); scp->hc = &chan_map[i]; scp->sc = sc; scp->dev = device_add_child(dev, "pcm", -1); @@ -527,6 +527,12 @@ hdspe_attach(device_t dev) return (bus_generic_attach(dev)); } +static void +hdspe_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static void hdspe_dmafree(struct sc_info *sc) { @@ -574,6 +580,7 @@ static device_method_t hdspe_methods[] = { DEVMETHOD(device_probe, hdspe_probe), DEVMETHOD(device_attach, hdspe_attach), DEVMETHOD(device_detach, hdspe_detach), + DEVMETHOD(bus_child_deleted, hdspe_child_deleted), { 0, 0 } }; From nobody Thu Feb 27 14:17:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLw6xSvz5qG9r; Thu, 27 Feb 2025 14:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLw6M1Zz3xD8; Thu, 27 Feb 2025 14:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KczNIMLtaWst/OfUCcQcFVbnMUoX5OjzPLDLCFEUFSo=; b=rdlPZyd4iDtf4U+O92WwAcl0tZ5uITbvJQBeBdsROmnImvUebWubSappqxe/hV13wG1qml cgUtwxqMJ+MC/55Eg7Hb+9K6j4N4FytNujJIta3PusyDWU2qemyYK94bP+gXS79LBGmONb jll6mHkMgauc9LVTiOMR1yGNC1cM8NLVBBUT8UzYBq70FRLJWCGoCYXi2Do5l7sNTyfjLE UNJqO4ioDXk0pRA6w4hJAT6Wr9GKpIqJlAmLto/uSwDGKxXcTBYpiCF+JMGMfkaiBYdabX 55laN3rVvnAEz+3FgE1bZYlYjFfoaAZH+iIfpt4wIa8eKlxYQ+/w6dR8aUfZPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665832; a=rsa-sha256; cv=none; b=ucQICvq6wAW9FJv7YoJAXZdc2OBodLxAbsWtK+ru/M1IlvZz64EX1cq/MjtbqDWM+LiAYd voBrMEDyFFEcur065aQA+Qdy3KqWF1ZUPQNsh3SbOxftGVNvjhIoLKp6rwEH5sw11vSiBl BaC7MYqZxCAY9jf6K8Tw1tOV4BRbXUH9pw4marLyHz09BPvuZEhYgf/nf9m0Y5yMGW/TTS sLKefGW9iYQ5jxnqWAtNNYyiZOjhUcRoNuw1UURSRmmnrT6Q8Ad+OT+tWVQFkLsbeU4l27 dTTlFdBQOK9hsJKBxk3dhOzvyXio6YDVkz4v7/MPW5C8Cavo5ib2v5D/BxvwLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KczNIMLtaWst/OfUCcQcFVbnMUoX5OjzPLDLCFEUFSo=; b=iAOyBt78EBQRgver5gLcEHz7JvNgLPplsB9q2offmbbAoQ66RHunYYhX65X7EvOqbjHlRD 5WbtMkyh4hAqrV7ugiR5U3HFMRioUwz+9DxTAPdhOsgldeowvc3TB+yGFpcsPDi3Jw8tdR q1J0gKcp/XlrCMd2jfZ8z7NA5Nx6XD/xWWGfs1/QLL7xk7zbIMxBLZ7Jct0XS9ceHghdTv 7v3/jzWHkVtWGdUQlDev7IfjseYm68TqAutVrZntSqDjKP4jgt4R9hN673VqqFl1306VKB leX0luz/yZRmHyk7SW/D98lVnP8nMtjSzDUT/EvL6YC5baJ5sOF/7uncxgSVIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLw5tnHzmpc; Thu, 27 Feb 2025 14:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHCRm016953; Thu, 27 Feb 2025 14:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHCcq016950; Thu, 27 Feb 2025 14:17:12 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:12 GMT Message-Id: <202502271417.51REHCcq016950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f3d53a9ecad4 - stable/14 - pci_host_generic: Enumerate resource ranges under bootverbose List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3d53a9ecad45889524b2a224815744f0697536d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f3d53a9ecad45889524b2a224815744f0697536d commit f3d53a9ecad45889524b2a224815744f0697536d Author: John Baldwin AuthorDate: 2024-03-01 22:20:10 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Enumerate resource ranges under bootverbose Previously ranges were only enumerated for the FDT attachment but not ACPI. This commit moves the enumeration to the shared attach routine so it is done for both. While here, don't list empty ranges but do include the resource type for each range. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D44132 (cherry picked from commit b28670018dbcc7d6ebc0d05584189d6d04aa079f) --- sys/dev/pci/pci_host_generic.c | 8 ++++++++ sys/dev/pci/pci_host_generic_fdt.c | 11 ----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 520462972a66..67b329b58685 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -83,6 +83,7 @@ pci_host_generic_core_attach(device_t dev) uint64_t phys_base; uint64_t pci_base; uint64_t size; + const char *range_descr; char buf[64]; int domain, error; int flags, rid, tuple, type; @@ -179,18 +180,21 @@ pci_host_generic_core_attach(device_t dev) switch (FLAG_TYPE(sc->ranges[tuple].flags)) { case FLAG_TYPE_PMEM: sc->has_pmem = true; + range_descr = "prefetch"; flags = RF_PREFETCHABLE; type = SYS_RES_MEMORY; error = rman_manage_region(&sc->pmem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_MEM: + range_descr = "memory"; flags = 0; type = SYS_RES_MEMORY; error = rman_manage_region(&sc->mem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_IO: + range_descr = "I/O port"; flags = 0; type = SYS_RES_IOPORT; error = rman_manage_region(&sc->io_rman, @@ -219,6 +223,10 @@ pci_host_generic_core_attach(device_t dev) error = ENXIO; goto err_rman_manage; } + if (bootverbose) + device_printf(dev, + "PCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx, Type: %s\n", + pci_base, phys_base, size, range_descr); } return (0); diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c index bcee6057ff3c..854ec0be8dfa 100644 --- a/sys/dev/pci/pci_host_generic_fdt.c +++ b/sys/dev/pci/pci_host_generic_fdt.c @@ -183,7 +183,6 @@ parse_pci_mem_ranges(device_t dev, struct generic_pcie_core_softc *sc) int nbase_ranges; phandle_t node; int i, j, k; - int tuple; node = ofw_bus_get_node(dev); @@ -239,16 +238,6 @@ parse_pci_mem_ranges(device_t dev, struct generic_pcie_core_softc *sc) sc->ranges[i].size = 0; } - if (bootverbose) { - for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { - device_printf(dev, - "\tPCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx\n", - sc->ranges[tuple].pci_base, - sc->ranges[tuple].phys_base, - sc->ranges[tuple].size); - } - } - free(base_ranges, M_DEVBUF); return (0); } From nobody Fri Feb 28 00:54:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3qV86jL5z5Jtww; Fri, 28 Feb 2025 00:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3qV868Dvz3LtS; Fri, 28 Feb 2025 00:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740704064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oR7p+2OMPDZViuZGRibUdQp8P0cyWBzs4SDyZoaLl1M=; b=CT4E/lEu83hY8b8IjFI/Ha001TDyN7E5txDbF6wL42k6+5GyacXkuYGyCBvcQ3d8daqQo4 zkEnRFjR4LK0jm8k4+6fDVzr8hVtDjnAi/tDUgfZ3KFkR/YgRKm7sUNe1zfz6x/Wjx0Tko drXeg+fUM1BHik9D94v5Q4Zc3qoa+HLZJjlJocQ9gVORNC0ruvW8WWt2gDKMs1IX8BC+rv WQ2T2Bq4yuOe4TZ9ot0gJ/aof7+jNA/z+GsOai21thraN6J5zurat9ZGV6sqTx1wAS2uRn ks84XD95JBdmnch0ERSAjHtb+iJScObZbVLF/lab7t2wJCV9ueAi1S5coXAcEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740704064; a=rsa-sha256; cv=none; b=dcf8V/0pkMj2xVIwOJkiWdqYVmhoLKDvhiEx5TBB+Nek8piLqrLJEsIQyKXEkfgWAgzV3c jNhoGozP1YNzjPZBq63Ocr1aChObW/6MBCg7TgrmJtGExc1+UBrwlHcWvDcUayfnDRO9Wk bIKrOa2RMppJDJGiX07rjtgZifXnGczNOWdHOQw6opOQ/OUuhVQiDeANjjYV5oreT+ZNW6 64kkZZWWXcSX2PEsJSile5ULYaqjbz8CaHqwdLT6Xp22m2OJ/nSGyMFQ5to0r2EbtGTDci ktzyi1eutTLG2pkvxoeV88XaGLzofvBCpxp+s9BOw4lXn2fh7AGzRz1im0L1/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740704064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oR7p+2OMPDZViuZGRibUdQp8P0cyWBzs4SDyZoaLl1M=; b=nxJXZ/P+NE5Zzm7QffgADQxHXvDpmFHMO1zOX4bVcpM+x8T4sS09cw1fqeDkXOlaLJRF5p y3gHiUCMrYgUlZkCdPErfn/clSKmtbP5vXEGAX79gOvFiAmqzj0DUhbjyKP01VWfzcINYm svDrGTf9g+tMKj+22xzdGHmbMeqTlcahL4EUC01ErVGPLSdQnUCpy5nxebb6f9H8KXjPNl 2MhTs/0H1xT036rhEV68dFPnKGIC9WpGn7Cb3L7dXafN/OrWF3rnsPir3xSE9+FQSY539m d3xBaHPNRRR5nWnJCS41278dTolSCEX4HFWiTYDsPnu4fd0dvQ13KmLrnlBYzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3qV85TT9z15vv; Fri, 28 Feb 2025 00:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S0sObW014976; Fri, 28 Feb 2025 00:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S0sOUm014973; Fri, 28 Feb 2025 00:54:24 GMT (envelope-from git) Date: Fri, 28 Feb 2025 00:54:24 GMT Message-Id: <202502280054.51S0sOUm014973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 956fb94dd608 - releng/13.5 - 13.5: Switch from "quarterly" to "release" pkgs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 956fb94dd608b252ac332bee27b4ab4fa7089494 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=956fb94dd608b252ac332bee27b4ab4fa7089494 commit 956fb94dd608b252ac332bee27b4ab4fa7089494 Author: Colin Percival AuthorDate: 2025-02-28 00:48:26 +0000 Commit: Colin Percival CommitDate: 2025-02-28 00:48:26 +0000 13.5: Switch from "quarterly" to "release" pkgs Approved by: re (implicit) Sponsored by: Amazon --- release/pkg_repos/release-dvd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index 600c309d5979..79f7c4c8dbca 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_4", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", From nobody Thu Feb 27 14:17:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM46yywz5qG9v; Thu, 27 Feb 2025 14:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM46Pjgz3xHN; Thu, 27 Feb 2025 14:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXNLwxipWw3Fl1j4eeSPRJMLkovSKlcdRb7CD9WDhsw=; b=Uaekajc/WAjnGJh+K0msjlqhB/VgrBQZUe07t8odz3c/pdd/Op1oIHwX4YL3gXfrkKfDFR 2zoD5Xv93hLYWWqg4kh8w1TRWixtc0Xm19M7m7aT1kPUFS6KoTTGlc7jAlXw59gjCnoz6a 7dmxQjbIs0nSNdoyYGQYKj5ltOYr12ZEBTvv6PVFLhLOWtFGfEbN0yerrYGjJPvhjyYxPw f58mLniS46R1MJKyJgCkB8+DGV6L5uuxur6EpoXr+MU0wn1jYbrvuGgLgzeXR3aYEX0OwA g2eA2yRdU6HzDpSvXyK4amNcGJCHaV4o5L86+z8TOKNptU5F92mr5umrOW6Xtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665840; a=rsa-sha256; cv=none; b=uN2Oilkn8iFjdUU5XnJDK1ZaDIbBFPIgqTT1JI8OweDKF1zTiI5Q256gpp4tpdtJgTfEfS k23JX8yM9l0mMAwpOZhlllsiTv6iFrbp2hkKbN/Zfl195bGxNEVI6mN+2Lbx54/v09bGdf d9tyV7cthjCaXF+7zRHUiSZMd8JbAIN4dvHRQSXfxKTtopk6+TBgGtFvXB2LgFX1ISzoZ5 glieZqe8nPFvNUcNPeakiA4ciiWUyv3lRL8A+DIanfmIXtucpU1MaiGklTT+8rYnEnB5BL T+Ft0mL1qMzV+7a3GXoFEtHBuh2xwEHVVNRgalBeg+pxxCl1s8TC3pxJSwGFIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXNLwxipWw3Fl1j4eeSPRJMLkovSKlcdRb7CD9WDhsw=; b=uJZYShG/O9TaSoeMQ4ClkydQb8yGTNNMTvt/55Ymx9owNuCi53KHaF67dx+eKOYFFJ4f1S 0TZkfiO2p703oxFH0wGoALuIPkI7gGqdGbWY8O8wkgQPhMp7OENCFwvlQyOcqnsikbDYrb 6U9Qun3LamM5Nr03ycw96EM8vuyf8puPIVZ6k50I3akJ4Jybb6BWs7vyNvfejBv+U0+aRs I40UY7d2Oz4gPyPhBuCIfcXphi1chautBdn24a6fznooCnFuLdMpY5p8BBFHdsQLNB9vCW m43j7MJoeBVAoBGxNYxdc7H+F7qd+4UVmB5djPF1eEzKXnZ2P72WKNwE5OeyOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM45sTDzmqV; Thu, 27 Feb 2025 14:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHKu7017189; Thu, 27 Feb 2025 14:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHKNS017186; Thu, 27 Feb 2025 14:17:20 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:20 GMT Message-Id: <202502271417.51REHKNS017186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 07b5d67777a7 - stable/14 - acpi: Use rman_get_type in acpi_is_resource_managed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 07b5d67777a73867dddc2be850c367f209a12f37 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=07b5d67777a73867dddc2be850c367f209a12f37 commit 07b5d67777a73867dddc2be850c367f209a12f37 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 acpi: Use rman_get_type in acpi_is_resource_managed Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44125 (cherry picked from commit 0ecee1602e195933a39da65d34440399129e19fb) --- sys/dev/acpica/acpi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index ee2494debae7..de6520331644 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1554,11 +1554,11 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, } static bool -acpi_is_resource_managed(device_t bus, int type, struct resource *r) +acpi_is_resource_managed(device_t bus, struct resource *r) { struct rman *rm; - rm = acpi_get_rman(bus, type, 0); + rm = acpi_get_rman(bus, rman_get_type(r), rman_get_flags(r)); if (rm == NULL) return (false); return (rman_is_region_manager(r, rm)); @@ -1570,7 +1570,7 @@ acpi_managed_resource(device_t bus, int type, struct resource *r) struct acpi_softc *sc = device_get_softc(bus); struct resource_list_entry *rle; - KASSERT(acpi_is_resource_managed(bus, type, r), + KASSERT(acpi_is_resource_managed(bus, r), ("resource %p is not suballocated", r)); STAILQ_FOREACH(rle, &sc->sysres_rl, link) { @@ -1588,7 +1588,7 @@ acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (rman_adjust_resource(r, start, end)); return (bus_generic_adjust_resource(bus, child, type, r, start, end)); } @@ -1601,7 +1601,7 @@ acpi_release_resource(device_t bus, device_t child, int type, int rid, * If this resource belongs to one of our internal managers, * deactivate it and release it to the local pool. */ - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_release_resource(bus, child, type, rid, r)); return (bus_generic_rl_release_resource(bus, child, type, rid, r)); @@ -1627,7 +1627,7 @@ static int acpi_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_activate_resource(bus, child, type, rid, r)); return (bus_generic_activate_resource(bus, child, type, rid, r)); @@ -1637,7 +1637,7 @@ static int acpi_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_deactivate_resource(bus, child, type, rid, r)); return (bus_generic_deactivate_resource(bus, child, type, rid, r)); @@ -1652,7 +1652,7 @@ acpi_map_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t length, start; int error; - if (!acpi_is_resource_managed(bus, type, r)) + if (!acpi_is_resource_managed(bus, r)) return (bus_generic_map_resource(bus, child, type, r, argsp, map)); @@ -1678,7 +1678,7 @@ static int acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r, struct resource_map *map) { - if (acpi_is_resource_managed(bus, type, r)) { + if (acpi_is_resource_managed(bus, r)) { r = acpi_managed_resource(bus, type, r); if (r == NULL) return (ENOENT); From nobody Thu Feb 27 16:55:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3ct057B0z5qNdD; Thu, 27 Feb 2025 16:55:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct04ZBtz46DL; Thu, 27 Feb 2025 16:55:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=icJlXbbqQ041QioJqLhJXqLdtLyzm1SgkROJF0K9dKs=; b=KYNq32mAyoTTDSLOaW7WOXWI6TM9T81cGzyUpXD1OC1WK1Umyt7K03nC3tt1hX9AmG8wgd BnctnAawk9bNikMRWVu74vjbU8B85TzMi0F4FIlYP0H/JhJ1lwj6T1H59W6A/9Wtp5eI0j mMQcAbs+/boqUqzUHCAbHWTTfIeSEhmiFit2UuvWkFmbjN/wWeWJCyU9ka097I7q4Q8UMS ENK9lki1ObuU2JRnVKZvpxpqmp3+Xg6hbeEsOa5I2b1fCiXs7UFOyu+HVXXXzDX9gD31U1 ATX3EDh1MexjY/1xFCi7hTAaXOQe4g51l8BlkO7x2dT7lc0jMIDqGoQACkDUYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675352; a=rsa-sha256; cv=none; b=jd86ZEvbKPPIocHD21vzTr6WkxxU5WkUwEtrJefRVRrEvhicFobCzlboS+GPE5mTazInAj wSNL+Hn6ADBG5etjnL7Ckdqv6q8sWt0RnPs2AhSLTpaGG2Gp9AEnStLyfGqTYplze0iJIf UaYD2a9pQ+gGR7HVvrtMbZN1NzYohfOvKqlZonmBpmRvCpIvd3ePTqGSXc2VxSLV9+jZRW pxCl9r7ikVPGkkBfXNZt/JJPTmYn8Ry7y2RQ6ChrbZF95yJtCx3bn70h1mw7Zc6guztQq8 at3SgCFYUrysW56eiIWHPT39kbk9kn+NaDaX+c8gcbk8bcDwDLjmKsGJgvZs7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=icJlXbbqQ041QioJqLhJXqLdtLyzm1SgkROJF0K9dKs=; b=Coi2utF2Qh3aiq8vFfbz86CzvErZCBT+UXQR7QhIWsdppEw/mr7VBf2HQMDt7lFcQsScCJ hUoZGUKdAFT75npwzPKugYaks3JjaFYnFKrwBDTNEKyCqLcWXxRxfWlrUOXRqVTdqfmHog 4Uh/4z2SD/ivde2Ei36GXygKh6mVQl0oGdp3K0xK25PbYa2V3K5MVUTG5vu9dpgCE3BaM8 055g8q2yjGWulEUyZdX9SBYnEgyJbi3Q1UX7399Ou8es/wcHljYxB53JGV+Y3swCY0BuRl UQifvs5HAl/k5/SNSadiFEBwwis6gq5KR9/xKczWvbD3ff4PGVvKN8VZcOthCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3ct042jszrtr; Thu, 27 Feb 2025 16:55:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtqJT016952; Thu, 27 Feb 2025 16:55:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtqn3016949; Thu, 27 Feb 2025 16:55:52 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:52 GMT Message-Id: <202502271655.51RGtqn3016949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2266614d0714 - stable/14 - hifn/safe: Remove dummy calls to bus_generic_detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2266614d0714ae78b693b450832c48d73cfc0404 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2266614d0714ae78b693b450832c48d73cfc0404 commit 2266614d0714ae78b693b450832c48d73cfc0404 Author: John Baldwin AuthorDate: 2024-11-05 01:31:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:18:05 +0000 hifn/safe: Remove dummy calls to bus_generic_detach These drivers do not add child devices, so there's no need to try to detach children. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47390 (cherry picked from commit 8b54d874c70d9fb3ed2e059f65c91b3e0eaadbd7) --- sys/dev/hifn/hifn7751.c | 2 -- sys/dev/safe/safe.c | 1 - 2 files changed, 3 deletions(-) diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index 23cf019b93a6..2e7545779b09 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -637,8 +637,6 @@ hifn_detach(device_t dev) crypto_unregister_all(sc->sc_cid); - bus_generic_detach(dev); /*XXX should be no children, right? */ - bus_teardown_intr(dev, sc->sc_irq, sc->sc_intrhand); /* XXX don't store rid */ bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index da2afbd38fad..c512f3fc62c0 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -464,7 +464,6 @@ safe_detach(device_t dev) mtx_destroy(&sc->sc_ringmtx); safe_dma_free(sc, &sc->sc_ringalloc); - bus_generic_detach(dev); bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); From nobody Thu Feb 27 15:14:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3ZcV5ZlHz5qJ0H; Thu, 27 Feb 2025 15:14:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ZcV4wN7z41qW; Thu, 27 Feb 2025 15:14:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740669242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekxX2BCmQ9uQVvSOLHUb2IhLV0bsq41P8MWrqRW/+q8=; b=cottKsExjvcqaziIHwXvOijzFG8g9rdrVHRHhQ7xkB7j/Bt0DHF3Zq2xTUF7tUrSQKpGss oloK3pWcbAgGQgHhqMmzYwT6C6+LzPeTx7tvsxm/x9pkoOnakzXxsu2XMtA2Ni7865YY9d HbwyW9qvQmILJ2vR3alb9yRaHkIgJhTcbGxzAoYj9+r2rFH1gjlsbge+SRsUQjHbczTWqj nLdFQLQKNIoHPruTGauLN6QyQC3kFQGWDTJ9JElOeYiaEqMjeORqwmhsN26lPV3Bn8GbXH fA0jDobqa+vhB5opaWEP1gQFzn9EF9KXK2torEluk96KXGGXaXEQ7DFCtggkvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740669242; a=rsa-sha256; cv=none; b=ai5gsTOB2wcUYKuwoWqxOwGj8qbl6lFgMdTYfjKAM0mjR4bVETYkeCuVYNr97c0XmSfhw+ r4odf3k2VGUxSz4W4m35eR62YlnlPv3yPYTvY9jMooODC684TQkZUTMZT1uHtODhAdGmIy aBAbyKHg6bs4vEJhaZWeHNr3noSBoxrkSea5qnzIvNriQeD4p7vV2CAzoaDm+xQ17udRrZ bP0D8HgL45jBYlAvVpMtwMPwupS+FKg2urpcCOQZrU4UAk+MdC45FvcPuA3TRyIQcE/6es hNnF7jX03e7sK6Z7Ulnd2099l7jumEtkkeTUkZ81QkfYZRzTEN3EK/xXFvYHfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740669242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekxX2BCmQ9uQVvSOLHUb2IhLV0bsq41P8MWrqRW/+q8=; b=ZP/rJpjao4SI9h7J29hBPf5R8FaBrBLzrQsE93NUqBvZEACOrJAO7l1fnWAjeQyNsf3kHi AICNSFhrrS1op0YK6D/LChfFHH8STwd3UXmRT4SCohcFD6PkDT3ZGUJw/bn36sJQspi0Ek +o84Ub+44OZeAg9YNav4Ou2orEP6Am4t47rl2yAmL/M4Lm7B3s2UdxSKEGD2uVCVur+hms OdyAq3wdY3xCjC1bop5VXG2uusbkaO2duXt6BG8nGciVqaHWjyVjoM9uEYg1MIVqgh3zdi VWTjfM+f1ct/aVM8Dv0l5eo3r2pKhm+lR4ILWGmk4NuronyOo2BGfwEw8/jJUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3ZcV4Vxfzp7l; Thu, 27 Feb 2025 15:14:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RFE2aD029016; Thu, 27 Feb 2025 15:14:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RFE2Qs029013; Thu, 27 Feb 2025 15:14:02 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:14:02 GMT Message-Id: <202502271514.51RFE2Qs029013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 32de28db2327 - stable/14 - acpi_gpiobus: Fix cleanup on set flags failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 32de28db2327014b320d2f3b29b5438dcdfd928c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=32de28db2327014b320d2f3b29b5438dcdfd928c commit 32de28db2327014b320d2f3b29b5438dcdfd928c Author: Andrew Turner AuthorDate: 2024-12-09 15:14:13 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:10:09 +0000 acpi_gpiobus: Fix cleanup on set flags failure When GPIOBUS_PIN_SETFLAGS fails we called gpiobus_free_ivars to clean up the contents of the ivar, then would free the ivar. This lead to a use-after-free as the ivar had already been set on the child so gpiobus_child_deleted would try to free it again. Fix this by removing the early cleanup and letting gpiobus_child_deleted handle it. Fixes: c9e880c0ceef ("gpiobus: Use a bus_child_deleted method to free ivars for children") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47670 (cherry picked from commit bb8c68b25333638a20838500ccffee23b4291427) --- sys/dev/gpio/acpi_gpiobus.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 14ded4539a5e..254bb951177d 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -201,8 +201,6 @@ acpi_gpiobus_enumerate_aei(ACPI_RESOURCE *res, void *context) for (int i = 0; i < devi->gpiobus.npins; i++) { if (GPIOBUS_PIN_SETFLAGS(bus, child, 0, devi->flags)) { - gpiobus_free_ivars(&devi->gpiobus); - free(devi, M_DEVBUF); device_delete_child(bus, child); return (AE_OK); } From nobody Thu Feb 27 14:16:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLX5Lfcz5qFx9; Thu, 27 Feb 2025 14:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLX4rZ0z3xGY; Thu, 27 Feb 2025 14:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uV2eqzwiQglMMdxyGb+VSmz1NTHHD8EpCt+q2YKMJg0=; b=j+ErcnfMRwNOWv4bIX1gQJoWH/mFcafNGU6HtNAPPoR9JFF2rFIA/Qa363VWVPfV5mJle1 RGE+Udyo/7B2G55QV8Xt6k5Wc9w0XCVV+t6Aymq2qcGpCShCKrLzglThkyJFKudYJjczoz 3qM6uVB5ISshLo8TJy4+KF+brFtzYprNbUp8WKvBkKRfK4B8QOKAsLUaqyL5mG3SaPrAem jzb2wsBfUg7KgE6Q3TfW+9ffVfFfYnjrhlDNTRbpEUahPrcRI45pSMFzRUTaNVHPLELlCm SYKiqNBAyY449FCdJDrMxbr4P2ZQ+QfUEyjOt8jSOrq3h8YG2yUyjSegUFcU7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665812; a=rsa-sha256; cv=none; b=YcggwK90c49s72uXfNMSU7q1e8nNp0xBEOhY/Xu9NsOx1u/SZCD0StYxOCWNstjAm6qmWF zbk2TgcrUgXPlheMOfRtdnd/yOEWf0OkRjyMplDPPd8RNbmY1oHgoC5e7dgG0e339+0oag hds14tnULo9IhIIducuwmeGRhTo4/+XlxRuWpGm5px05mZDTIHFTnr++gxu2W3EqyOPjpF z8wShfEnaXpG0TbahOLsR/gnjZixz3LXEkXLpmjN1ATHGoTP9eDvWxFxF/Qk+oB1eCM2zq p0OnhfuRbzozdCui4mEvvdabg1SnOzzqoDhh0nwdSbdcbeFxIhAOIel5FSHLyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uV2eqzwiQglMMdxyGb+VSmz1NTHHD8EpCt+q2YKMJg0=; b=DtfKFksT3TDpoI4AtQn4RiNbRyQ8Ft93CIoZPCY0HVcOP3tXMQt4I4ftSDqeE319PmZhT2 TZAgePMiIdsqA3NNqrFuulr4mI+7ibK2Legd/cTa5qWDGgX7ogzp2TXIKTafFpQQ4xnpqX DIjy4Fqe3t3uqSUB4qOmLd4RPmqqmeWUMQqezvbB0owrHG5dFF7XMwdZxJw/FUEseQJgfn ykqSvrsIm+ZVmRYhBnUwYsDKKtsWQJ4BcyRcfy4Y8jJiU5MvUoUaYz1ZgFTnlIBbylCsKP 4Bk3WuTBSqXCDdOJ0kolnxJZCZcI5OH1JnMY92Q7MVLMDQHlSE/hg9un+qIGTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLX4M8TzmQF; Thu, 27 Feb 2025 14:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGqmb016310; Thu, 27 Feb 2025 14:16:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGqR4016307; Thu, 27 Feb 2025 14:16:52 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:52 GMT Message-Id: <202502271416.51REGqR4016307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4b2667686f68 - stable/14 - pci_host_generic: Remove unused res1 field from softc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4b2667686f68aa8d216b89803da38cc84ff997f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4b2667686f68aa8d216b89803da38cc84ff997f0 commit 4b2667686f68aa8d216b89803da38cc84ff997f0 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Remove unused res1 field from softc Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43889 (cherry picked from commit eac46b9dd7dd831d41645b734060fc8c039ff77b) --- sys/dev/pci/pci_host_generic.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.h b/sys/dev/pci/pci_host_generic.h index a408ef9d56fd..8e72ac6e5cef 100644 --- a/sys/dev/pci/pci_host_generic.h +++ b/sys/dev/pci/pci_host_generic.h @@ -74,7 +74,6 @@ struct generic_pcie_core_softc { struct rman mem_rman; struct rman io_rman; struct resource *res; - struct resource *res1; int bus_start; int bus_end; int ecam; From nobody Thu Feb 27 14:17:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLt5HBBz5qFrS; Thu, 27 Feb 2025 14:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLt4rQVz3xJc; Thu, 27 Feb 2025 14:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mLMgQieBten+24fwOwBjSkDjcNJ7hjdjbJxVZaXJ+Xs=; b=uyClX2qEGIyk4eFccfIl2kPelmwpdMiVUwF844+znVSCyLKhu0FVeiApgiK8kIynSbdiaG i6v3tj+B6+jCsWoVnznjP9I81grVHAqQhl4KEyJtd/k7IqTeDIJZss0oQA2kyC9xdAwqh8 BjE/OdRvf4NuvSMSRi1jqnJYhBCZEOOTpo+iaIVzWLznWqP8d7/DpRvHIELUc/odlTyU0F EOqDYn52tSX0uSgmEaGjHOaDQcGS/PpE7Zsyyfi16gyZNrSeeT6gyLZmc/OGWyc3nf1SL/ p3DHna/tWzTPwBSuAGn4E80by1bsN3xfz4HQS+psurkyMYT+D1AbXv4+uXm5Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665830; a=rsa-sha256; cv=none; b=u3WBcFGRSbBfJcPhgr/0jfuz4sDVyza9BgQjbWWKxcf0fvzCZ54tT0LoaanL5oCqnjpo1i veiHaEYO2+OdSQN4VvsZZHMJ4wlGjiFMJVJeCudleB2TDap3NCRpRZSidG7ScFQPhagi7c ySp3w1FIxRM+JVqo1JT+7hFhNyZgNYCjrecSN6UK+S3dtew47l4PObLIZcsDKfydUJOmBQ F4Z9PWg3HWKkqXZ0wjwezypeitwctoRYAVvGjJeS+ejKYBcmYiYEohKWkhOrhH572kGH3y NxjT40x1jD7H+4FUUev+y3CQ0uQy6IhYMJEDGQZ3/rdbhVGSEsC8cf/mTgCPPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mLMgQieBten+24fwOwBjSkDjcNJ7hjdjbJxVZaXJ+Xs=; b=OgtUcqozpLeaUDhylu3/WQPZiR48AQUOquNf3qI//FPW9nfhODqr9/4s+omStUB1+oIPjb EEWEXLuMif5I0walPpjX7v9Mrrhx1kSm3/SRw4Wc3Y+J3/MbSrK5pPPOVl+ZR6Uq5shnDT fjA50h2hQS1KGpuzz83VOQ3WOQGPl9dRuOAnFnUWC4uu7qZzwfXyl9NRpE4fh55O2pAkWl WmcFAyRH8c8fjJQMt+MbSm6Si+hMb258LRWLW1Z0gB4j+HLUuD29iO+y6J6Of7ixozrMOX i0+mR3Y7WRf0hfF5YwOONdBAgS+FN7RMuYDx8vM3RKYmy2m9UdaHmI4+TJSgFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLt4RmVzmZW; Thu, 27 Feb 2025 14:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHA0g016884; Thu, 27 Feb 2025 14:17:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHAnr016881; Thu, 27 Feb 2025 14:17:10 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:10 GMT Message-Id: <202502271417.51REHAnr016881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 189d06c37731 - stable/14 - bhnd_usb: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 189d06c3773118f804b93f59f46dce9b1fb284b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=189d06c3773118f804b93f59f46dce9b1fb284b1 commit 189d06c3773118f804b93f59f46dce9b1fb284b1 Author: John Baldwin AuthorDate: 2024-02-27 19:44:03 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 bhnd_usb: Use bus_generic_rman_* For SYS_RES_MEMORY, use bus_generic_rman_* for activate/deactivate_resource methods as well as custom map/unmap_resource methods that request submappings of the sc_mem resource allocated from the parent bus. Differential Revision: https://reviews.freebsd.org/D43938 (cherry picked from commit b25f03a1a27256c8d638a7e82ac3f6248994d5f3) --- sys/dev/bhnd/cores/usb/bhnd_usb.c | 111 +++++++++++++++++++++++++++++--------- 1 file changed, 85 insertions(+), 26 deletions(-) diff --git a/sys/dev/bhnd/cores/usb/bhnd_usb.c b/sys/dev/bhnd/cores/usb/bhnd_usb.c index e3bcd8f40bf8..68701df14c50 100644 --- a/sys/dev/bhnd/cores/usb/bhnd_usb.c +++ b/sys/dev/bhnd/cores/usb/bhnd_usb.c @@ -234,6 +234,19 @@ bhnd_usb_attach(device_t dev) return (0); } +static struct rman * +bhnd_usb_get_rman(device_t bus, int type, u_int flags) +{ + struct bhnd_usb_softc *sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -241,12 +254,10 @@ bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, struct resource *rv; struct resource_list *rl; struct resource_list_entry *rle; - int passthrough, isdefault, needactivate; - struct bhnd_usb_softc *sc = device_get_softc(bus); + int passthrough, isdefault; isdefault = RMAN_IS_DEFAULT_RANGE(start,end); passthrough = (device_get_parent(child) != bus); - needactivate = flags & RF_ACTIVE; rle = NULL; if (!passthrough && isdefault) { @@ -272,20 +283,11 @@ bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, * attempt to satisfy the allocation ourselves. */ if (type == SYS_RES_MEMORY) { - rv = rman_reserve_resource(&sc->mem_rman, start, end, count, - flags, child); + rv = bus_generic_rman_alloc_resource(bus, child, type, rid, + start, end, count, flags); if (rv == NULL) { - BHND_ERROR_DEV(bus, "could not reserve resource"); - return (0); - } - - rman_set_rid(rv, *rid); - - if (needactivate && - bus_activate_resource(child, type, *rid, rv)) { - BHND_ERROR_DEV(bus, "could not activate resource"); - rman_release_resource(rv); - return (0); + BHND_ERROR_DEV(bus, "could not allocate resource"); + return (NULL); } return (rv); @@ -327,14 +329,8 @@ bhnd_usb_release_resource(device_t dev, device_t child, int type, r)); } - /* Deactivate resources */ - if (rman_get_flags(r) & RF_ACTIVE) { - error = BUS_DEACTIVATE_RESOURCE(dev, child, type, rid, r); - if (error) - return (error); - } - - if ((error = rman_release_resource(r))) + error = bus_generic_rman_release_resource(dev, child, type, rid, r); + if (error != 0) return (error); if (!passthrough) { @@ -348,6 +344,66 @@ bhnd_usb_release_resource(device_t dev, device_t child, int type, return (0); } +static int +bhnd_usb_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type != SYS_RES_MEMORY) + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + return (bus_generic_rman_activate_resource(dev, child, type, rid, r)); +} + +static int +bhnd_usb_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type != SYS_RES_MEMORY) + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + return (bus_generic_rman_deactivate_resource(dev, child, type, rid, r)); +} + +static int +bhnd_usb_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct bhnd_usb_softc *sc = device_get_softc(dev); + struct resource_map_request args; + rman_res_t length, start; + int error; + + if (type != SYS_RES_MEMORY) + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + args.offset = start - rman_get_start(sc->sc_mem); + args.length = length; + return (bus_generic_map_resource(dev, child, type, sc->sc_mem, &args, + map)); +} + +static int +bhnd_usb_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + struct bhnd_usb_softc *sc = device_get_softc(dev); + + if (type == SYS_RES_MEMORY) + r = sc->sc_mem; + return (bus_generic_unmap_resource(dev, child, type, r, map)); +} + static int bhnd_usb_print_all_resources(device_t dev) { @@ -478,11 +534,14 @@ static device_method_t bhnd_usb_methods[] = { DEVMETHOD(bus_child_deleted, bhnd_usb_child_deleted), DEVMETHOD(bus_alloc_resource, bhnd_usb_alloc_resource), DEVMETHOD(bus_get_resource_list, bhnd_usb_get_reslist), + DEVMETHOD(bus_get_rman, bhnd_usb_get_rman), DEVMETHOD(bus_print_child, bhnd_usb_print_child), DEVMETHOD(bus_release_resource, bhnd_usb_release_resource), + DEVMETHOD(bus_activate_resource, bhnd_usb_activate_resource), + DEVMETHOD(bus_deactivate_resource, bhnd_usb_deactivate_resource), + DEVMETHOD(bus_map_resource, bhnd_usb_map_resource), + DEVMETHOD(bus_unmap_resource, bhnd_usb_unmap_resource), /* Bus interface: generic part */ - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 14:16:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLM56g4z5qFx6; Thu, 27 Feb 2025 14:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLM4SYnz3xNs; Thu, 27 Feb 2025 14:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7GD/6UoqZNmPjUUf3P+SutV49Orql6Vqe0pFmiqk5Tg=; b=fZWYKy2XKRqzVaVsq5BzNputUtWkpHhCHOLazp48u1a3LyQNuIs+/b8kDA3XzDN71Eeu0r aSvS1M1JwVqRpti/Chv2Uqv1oOhUrELftCb5DcAIntE+NVkaQA/k8Z3T5pqmhbwqn4UiyY oNq2qQ+x+VR1LUOMGsWsTwQ/ggg4g4VEhZlJ49KH81k/IaXcN0J9s1D9tsWR9iKFPmZzwu r2re3WJ7cnT26KLB62hyDhEWfPHja8yTidJZZJVrdvx/sn+wC+DV9kwqMyy8M6jg8e3JPX bYcKUe1TnxsHnnAVLihUlH0Zzko/4bYbAElwdlyfq6ZqWn9u66amJTE2KV9iXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665803; a=rsa-sha256; cv=none; b=iH6vHu+tS+i8QB7by8B7SAqaMf+qTEG4LaRLFvQiUrESZ8jrETpit30tRDVLCL/fKCQlbj Iy7mR2AWEhCfxrs7IC1ttZiNlrpFeiW+HJwswWEW27hBzuMtDD28V/Cqly77tYsXQA4sD5 lj1ITlMcaRg4j103XVWWf+rSVkhajJ39M9MrgzsDOl8b1BYukyuOmQ5Uv9uqCJ7JMXJk/Y gn7NSO+o7lRgCVLCmoYdIi1M/BmcTZ7GtB6Z3pyvHbJrmSaPOBvkQVUcsdoLdeuYQJcYzR aTZ/Qy49a6hauv7V1lPwENiVF5V3OBU+RfUvczzOiPcjV78S/x7UTdSqy3F/ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7GD/6UoqZNmPjUUf3P+SutV49Orql6Vqe0pFmiqk5Tg=; b=dGMzks+dzYIqQMFlEwRQzpQs9W/TAzThBDuh/SMEVn/MHb67BH6WjW4+shmgL1xk8/I74M X+nnQuqrmR7A13tHpnGbfsqtHO6Ivl5hsSH8gRdmDuWMukU+BFK+aoXNCIsC6D+znoU3Cm NTuIb2fOMg7YaurIAG1Zqn7AgiL4qos9ywRzF3LxVu+q3upXZlaSweGBQkYzdVcBmNPpUP 0yAtmli5HPvwCV4xBRkO4wdVPRwUK02ym7nWqmCMSVFY87lkKtBhQKH+whIT8UFngEJ2ZF HJLajQh2c3ETTYTIwPFdF1upCfqbh5Ls9Sos4rP+ONmBsLBtuyEiS4Or89kUVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLM3zQLzmqM; Thu, 27 Feb 2025 14:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGhj6016021; Thu, 27 Feb 2025 14:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGhi3016018; Thu, 27 Feb 2025 14:16:43 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:43 GMT Message-Id: <202502271416.51REGhi3016018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 782d09ad298b - stable/14 - powerpc: Fix bus_space_unmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 782d09ad298bb9d66099d3f7276cd160f5fcd738 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=782d09ad298bb9d66099d3f7276cd160f5fcd738 commit 782d09ad298bb9d66099d3f7276cd160f5fcd738 Author: John Baldwin AuthorDate: 2024-01-23 17:37:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc: Fix bus_space_unmap Previously it failed to compile since the macro passed too many arguments to the function. Fix by adding the bus handle to the function and adding an implementation that calls pmap_unmapdev. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43440 (cherry picked from commit a3d6e0de1c89c145b40ed80fe54c6bad1abbf416) --- sys/powerpc/include/bus.h | 2 +- sys/powerpc/powerpc/bus_machdep.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/include/bus.h b/sys/powerpc/include/bus.h index 6e91900c236d..ddb4737d9b76 100644 --- a/sys/powerpc/include/bus.h +++ b/sys/powerpc/include/bus.h @@ -103,7 +103,7 @@ struct bus_space { /* mapping/unmapping */ int (*bs_map)(bus_addr_t, bus_size_t, int, bus_space_handle_t *); - void (*bs_unmap)(bus_size_t); + void (*bs_unmap)(bus_space_handle_t, bus_size_t); int (*bs_subregion)(bus_space_handle_t, bus_size_t, bus_size_t, bus_space_handle_t *); diff --git a/sys/powerpc/powerpc/bus_machdep.c b/sys/powerpc/powerpc/bus_machdep.c index 39096edfc1f7..e908750961d0 100644 --- a/sys/powerpc/powerpc/bus_machdep.c +++ b/sys/powerpc/powerpc/bus_machdep.c @@ -140,8 +140,13 @@ bs_remap_earlyboot(void) } static void -bs_gen_unmap(bus_size_t size __unused) +bs_gen_unmap(bus_space_handle_t bsh, bus_size_t size) { + + if (!pmap_bootstrapped) + return; + + pmap_unmapdev((void *)bsh, size); } static int From nobody Thu Feb 27 14:17:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLj5M0tz5qGFm; Thu, 27 Feb 2025 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLj4tjlz3xPL; Thu, 27 Feb 2025 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7g0eAH2548jDaa2CnNzwPUVSi7GnuvZEk0yT2gUlol4=; b=joPVJnoR8xh0L/0/XQTksAlSEAkOOPgmRjsV+eMoty2Nm2JCpjwLUTxDzE69M+RJHiu3TZ aGJi/FiUtx3AT+/tmFB7GJ6LCl4YoO+SPSVoxBAxhBe/e8w0IlMWZvdxkVZbQDN/2XFn9u P/iHvYW16e5X+7jg9gWMj8HWd9t7RJCZXPIdz0aAJ/L31HONTd0lfnMdm9smf7wixa+Rsx cdPuBMkMExDlsjjiyS35Y5xfGJfLtjREflu5oWUb+4UpnJdQPvVfMCh0tbmAW361gF/R9b aRzh7RQw2GHR1e1+OxZ8KQ4a/LLQubZdPzqDBW4q9nnWCWEx2kZDKHpaWmdaxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665821; a=rsa-sha256; cv=none; b=DM9nwZS7oxW8C+o2OCTrLdw0Eg+lmwtx7UqlWQJuxeS+eUnyct1oSro47/LQv8v76CBDRq QpC7CLerGE9/509NOdSmtXYcU3rGVoNZpDR3QG635ZQlWM6dbE5v4i/egno4Abe7BEVcMF oaarxb5IICDJAxXxLj5LDSYJ8M65fj+B5uvY21ao+BJlr/+qe4jBntS5PKQILFOodQjLzx qE4w3HMmGs65BmNnFelt4FykRIFMq5xmkZ3W7SB09gPQ4pOGJ2ZFdIfnAZEV0hdvfjH2OR NykP6yUZiSJyn5WjM5J457EbZYATMhFrPkBI7uCZKCLCeM7cTUt7wB+2QyHjpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7g0eAH2548jDaa2CnNzwPUVSi7GnuvZEk0yT2gUlol4=; b=kssuN90tcIJI++Y050klfo5vyfi34YLMnJ44RuFKe2/n34Z7zpqm2Ho9EYiqLyUQpEghYZ l74PhXgw+cIwc0BSPXZujoTif57SN0BItXLyapicWRNVMLWIZtM14p+AdWhFrkg0x9lCaA bbvdvlkaHzQI0kOsjeVQtYuuci2N752igtOSl4yttFiA2YZTPpgjZQUCkTCsRf3IRDFOMN QtXHicsbnK0MwHTUV5iHlk3fEBkTLh2KQRezyBA+c6gjQEoQLG3Ei1Zd2zm6VerDwrGuna fwxAU1BlA+0s8E2lt54Nd9Wp8uVkaX2J2pLLFTysxwa3+PlbvHXPL6SOVA5MgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLj4VP9zmZT; Thu, 27 Feb 2025 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH1Ti016607; Thu, 27 Feb 2025 14:17:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH15g016604; Thu, 27 Feb 2025 14:17:01 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:01 GMT Message-Id: <202502271417.51REH15g016604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2afea415b919 - stable/14 - pci_host_generic: Properly handle bus_release_resource of IRQ resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2afea415b91992f401b795dc6cbdd9539367d344 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2afea415b91992f401b795dc6cbdd9539367d344 commit 2afea415b91992f401b795dc6cbdd9539367d344 Author: John Baldwin AuthorDate: 2024-02-16 01:56:01 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Properly handle bus_release_resource of IRQ resources Unlike other bus methods updated to use bus_generic_rman_* in commit d79b6b8ec267, the bus_release_resource method was using bus_generic_rman_release_resource for all types other than PCI_RES_BUS. Instead, bus_generic_rman_* should only be used for memory and I/O port resources for this driver. Tested by: cperciva Reviewed by: cperciva Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D43925 (cherry picked from commit feefc3c71e33d8f97879c4889d5cf1ec82e98cd9) --- sys/dev/pci/pci_host_generic.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index ca384d9a1483..386b8411d29a 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -431,16 +431,24 @@ int pci_host_generic_core_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; sc = device_get_softc(dev); - +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { + case PCI_RES_BUS: return (pci_domain_release_bus(sc->ecam, child, rid, res)); - } #endif - return (bus_generic_rman_release_resource(dev, child, type, rid, res)); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(dev, child, type, rid, + res)); + default: + return (bus_generic_release_resource(dev, child, type, rid, + res)); + } } static struct pcie_range * From nobody Thu Feb 27 17:03:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3d3L5Fyjz59JDT; Thu, 27 Feb 2025 17:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3d3L4R3xz46Lx; Thu, 27 Feb 2025 17:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Smhx0fBO8Q/ytuPEEAppdNK8C9lfGUvm1QoCH84se+8=; b=Cq+iFyWJqCO86CFzUD3JDu4etaET53OGU5q2QRgjV+CccrSKuDMJenADIfP8HJ2g7IQzZ2 zza8mXpCLjFnc4FrA8gPU9eGsmYL/YXLnEulYsCsD9w/G+zH0u/gOmRC5vFaQAMDYkUEot HR4BrG4GzInXJHe3y22hO5LPkuYS1vosTwhmGmYY3M4JjVc6FMhDUWgx9CM8oXsIUQizzP K6E/aXJo2RlQlHhMuJCynP0h48XK6vy+8WxM9CaAVF7nMw4e2NUhHcUWSw+pJex+cZnN6b nbz3fJyVF/JJXohVb7ozDRLgG7YhWYfI4/Fi5r5JdudAFUbZTzvayoTIohv5Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675838; a=rsa-sha256; cv=none; b=A95vHYvfjJfhwkQdnu3RjxcEP1sGk1lXSbrrTdmJMzV7IdXWRCFC7aqkMrpkBRWxwxYUF8 6hifDFe9jdPo4hrGp9iBFIRg3HQLesJB8aqoE3wkd3ypXEWUyiLsS8njRd+s4klqdBqAKh GGVovaIETF63mbUDmf5MZzBlqx0yPc6lsII8TZ+KHb/CUPl6MXxOhGsixaFS8v3iM4ccYp teiuqut5U1ApPLLp6nuxR90sSwpBy+FF6xf5YdJh6uNsg/kzRk2FTLSsg235tGmcyWX9Ax Ay8lbwSa8PK98s29hc1KwcGwoF8VCOL+yMFvGlBUR3X0JGJvXZNY0nRmXgQy5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Smhx0fBO8Q/ytuPEEAppdNK8C9lfGUvm1QoCH84se+8=; b=CnwOU7FCu3QB69LVbS2xcGKpCQMJ6k5Vzi8JGtz2HM5DOkocggYT9Xi+DYc4HES0WHLlNe P7spCjKrapFgv9sXtJ7qm3E/gwQzMeCcek8uCNulGNcqbw4gC3xRuCKU9OGkLJb+H3bDR5 lf6qtE+3cgVigHRswEytNN8a0dUyXBtD6PWKqgUNT0OUI55LE6d1QxZXyzM9dbWdGLZxhS ZuvDcOhJgUJ7ZxD6l1Ym1fYP6LhyI+2ph23RVf3DcuRfnUewYKn6XxdqBhB2lJ7guGgH2o 2jlKOLIiVU160oIicb3CeE/0cJZNBJlqR/SKNoFmYawyudIzrInu9b++WApKPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3d3L3zqczs9D; Thu, 27 Feb 2025 17:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RH3wu3036961; Thu, 27 Feb 2025 17:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RH3w0W036958; Thu, 27 Feb 2025 17:03:58 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:03:58 GMT Message-Id: <202502271703.51RH3w0W036958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d57dc2d6a06f - stable/14 - cxgbe tom: Enable TLS offload support by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d57dc2d6a06f8397645c6d4ed4e0791b41282db4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d57dc2d6a06f8397645c6d4ed4e0791b41282db4 commit d57dc2d6a06f8397645c6d4ed4e0791b41282db4 Author: John Baldwin AuthorDate: 2024-12-10 20:30:11 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:03:00 +0000 cxgbe tom: Enable TLS offload support by default Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47764 (cherry picked from commit 8b1788118a1af586ed056a00b32a287c41095e7a) --- sys/dev/cxgbe/t4_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9a163880220d..011978ce131b 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7797,7 +7797,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); - sc->tt.tls = 0; + sc->tt.tls = 1; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sysctl_tls, "I", "Inline TLS allowed"); From nobody Thu Feb 27 21:05:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3kQ508B8z59Wyd; Thu, 27 Feb 2025 21:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kQ46Yycz43tk; Thu, 27 Feb 2025 21:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BvwJutJZeD+c1t+ae1APbgtquXkhcIgT3lcTCtw96dk=; b=H33NC7hrx9W8wNZnGLVqU7HjawhbH43F7oEpAN0zaCLW/znspG8hf7oMz6mFT/M7UNqaJ0 ilkm7EMTylzNADlcBdDWw3g+yH9wssikqmV3bckThrd1GZoMfr0ZRAWAB4amtL/xMS7/I/ ++CaTNxzy0m5uNjgqwZuQBLHk8tUOx5ICud3A/GlH7pxLUJ6kstjZgx6y9iLtNMklAAzK1 zFM6G9pLVvj7I48/rfOL29qudJT75toVo4WeSpdCaKmdOeyVfCVf7EtAcmQ0HYzOm+MiZH D+/VZKsuLx5Ra231k8TqSL4Wp8O3qfq9+mWoF0in19SOj/8FDQMQuh/pzxguPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690332; a=rsa-sha256; cv=none; b=JDrOwtAElPVTybTAtZvNqpXjmvJ04II0g1P/yIItqRhVAKRF+zEmH0MZAas2mdgQSn5lsx 380/+zpvHUI+DkZTACr6C4VI28Q68cpI56CNj7nf+HW2IERdRXIO1YHcxXkFHOhgK8mxoH Xdc6wL5+v6Yr79bNT7Q95r9zbf/MRRMEJ1cXvnEp7WYmjjXz33yMFlXKJjOwH3Rc7k7t2N NmzceMWKrONbl57ezb6Qk3ics4Zu+aDwl9rOaXTIy2fceil2quWJJlfGsvHAmNcCN2gVbG dNqFA7ECm/PJ1DvSm8Hs/UocLmRMjpRJZhsqBtkvpExCJqDy5Q6WrxednoigTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BvwJutJZeD+c1t+ae1APbgtquXkhcIgT3lcTCtw96dk=; b=azxv6w5hJ+I6kDZeSKQ4uFE+ZYYZrvbZUekyR0w3HZs4szUEEpdvt7Y9465e+VPNVeoFQ7 J3/dwrCZ9yBHEOsW0g16LGLB5aNu8DCmroWpXR1QenFGE4IGf6FcLnKh+F3LWeVW4bqjw1 qpxkHJDr7viI82FbVDdRoGfEirqqcO8FJPAOP3CqvZ9sWn4QA4HK+lFArLX3JGCLM3v0ld Uyn3PVDUeko5KljBvXGogy8aQdr05hJjXdl0OXQoQFmMNS8tXf7yRUUDQD3ctvWN2unMR+ EMbswF1aVaANMxpvgikSTQV9c/sexc+o8XdxOe0gpRSO64OJK+EvY+/noHrokQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3kQ469GZz10Cl; Thu, 27 Feb 2025 21:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL5W9P085998; Thu, 27 Feb 2025 21:05:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL5WB1085995; Thu, 27 Feb 2025 21:05:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:05:32 GMT Message-Id: <202502272105.51RL5WB1085995@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: d3c4b002d1fd - main - queue: Fix STAILQ_ASSERT_EMPTY() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3c4b002d1fd54ac69c1714e208051867ee56dc4 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d3c4b002d1fd54ac69c1714e208051867ee56dc4 commit d3c4b002d1fd54ac69c1714e208051867ee56dc4 Author: Olivier Certner AuthorDate: 2025-02-27 20:59:41 +0000 Commit: Olivier Certner CommitDate: 2025-02-27 21:04:17 +0000 queue: Fix STAILQ_ASSERT_EMPTY() The 'while' part corresponding to the 'do' was missing. Did not notice the problem as later commits using it have been stashed and never reworked up to now, and it is currently unused in the tree. While here, fix spacing after the '#define' in the !(_KERNEL && INVARIANS) part. Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") MFC after: 1 minute Sponsored by: The FreeBSD Foundation --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 6e4da0fa0bec..70d13ee92617 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -358,7 +358,7 @@ struct { \ #define STAILQ_ASSERT_EMPTY(head) do { \ if (!STAILQ_EMPTY((head))) \ panic("stailq %p is not empty", (head)); \ -} +} while (0) /* * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) @@ -372,7 +372,7 @@ struct { \ } while (0) #else #define QMD_STAILQ_CHECK_EMPTY(head) -#define STAILQ_ASSERT_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) #define QMD_STAILQ_CHECK_TAIL(head) #endif /* (_KERNEL && INVARIANTS) */ From nobody Thu Feb 27 14:17:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YMH08Dvz5qG2Q; Thu, 27 Feb 2025 14:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMG6Pkzz3xQ2; Thu, 27 Feb 2025 14:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=paMZPKJ+jjnRZvy3hoV2aQDOQVhFcSF+4FXhsdFGXng=; b=tGUACg9KevAdDn1xQ/SquLwewiytdG5acglAv6BT/vugde5x+8cgMUl0vPgU83su73R7Ph a5pIVg1E6n40XeWJPtzcCQ1pYMkM6Y976iTBQttdC1lP169D5Bv1PSRJMU65pZKJ5gHDiK 76uAWee0lqr3m26E9tKLMtrR7rCArYXO1hOBYDV/0RgfQRZnGoBVtTiCAzxVx5uy1cLo28 511+kSgJlxbsIGAg0V1gC2P9xGIzwZh9ofIpiuI1a0JsGCoKTlB/wyZWpbOV1jYoUvcHy3 P8XQK5z4XkNEPItAxcDTgUZJRnv0LEzb28lUZrHDI8l1+n4/luEQvKTaxwk85g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665850; a=rsa-sha256; cv=none; b=Xr7S0c5x50xLBuMPX3v1tI19M5sxti6jF12wxkf9WXT2jTwdj2ROmYKHJmmkmdN/KcPD0s 9IKaJy+ys5kLIngLNuWSoSH4faDfUCazKdGjq6twvc1mnv0SJakleeXOn1whDkHMeUSXux YpmklBvdtTAuRE/8JdQ30cmPM5CkBm8OJF3JwmiyCA0O5safKbjfENu/xQgaPUZSVY7rrt LTe7qkxL88zcV4raKbNXCDU7dID95RqtdvLnGz1GeRxgQpzZFJN4ro8e1e4m2JfP78ZCpP JNkdmwmYWjN2MFjvwUewOZjpzV9tvbsBcoVv+SW3nTfr4YhwVQkg3WAvZJ7qFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=paMZPKJ+jjnRZvy3hoV2aQDOQVhFcSF+4FXhsdFGXng=; b=LPco3nWq8M1YV6I2QbN8VfdiC67fisBAGayKS45kmJbGuiBKYH4oZ0go+g30HWPgOIYOBV 1LD3UZ1QeMG2elYKlojQLenA9QW1JhZHNYMS2WQr43zOJZNLt1GfO6XwSliyIOfvuvxygT LDxHSYgYgvamH0LUdhpuLzH9xDpcg+N8NUA1BJbwhzRRxQZUV+I0foV3OykOtto7iovBal 0ZukcAzQFNSiQO5+m2rHJgckZe+aEETbKyqGUfNSU+qQDzHzdFNGH+2hhTWxo7DzG+MS9C frL3ylahN+G3C/I4Vk/wiLPgXbM1gln/qh8Z/tcA6a4XaTL450vkQRF2RK5scQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YMG5v6Rzmsd; Thu, 27 Feb 2025 14:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHUBd017505; Thu, 27 Feb 2025 14:17:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHUtI017502; Thu, 27 Feb 2025 14:17:30 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:30 GMT Message-Id: <202502271417.51REHUtI017502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9f54ed946430 - stable/14 - pci: Consistently use pci_vf_* for suballocated VF memory resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f54ed9464308593f130f7b36bd4052e34af8c35 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f54ed9464308593f130f7b36bd4052e34af8c35 commit 9f54ed9464308593f130f7b36bd4052e34af8c35 Author: John Baldwin AuthorDate: 2024-06-04 23:51:37 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci: Consistently use pci_vf_* for suballocated VF memory resources Some of the bus resource methods were passing these up to the parent which triggered rman mismatch assertions in INVARIANTS kernels. Reported by: kp Reviewed by: imp Tested by: kp (earlier version) Differential Revision: https://reviews.freebsd.org/D45406 (cherry picked from commit 871b33ad65baf07c92cce120a4fc1978c2ed7b3b) --- sys/dev/pci/pci.c | 121 ++++++++++++++++++++++++++++++++++-- sys/dev/pci/pci_iov.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/pci/pci_private.h | 19 ++++++ 3 files changed, 288 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 2c00b44d941a..8ff31beca696 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -164,10 +164,18 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_delete_resource, pci_delete_resource), DEVMETHOD(bus_alloc_resource, pci_alloc_resource), +#ifdef PCI_IOV + DEVMETHOD(bus_adjust_resource, pci_adjust_resource), +#else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), +#endif DEVMETHOD(bus_release_resource, pci_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), +#ifdef PCI_IOV + DEVMETHOD(bus_map_resource, pci_map_resource), + DEVMETHOD(bus_unmap_resource, pci_unmap_resource), +#endif DEVMETHOD(bus_child_deleted, pci_child_deleted), DEVMETHOD(bus_child_detached, pci_child_detached), DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), @@ -5694,14 +5702,31 @@ pci_activate_resource(device_t dev, device_t child, int type, int rid, struct pci_devinfo *dinfo; int error; - error = bus_generic_activate_resource(dev, child, type, rid, r); + dinfo = device_get_ivars(child); +#ifdef PCI_IOV + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + error = EINVAL; + break; + case SYS_RES_MEMORY: + error = pci_vf_activate_mem_resource(dev, child, r); + break; + default: + error = bus_generic_activate_resource(dev, child, type, + rid, r); + break; + } + } else +#endif + error = bus_generic_activate_resource(dev, child, type, rid, r); if (error) return (error); /* Enable decoding in the command register when activating BARs. */ if (device_get_parent(child) == dev) { /* Device ROMs need their decoding explicitly enabled. */ - dinfo = device_get_ivars(child); if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r) | PCIM_BIOS_ENABLE); @@ -5722,13 +5747,31 @@ pci_deactivate_resource(device_t dev, device_t child, int type, struct pci_devinfo *dinfo; int error; - error = bus_generic_deactivate_resource(dev, child, type, rid, r); + dinfo = device_get_ivars(child); +#ifdef PCI_IOV + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + error = EINVAL; + break; + case SYS_RES_MEMORY: + error = pci_vf_deactivate_mem_resource(dev, child, r); + break; + default: + error = bus_generic_deactivate_resource(dev, child, + type, rid, r); + break; + } + } else +#endif + error = bus_generic_deactivate_resource(dev, child, type, rid, + r); if (error) return (error); /* Disable decoding for device ROMs. */ if (device_get_parent(child) == dev) { - dinfo = device_get_ivars(child); if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r)); @@ -5736,6 +5779,76 @@ pci_deactivate_resource(device_t dev, device_t child, int type, return (0); } +#ifdef PCI_IOV +int +pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, + rman_res_t start, rman_res_t end) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (EINVAL); + case SYS_RES_MEMORY: + return (pci_vf_adjust_mem_resource(dev, child, r, + start, end)); + } + + /* Fall through for other types of resource allocations. */ + } + + return (bus_generic_adjust_resource(dev, child, type, r, start, end)); +} + +int +pci_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (EINVAL); + case SYS_RES_MEMORY: + return (pci_vf_map_mem_resource(dev, child, r, argsp, + map)); + } + + /* Fall through for other types of resource allocations. */ + } + + return (bus_generic_map_resource(dev, child, type, r, argsp, map)); +} + +int +pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (EINVAL); + case SYS_RES_MEMORY: + return (pci_vf_unmap_mem_resource(dev, child, r, map)); + } + + /* Fall through for other types of resource allocations. */ + } + + return (bus_generic_unmap_resource(dev, child, type, r, map)); +} +#endif + void pci_child_deleted(device_t dev, device_t child) { diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index ee1387966b00..b9e22fafe103 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -1076,6 +1076,12 @@ pci_vf_release_mem_resource(device_t dev, device_t child, int rid, dinfo = device_get_ivars(child); + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + if (rman_get_flags(r) & RF_ACTIVE) { error = bus_deactivate_resource(child, SYS_RES_MEMORY, rid, r); if (error != 0) @@ -1091,3 +1097,149 @@ pci_vf_release_mem_resource(device_t dev, device_t child, int rid, return (rman_release_resource(r)); } + +int +pci_vf_activate_mem_resource(device_t dev, device_t child, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_devinfo *dinfo = device_get_ivars(child); +#endif + struct resource_map map; + int error; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + error = rman_activate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + error = BUS_MAP_RESOURCE(dev, child, SYS_RES_MEMORY, r, NULL, + &map); + if (error != 0) { + rman_deactivate_resource(r); + return (error); + } + + rman_set_mapping(r, &map); + } + return (0); +} + +int +pci_vf_deactivate_mem_resource(device_t dev, device_t child, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_devinfo *dinfo = device_get_ivars(child); +#endif + struct resource_map map; + int error; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + error = rman_deactivate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, SYS_RES_MEMORY, r, &map); + } + return (0); +} + +int +pci_vf_adjust_mem_resource(device_t dev, device_t child, struct resource *r, + rman_res_t start, rman_res_t end) +{ +#ifdef INVARIANTS + struct pci_devinfo *dinfo = device_get_ivars(child); +#endif + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + return (rman_adjust_resource(r, start, end)); +} + +static struct resource * +pci_vf_find_parent_resource(struct pcicfg_iov *iov, struct resource *r) +{ + struct resource *pres; + + for (u_int i = 0; i <= PCIR_MAX_BAR_0; i++) { + pres = iov->iov_bar[i].res; + if (pres != NULL) { + if (rman_get_start(pres) <= rman_get_start(r) && + rman_get_end(pres) >= rman_get_end(r)) + return (pres); + } + } + return (NULL); +} + +int +pci_vf_map_mem_resource(device_t dev, device_t child, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_iov *iov = dinfo->cfg.iov; + struct resource_map_request args; + struct resource *pres; + rman_res_t length, start; + int error; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + pres = pci_vf_find_parent_resource(dinfo->cfg.iov, r); + if (pres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(pres); + args.length = length; + return (bus_map_resource(iov->iov_pf, pres, &args, map)); +} + +int +pci_vf_unmap_mem_resource(device_t dev, device_t child, struct resource *r, + struct resource_map *map) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_iov *iov = dinfo->cfg.iov; + struct resource *pres; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + pres = pci_vf_find_parent_resource(iov, r); + if (pres == NULL) + return (ENOENT); + return (bus_unmap_resource(iov->iov_pf, pres, map)); +} diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index ea0efc54c829..d3dd41abdb62 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -65,9 +65,16 @@ bus_get_dma_tag_t pci_get_dma_tag; bus_get_resource_list_t pci_get_resource_list; bus_delete_resource_t pci_delete_resource; bus_alloc_resource_t pci_alloc_resource; +#ifdef PCI_IOV +bus_adjust_resource_t pci_adjust_resource; +#endif bus_release_resource_t pci_release_resource; bus_activate_resource_t pci_activate_resource; bus_deactivate_resource_t pci_deactivate_resource; +#ifdef PCI_IOV +bus_map_resource_t pci_map_resource; +bus_unmap_resource_t pci_unmap_resource; +#endif bus_child_deleted_t pci_child_deleted; bus_child_detached_t pci_child_detached; bus_child_pnpinfo_t pci_child_pnpinfo_method; @@ -158,4 +165,16 @@ struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child, rman_res_t count, u_int flags); int pci_vf_release_mem_resource(device_t dev, device_t child, int rid, struct resource *r); +int pci_vf_activate_mem_resource(device_t dev, device_t child, + struct resource *r); +int pci_vf_deactivate_mem_resource(device_t dev, device_t child, + struct resource *r); +int pci_vf_adjust_mem_resource(device_t dev, device_t child, + struct resource *r, rman_res_t start, rman_res_t end); +int pci_vf_map_mem_resource(device_t dev, device_t child, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map); +int pci_vf_unmap_mem_resource(device_t dev, device_t child, + struct resource *r, struct resource_map *map); + #endif /* _PCI_PRIVATE_H_ */ From nobody Thu Feb 27 14:17:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLm05mZz5qFrR; Thu, 27 Feb 2025 14:17:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLl6h2fz3xGt; Thu, 27 Feb 2025 14:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VtZGOSUPZfoM+NLdUFw2rdoC5kFkTfIEfHrCRHIRves=; b=RkzXx0wu9RC8Yq29WyVP+JQXp2EhW3+E5WSj9bBjLpumRjU3yB3wjzlfChULaoLxXRjhQm HGjg9/IQ9m3EgUuMQlxJSAikZv5a46HDiOlDslC7JiLw8p/46QBeohTmDws6u9pOPRSXp/ GG1sCsLGFgyH8Me4KHBcrRVfnXVGhkHJ55X7rmpTMjd/khS3+u3WG4zHpYysPo6JiPRrBu 6z4g+DJcNzE7XZDYdhayYZOEAmj1cI6sTGmZ+LuOE3g7Ljq4tn1yi8ZJnbyauYLPsbIrbV 2JH2Flbos4FDRsXZG7KAfpHRB0HeipLDh5vTxSlH5GxKzEMnPB0KoyLUCNvzZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665823; a=rsa-sha256; cv=none; b=DKDgN8opJpl+kxduplEF8flJdR788XPtTzZH4Yq+rjEWb2yX2GjwH1ThRl2UkKmueoYcoX WzVGMT12ewFnQuUMq6LxhNZOdQE9vW4LoseFnOEM4K4SBN/jntj0BsOnBzVSW6TZFDZe/c gTSu928kZ33gKQkGNnj0wBUIqXuSavNaHklhm11Fwy4C6JlN+jfAwld+sHGERaydHJrVJD TXfF0KtWYQCj3jI7uLmGIjLhxK/vbOwJ3VO5Xt3nQdGTrly91SxxKKhqrS5LdkEcweF+le 6DQvOd5/c6SLxqxQ4B9MxoLphFXoAPK0glu+sowbLQtRs/b7k90DJtpVxt0g6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VtZGOSUPZfoM+NLdUFw2rdoC5kFkTfIEfHrCRHIRves=; b=ufXna5Ta782gXa9KGUJOXun0Yd/cJMmSh3Qu9U0eTeY5ii47DX3B0f1S5+H8f41oyd94vE 1Td5bxZHtVaqLlbjZ4ap6ocTkSQn1X8ZeMnl0cs/kBnJAsBBByo8YHHodmkr470RcFB6cN x/r6T/tMDW/VX3XGpv4QfSxYJRs34CarUX9zvOER8i4aAbtwqmUnk1Sz0y/Z2KiIHgnd6N WD/WEjqrDTk7k6QDkSPeAd26IqpLcGAjMgrkDed4qWU+adQi4qSxl1J8bLksuWX11qZOHI UOCCghLKC/8kLm193r/Rj391l5vUXF24sQPvrveGZstxPkhut+CSq3/RV3mqKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLl6HGnzm7N; Thu, 27 Feb 2025 14:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH3jL016675; Thu, 27 Feb 2025 14:17:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH3eQ016672; Thu, 27 Feb 2025 14:17:03 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:03 GMT Message-Id: <202502271417.51REH3eQ016672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e7cab085e015 - stable/14 - powerpc psim: Fix infinite recursion in bus_adjust_resource method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7cab085e015abce194a2fca2791cbe3d31d117a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e7cab085e015abce194a2fca2791cbe3d31d117a commit e7cab085e015abce194a2fca2791cbe3d31d117a Author: John Baldwin AuthorDate: 2024-02-16 17:42:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 powerpc psim: Fix infinite recursion in bus_adjust_resource method The default case needs to call bus_generic_adjust_resource to pass the request up the tree, not bus_adjust_resource which will just call this method again. Fixes: d7c16b333455 powerpc psim: Use bus_generic_rman_* (cherry picked from commit ccb1b43e20f5a1a0795b14f3ef39d5c2e15b424d) --- sys/powerpc/psim/iobus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index 497ef42d82e6..c572a1fdc12b 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -352,7 +352,8 @@ iobus_adjust_resource(device_t bus, device_t child, int type, return (bus_generic_rman_adjust_resource(bus, child, type, r, start, end)); case SYS_RES_IRQ: - return (bus_adjust_resource(bus, type, r, start, end)); + return (bus_generic_adjust_resource(bus, child, type, r, start, + end)); default: return (EINVAL); } From nobody Thu Feb 27 21:16:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3kfb0696z59XY4; Thu, 27 Feb 2025 21:16:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kfZ6fnKz47gf; Thu, 27 Feb 2025 21:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8pe/0qsDJNAJbdlp2vZHp9kfpzwoxYcNoomLMsg9g/I=; b=Z8ez9cRbiSvRWwFqD6QsXBDLTHPgAVJbpPNvPOxML6kmLBC9ZEmp5hR6QKiZTrzwiVdXFU hYSL5pVOhcE9CTmfGm0p3+kjpCDG8l3iKhgsWoX1qGvkwBXYA/xMCT/AO1QDUAcA/11uJK 8hfUAKskeQjEgTTWnSPa/vDsYzUNyiDgUnxNbVvm15NNkkLJ8Y5bk/+ebReGITdcH0vPi8 tRvcqiWOOq1EGlILqPrM+06HxVpnM5V16tQuv2K8gtzfreTp6bRBg4eyuWaLq/QHa/kxVt TkUlUmXLGit6GBiECq6yhKcnzMIcbcoLx48Y5nbVFktt/+eqjOpvPBKcGL86xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690982; a=rsa-sha256; cv=none; b=hSE+xJp+HIXTRTrKAje/e2z4PkO9Kv9KLWXXuXd+9WE7gIAbFwm9nBDeBgwmvKKhD2wrNi dzReQs84hFJz037oXDIrBd59kyqy8CkBowQ9SMVgLp9HqcDCPlwUG+fMAKVqiJMKqVFn4+ /tgLTh+vinDy737XTMovtOWLxmAcjom0TNV3BZduU0FT1XVZKSul/NkxFKmjFdtG+Vwk32 LiphFfPRXcFSuexjY1z0Tah/6bWaGCmrs/FeR/qPG1aigYMLc8x+YKLSHZSUp8Us1T47w/ T5iOR7eQVySJiy0F54ZnHAygwFldq0FHlzKpcd2E2aMAPejp1+ee44FqhUHz3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8pe/0qsDJNAJbdlp2vZHp9kfpzwoxYcNoomLMsg9g/I=; b=BpSDRbb/2i9H3Q0mKIJpD+am4sdoOEQCcKjcq8N4X3tO33PNJG41bW1jPv/HmrmSKnWfW9 m7rqaF39KZ403XBVCkNDL7NpT0xX7YfTCF+kATQpz/huUXZU+PLv7oHmiqefs4IO1yVoCR LqUPhyr8O9JjiUxQ1bnSxEdfG7UDvVdofkvDd5R47yuFDGu4sUQKn4KxZ+Ho6KHe4zUn6H lrkMvZkBLcJCaM6+sDs18zOmBkXA6Z/5+xcQt3Gtsn4AY9zYdQ8IKKlE5+3CHlgmVOsS// uF7BKNuaBvKlrkbxO5jBa1kQWa0cbstN7+oYhLLcc4iiMubuQbCn4y54TlEEOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3kfZ62QXz10Hj; Thu, 27 Feb 2025 21:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RLGME6005409; Thu, 27 Feb 2025 21:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RLGMpU005406; Thu, 27 Feb 2025 21:16:22 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:16:22 GMT Message-Id: <202502272116.51RLGMpU005406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 9e0ef670d8a8 - stable/14 - queue: Fix STAILQ_ASSERT_EMPTY() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9e0ef670d8a864d161a14cf374add713a659c3cd Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9e0ef670d8a864d161a14cf374add713a659c3cd commit 9e0ef670d8a864d161a14cf374add713a659c3cd Author: Olivier Certner AuthorDate: 2025-02-27 20:59:41 +0000 Commit: Olivier Certner CommitDate: 2025-02-27 21:15:40 +0000 queue: Fix STAILQ_ASSERT_EMPTY() The 'while' part corresponding to the 'do' was missing. Did not notice the problem as later commits using it have been stashed and never reworked up to now, and it is currently unused in the tree. While here, fix spacing after the '#define' in the !(_KERNEL && INVARIANS) part. Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") MFC after: 1 minute Sponsored by: The FreeBSD Foundation (cherry picked from commit d3c4b002d1fd54ac69c1714e208051867ee56dc4) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index be862c7ce814..38c319704cc4 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -357,7 +357,7 @@ struct { \ #define STAILQ_ASSERT_EMPTY(head) do { \ if (!STAILQ_EMPTY((head))) \ panic("stailq %p is not empty", (head)); \ -} +} while (0) /* * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) @@ -371,7 +371,7 @@ struct { \ } while (0) #else #define QMD_STAILQ_CHECK_EMPTY(head) -#define STAILQ_ASSERT_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) #define QMD_STAILQ_CHECK_TAIL(head) #endif /* (_KERNEL && INVARIANTS) */ From nobody Thu Feb 27 16:55:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3ct3006kz5qNVq; Thu, 27 Feb 2025 16:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct26NwKz46DR; Thu, 27 Feb 2025 16:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3fb6TDG4n14v6p+mJmuJo0giRTaKgJIdjaFAyCaO3sI=; b=hI/u/Q8EaCdESbB/xZAJXrJTisgglBkaYefgfenkQnCoYfJb7l37ArmyU+GSkPmtluGeCN LSz1tsJOJ//7PLixofVH+SGpVddE4bXPQ4s51SzxxRNgtbArv5bdF1p4A9TvVmpppRjGpU UwFIWkz6iRGdi7Zol1tWdTd99/GEVCeDB9osLSbpdJMN051sQxkwC5Ms+Z271k/LKKs+pC THivtJ/oRSEl2cBQkCc9S3zDlShE9MB/0E8TkHdbHQgy70cz49Mz94lNdz3Kkvfm6QxbPh 4fpWDODjkoVtdH3bay+A90bT9fGKMPslGVTvlTaiv0fHD9HboIn6kiXO+5fi3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675354; a=rsa-sha256; cv=none; b=SaGgMGZo/eXG4ZVNxRIQWlniw/chIlrsI+QQehXtzRqYceohf7GenH3g/D+JZQfC1lFRSC 5A0gwEJ6SE43cVGEFB8kqRbUYGdpHY2Qh+DsftM2TDHeqc/zxfG2nsSdpy7sA2tBCCP85Q 6wWqeQg3c3T40u87QEGxY+dW7e8CWzKJfqizDA4cQUHFDtS5Xa5l4HiVAbCUsXPqX5GA9C qcq5icyt7Hv3TgDS4OQQoE8LMYbyjZb7+HA5iw4Lu+NNlEskFp9HDoGutoK7z+qvADovDj vsaN8o6uYb+qK11Bzj2LFCizFvYFcADo/aWS+KFo2ZYhYXiHPPcvR/r0x3Hpzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3fb6TDG4n14v6p+mJmuJo0giRTaKgJIdjaFAyCaO3sI=; b=kExfjAiqYBw02/QyQOhUFJGkv9FpS3dJEe1i2MfhdAo5usnPzYZp/6O2NzcmCUyistLWJA WQgGhxMrnJjhQNYljmsc6bmSVe6plcr2ErbZef+RMZNuqlCA/b4nzbEwHMlWuz3kO4nC98 Fm/Zo8YgN10T8Uwkw8SjfCwtbT6wmxKgtNBAYH2LSiTvEV9BF+CK95qpjPt8vVtoXvN6EE y8LCt9SV4Sj+eNR8bgwKnByn9E/7lDwIhqE+y+FBtSguj8Q6X9IE+Cme6FOp7UJcPRw9ej 72Syh6X1aFXc/OTM20BBnK6vod5+pCPojf0D1psWw1OyYKLk2BFNMUSZee/seA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3ct25v5wzrGn; Thu, 27 Feb 2025 16:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtsqC017028; Thu, 27 Feb 2025 16:55:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtsW1017025; Thu, 27 Feb 2025 16:55:54 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:54 GMT Message-Id: <202502271655.51RGtsW1017025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: bc8f3704f1d8 - stable/14 - stand/kshim: Update for devclass being removed from DRIVER_MODULE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc8f3704f1d82fc8b6eb5f77b6f7fc062b5d30ba Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bc8f3704f1d82fc8b6eb5f77b6f7fc062b5d30ba commit bc8f3704f1d82fc8b6eb5f77b6f7fc062b5d30ba Author: John Baldwin AuthorDate: 2025-01-11 04:01:48 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:23:52 +0000 stand/kshim: Update for devclass being removed from DRIVER_MODULE The kshim code abused the devclass argument to DRIVER_MODULE in some odd ways. Instead, refactor the devclass handling to more closely mirror what new-bus does in the kernel by having a linked list of devclasses looked up by name and associate devices with a devclass. Devices are now only associated with a module while probing and attaching. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48409 (cherry picked from commit ee15875c01593b287e55147c482b914e3ab01152) --- stand/kshim/bsd_kernel.c | 140 ++++++++++++++++++--------------------- stand/kshim/bsd_kernel.h | 11 +-- stand/usb/storage/umass_common.c | 4 +- 3 files changed, 71 insertions(+), 84 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index ac552d86603f..abe81ccc6c1d 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -556,6 +556,8 @@ static const char unknown_string[] = { "unknown" }; static TAILQ_HEAD(, module_data) module_head = TAILQ_HEAD_INITIALIZER(module_head); +static TAILQ_HEAD(, devclass) devclasses = + TAILQ_HEAD_INITIALIZER(devclasses); static uint8_t devclass_equal(const char *a, const char *b) @@ -688,58 +690,50 @@ device_get_nameunit(device_t dev) return (unknown_string); } -static uint8_t -devclass_create(devclass_t *dc_pp) +static devclass_t +devclass_create(const char *classname) { - if (dc_pp == NULL) { - return (1); - } - if (dc_pp[0] == NULL) { - dc_pp[0] = malloc(sizeof(**(dc_pp)), - M_DEVBUF, M_WAITOK | M_ZERO); + devclass_t dc; - if (dc_pp[0] == NULL) { - return (1); - } + dc = malloc(sizeof(*dc), M_DEVBUF, M_WAITOK | M_ZERO); + if (dc == NULL) { + return (NULL); } - return (0); + dc->name = classname; + TAILQ_INSERT_TAIL(&devclasses, dc, link); + return (dc); } -static const struct module_data * +static devclass_t devclass_find_create(const char *classname) { - const struct module_data *mod; + devclass_t dc; - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->mod_name, classname)) { - if (devclass_create(mod->devclass_pp)) { - continue; - } - return (mod); - } - } - return (NULL); + dc = devclass_find(classname); + if (dc == NULL) + dc = devclass_create(classname); + return (dc); } static uint8_t -devclass_add_device(const struct module_data *mod, device_t dev) +devclass_add_device(devclass_t dc, device_t dev) { device_t *pp_dev; device_t *end; uint8_t unit; - pp_dev = mod->devclass_pp[0]->dev_list; + pp_dev = dc->dev_list; end = pp_dev + DEVCLASS_MAXUNIT; unit = 0; while (pp_dev != end) { if (*pp_dev == NULL) { *pp_dev = dev; + dev->dev_class = dc; dev->dev_unit = unit; - dev->dev_module = mod; snprintf(dev->dev_nameunit, sizeof(dev->dev_nameunit), - "%s%d", device_get_name(dev), unit); + "%s%d", dc->name, unit); return (0); } pp_dev++; @@ -750,26 +744,26 @@ devclass_add_device(const struct module_data *mod, device_t dev) } static void -devclass_delete_device(const struct module_data *mod, device_t dev) +devclass_delete_device(devclass_t dc, device_t dev) { - if (mod == NULL) { + if (dc == NULL) { return; } - mod->devclass_pp[0]->dev_list[dev->dev_unit] = NULL; - dev->dev_module = NULL; + dc->dev_list[dev->dev_unit] = NULL; + dev->dev_class = NULL; } static device_t make_device(device_t parent, const char *name) { device_t dev = NULL; - const struct module_data *mod = NULL; + devclass_t dc = NULL; if (name) { - mod = devclass_find_create(name); + dc = devclass_find_create(name); - if (!mod) { + if (!dc) { DPRINTF("%s:%d:%s: can't find device " "class %s\n", __FILE__, __LINE__, @@ -789,7 +783,7 @@ make_device(device_t parent, const char *name) if (name) { dev->dev_fixed_class = 1; - if (devclass_add_device(mod, dev)) { + if (devclass_add_device(dc, dev)) { goto error; } } @@ -845,7 +839,8 @@ device_delete_child(device_t dev, device_t child) } } - devclass_delete_device(child->dev_module, child); + if (child->dev_class != NULL) + devclass_delete_device(child->dev_class, child); if (dev != NULL) { /* remove child from parent */ @@ -913,7 +908,7 @@ device_get_method(device_t dev, const char *what) const char * device_get_name(device_t dev) { - if (dev == NULL) + if (dev == NULL || dev->dev_module == NULL) return (unknown_string); return (dev->dev_module->driver->name); @@ -944,16 +939,34 @@ device_probe_and_attach(device_t dev) { const struct module_data *mod; const char *bus_name_parent; - - bus_name_parent = device_get_name(device_get_parent(dev)); + devclass_t dc; if (dev->dev_attached) return (0); /* fail-safe */ - if (dev->dev_fixed_class) { + /* + * Find a module for our device, if any + */ + bus_name_parent = device_get_name(device_get_parent(dev)); + + TAILQ_FOREACH(mod, &module_head, entry) { + if (!devclass_equal(mod->bus_name, bus_name_parent)) + continue; + + dc = devclass_find(mod->mod_name); - mod = dev->dev_module; + /* Does this device need assigning to the new devclass? */ + if (dev->dev_class != dc) { + if (dev->dev_fixed_class) + continue; + if (dev->dev_class != NULL) + devclass_delete_device(dev->dev_class, dev); + if (devclass_add_device(dc, dev)) { + continue; + } + } + dev->dev_module = mod; if (DEVICE_PROBE(dev) <= 0) { if (device_allocate_softc(dev) == 0) { @@ -965,40 +978,11 @@ device_probe_and_attach(device_t dev) } } } - device_detach(dev); + /* else try next driver */ - goto error; - } - /* - * Else find a module for our device, if any - */ - - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->bus_name, bus_name_parent)) { - if (devclass_create(mod->devclass_pp)) { - continue; - } - if (devclass_add_device(mod, dev)) { - continue; - } - if (DEVICE_PROBE(dev) <= 0) { - - if (device_allocate_softc(dev) == 0) { - - if (DEVICE_ATTACH(dev) == 0) { - /* success */ - dev->dev_attached = 1; - return (0); - } - } - } - /* else try next driver */ - - device_detach(dev); - } + device_detach(dev); } -error: return (ENODEV); } @@ -1017,9 +1001,10 @@ device_detach(device_t dev) dev->dev_attached = 0; } device_set_softc(dev, NULL); + dev->dev_module = NULL; if (dev->dev_fixed_class == 0) - devclass_delete_device(mod, dev); + devclass_delete_device(dev->dev_class, dev); return (0); } @@ -1095,11 +1080,11 @@ devclass_get_device(devclass_t dc, int unit) devclass_t devclass_find(const char *classname) { - const struct module_data *mod; + devclass_t dc; - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->driver->name, classname)) - return (mod->devclass_pp[0]); + TAILQ_FOREACH(dc, &devclasses, link) { + if (devclass_equal(dc->name, classname)) + return (dc); } return (NULL); } @@ -1110,6 +1095,7 @@ module_register(void *data) struct module_data *mdata = data; TAILQ_INSERT_TAIL(&module_head, mdata, entry); + (void)devclass_find_create(mdata->mod_name); } /*------------------------------------------------------------------------* diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h index 0608d32f21ec..8caee7950270 100644 --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -87,11 +87,11 @@ struct sysctl_req { #define MOD_UNLOAD 2 #define DEVMETHOD(what,func) { #what, (void *)&func } #define DEVMETHOD_END {0,0} -#define EARLY_DRIVER_MODULE(a, b, c, d, e, f, g) DRIVER_MODULE(a, b, c, d, e, f) -#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \ +#define EARLY_DRIVER_MODULE(a, b, c, d, e, f) DRIVER_MODULE(a, b, c, d, e) +#define DRIVER_MODULE(name, busname, driver, evh, arg) \ static struct module_data bsd_##name##_##busname##_driver_mod = { \ evh, arg, #busname, #name, #busname "/" #name, \ - &driver, &devclass, { 0, 0 } }; \ + &driver, { 0, 0 } }; \ SYSINIT(bsd_##name##_##busname##_driver_mod, SI_SUB_DRIVERS, \ SI_ORDER_MIDDLE, module_register, \ &bsd_##name##_##busname##_driver_mod) @@ -135,6 +135,7 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \ #define cold 0 #define BUS_PROBE_GENERIC 0 #define BUS_PROBE_DEFAULT (-20) +#define DEVICE_UNIT_ANY -1 #define CALLOUT_RETURNUNLOCKED 0x1 #undef ffs #define ffs(x) __builtin_ffs(x) @@ -406,6 +407,7 @@ struct device { TAILQ_HEAD(device_list, device) dev_children; TAILQ_ENTRY(device) dev_link; + devclass_t dev_class; struct device *dev_parent; const struct module_data *dev_module; void *dev_sc; @@ -429,6 +431,8 @@ struct device { }; struct devclass { + TAILQ_ENTRY(devclass) link; + const char *name; device_t dev_list[DEVCLASS_MAXUNIT]; }; @@ -445,7 +449,6 @@ struct module_data { const char *mod_name; const char *long_name; const struct driver *driver; - struct devclass **devclass_pp; TAILQ_ENTRY(module_data) entry; }; diff --git a/stand/usb/storage/umass_common.c b/stand/usb/storage/umass_common.c index 639d70a7f7e6..b62412b13637 100644 --- a/stand/usb/storage/umass_common.c +++ b/stand/usb/storage/umass_common.c @@ -38,8 +38,6 @@ static device_probe_t umass_probe; static device_attach_t umass_attach; static device_detach_t umass_detach; -static devclass_t umass_devclass; - static device_method_t umass_methods[] = { /* Device interface */ DEVMETHOD(device_probe, umass_probe), @@ -54,7 +52,7 @@ static driver_t umass_driver = { .methods = umass_methods, }; -DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, NULL, 0); +DRIVER_MODULE(umass, uhub, umass_driver, NULL, 0); static int umass_probe(device_t dev) From nobody Thu Feb 27 23:34:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3nkQ42r6z5JqDJ; Thu, 27 Feb 2025 23:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3nkP7194z45lY; Thu, 27 Feb 2025 23:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740699294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SZkj+ufRR9pgRYCqXlyHz+hgGKpT8c/212P+ItlB7U0=; b=rEJEr/eSE9fSeba2D+tE6xOoF50lZi6XqEAKSvcMvPfAf5y+0M9TYfDEOhDyHvKwqrcGI9 aMZ9eGiW3XXNQ5YnkzLqoLmDTxPUAmfM1MQAx50a4DWp+G3RgKig6fOY1jQOMwfI1vi6M7 cLNId3lQ5itBgCvCmQS8dKbXgJR/P3rwJRFO27B+AKuZSaeH67kD4bZ3GNcx6vKR9tNGpu IJYxT3hrLXS9lVu0lSJkEqkkFONVyQqj3u6oAhyRCXdH6kP6s9ZPEqrh2QWzAwiNzyou9l m2m6xDlQV24VKIie0nN294CUuanueapN32e7d3+0ZIPHaVDX/8KOc32fasgyhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740699294; a=rsa-sha256; cv=none; b=qYIn9V1ucWewFMnT/u9jSrKs6/5nKT/dVRQmeQqTsaTjWzNBfZWkp9h/sd1YZ0r7tfHOQs 9z4fHt6atCTGVL43kpbtP5RwYnHG7E09X09PJ8Z/RgmHJwMUJTil3G7NAqO3dyhk5wukeH 10fsIPI6aNd8V+wyN0pssfMQnlC0vbaY5jEhsuHae6S5+HBUlgX51ypD1AYOLXfVfKgX1l MPjjnmaeJQmp/6HY65BFOqarfwNgOkCUZngTystInoeS028kLdrecvKCSM8OlCDVbQ3rgq w5xTNXWex7C5TwMPZXXIlj3sd1DEyJ5IwfI8Wm4lIgyIzSD6qZVrTxf3yYiR3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740699294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SZkj+ufRR9pgRYCqXlyHz+hgGKpT8c/212P+ItlB7U0=; b=DFXTdsPQbkv9p82M+yDkeZO0e0bFjOCJSey5khmPlMvaw9iCj3xGdna9oY0xqVmlCw9f2P 2spC1ErxqCF5Q1Kl1L4HZ/vDSaA13DFdQ8nsferpBnRAwgJ71hECqaPWx7mBNc+104Ahb9 4rddce+a2kynlKOaMueeknpSy95aLV1t79tN4Q2PdOv73rXi+cfxDfNTiE37/9LXcJv6v5 FwTh59v1t58UALVNrADgL9glqDJZI/IT+IikBYdRBKPIyxKjV2N1xJUeEVC4+wC5dMcbbg 02BtIgY1DAOFh6YV9AAwzsjhR4prFl9QjJeAWGsp9qe1nbtQmymy9bbm03m//A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3nkP6VzJz13CK; Thu, 27 Feb 2025 23:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RNYrTj065887; Thu, 27 Feb 2025 23:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RNYrWL065884; Thu, 27 Feb 2025 23:34:53 GMT (envelope-from git) Date: Thu, 27 Feb 2025 23:34:53 GMT Message-Id: <202502272334.51RNYrWL065884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: cf411e5ed3a0 - releng/13.5 - queue: Fix STAILQ_ASSERT_EMPTY() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: cf411e5ed3a0fdb9fb58866b98802f7f6d3597f1 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cf411e5ed3a0fdb9fb58866b98802f7f6d3597f1 commit cf411e5ed3a0fdb9fb58866b98802f7f6d3597f1 Author: Olivier Certner AuthorDate: 2025-02-27 20:59:41 +0000 Commit: Olivier Certner CommitDate: 2025-02-27 23:33:27 +0000 queue: Fix STAILQ_ASSERT_EMPTY() The 'while' part corresponding to the 'do' was missing. Did not notice the problem as later commits using it have been stashed and never reworked up to now, and it is currently unused in the tree. While here, fix spacing after the '#define' in the !(_KERNEL && INVARIANS) part. Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") MFC after: 1 minute Sponsored by: The FreeBSD Foundation (cherry picked from commit d3c4b002d1fd54ac69c1714e208051867ee56dc4) (cherry picked from commit 4fd887f08b000173c196e954b510752025ff3fc0) Approved by: re (cperciva) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 0b1e1f9fba55..31a220bcdcc0 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -356,7 +356,7 @@ struct { \ #define STAILQ_ASSERT_EMPTY(head) do { \ if (!STAILQ_EMPTY((head))) \ panic("stailq %p is not empty", (head)); \ -} +} while (0) /* * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) @@ -370,7 +370,7 @@ struct { \ } while (0) #else #define QMD_STAILQ_CHECK_EMPTY(head) -#define STAILQ_ASSERT_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) #define QMD_STAILQ_CHECK_TAIL(head) #endif /* (_KERNEL && INVARIANTS) */ From nobody Thu Feb 27 14:16:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YL83vbZz5qFrK; Thu, 27 Feb 2025 14:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL83HQ0z3xFv; Thu, 27 Feb 2025 14:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iki9p/ojcXUO20vhyd1XGwOEY8QvaLkGpGtXz0BMy7Q=; b=NXJ6RSvzE+c4o8zHvGNWZwCAUUUFX1s6wE2m065/5yT7aTgbRd76s+TurM5eYmz2LQtPcN G3ZJ/LEAHSIBDZNGdkO+YxRQxxXDAc9yRwNSEpH5o7hjxaT3yB/TaanditdhO1hgKWnBzz Zbg4nkZd/XGrbJPed+WsXq+Vuw49jJcjR4wwjvGmgPC7o9a4e56glQN8DB9t/4pNJyY1G9 VDeC3bEl2iCYzMm7/+YVzoNMgATqxaca97MqfqhOXN+YuKiWWPQj8yfEe/66I23MHtIC78 4yM5inTG70OPk4TZuRwTAszlCp0Lx32B5+zTV4oJ/39lMsFDvoLe+np6OSPKRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665792; a=rsa-sha256; cv=none; b=ypFBSEMtSnpNJGT3boD18QOjHY/+bQQiNLxIfx+fMWHVxlM3kyUAW54El4qGMmO/E8Nu1E XRxuDmEo5/cxYpBmQukaDVhe1W5QdqEM/vIYIe/ACnGTwRalGTMj2MSd6smxzSp/6LLC44 BSnUeAyDY59DgZjFzH9JISt0rg/WpwUUcv7KvWvJDotqyU/Ri+4rGI+7zDkhnj5/jIZzrI 2y8IVHNyXmD+m7ST9uXhPyWKPk8dFp+lLagDRaxzlLVzH0QkNjo+sWl0KqA6YhV0XpT2jq 7KpLXscWKmu24kozTd7Yt0QkGdJ7j69BuNDCPG1BKw+AHMyiww33/yqVFsbc8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iki9p/ojcXUO20vhyd1XGwOEY8QvaLkGpGtXz0BMy7Q=; b=iDaF4/RuUhh0WtybB6G/XdzKXpHecTfFGOmloo009YpBcDdbCJSuKHvUf7Q7572aRiKu6Y 2jNidPkci1GCxvEvI2+onhwAx8TgvMRp9KqULpmBVWwqfFLhW1rxfi6tE06dHCdFU+8czM XEmuo1EaUvUnUtrChIn71+DfFM6UJJNGJVcFs4bILrlGEYynk5BYSK1xWwGCI9yj21ox0B VEQiy7qbcJuxMW/zCHaLCesSJOQvq4qK8phUrUWzpaiHIWZJbu/hfwjzMf+uzAxI2+2BQ1 S8vZ/BWB7Jt/XkRF/tTAgjp5lVb+Oe68qax47hRY1pOvsDQYsE1Gj7Y0ps5a8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YL82nykzmpX; Thu, 27 Feb 2025 14:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGWls015652; Thu, 27 Feb 2025 14:16:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGW0o015649; Thu, 27 Feb 2025 14:16:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:32 GMT Message-Id: <202502271416.51REGW0o015649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d65f66c98337 - stable/14 - hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d65f66c983376223b2a832e0cae71b7ec4dd38d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d65f66c983376223b2a832e0cae71b7ec4dd38d5 commit d65f66c983376223b2a832e0cae71b7ec4dd38d5 Author: John Baldwin AuthorDate: 2024-01-23 17:35:58 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources Specifically for bus_activate/adjust/deactivate_bus methods. Differential Revision: https://reviews.freebsd.org/D43431 (cherry picked from commit 9c4effb1063d49748b4b7da4cc54f508ccad41fc) --- sys/dev/hyperv/pcib/vmbus_pcib.c | 41 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c index be66393a7ab4..03fc5f09be6c 100644 --- a/sys/dev/hyperv/pcib/vmbus_pcib.c +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c @@ -1712,6 +1712,18 @@ vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, return (res); } +static int +vmbus_pcib_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_adjust_bus(sc->hbus->pci_domain, child, r, + start, end)); + return (bus_generic_adjust_resource(dev, child, type, r, start, end)); +} + static int vmbus_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) @@ -1728,6 +1740,30 @@ vmbus_pcib_release_resource(device_t dev, device_t child, int type, int rid, return (bus_generic_release_resource(dev, child, type, rid, r)); } +static int +vmbus_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(sc->hbus->pci_domain, child, + rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +static int +vmbus_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(sc->hbus->pci_domain, child, + rid, r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} + static int vmbus_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) @@ -1981,9 +2017,10 @@ static device_method_t vmbus_pcib_methods[] = { DEVMETHOD(bus_read_ivar, vmbus_pcib_read_ivar), DEVMETHOD(bus_write_ivar, vmbus_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, vmbus_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, vmbus_pcib_adjust_resource), DEVMETHOD(bus_release_resource, vmbus_pcib_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_activate_resource, vmbus_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, vmbus_pcib_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_cpus, vmbus_pcib_get_cpus), From nobody Thu Feb 27 14:17:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YMC495Pz5qG9w; Thu, 27 Feb 2025 14:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMC40RCz3xS3; Thu, 27 Feb 2025 14:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3D5SNttyttCAwU6IPtpRD7B/WFaYFZncMNnAiQLtBvY=; b=Zhrk61ZQjjyHBmWp45w/Cc0FdJl7joMtpkdQmxUNwYfI8VImZsJ5sIMZl5UEz/JC1/32Aj YJj4nlSjcTTNZtuxpnf4aWD6u4SfajmfV9zr/hiE+IDw4v+XQG/cSb6ExH6Eo+y1PSFURw UHw3wXjcIPExPRSGJZ53odygSy9F9lPcnHZ+yisDwm+IqH9de6KrfZWpclyQatjUQXT7ic hRWPxPlCRZ692hBNkYCaWJ7zAjumch5oXLuzr5gviIdeaHPejCWq1TJOxwTMHRIdsY7E/+ kj3kBXWGCMNem9OP6lmtklEi72AxR3ZPPwOU2J7UGpGvN7LHhgkD2SeJiwJZrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665847; a=rsa-sha256; cv=none; b=cqCksa3KAwCKlrtXQamHATD3W2JfFnH2DWEyv6/JKm0dFYtlntqSU0i7Z5/MxN5pczk0lK M83yNz2i+o2YXqJzRpsdsAhYp5VXKYXK/vBdkykNdSbKQptZseaA5EdAnQGIJ44M9Fy/YP XqJb6M8KgF/5EXeCR3W9myXkBOK/TMPJ7oTPyeFcNF12i+DwaWlIfkb7O9mAH7bf5cus1W UndpCFaeZVrwBpZuZ+NrTO7gxMt3tWAhfQLatzEphcrGEQhwnccDe/WgG7T73wNrPX2jMY CNniz0YuXFlELzWfOwIqfwP4DB5AVnluIa6LxBgY/d+G6f4AN6fdcYz1Zk8MDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3D5SNttyttCAwU6IPtpRD7B/WFaYFZncMNnAiQLtBvY=; b=HQjsCCm++RB6LDZtPaS69TfWbiqzFZ6tHBonEu6HJJw9O0n35wVtAv7LvD+LwuzAZ2SmJZ 2ysrWCjSSiP+zK8Ij8SVheGUjW3rctocXPeGsTvNVjg4nauc+6T6pPmry1lhbxpxUwAgg2 YVAkm5sbho1Hol9uy6faEKncob0tFJRoeWTcjGNRGOg/p6mi2xAxZMDNa8coqnNMSCyM9X 0y+0lrjVBZT7q1JwWJVO5+EjVQdWIfenzyf5nNfocm92CxHhonMsbpfl9UTSVwHsIy7V6P AazV5/pdTXyJ1uhhMnw/xLLthqkbv0IXElGQ2ZNpbANqwuFyyjnTFIGYICAf7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YMC3bQJzmqZ; Thu, 27 Feb 2025 14:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHRGa017400; Thu, 27 Feb 2025 14:17:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHRPc017397; Thu, 27 Feb 2025 14:17:27 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:27 GMT Message-Id: <202502271417.51REHRPc017397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ecd885d19639 - stable/14 - bhnd: Remove orphaned driver for the BHND USB core List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ecd885d196397ce0ea7c99720c5afb1e7fea6385 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ecd885d196397ce0ea7c99720c5afb1e7fea6385 commit ecd885d196397ce0ea7c99720c5afb1e7fea6385 Author: John Baldwin AuthorDate: 2024-06-01 20:25:12 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 bhnd: Remove orphaned driver for the BHND USB core This was only connected to the build for MIPS and has been disconnected from the build since MIPS was removed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45432 (cherry picked from commit c7c037fad1862c18e3e9635b06194a4ca00ac3c1) --- sys/dev/bhnd/cores/usb/bhnd_ehci.c | 258 ---------------- sys/dev/bhnd/cores/usb/bhnd_ohci.c | 220 -------------- sys/dev/bhnd/cores/usb/bhnd_usb.c | 555 ----------------------------------- sys/dev/bhnd/cores/usb/bhnd_usbvar.h | 60 ---- 4 files changed, 1093 deletions(-) diff --git a/sys/dev/bhnd/cores/usb/bhnd_ehci.c b/sys/dev/bhnd/cores/usb/bhnd_ehci.c deleted file mode 100644 index 765d7eaaa144..000000000000 --- a/sys/dev/bhnd/cores/usb/bhnd_ehci.c +++ /dev/null @@ -1,258 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. - * Copyright (c) 2010, Aleksandr Rybalko - * All rights reserved. - * - * Developed by Semihalf. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of MARVELL nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -/* - * BHND attachment driver for the USB Enhanced Host Controller. - * Ported from ZRouter with insignificant adaptations for FreeBSD11. - */ - -#include "opt_bus.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#define EHCI_HC_DEVSTR "Broadcom EHCI" - -#define USB_BRIDGE_INTR_CAUSE 0x210 -#define USB_BRIDGE_INTR_MASK 0x214 - -static device_attach_t bhnd_ehci_attach; -static device_detach_t bhnd_ehci_detach; - -static int bhnd_ehci_probe(device_t self); -static void bhnd_ehci_post_reset(struct ehci_softc *ehci_softc); - -static int -bhnd_ehci_probe(device_t self) -{ - - device_set_desc(self, EHCI_HC_DEVSTR); - - return (BUS_PROBE_DEFAULT); -} - -static void -bhnd_ehci_post_reset(struct ehci_softc *ehci_softc) -{ - uint32_t usbmode; - - /* Force HOST mode */ - usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); - usbmode &= ~EHCI_UM_CM; - usbmode |= EHCI_UM_CM_HOST; - EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); -} - -static int -bhnd_ehci_attach(device_t self) -{ - ehci_softc_t *sc; - int err; - int rid; - - sc = device_get_softc(self); - /* initialise some bus fields */ - sc->sc_bus.parent = self; - sc->sc_bus.devices = sc->sc_devices; - sc->sc_bus.devices_max = EHCI_MAX_DEVICES; - sc->sc_bus.usbrev = USB_REV_2_0; - sc->sc_bus.dma_bits = 32; - - /* get all DMA memory */ - if ((err = usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), - &ehci_iterate_hw_softc)) != 0) { - BHND_ERROR_DEV(self, "can't allocate DMA memory: %d", err); - return (ENOMEM); - } - - rid = 0; - sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (!sc->sc_io_res) { - BHND_ERROR_DEV(self, "Could not map memory"); - goto error; - } - sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); - sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); - sc->sc_io_size = rman_get_size(sc->sc_io_res); - - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - - if (sc->sc_irq_res == NULL) { - BHND_ERROR_DEV(self, "Could not allocate error irq"); - bhnd_ehci_detach(self); - return (ENXIO); - } - - sc->sc_bus.bdev = device_add_child(self, "usbus", -1); - if (!sc->sc_bus.bdev) { - BHND_ERROR_DEV(self, "Could not add USB device"); - goto error; - } - device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - device_set_desc(sc->sc_bus.bdev, EHCI_HC_DEVSTR); - - sprintf(sc->sc_vendor, "Broadcom"); - - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); - if (err) { - BHND_ERROR_DEV(self, "Could not setup irq, %d", err); - sc->sc_intr_hdl = NULL; - goto error; - } - - sc->sc_flags |= EHCI_SCFLG_LOSTINTRBUG; - sc->sc_vendor_post_reset = bhnd_ehci_post_reset; - - err = ehci_init(sc); - if (!err) { - err = device_probe_and_attach(sc->sc_bus.bdev); - } - if (err) { - BHND_ERROR_DEV(self, "USB init failed err=%d", err); - goto error; - } - return (0); - -error: - bhnd_ehci_detach(self); - return (ENXIO); -} - -static int -bhnd_ehci_detach(device_t self) -{ - ehci_softc_t *sc; - int err; - - sc = device_get_softc(self); - - /* during module unload there are lots of children leftover */ - device_delete_children(self); - - /* - * disable interrupts that might have been switched on in ehci_init - */ -#ifdef notyet - if (sc->sc_io_res) { - EWRITE4(sc, EHCI_USBINTR, 0); - EWRITE4(sc, USB_BRIDGE_INTR_MASK, 0); - } -#endif - if (sc->sc_irq_res && sc->sc_intr_hdl) { - /* - * only call ehci_detach() after ehci_init() - */ - ehci_detach(sc); - - err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); - - if (err) - /* XXX or should we panic? */ - BHND_ERROR_DEV(self, "Could not tear down irq, %d", err); - - sc->sc_intr_hdl = NULL; - } - if (sc->sc_irq_res) { - bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); - sc->sc_irq_res = NULL; - } - if (sc->sc_io_res) { - bus_release_resource(self, SYS_RES_MEMORY, 0, sc->sc_io_res); - sc->sc_io_res = NULL; - } - usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); - - return (0); -} - -static device_method_t ehci_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, bhnd_ehci_probe), - DEVMETHOD(device_attach, bhnd_ehci_attach), - DEVMETHOD(device_detach, bhnd_ehci_detach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - {0, 0} -}; - -static driver_t ehci_driver = { - "ehci", - ehci_methods, - sizeof(ehci_softc_t), -}; - -DRIVER_MODULE(ehci, bhnd_usb, ehci_driver, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); diff --git a/sys/dev/bhnd/cores/usb/bhnd_ohci.c b/sys/dev/bhnd/cores/usb/bhnd_ohci.c deleted file mode 100644 index c72c50be4675..000000000000 --- a/sys/dev/bhnd/cores/usb/bhnd_ohci.c +++ /dev/null @@ -1,220 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * Copyright (c) 2010, Aleksandr Rybalko - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@carlstedt.se) at - * Carlstedt Research & Technology. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -/* - * USB Open Host Controller driver. - * - * OHCI spec: http://www.intel.com/design/usb/ohci11d.pdf - */ - -/* The low level controller code for OHCI has been split into - * SIBA probes and OHCI specific code. This was done to facilitate the - * sharing of code between *BSD's - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -static device_probe_t bhnd_ohci_probe; -static device_attach_t bhnd_ohci_attach; -static device_detach_t bhnd_ohci_detach; - -static int -bhnd_ohci_probe(device_t self) -{ - device_set_desc(self, "Broadcom OHCI"); - return (0); -} - -static int -bhnd_ohci_attach(device_t self) -{ - ohci_softc_t *sc; - int rid; - int err; - - sc = device_get_softc(self); - /* initialise some bus fields */ - sc->sc_bus.parent = self; - sc->sc_bus.devices = sc->sc_devices; - sc->sc_bus.devices_max = OHCI_MAX_DEVICES; - sc->sc_bus.dma_bits = 32; - - /* get all DMA memory */ - if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), - &ohci_iterate_hw_softc)) { - return (ENOMEM); - } - sc->sc_dev = self; - - rid = 0; - sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (!sc->sc_io_res) { - device_printf(self, "Could not map memory\n"); - goto error; - } - sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); - sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); - sc->sc_io_size = rman_get_size(sc->sc_io_res); - - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->sc_irq_res == NULL) { - device_printf(self, "Could not allocate irq\n"); - goto error; - } - sc->sc_bus.bdev = device_add_child(self, "usbus", -1); - if (!sc->sc_bus.bdev) { - device_printf(self, "Could not add USB device\n"); - goto error; - } - device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - - strlcpy(sc->sc_vendor, "Broadcom", sizeof(sc->sc_vendor)); - - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); - - if (err) { - device_printf(self, "Could not setup irq, %d\n", err); - sc->sc_intr_hdl = NULL; - goto error; - } - err = ohci_init(sc); - if (!err) { - err = device_probe_and_attach(sc->sc_bus.bdev); - } - if (err) { - device_printf(self, "USB init failed\n"); - goto error; - } - return (0); - -error: - bhnd_ohci_detach(self); - return (ENXIO); -} - -static int -bhnd_ohci_detach(device_t self) -{ - ohci_softc_t *sc; - - sc = device_get_softc(self); - - /* during module unload there are lots of children leftover */ - device_delete_children(self); - - if (sc->sc_irq_res && sc->sc_intr_hdl) { - /* - * only call ohci_detach() after ohci_init() - */ - ohci_detach(sc); - - int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); - - if (err) { - /* XXX or should we panic? */ - device_printf(self, "Could not tear down irq, %d\n", - err); - } - sc->sc_intr_hdl = NULL; - } - if (sc->sc_irq_res) { - bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); - sc->sc_irq_res = NULL; - } - if (sc->sc_io_res) { - bus_release_resource(self, SYS_RES_MEMORY, 0, - sc->sc_io_res); - sc->sc_io_res = NULL; - } - usb_bus_mem_free_all(&sc->sc_bus, &ohci_iterate_hw_softc); - - return (0); -} - -static device_method_t bhnd_ohci_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, bhnd_ohci_probe), - DEVMETHOD(device_attach, bhnd_ohci_attach), - DEVMETHOD(device_detach, bhnd_ohci_detach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - - DEVMETHOD_END -}; - -static driver_t ohci_driver = { - .name = "ohci", - .methods = bhnd_ohci_methods, - .size = sizeof(struct ohci_softc), -}; - -DRIVER_MODULE(ohci, bhnd_usb, ohci_driver, 0, 0); -MODULE_DEPEND(ohci, usb, 1, 1, 1); diff --git a/sys/dev/bhnd/cores/usb/bhnd_usb.c b/sys/dev/bhnd/cores/usb/bhnd_usb.c deleted file mode 100644 index 68701df14c50..000000000000 --- a/sys/dev/bhnd/cores/usb/bhnd_usb.c +++ /dev/null @@ -1,555 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2010, Aleksandr Rybalko - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -/* - * Ported version of BroadCom USB core driver from ZRouter project - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -#include "bhnd_usbvar.h" - -/****************************** Variables ************************************/ -static const struct bhnd_device bhnd_usb_devs[] = { - BHND_DEVICE(BCM, USB20H, "USB2.0 Host core", NULL), - BHND_DEVICE_END -}; - -/****************************** Prototypes ***********************************/ - -static int bhnd_usb_attach(device_t); -static int bhnd_usb_probe(device_t); -static device_t bhnd_usb_add_child(device_t dev, u_int order, const char *name, - int unit); -static int bhnd_usb_print_all_resources(device_t dev); -static int bhnd_usb_print_child(device_t bus, device_t child); - -static struct resource * bhnd_usb_alloc_resource(device_t bus, - device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -static int bhnd_usb_release_resource(device_t dev, - device_t child, int type, int rid, - struct resource *r); - -static struct resource_list * bhnd_usb_get_reslist(device_t dev, - device_t child); - -static int -bhnd_usb_probe(device_t dev) -{ - const struct bhnd_device *id; - - id = bhnd_device_lookup(dev, bhnd_usb_devs, sizeof(bhnd_usb_devs[0])); - if (id == NULL) - return (ENXIO); - - device_set_desc(dev, id->desc); - return (BUS_PROBE_DEFAULT); -} - -static int -bhnd_usb_attach(device_t dev) -{ - struct bhnd_usb_softc *sc; - int rid; - uint32_t tmp; - int tries, err; - - sc = device_get_softc(dev); - - bhnd_reset_hw(dev, 0, 0); - - /* - * Allocate the resources which the parent bus has already - * determined for us. - * XXX: There are few windows (usually 2), RID should be chip-specific - */ - rid = 0; - sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (sc->sc_mem == NULL) { - BHND_ERROR_DEV(dev, "unable to allocate memory"); - return (ENXIO); - } - - sc->sc_bt = rman_get_bustag(sc->sc_mem); - sc->sc_bh = rman_get_bushandle(sc->sc_mem); - sc->sc_maddr = rman_get_start(sc->sc_mem); - sc->sc_msize = rman_get_size(sc->sc_mem); - - rid = 0; - sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->sc_irq == NULL) { - BHND_ERROR_DEV(dev, "unable to allocate IRQ"); - return (ENXIO); - } - - sc->sc_irqn = rman_get_start(sc->sc_irq); - - sc->mem_rman.rm_start = sc->sc_maddr; - sc->mem_rman.rm_end = sc->sc_maddr + sc->sc_msize - 1; - sc->mem_rman.rm_type = RMAN_ARRAY; - sc->mem_rman.rm_descr = "BHND USB core I/O memory addresses"; - if (rman_init(&sc->mem_rman) != 0 || - rman_manage_region(&sc->mem_rman, sc->mem_rman.rm_start, - sc->mem_rman.rm_end) != 0) { - panic("%s: sc->mem_rman", __func__); - } - - /* TODO: macros for registers */ - bus_write_4(sc->sc_mem, 0x200, 0x7ff); - DELAY(100); - -#define OHCI_CONTROL 0x04 - bus_write_4(sc->sc_mem, OHCI_CONTROL, 0); - - if ( bhnd_get_device(dev) == BHND_COREID_USB20H) { - uint32_t rev = bhnd_get_hwrev(dev); - BHND_INFO_DEV(dev, "USB HOST 2.0 setup for rev %d", rev); - if (rev == 1/* ? == 2 */) { - /* SiBa code */ - - /* Change Flush control reg */ - tmp = bus_read_4(sc->sc_mem, 0x400) & ~0x8; - bus_write_4(sc->sc_mem, 0x400, tmp); - tmp = bus_read_4(sc->sc_mem, 0x400); - BHND_DEBUG_DEV(dev, "USB20H fcr: 0x%x", tmp); - - /* Change Shim control reg */ - tmp = bus_read_4(sc->sc_mem, 0x304) & ~0x100; - bus_write_4(sc->sc_mem, 0x304, tmp); - tmp = bus_read_4(sc->sc_mem, 0x304); - BHND_DEBUG_DEV(dev, "USB20H shim: 0x%x", tmp); - } else if (rev >= 5) { - /* BCMA code */ - err = bhnd_alloc_pmu(dev); - if(err) { - BHND_ERROR_DEV(dev, "can't alloc pmu: %d", err); - return (err); - } - - err = bhnd_request_ext_rsrc(dev, 1); - if(err) { - BHND_ERROR_DEV(dev, "can't req ext: %d", err); - return (err); - } - /* Take out of resets */ - bus_write_4(sc->sc_mem, 0x200, 0x4ff); - DELAY(25); - bus_write_4(sc->sc_mem, 0x200, 0x6ff); - DELAY(25); - - /* Make sure digital and AFE are locked in USB PHY */ - bus_write_4(sc->sc_mem, 0x524, 0x6b); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - DELAY(50); - bus_write_4(sc->sc_mem, 0x524, 0xab); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - DELAY(50); - bus_write_4(sc->sc_mem, 0x524, 0x2b); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - DELAY(50); - bus_write_4(sc->sc_mem, 0x524, 0x10ab); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - - tries = 10000; - for (;;) { - DELAY(10); - tmp = bus_read_4(sc->sc_mem, 0x528); - if (tmp & 0xc000) - break; - if (--tries != 0) - continue; - - tmp = bus_read_4(sc->sc_mem, 0x528); - BHND_ERROR_DEV(dev, "USB20H mdio_rddata 0x%08x", tmp); - } - - /* XXX: Puzzle code */ - bus_write_4(sc->sc_mem, 0x528, 0x80000000); - bus_read_4(sc->sc_mem, 0x314); - DELAY(265); - bus_write_4(sc->sc_mem, 0x200, 0x7ff); - DELAY(10); - - /* Take USB and HSIC out of non-driving modes */ - bus_write_4(sc->sc_mem, 0x510, 0); - } - } - - bus_generic_probe(dev); - - if (bhnd_get_device(dev) == BHND_COREID_USB20H && - ( bhnd_get_hwrev(dev) > 0)) - bhnd_usb_add_child(dev, 0, "ehci", -1); - bhnd_usb_add_child(dev, 1, "ohci", -1); - - bus_generic_attach(dev); - - return (0); -} - -static struct rman * -bhnd_usb_get_rman(device_t bus, int type, u_int flags) -{ - struct bhnd_usb_softc *sc = device_get_softc(bus); - - switch (type) { - case SYS_RES_MEMORY: - return (&sc->sc_mem_rman); - default: - return (NULL); - } -} - -static struct resource * -bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct resource *rv; - struct resource_list *rl; - struct resource_list_entry *rle; - int passthrough, isdefault; - - isdefault = RMAN_IS_DEFAULT_RANGE(start,end); - passthrough = (device_get_parent(child) != bus); - rle = NULL; - - if (!passthrough && isdefault) { - BHND_INFO_DEV(bus, "trying allocate def %d - %d for %s", type, - *rid, device_get_nameunit(child) ); - - rl = BUS_GET_RESOURCE_LIST(bus, child); - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); - start = rle->start; - end = rle->end; - count = rle->count; - } else { - BHND_INFO_DEV(bus, "trying allocate %d - %d (%jx-%jx) for %s", type, - *rid, start, end, device_get_nameunit(child) ); - } - - /* - * If the request is for a resource which we manage, - * attempt to satisfy the allocation ourselves. - */ - if (type == SYS_RES_MEMORY) { - rv = bus_generic_rman_alloc_resource(bus, child, type, rid, - start, end, count, flags); - if (rv == NULL) { - BHND_ERROR_DEV(bus, "could not allocate resource"); - return (NULL); - } - - return (rv); - } - - /* - * Pass the request to the parent. - */ - return (bus_generic_rl_alloc_resource(bus, child, type, rid, start, end, - count, flags)); -} - -static struct resource_list * -bhnd_usb_get_reslist(device_t dev, device_t child) -{ - struct bhnd_usb_devinfo *sdi; - - sdi = device_get_ivars(child); - - return (&sdi->sdi_rl); -} - -static int -bhnd_usb_release_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - struct bhnd_usb_softc *sc; - struct resource_list_entry *rle; - bool passthrough; - int error; - - sc = device_get_softc(dev); - passthrough = (device_get_parent(child) != dev); - - /* Delegate to our parent device's bus if the requested resource type - * isn't handled locally. */ - if (type != SYS_RES_MEMORY) { - return (bus_generic_rl_release_resource(dev, child, type, rid, - r)); - } - - error = bus_generic_rman_release_resource(dev, child, type, rid, r); - if (error != 0) - return (error); - - if (!passthrough) { - /* Clean resource list entry */ - rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), - type, rid); - if (rle != NULL) - rle->res = NULL; - } - - return (0); -} - -static int -bhnd_usb_activate_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - if (type != SYS_RES_MEMORY) - return (bus_generic_activate_resource(dev, child, type, rid, - r)); - return (bus_generic_rman_activate_resource(dev, child, type, rid, r)); -} - -static int -bhnd_usb_deactivate_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - if (type != SYS_RES_MEMORY) - return (bus_generic_deactivate_resource(dev, child, type, rid, - r)); - return (bus_generic_rman_deactivate_resource(dev, child, type, rid, r)); -} - -static int -bhnd_usb_map_resource(device_t dev, device_t child, int type, - struct resource *r, struct resource_map_request *argsp, - struct resource_map *map) -{ - struct bhnd_usb_softc *sc = device_get_softc(dev); - struct resource_map_request args; - rman_res_t length, start; - int error; - - if (type != SYS_RES_MEMORY) - return (bus_generic_map_resource(dev, child, type, r, argsp, - map)); - - /* Resources must be active to be mapped. */ - if (!(rman_get_flags(r) & RF_ACTIVE)) - return (ENXIO); - - resource_init_map_request(&args); - error = resource_validate_map_request(r, argsp, &args, &start, &length); - if (error) - return (error); - - args.offset = start - rman_get_start(sc->sc_mem); - args.length = length; - return (bus_generic_map_resource(dev, child, type, sc->sc_mem, &args, - map)); -} - -static int -bhnd_usb_unmap_resource(device_t dev, device_t child, int type, - struct resource *r, struct resource_map *map) -{ - struct bhnd_usb_softc *sc = device_get_softc(dev); - - if (type == SYS_RES_MEMORY) - r = sc->sc_mem; - return (bus_generic_unmap_resource(dev, child, type, r, map)); -} - -static int -bhnd_usb_print_all_resources(device_t dev) -{ - struct bhnd_usb_devinfo *sdi; - struct resource_list *rl; - int retval; - - retval = 0; - sdi = device_get_ivars(dev); - rl = &sdi->sdi_rl; - - if (STAILQ_FIRST(rl)) - retval += printf(" at"); - - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%jx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - - return (retval); -} - -static int -bhnd_usb_print_child(device_t bus, device_t child) -{ - int retval = 0; - - retval += bus_print_child_header(bus, child); - retval += bhnd_usb_print_all_resources(child); - if (device_get_flags(child)) - retval += printf(" flags %#x", device_get_flags(child)); - retval += printf(" on %s\n", device_get_nameunit(bus)); - - return (retval); -} - -static device_t -bhnd_usb_add_child(device_t dev, u_int order, const char *name, int unit) -{ - struct bhnd_usb_softc *sc; - struct bhnd_usb_devinfo *sdi; - device_t child; - int error; - - sc = device_get_softc(dev); - - sdi = malloc(sizeof(struct bhnd_usb_devinfo), M_DEVBUF, M_NOWAIT|M_ZERO); - if (sdi == NULL) - return (NULL); - - resource_list_init(&sdi->sdi_rl); - sdi->sdi_irq_mapped = false; - - if (strncmp(name, "ohci", 4) == 0) - { - sdi->sdi_maddr = sc->sc_maddr + 0x000; - sdi->sdi_msize = 0x200; - } - else if (strncmp(name, "ehci", 4) == 0) - { *** 157 LINES SKIPPED *** From nobody Thu Feb 27 21:04:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3kNk3nP0z59WyP; Thu, 27 Feb 2025 21:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNk3J9Rz43Xt; Thu, 27 Feb 2025 21:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p5Y6O+Tk72CGxB46NNIIVWiOn9pqwiihDF1K3oMTncI=; b=cw0Xc5YBE0xMEdST7WuUD1UB9eJuHg9j2/ClpoIMs0tmVdjzpztXiRE+nhJ+/VVjf43U22 bhsSsuCf4G1/sb2nPHVQ3bo8frdF2Nwgvf54VLKJXw3gWBYmqv6zQ5/4FNLdDi83a9l0YL VnwlSenDOUZTZ+dx8ulip97LhaUMxDb0/cWVjvR6RD8ZKsX2HiJlm/eqcdIJUzheIvOLc9 Q6GKh1bGPETgr0py76Dcf72aIbAHJp/hRyUtNVusLkoTQW+7lhvUWhxi5zeEvuFK5sqV5Y INeurA40KvFeAHH4lM4hhNzvU1A03VCwytfKBnP4KNyL63LywyVxWLmfmYcBIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690262; a=rsa-sha256; cv=none; b=QEZu8NMjc9TMiNC20rHZ4A5572qGuoXPqhUf3jRuK6M/vOfMsTLEZuzUvaw6tjzpPAXYlB z3LHQT1b8J4h28AFyevExrcKEAPonG70Y+dMMdQdT0Fmb2DXpS7ZpUaovddfm4eH94MqFA lmM1NACWAfxXDlPQeboGr3Vmq0xNh7RO+NQFaZ7cFiEh5Tflatb0jehT8/o2EgpOXyZIeS awURiVQeRdc7XQ6jTXuL1gF/NnB+oXVDanjPwWLx5iy4egmGxksxJdWpI4OIDc0udJVtER vcXU9kwVqeN5qQgJDazyQRsLZGpMN22hMnMo4EK7ESDUBVCqZtPUu/4t1RknDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p5Y6O+Tk72CGxB46NNIIVWiOn9pqwiihDF1K3oMTncI=; b=P49reEqSMnXH5EZ+BOJIMOkb50eUWR+Y7vrz9KJT4ZG1ItQNtS6SFiEbEq8YdjoxMvwPHm 3cqc04tUHUhva88pi2+GD4oU8EbJ6NGfH8n6BrnAFg3/r3egLVxIHnuCeObeuQ4nR0ZeNO rU2Gk+BN3bLGbWkhMKux960vUVtWtpFTqZIciBsswPQ+PZnoijX8t6G2R9TDehWAHvf83z 8hL1DtfORlBQEbzgTCCZ+XcRlmyaKG+15O9+iOrDdbgJ8BN7ZF9MrV2gK/0GiLY9S64K3B O8JumCVwZeaKIouzebCKEBV228yt3dqeoHBwxmsOVFF+o5kwZTMvx3JR05sZvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3kNk2X48zybn; Thu, 27 Feb 2025 21:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4MAN085511; Thu, 27 Feb 2025 21:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Miq085508; Thu, 27 Feb 2025 21:04:22 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:22 GMT Message-Id: <202502272104.51RL4Miq085508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b2e5cbc82bff - stable/14 - LinuxKPI: 802.11: compile in HT compat code by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b2e5cbc82bffb3884162dd2df928d06a49c3cc67 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b2e5cbc82bffb3884162dd2df928d06a49c3cc67 commit b2e5cbc82bffb3884162dd2df928d06a49c3cc67 Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 01:12:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 LinuxKPI: 802.11: compile in HT compat code by default Compile in the HT compat code by default even though no one will make use of it yet. Sponsored by: The FreeBSD Foundation Tested with: iwlwifi AX210 (NOHT, HT20 and HT40) (cherry picked from commit 75d23d882389e1bb011bda37022aaa17c068cbf8) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 5db1512394cc..b684bd76bacf 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -79,7 +79,7 @@ #define LKPI_80211_WME #define LKPI_80211_HW_CRYPTO -/* #define LKPI_80211_HT */ +#define LKPI_80211_HT /* #define LKPI_80211_VHT */ #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) From nobody Thu Feb 27 14:17:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM93lY5z5qG2N; Thu, 27 Feb 2025 14:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM92zTdz3xJv; Thu, 27 Feb 2025 14:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ptx2sE68wrphsPNQ/AZw/UG0U/I/4cp9qwjiwYCD77k=; b=IuX4XJrGW5Xm85hbIcKoxBYmwvd6UWDSBpfhaVyxLbRY0Juxjn3fK32vtuwsTUpj47n9OX /+NKwk4yMDtHr2e+oQ+mItiT7/6nXes5u/doS90Y5MBOWHPyX+4QdpkIZZnk4WFZFr3Wbr lLbLAiWdLCcZDU/4j+sRXMkRXN605z42lWmT5tnjC2BGbqnPAkguHdE/6v5IhVSQmOBRoj wNX361ERCD5AHfbaVo8dwZv53X7LeHG2BnwxRPR/g7YO41Y/1XQ7sLyaXgcYWdgdh8h1SX 5vkG4u9f5wnLhpBJTNp+pHa7htU+18EvX8tiCi1wwI+BtMoxWg1Nzz8JDYywUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665845; a=rsa-sha256; cv=none; b=hVg25ezeWOvnkHVmUySUn4YhYjRuLUpvmq976XTeix1MnI90CUsHnSzKoWAR5YVdAk8QN3 okx3AQIZVdCpnvJnR1QEVpbu64d6Txkl8YY2YQ7/SMzL1L2Ji5q74V/xv9ncFNYgZ9eP2h L2Rwo3S0RE71f7A+MWGiDNxe8kJipJimhLn/ri0KWqW2t/+eWuYmfOwIa9tF+YKKFW3kCQ /Q6tqogIt1gZFYg0Z24Iv5EdQakR/pnU1CHCZ4rqhcH98MOkDbyBFyo0HBUIzHI1p+TBzi ej81+fPgO4k0EZBiDLVT2tgT3zGhGCMrCpg27o6jZ1pxV8i+fk+hxqeVVwHvvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ptx2sE68wrphsPNQ/AZw/UG0U/I/4cp9qwjiwYCD77k=; b=pcYmAUdWMDEUtIC8sM3c4RvQK3VFtdjjUPXyLeprEm9vLcsKy/+JRHeHfcl3yl0n2tLZT6 r3WcG0wnVVJva6bR2hOdxNAVdUYBMgzbslFfFHiaWDsGMA3F78+uYCLdTdv8bA7B+9U4Ou lsPkm8iCNtYsCJe3dOMUZAdro0IMqYeEZdhxlnsX2VgM8QHgFzgmxAo8aUz8pSuKYxjLQd kq+SUUBoAXiC3/imqRAR42mjANmqFBT414BVWQp9103PD03ptHGZwfkDvmd0WKXrkPGba0 zz4CynzS5aADu6RCf9fhntNh1M1NacX1JMcyxZLCMueHBdmqAM11nA3rWQ+dWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM92LLWzmqX; Thu, 27 Feb 2025 14:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHPR1017334; Thu, 27 Feb 2025 14:17:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHPGo017331; Thu, 27 Feb 2025 14:17:25 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:25 GMT Message-Id: <202502271417.51REHPGo017331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 92e593668608 - stable/14 - pci_host_generic: Tolerate range resource allocation failures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 92e593668608efde40dc1b6d97b60f01a9ce89fe Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=92e593668608efde40dc1b6d97b60f01a9ce89fe commit 92e593668608efde40dc1b6d97b60f01a9ce89fe Author: John Baldwin AuthorDate: 2024-04-09 21:55:40 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci_host_generic: Tolerate range resource allocation failures QEMU for armv7 includes a PCI memory range whose CPU address is greater than 4GB. This falls outside the range of armv7's global mem_rman used by the nexus driver. As a result, pcib0 fails to attach blocking all PCI devices. Instead, change the driver to be a bit more tolerant. If allocating a resource for a range fails, don't fail attaching the entire driver, but do skip adding the associated PCI range to the relevant rman in the pcib driver. This will prevent child devices from using BARs that allocate from this range. In the case of QEMU on armv7 devices can still allocate from an earlier PCI memory range that is within the 32-bit address space (and in fact none of the firmware-assigned memory BARs use addresses from the upper range). While here, reorder the operations on I/O ranges a bit: 1) print the range under bootverbose first (rather than last) so that the range is printed before any relevant errors for the range, 2) move rman_manage_region last after the parent resource has been set and allocated. Reported by: markj, Jenkins Reviewed by: markj Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D44698 (cherry picked from commit 03713f805a91749eabcfb2e23e86489b2d4034df) --- sys/dev/pci/pci_host_generic.c | 55 ++++++++++++------------------------------ 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index da49edcf91f5..4b7a1cb8ab39 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -80,6 +80,7 @@ pci_host_generic_core_attach(device_t dev) struct resource_map map; #endif struct generic_pcie_core_softc *sc; + struct rman *rm; uint64_t phys_base; uint64_t pci_base; uint64_t size; @@ -183,75 +184,51 @@ pci_host_generic_core_attach(device_t dev) range_descr = "prefetch"; flags = RF_PREFETCHABLE; type = SYS_RES_MEMORY; - error = rman_manage_region(&sc->pmem_rman, - pci_base, pci_base + size - 1); + rm = &sc->pmem_rman; break; case FLAG_TYPE_MEM: range_descr = "memory"; flags = 0; type = SYS_RES_MEMORY; - error = rman_manage_region(&sc->mem_rman, - pci_base, pci_base + size - 1); + rm = &sc->mem_rman; break; case FLAG_TYPE_IO: range_descr = "I/O port"; flags = 0; type = SYS_RES_IOPORT; - error = rman_manage_region(&sc->io_rman, - pci_base, pci_base + size - 1); + rm = &sc->io_rman; break; default: continue; } - if (error) { - device_printf(dev, "rman_manage_region() failed." - "error = %d\n", error); - goto err_rman_manage; - } + if (bootverbose) + device_printf(dev, + "PCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx, Type: %s\n", + pci_base, phys_base, size, range_descr); error = bus_set_resource(dev, type, rid, phys_base, size); if (error != 0) { device_printf(dev, "failed to set resource for range %d: %d\n", tuple, error); - goto err_rman_manage; + continue; } sc->ranges[tuple].res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE | RF_UNMAPPED | flags); if (sc->ranges[tuple].res == NULL) { device_printf(dev, "failed to allocate resource for range %d\n", tuple); - error = ENXIO; - goto err_rman_manage; + continue; + } + error = rman_manage_region(rm, pci_base, pci_base + size - 1); + if (error) { + device_printf(dev, "rman_manage_region() failed." + "error = %d\n", error); + continue; } - if (bootverbose) - device_printf(dev, - "PCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx, Type: %s\n", - pci_base, phys_base, size, range_descr); } return (0); -err_rman_manage: - for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { - if (sc->ranges[tuple].size == 0) - continue; /* empty range element */ - switch (FLAG_TYPE(sc->ranges[tuple].flags)) { - case FLAG_TYPE_PMEM: - case FLAG_TYPE_MEM: - type = SYS_RES_MEMORY; - break; - case FLAG_TYPE_IO: - type = SYS_RES_IOPORT; - break; - default: - continue; - } - if (sc->ranges[tuple].res != NULL) - bus_release_resource(dev, type, tuple + 1, - sc->ranges[tuple].res); - bus_delete_resource(dev, type, tuple + 1); - } - rman_fini(&sc->io_rman); err_io_rman: rman_fini(&sc->mem_rman); err_mem_rman: From nobody Thu Feb 27 14:46:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3Z0v3vM6z5qH59; Thu, 27 Feb 2025 14:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Z0v37LWz40N8; Thu, 27 Feb 2025 14:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740667599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xr4iYwCSRANLb76EB8XspON/EXYR4X5RmXtXkeCT81E=; b=AjTMjLzGK32oQRcxzm2mH50/7/tPjisUFuQ5/CocJhJve1wkbxI33LxBGhmTmnucr05D+h O0aKwz9aHjugrkSdY38PqnRlk7jWfxCHUko3uUn4x9V6mLhDFup/o0RvDh0irhj50FKp51 uQISRoHHnt8T0rjJIqYzh6uTtHhjXKB4PTuXajHdGF9hPjYxuou2/ykl9HY5V5pcGz1kSM 2brKMhrZPll5DWA/B0WXT6xJR7p2Dtx8/E1eemR43unM+Et+JdTzGbFkJQQusnDfJS5qWB 8aFQr71e83ZHgoRc/uO1QePMlgXlKu/1S5ETZROGW+xED0HOtRg4a72MuBJ1Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740667599; a=rsa-sha256; cv=none; b=JN7TNCCUyyfcgeTsjLAzCR8uVUMb8pE56NMljNzvwJtqixV0jolk3HY+BJ/PmAqcimWCRf sas1woFyQjjJZD+Cxsm5uRRzD95KifSHTd0qvTYXEpCKNcGrncdk1+MkMqxw9YJoaMqSwJ vyS+muNg0Pk4OeW5AdLssh4xKobcTuSQSmpw62m+hCvw185BekU0ZKNOAyqL5DjNMTPMYr VWVMsEmHaKKeIsuL6471HC5NQIjrK+HJzxjvrjCN5pdTbspIjbfJkJjsE7FKbfdHTJTHHR 0GKy4dQODAz/ZmGDj/GfZFaIW60OLrr4lLMoqWrBzHx6wSr22zehUXpMmg3tFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740667599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xr4iYwCSRANLb76EB8XspON/EXYR4X5RmXtXkeCT81E=; b=r0cHvdotk33qZFqFOgYXzOgSQM9xKDZp9G52Bdmo3c5ZfUwWBHaM0A/JT0r389Kss2Mkdq 7bm/WvDAV8lluuY+2tyM2M90YevK/G6stswYdyeNQfm5ajI/wV3ZgdNvkPTw4FyeqzHLW8 bCJ3OjZpRuziPHvfQFTZpcPwPi67/sK/nfMVKXF3UANYoFqynaq53kAs95rRr4B78o2Jyw N8J9wsEtWPjtpjDsMJmokBLATOwaCZEESgMjKAht1Q1njPmmU394cXvQSFNz8YsjNdWpGY taPpwti7iSXDKwArI2SQbDIu6HyAJRLyVuICT8uhYjywdmWWnJ8Ih9xH0nPzQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3Z0v26xpznNt; Thu, 27 Feb 2025 14:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REkdhC072905; Thu, 27 Feb 2025 14:46:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REkdI1072902; Thu, 27 Feb 2025 14:46:39 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:46:39 GMT Message-Id: <202502271446.51REkdI1072902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 96b62eae3c24 - stable/14 - netinet: Update a comment for in_localip() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 96b62eae3c24062b817d5f77521e8c28f430a393 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=96b62eae3c24062b817d5f77521e8c28f430a393 commit 96b62eae3c24062b817d5f77521e8c28f430a393 Author: Zhenlei Huang AuthorDate: 2025-02-24 10:14:39 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-27 14:45:47 +0000 netinet: Update a comment for in_localip() The function in_localip() was changed to return bool but the comment was left unchanged. Fixes: c8ee75f2315e Use network epoch to protect local IPv4 addresses hash MFC after: 3 days (cherry picked from commit a5e380e51cdba64a392846a4eeda000f948f42ce) --- sys/netinet/in.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 4ef1d9735658..de6224ad9ebc 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -149,7 +149,7 @@ in_localaddr(struct in_addr in) } /* - * Return 1 if an internet address is for the local host and configured + * Return true if an internet address is for the local host and configured * on one of its interfaces. */ bool From nobody Thu Feb 27 14:17:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YMB42z2z5qFY2; Thu, 27 Feb 2025 14:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMB3YCjz3xPq; Thu, 27 Feb 2025 14:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W8GJSZv7yUsymZdfqXk22sT9omQ3CZH05iAviB9TumU=; b=Rl/uA1RL/zVZuXdtNggWOV+BhvOO5lMhLlYKnqgXu/v+JENcwAkla4IOGTBdLFkiekPT74 0rnRhPdQstr/5OvqmFPkjqPVyJ3JSycOpN17kLQQqGn4Nezrv7UW7G42ls1q1uZYRjd2LZ VFnk7aBjNOFxBcUglBnaklD9uDvekTBYfGnNpf2sl+Gg0d0zq36V4iP76LxEDcCO3xOdRA REDOlnzmlvya5tyf2NFZOfWVVjOc83lOH5Fq0tysG8sNObzirS0uFbEo6A4FM3r3IUAGhJ hv1Mv544WUijJ4gA4iAuoApGXA3nZsk2BHK2KRZmHhsFUqXTfF6nV4bXl5p+2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665846; a=rsa-sha256; cv=none; b=UXPItAw+iWfjl/6xUandKVU5cbIvYS+vWcEtUE8Be8reWUidfj4UOra5DWCt/Zodqj4FG7 bz+m0gejk+DYVxvCi6Hesf+R3SgPVA0b+T03BoTKgJGHXztZ66VANj3Bd1CRBH2SrqbHbS SMHFOOyATvoHLrYi43oiXmxgQercxm39s+anSrzrouotjuAtSi0aXoAeSbQExuwENpdBIg 6DBmd4OJSogzTH6ISM32UsyAL7f3Iqdul1oMWjr7H5yLaSna9GqJxYfLjxIQDEFydNvnKZ ANCt5ejMseCsAvMhjdiqCbAPGf5shhw215YJZ1bSGK6HhHn2sPvRb0uGKE9Mbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W8GJSZv7yUsymZdfqXk22sT9omQ3CZH05iAviB9TumU=; b=mTO7GDqnduCwcXqGpYENIgHGCJ8YLUhsrUJOaKWPNpPYMG+dfdgoddblCLAhu4SWgwincF +ji0/fYpLoCcz1ukovTsX3gCPCtTtQHVgq5aeSD7Ggr8/zARHLigD3Vx930+YKePXkSn8z xtyvTc0Hf/IoAWj3RETVnpH0t93T9HV+ED5xnJN6w/Pm3I5MwNgcxcVqENIejVCmio1h+k 1KL3tLAiXxyvqsS/Kl7pwLRoXe/NfSDVUsM4J6UZDgrXeFeR6S/8HCcjFfBpO5f0P0G/RL TMGOrbxAT6hs9RZwkgI+Whc+kGofgFwaKImTU3z7rjWEEo51EcCya+XFtf1K9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YMB38QPzmqY; Thu, 27 Feb 2025 14:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHQL7017367; Thu, 27 Feb 2025 14:17:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHQLR017364; Thu, 27 Feb 2025 14:17:26 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:26 GMT Message-Id: <202502271417.51REHQLR017364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1e5d162165e2 - stable/14 - pci: Use kobj typedefs for new-bus method prototypes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e5d162165e283feb34551c379ee22dfb108c106 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1e5d162165e283feb34551c379ee22dfb108c106 commit 1e5d162165e283feb34551c379ee22dfb108c106 Author: John Baldwin AuthorDate: 2024-06-01 20:24:29 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci: Use kobj typedefs for new-bus method prototypes Reviewed by: kp, imp Differential Revision: https://reviews.freebsd.org/D45405 (cherry picked from commit 0f1d148cfd1503eb5c4bcc4c4689c4219dbb605f) --- sys/dev/pci/pci.c | 22 +++---- sys/dev/pci/pci_private.h | 156 +++++++++++++++++++--------------------------- 2 files changed, 75 insertions(+), 103 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 1a415f676ff7..2c00b44d941a 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -88,6 +88,16 @@ (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1)) +static device_probe_t pci_probe; + +static bus_reset_post_t pci_reset_post; +static bus_reset_prepare_t pci_reset_prepare; +static bus_reset_child_t pci_reset_child; +static bus_hint_device_unit_t pci_hint_device_unit; +static bus_remap_intr_t pci_remap_intr_method; + +static pci_get_id_t pci_get_id_method; + static int pci_has_quirk(uint32_t devid, int quirk); static pci_addr_t pci_mapbase(uint64_t mapreg); static const char *pci_maptype(uint64_t mapreg); @@ -103,7 +113,6 @@ static void pci_assign_interrupt(device_t bus, device_t dev, int force_route); static int pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl, int force, int prefetch); -static int pci_probe(device_t dev); static void pci_load_vendor_data(void); static int pci_describe_parse_line(char **ptr, int *vendor, int *device, char **desc); @@ -125,17 +134,6 @@ static int pci_msi_blacklisted(void); static int pci_msix_blacklisted(void); static void pci_resume_msi(device_t dev); static void pci_resume_msix(device_t dev); -static int pci_remap_intr_method(device_t bus, device_t dev, - u_int irq); -static void pci_hint_device_unit(device_t acdev, device_t child, - const char *name, int *unitp); -static int pci_reset_post(device_t dev, device_t child); -static int pci_reset_prepare(device_t dev, device_t child); -static int pci_reset_child(device_t dev, device_t child, - int flags); - -static int pci_get_id_method(device_t dev, device_t child, - enum pci_id_type type, uintptr_t *rid); static struct pci_devinfo * pci_fill_devinfo(device_t pcib, device_t bus, int d, int b, int s, int f, uint16_t vid, uint16_t did); diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index b634c7b61260..ea0efc54c829 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -48,6 +48,71 @@ struct pci_softc { extern int pci_do_power_resume; extern int pci_do_power_suspend; + +device_attach_t pci_attach; +device_detach_t pci_detach; +device_resume_t pci_resume; + +bus_print_child_t pci_print_child; +bus_probe_nomatch_t pci_probe_nomatch; +bus_read_ivar_t pci_read_ivar; +bus_write_ivar_t pci_write_ivar; +bus_driver_added_t pci_driver_added; +bus_setup_intr_t pci_setup_intr; +bus_teardown_intr_t pci_teardown_intr; + +bus_get_dma_tag_t pci_get_dma_tag; +bus_get_resource_list_t pci_get_resource_list; +bus_delete_resource_t pci_delete_resource; +bus_alloc_resource_t pci_alloc_resource; +bus_release_resource_t pci_release_resource; +bus_activate_resource_t pci_activate_resource; +bus_deactivate_resource_t pci_deactivate_resource; +bus_child_deleted_t pci_child_deleted; +bus_child_detached_t pci_child_detached; +bus_child_pnpinfo_t pci_child_pnpinfo_method; +bus_child_location_t pci_child_location_method; +bus_get_device_path_t pci_get_device_path_method; +bus_suspend_child_t pci_suspend_child; +bus_resume_child_t pci_resume_child; +bus_rescan_t pci_rescan_method; + +pci_read_config_t pci_read_config_method; +pci_write_config_t pci_write_config_method; +pci_enable_busmaster_t pci_enable_busmaster_method; +pci_disable_busmaster_t pci_disable_busmaster_method; +pci_enable_io_t pci_enable_io_method; +pci_disable_io_t pci_disable_io_method; +pci_get_vpd_ident_t pci_get_vpd_ident_method; +pci_get_vpd_readonly_t pci_get_vpd_readonly_method; +pci_get_powerstate_t pci_get_powerstate_method; +pci_set_powerstate_t pci_set_powerstate_method; +pci_assign_interrupt_t pci_assign_interrupt_method; +pci_find_cap_t pci_find_cap_method; +pci_find_next_cap_t pci_find_next_cap_method; +pci_find_extcap_t pci_find_extcap_method; +pci_find_next_extcap_t pci_find_next_extcap_method; +pci_find_htcap_t pci_find_htcap_method; +pci_find_next_htcap_t pci_find_next_htcap_method; +pci_alloc_msi_t pci_alloc_msi_method; +pci_alloc_msix_t pci_alloc_msix_method; +pci_enable_msi_t pci_enable_msi_method; +pci_enable_msix_t pci_enable_msix_method; +pci_disable_msi_t pci_disable_msi_method; +pci_remap_msix_t pci_remap_msix_method; +pci_release_msi_t pci_release_msi_method; +pci_msi_count_t pci_msi_count_method; +pci_msix_count_t pci_msix_count_method; +pci_msix_pba_bar_t pci_msix_pba_bar_method; +pci_msix_table_bar_t pci_msix_table_bar_method; +pci_alloc_devinfo_t pci_alloc_devinfo_method; +pci_child_added_t pci_child_added_method; +#ifdef PCI_IOV +pci_iov_attach_t pci_iov_attach_method; +pci_iov_detach_t pci_iov_detach_method; +pci_create_iov_child_t pci_create_iov_child_method; +#endif + void pci_add_children(device_t dev, int domain, int busno); void pci_add_child(device_t bus, struct pci_devinfo *dinfo); device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, @@ -55,95 +120,12 @@ device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask); void pci_add_resources_ea(device_t bus, device_t dev, int alloc_iov); -struct pci_devinfo *pci_alloc_devinfo_method(device_t dev); -int pci_attach(device_t dev); int pci_attach_common(device_t dev); -int pci_detach(device_t dev); -int pci_rescan_method(device_t dev); -void pci_driver_added(device_t dev, driver_t *driver); int pci_ea_is_enabled(device_t dev, int rid); -int pci_print_child(device_t dev, device_t child); -void pci_probe_nomatch(device_t dev, device_t child); -int pci_read_ivar(device_t dev, device_t child, int which, - uintptr_t *result); -int pci_write_ivar(device_t dev, device_t child, int which, - uintptr_t value); -int pci_setup_intr(device_t dev, device_t child, - struct resource *irq, int flags, driver_filter_t *filter, - driver_intr_t *intr, void *arg, void **cookiep); -int pci_teardown_intr(device_t dev, device_t child, - struct resource *irq, void *cookie); -int pci_get_vpd_ident_method(device_t dev, device_t child, - const char **identptr); -int pci_get_vpd_readonly_method(device_t dev, device_t child, - const char *kw, const char **vptr); -int pci_set_powerstate_method(device_t dev, device_t child, - int state); -int pci_get_powerstate_method(device_t dev, device_t child); -uint32_t pci_read_config_method(device_t dev, device_t child, - int reg, int width); -void pci_write_config_method(device_t dev, device_t child, - int reg, uint32_t val, int width); -int pci_enable_busmaster_method(device_t dev, device_t child); -int pci_disable_busmaster_method(device_t dev, device_t child); -int pci_enable_io_method(device_t dev, device_t child, int space); -int pci_disable_io_method(device_t dev, device_t child, int space); -int pci_find_cap_method(device_t dev, device_t child, - int capability, int *capreg); -int pci_find_next_cap_method(device_t dev, device_t child, - int capability, int start, int *capreg); -int pci_find_extcap_method(device_t dev, device_t child, - int capability, int *capreg); -int pci_find_next_extcap_method(device_t dev, device_t child, - int capability, int start, int *capreg); -int pci_find_htcap_method(device_t dev, device_t child, - int capability, int *capreg); -int pci_find_next_htcap_method(device_t dev, device_t child, - int capability, int start, int *capreg); -int pci_alloc_msi_method(device_t dev, device_t child, int *count); -int pci_alloc_msix_method(device_t dev, device_t child, int *count); -void pci_enable_msi_method(device_t dev, device_t child, - uint64_t address, uint16_t data); -void pci_enable_msix_method(device_t dev, device_t child, - u_int index, uint64_t address, uint32_t data); -void pci_disable_msi_method(device_t dev, device_t child); -int pci_remap_msix_method(device_t dev, device_t child, - int count, const u_int *vectors); -int pci_release_msi_method(device_t dev, device_t child); -int pci_msi_count_method(device_t dev, device_t child); -int pci_msix_count_method(device_t dev, device_t child); -int pci_msix_pba_bar_method(device_t dev, device_t child); -int pci_msix_table_bar_method(device_t dev, device_t child); -struct resource *pci_alloc_resource(device_t dev, device_t child, - int type, int *rid, rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -int pci_release_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); -int pci_activate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); -int pci_deactivate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); -void pci_delete_resource(device_t dev, device_t child, - int type, int rid); -struct resource_list *pci_get_resource_list (device_t dev, device_t child); struct pci_devinfo *pci_read_device(device_t pcib, device_t bus, int d, int b, int s, int f); void pci_print_verbose(struct pci_devinfo *dinfo); int pci_freecfg(struct pci_devinfo *dinfo); -void pci_child_deleted(device_t dev, device_t child); -void pci_child_detached(device_t dev, device_t child); -int pci_child_location_method(device_t cbdev, device_t child, - struct sbuf *sb); -int pci_child_pnpinfo_method(device_t cbdev, device_t child, - struct sbuf *sb); -int pci_get_device_path_method(device_t dev, device_t child, - const char *locator, struct sbuf *sb); -int pci_assign_interrupt_method(device_t dev, device_t child); -int pci_resume(device_t dev); -int pci_resume_child(device_t dev, device_t child); -int pci_suspend_child(device_t dev, device_t child); -bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); -void pci_child_added_method(device_t dev, device_t child); /** Restore the config register state. The state must be previously * saved with pci_cfg_save. However, the pci bus driver takes care of @@ -171,14 +153,6 @@ struct resource *pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_long num, u_int flags); -int pci_iov_attach_method(device_t bus, device_t dev, - struct nvlist *pf_schema, struct nvlist *vf_schema, - const char *name); -int pci_iov_detach_method(device_t bus, device_t dev); - -device_t pci_create_iov_child_method(device_t bus, device_t pf, - uint16_t rid, uint16_t vid, uint16_t did); - struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); From nobody Thu Feb 27 14:16:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLL3z88z5qG9g; Thu, 27 Feb 2025 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLL3W0kz3xRK; Thu, 27 Feb 2025 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=giywZKC9LzjzP/IiwLaayeqkyCDVM/BsiVqg31cnw18=; b=n2N8Rxk4Hk+Hj/BLY2QAdqeZcBRYicoRJdi5dJp4YPW9L9rvGL9H8fO88Mlm4M4nMV2KFR pVA20kkYmBh7uhK70Ryryn5cwNImaRodOXMPF2H4wGVrBwtJHMXPFg2CYDGmhmAvZh+6E8 iS5kORPoxvne2PJl2AEGj7XZSh5TWkLAEkN9vmAxl3JXt+fXFwpZXOmHP6lGatZWT8e+Ab hoMjYlMtCMR+YJvR4PDUTobKrenMY5axAnJOsAIGkU74P4GSQjYOb+cmTsvXJZFO2Qbl5s zbMFOmX9Y/M5oNkg4HpGdBB04WLKuTc7Gaefqx8mqlmHAPkhAVe29rcm+/CImQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665802; a=rsa-sha256; cv=none; b=cOgt1RJp3Of1eaRW5WZ2Exv2rrx0eZTyBBXtDcXoObkL5LITgPuqzNgpkccKTfKEBIS6S+ VG2N+zWaFYvuqyPgrXQNVHKKruDcf+ury1meJ2Nh9HFCXE5kSQakrep8LlMwnYHOtW+5k3 CttmWbtCpNphe+x+UNC9RWXGDa+HJofhHHCMhxI/75i/RhFNXhcm4W8DV3FTvNYSQ06Ofr zngxExlrvQ8rj38f5+wwMwC1x+NL7xj2rFogmWaGRVK9KPgBaZ+AoU0tMJR3FakurmJ+Tw qMXUlfLixHCKfsy/cc4FstofAnph6NfEvp+KLkEVzuMvPUJwaG5O3lIc6Vz3Lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=giywZKC9LzjzP/IiwLaayeqkyCDVM/BsiVqg31cnw18=; b=yGlhSfvuwuazFSFsfm5/IfsYF7QpGpuJg57WjTKbRCuqBz2/EfBTHU0StMz7HFXYwj2+qj +owR8SpZvDPKQcEDx0L/XSzzYpJM+doroFqgnPhTTKYnvEA9sv0RX7xU1dJ2CuwrmOkNKp j5rbAltCgEJQpAaOYvLJkHRdaslVRlPbnLbZXxCYmvGFMh2k8aXPjq9kJ22kf5RopNrDgF RpiQTE/g5wykaoYCQKpMKYcKXIotwUruMlmIUG+SdZ4S8vHSEDHIGOrNq9B0lu89Cj5FnF srv3h4FPi4DJQ8PdBkJHDN3GhbMKcZicLzQvj1ekv5qepFrljQzVZ1pOPWBLFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLL35tdzm7L; Thu, 27 Feb 2025 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGg6a015985; Thu, 27 Feb 2025 14:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGgAe015982; Thu, 27 Feb 2025 14:16:42 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:42 GMT Message-Id: <202502271416.51REGgAe015982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cae52eb91f15 - stable/14 - arm64 thunder: Use bus_generic_rman_* in the pcie_pem driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cae52eb91f15e04d0b3b949f9f9d5c10498835a2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cae52eb91f15e04d0b3b949f9f9d5c10498835a2 commit cae52eb91f15e04d0b3b949f9f9d5c10498835a2 Author: John Baldwin AuthorDate: 2024-01-23 17:37:41 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 arm64 thunder: Use bus_generic_rman_* in the pcie_pem driver - Implement bus_map/unmap_resource pulling bits from the previous thunder_pem_activate/deactivate_resource. - Use bus_generic_rman_* in various routines for memory and I/O port resources. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43439 (cherry picked from commit e5c6dbd576140c423b73ef6c908ffef6178cff9b) --- sys/arm64/cavium/thunder_pcie_pem.c | 206 ++++++++++++++++++++++-------------- 1 file changed, 124 insertions(+), 82 deletions(-) diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c index 2841486c1442..29dc84de6aaf 100644 --- a/sys/arm64/cavium/thunder_pcie_pem.c +++ b/sys/arm64/cavium/thunder_pcie_pem.c @@ -136,6 +136,10 @@ static int thunder_pem_get_id(device_t, device_t, enum pci_id_type, static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int thunder_pem_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int thunder_pem_unmap_resource(device_t, device_t, int, + struct resource *, struct resource_map *); static bus_dma_tag_t thunder_pem_get_dma_tag(device_t, device_t); static int thunder_pem_detach(device_t); static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int); @@ -148,7 +152,7 @@ static int thunder_pem_read_ivar(device_t, device_t, int, uintptr_t *); static void thunder_pem_release_all(device_t); static int thunder_pem_release_resource(device_t, device_t, int, int, struct resource *); -static struct rman * thunder_pem_rman(struct thunder_pem_softc *, int); +static struct rman * thunder_pem_get_rman(device_t, int, u_int); static void thunder_pem_slix_s2m_regx_acc_modify(struct thunder_pem_softc *, int, int); static void thunder_pem_write_config(device_t, u_int, u_int, u_int, u_int, @@ -168,11 +172,14 @@ static device_method_t thunder_pem_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, thunder_pem_read_ivar), DEVMETHOD(bus_write_ivar, thunder_pem_write_ivar), + DEVMETHOD(bus_get_rman, thunder_pem_get_rman), DEVMETHOD(bus_alloc_resource, thunder_pem_alloc_resource), DEVMETHOD(bus_release_resource, thunder_pem_release_resource), DEVMETHOD(bus_adjust_resource, thunder_pem_adjust_resource), DEVMETHOD(bus_activate_resource, thunder_pem_activate_resource), DEVMETHOD(bus_deactivate_resource, thunder_pem_deactivate_resource), + DEVMETHOD(bus_map_resource, thunder_pem_map_resource), + DEVMETHOD(bus_unmap_resource, thunder_pem_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -250,86 +257,125 @@ static int thunder_pem_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct thunder_pem_softc *sc; - if ((err = rman_activate_resource(r)) != 0) - return (err); + sc = device_get_softc(dev); +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_activate_bus(sc->id, child, rid, r)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_activate_resource(dev, child, type, + rid, r)); + default: + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + } +} + +static int +thunder_pem_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct thunder_pem_softc *sc; sc = device_get_softc(dev); +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->id, child, rid, r)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_deactivate_resource(dev, child, type, + rid, r)); + default: + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + } +} - /* - * If this is a memory resource, map it into the kernel. - */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); +static int +thunder_pem_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct thunder_pem_softc *sc; + rman_res_t length, start; + int error; - paddr = range_addr_pci_to_phys(sc->ranges, paddr); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - err = bus_space_map(&memmap_bus, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); - return (err); - } - rman_set_bustag(r, &memmap_bus); - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + break; + default: + return (EINVAL); } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + sc = device_get_softc(dev); + start = range_addr_pci_to_phys(sc->ranges, start); + error = bus_space_map(&memmap_bus, start, length, 0, &map->r_bushandle); + if (error) + return (error); + map->r_bustag = &memmap_bus; + map->r_vaddr = (void *)map->r_bushandle; + map->r_size = length; return (0); } -/* - * This function is an exact copy of nexus_deactivate_resource() - * Keep it up-to-date with all changes in nexus. To be removed - * once bus-mapping interface is developed. - */ static int -thunder_pem_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +thunder_pem_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) { - bus_size_t psize; - bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); - - if (vaddr != 0) { - bus_space_unmap(&memmap_bus, vaddr, psize); - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + bus_space_unmap(map->r_bustag, map->r_bushandle, map->r_size); + return (0); + default: + return (EINVAL); } - - return (rman_deactivate_resource(r)); } static int thunder_pem_adjust_resource(device_t dev, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct thunder_pem_softc *sc; - struct rman *rm; sc = device_get_softc(dev); +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_adjust_bus(sc->id, child, res, start, end)); #endif - - rm = thunder_pem_rman(sc, type); - if (rm == NULL) + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_adjust_resource(dev, child, type, res, + start, end)); + default: return (bus_generic_adjust_resource(dev, child, type, res, start, end)); - if (!rman_is_region_manager(res, rm)) - /* - * This means a child device has a memory or I/O - * resource not from you which shouldn't happen. - */ - return (EINVAL); - return (rman_adjust_resource(res, start, end)); + } } static bus_dma_tag_t @@ -629,17 +675,19 @@ thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct thunder_pem_softc *sc = device_get_softc(dev); - struct rman *rm = NULL; struct resource *res; device_t parent_dev; + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_alloc_bus(sc->id, child, rid, start, end, count, flags)); #endif - rm = thunder_pem_rman(sc, type); - if (rm == NULL) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: /* Find parent device. On ThunderX we know an exact path. */ parent_dev = device_get_parent(device_get_parent(dev)); return (BUS_ALLOC_RESOURCE(parent_dev, dev, type, rid, start, @@ -663,28 +711,15 @@ thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, start, end, count); } - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - goto fail; - - rman_set_rid(res, *rid); - - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res)) { - rman_release_resource(res); - goto fail; - } - - return (res); - -fail: - if (bootverbose) { + res = bus_generic_rman_alloc_resource(dev, child, type, rid, start, + end, count, flags); + if (res == NULL && bootverbose) { device_printf(dev, "%s FAIL: type=%d, rid=%d, " "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", __func__, type, *rid, start, end, count, flags); } - return (NULL); + return (res); } static int @@ -694,24 +729,31 @@ thunder_pem_release_resource(device_t dev, device_t child, int type, int rid, device_t parent_dev; #if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct thunder_pem_softc *sc = device_get_softc(dev); +#endif - if (type == PCI_RES_BUS) + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_release_bus(sc->id, child, rid, res)); #endif - /* Find parent device. On ThunderX we know an exact path. */ - parent_dev = device_get_parent(device_get_parent(dev)); - - if ((type != SYS_RES_MEMORY) && (type != SYS_RES_IOPORT)) + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_release_resource(dev, child, type, + rid, res)); + default: + /* Find parent device. On ThunderX we know an exact path. */ + parent_dev = device_get_parent(device_get_parent(dev)); return (BUS_RELEASE_RESOURCE(parent_dev, child, type, rid, res)); - - return (rman_release_resource(res)); + } } static struct rman * -thunder_pem_rman(struct thunder_pem_softc *sc, int type) +thunder_pem_get_rman(device_t bus, int type, u_int flags) { + struct thunder_pem_softc *sc; + sc = device_get_softc(bus); switch (type) { case SYS_RES_IOPORT: return (&sc->io_rman); @@ -866,7 +908,7 @@ thunder_pem_attach(device_t dev) if (size == 0) continue; /* empty range element */ - rman = thunder_pem_rman(sc, sc->ranges[tuple].flags); + rman = thunder_pem_get_rman(dev, sc->ranges[tuple].flags, 0); if (rman != NULL) error = rman_manage_region(rman, base, base + size - 1); From nobody Thu Feb 27 15:59:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3bcn1H0Qz5qKcl; Thu, 27 Feb 2025 15:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3bcm5BgVz43WZ; Thu, 27 Feb 2025 15:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740671960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lafgwD9w4GGx0ZwQM1MNNFPt6gcE7UeBvQep5RpCDI=; b=Yu0Cog3+cObxenNx5vxfzIWRDGIGoJq5K+1cC9j6a17oKo45Dny4HTDWQ5QqVwhHkbJ95+ WxsquAY4Wc49Mc7txgw/JzH0j71wo68TLd18TGmJoC/VrdDplmq+Saczx5/pPjmiEuWwMZ 4uDxrQHrTFoFJkL0dVtJiCstrgHf3mRKslrnH7wsL1rcczrFWdl9E/v+Zwjjz8TFOcIDmn lCbitvAN5No/okRt2VNhcRbnWScJpTjuKL7s1mG2WWKjPpgEUcScuNr2ytsqEUurme/d9b pu/uR8SRrb7qWEDlDVi/l916/ZeV8l8L5yi9QUpKleASEWE5eyIXjSzS3J5YJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740671960; a=rsa-sha256; cv=none; b=WEjhgdsbAwBtzmZbU4krlubs1Qnwjk1clEP75q16UzA+BsqCy6/ofOB3M7bnktUg6MdgRd cN6vhVO8sBoQtRoirE4iuXQw0vIH7+CQx6b+Pqq0PnK4c8/Cy+xV7xg2V/1Y03AlRTdp2J 7Uo50r4i9wdYZb8z+kK0Sky7b9blT2CoNvEUoGTfTVqthrMt9eHJg3n/k/dR5bPbhdw97D tnD3OUIBkLJpUlRQg4kCY5AOnRa+VeWpcl7sGTI7kdCi5n2HyKDDDb9uoCzftcskO4YUGy S/EItUf2fb1uTVCzWR7QOmnEe6DTiOjIu/+nmD7SXtWwGZEHN1iY7MF5sVXpKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740671960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lafgwD9w4GGx0ZwQM1MNNFPt6gcE7UeBvQep5RpCDI=; b=LuR5i7wnR0bGN4WqqntuMr+fZNHUL8mcMfXQ/D/ePfFz78uhGXgnF2+aEeEaxs1EdVtzzs n/fYTv1+rqiKcIO+qvQu3knu9RhWYu1gSCv7WYt7iUpUWAVl4napu0llugnVf/e0AX4jYf rjVom4Q64MxiOb4rBzCc77SqIQmI9AVjyCM9GVU/3ht4djM+04fSafYTxW2rLXB5A1zeHu IemCXdPqMrqrrXGuRRUKZxSpw4p/sXEvmiobu1Khvcz3JhMk7vPORT33ZM7UeGfLgqMhr3 yEtHuXxYGHFWnn5FDQbNfL110/+TtiiVmsJuELM8hdEuFWMKL705kA/7E7T3WA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3bcm4dVkzqP2; Thu, 27 Feb 2025 15:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RFxKPp004670; Thu, 27 Feb 2025 15:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RFxKme004667; Thu, 27 Feb 2025 15:59:20 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:59:20 GMT Message-Id: <202502271559.51RFxKme004667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 97309cec6f31 - main - netinet: Make in_ifhasaddr() return bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97309cec6f31f1f4f7a76f9ec5c7dd359c56de02 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=97309cec6f31f1f4f7a76f9ec5c7dd359c56de02 commit 97309cec6f31f1f4f7a76f9ec5c7dd359c56de02 Author: Zhenlei Huang AuthorDate: 2025-02-27 15:58:20 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-27 15:58:20 +0000 netinet: Make in_ifhasaddr() return bool No functional change intended. MFC after: 1 week --- sys/netinet/in.c | 8 ++++---- sys/netinet/in.h | 2 +- sys/netinet/udp_usrreq.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 5a28eecc6945..9a644c60e541 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -185,9 +185,9 @@ in_localip_fib(struct in_addr in, uint16_t fib) } /* - * Return 1 if an internet address is configured on an interface. + * Return true if an internet address is configured on an interface. */ -int +bool in_ifhasaddr(struct ifnet *ifp, struct in_addr in) { struct ifaddr *ifa; @@ -200,10 +200,10 @@ in_ifhasaddr(struct ifnet *ifp, struct in_addr in) continue; ia = (struct in_ifaddr *)ifa; if (ia->ia_addr.sin_addr.s_addr == in.s_addr) - return (1); + return (true); } - return (0); + return (false); } /* diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 0ebd238d6638..3d087e5b06d5 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -678,7 +678,7 @@ int in_canforward(struct in_addr); bool in_localaddr(struct in_addr); bool in_localip(struct in_addr); bool in_localip_fib(struct in_addr, uint16_t); -int in_ifhasaddr(struct ifnet *, struct in_addr); +bool in_ifhasaddr(struct ifnet *, struct in_addr); struct in_ifaddr *in_findlocal(uint32_t, bool); int inet_aton(const char *, struct in_addr *); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 131242ce9859..2c68d0880100 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1072,7 +1072,7 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct sockaddr_in * src, ifp = NULL; if (ifp != NULL && !IN6_IS_ADDR_UNSPECIFIED(&pktinfo->ipi6_addr)) { ia.s_addr = pktinfo->ipi6_addr.s6_addr32[3]; - if (in_ifhasaddr(ifp, ia) == 0) + if (!in_ifhasaddr(ifp, ia)) return (EADDRNOTAVAIL); } From nobody Thu Feb 27 14:17:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM611Gpz5qGJt; Thu, 27 Feb 2025 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM60Ll6z3xDP; Thu, 27 Feb 2025 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S4f7jbzMihCOcRKyXBeUQFSFbgy1W4gEEjWprnOBXYo=; b=VbEd7ZbX8yL+u26Xj2O9mlCS5bxGpFnZBP/jBHJie1XwU3DbvikR7WgpO3GMKa5H7oK9Cf fqbBm6WRuOc99dWSDPPNw/qljNmbghkaAwBK/la60yjjv8TiIsavmTVZp0m+B8p14hGcYV DeQmC0lg3i9FtM5vGvAmfx6xu5HZ5eHdYLcj9+6IV0Si/OSPy1WcOQOiK7GMyfNtLxBAdm DTLNeZvUTmolBLEi0tCJbqlIJjJ/SodXp6iNbeTwC0yiwV2W+m1pru/4TcA34atz1ewRT4 oNvY1ikseJB5GQIb5mOGjkKq/D8HxBHNto9nMLJe1bORaEP5g9ixleP/gl4JuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665842; a=rsa-sha256; cv=none; b=e+ks2Y/Sf61jPmFgyqr/5UFDjVBlGs82H99Yz6sjq7+XM2MsG+ZvL7ubTJgaOnDrleEfjN YqV+z8CSKaDqWVDbMX3xiSnEVy74D1ouPKWQRTzMsxKEksh0Isg8ufVOXURagp2XQ3iLvF xpSXegMkFj+jKW1fLT24Jpvcl5g859tcrKbYPUvDZz4sKu3B9zT9gzc2eAmXeMe4cOQGCQ Lixase8bFO0MJVTD2htyYLM8xkEcO1cHWu9nq0vOtx9J7o+et3Hx4G1CoUMzfIiaQQbYXj QXoTTkVAWjAVLTShoQUKsaV1TOWg+oPoi3mNaWgWnh3M54F4wWlZSRS0rfiTEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S4f7jbzMihCOcRKyXBeUQFSFbgy1W4gEEjWprnOBXYo=; b=IbE2xlaliHTvbmRCzIOtzyH30p/ouk419MetGGCODXu9cnKWJizTqZBH6grjoAwCUldcDr 0HHrT51aso6J1EY1E1pePiXtM7FRLOcA57EU+S/SCoKrygELRDHhwPW2Ewcqu0wClfksdL NlvxatDdPVwPXhxfrtuXg6NaTeg/IZ4zlAWoXJgbSaiAOrY0yFStczLfjpDWOFK5NdfFGs 0wiaf40aJa55D699ifVivBfo1037R+Nc16OGLryJeLqQgxwkg01sNMM71ThCw/XrBVI5Sq CdLrKFc33kanyXJ/D9q1LJlmNhsMmMaUbn2Qf/jt0sYP44YO3wOmFYtvF6tNEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM56vm3zmf0; Thu, 27 Feb 2025 14:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHLWm017222; Thu, 27 Feb 2025 14:17:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHLj1017219; Thu, 27 Feb 2025 14:17:21 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:21 GMT Message-Id: <202502271417.51REHLj1017219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6343760d7405 - stable/14 - bhnd: Use rman_get_type in bhndb_find_resource_limits List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6343760d74050b27eb84dc7c3712837361661a1d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6343760d74050b27eb84dc7c3712837361661a1d commit 6343760d74050b27eb84dc7c3712837361661a1d Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 bhnd: Use rman_get_type in bhndb_find_resource_limits Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44126 (cherry picked from commit 3351964c5e5d29ef93b3f26b7fc31a4972aa9af7) --- sys/dev/bhnd/bhndb/bhndb.c | 2 +- sys/dev/bhnd/bhndb/bhndb_private.h | 2 +- sys/dev/bhnd/bhndb/bhndb_subr.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c index 978ad9c3e62b..ea5230bf459b 100644 --- a/sys/dev/bhnd/bhndb/bhndb.c +++ b/sys/dev/bhnd/bhndb/bhndb.c @@ -1113,7 +1113,7 @@ bhndb_adjust_resource(device_t dev, device_t child, int type, goto done; /* Otherwise, the range is limited by the bridged resource mapping */ - error = bhndb_find_resource_limits(sc->bus_res, type, r, &mstart, + error = bhndb_find_resource_limits(sc->bus_res, r, &mstart, &mend); if (error) goto done; diff --git a/sys/dev/bhnd/bhndb/bhndb_private.h b/sys/dev/bhnd/bhndb/bhndb_private.h index 851cbe82d3a7..7b56f0b05c84 100644 --- a/sys/dev/bhnd/bhndb/bhndb_private.h +++ b/sys/dev/bhnd/bhndb/bhndb_private.h @@ -73,7 +73,7 @@ int bhndb_add_resource_region( const struct bhndb_regwin *static_regwin); int bhndb_find_resource_limits( - struct bhndb_resources *br, int type, + struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end); diff --git a/sys/dev/bhnd/bhndb/bhndb_subr.c b/sys/dev/bhnd/bhndb/bhndb_subr.c index 94d415d67064..b695785a4f7a 100644 --- a/sys/dev/bhnd/bhndb/bhndb_subr.c +++ b/sys/dev/bhnd/bhndb/bhndb_subr.c @@ -988,7 +988,6 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep) * returned. * * @param br The resource state to search. - * @param type The resource type (see SYS_RES_*). * @param r The resource to search for in @p br. * @param[out] start On success, the minimum supported start address. * @param[out] end On success, the maximum supported end address. @@ -997,14 +996,14 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep) * @retval ENOENT no active mapping found for @p r of @p type */ int -bhndb_find_resource_limits(struct bhndb_resources *br, int type, +bhndb_find_resource_limits(struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end) { struct bhndb_dw_alloc *dynamic; struct bhndb_region *sregion; struct bhndb_intr_handler *ih; - switch (type) { + switch (rman_get_type(r)) { case SYS_RES_IRQ: /* Is this one of ours? */ STAILQ_FOREACH(ih, &br->bus_intrs, ih_link) { @@ -1043,7 +1042,8 @@ bhndb_find_resource_limits(struct bhndb_resources *br, int type, } default: - device_printf(br->dev, "unknown resource type: %d\n", type); + device_printf(br->dev, "unknown resource type: %d\n", + rman_get_type(r)); return (ENOENT); } } From nobody Thu Feb 27 16:55:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3ct51Dvfz5qNVr; Thu, 27 Feb 2025 16:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct50kjwz45wr; Thu, 27 Feb 2025 16:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LWz1+WbUl+G2TatniDv2WIMyxZi9EBq+FErIP/4JwSs=; b=XlgaOQoSeC7Kptu3xgONoqik0vXUQ780ExEAHloxjH5PCKPrePdIWsmn/xDoL4PyS6/AxV fHGSyJFAHoLgcseQlxtkKmzyWbyv9bgwlot5PYMo0mYxML5LZUCxhWZ68A8seVtgRCmYeS pINubkhLbvg1EzYLy+z3i9H/Ovdvid9bt4o7sOpAN6w/gDby6xrMeCVzbNdCkH5NBmZROh VAFeIY6LFxDXH8BS83Yu/BisbTeA3EzlsLyrcwV0YXGikfcAYpD8yTmZbdbvc6xehk5+iY +B/Wb2rphSMeQ8MO8hKnxT7Ml+bUA9zFcqptAX7g+8FTq2mMc2L6v3G2UARZEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675357; a=rsa-sha256; cv=none; b=Fr3oTqaSAOPaOkAzD4ebxtluYRO8351E0ANLRu8DlUobHCgn+9qlT+m8dIfoNbFGGSgD1V LfAbA1P544m0hb4O1l2Vbz9L2UbDCs5iKLOQZM/XFKhWao5FvWUxEjXcJY+RkBHT9+CPoW ucg1Yz05BAnvmT9H9yQXsBp8J2WollJY0LUKoYhUiwF96rBK4PZbW+kxWewC10QfbumDQ+ /4Z82zytFyU1WryBlxifjDrOmMtrijsQRKJ2I+eCnPunRwNZWf2yEUDJW7RNLuOv/Runw9 ni/iTlWEN3iqeKu7oXSC1NF+nFg51SaoW5SNUk6M5GNGAsQD9FVIR+NsWP/EvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LWz1+WbUl+G2TatniDv2WIMyxZi9EBq+FErIP/4JwSs=; b=bdhb3GxbwHSxOgxi4wNGiIRtk3Omf2O/TJn2BPkrZ+ypCrGJRPuDpxkeBH/ah8ubzPBMoU BpThZxzc9voYwusaogEYqu0ymR/D72UWhrgEYK0rDGbW615NsiWWi+XUy9SOA9+VWk0cYp gY7e5MVC7AHKLTFc0mt2qIv0iQcJUXoSoRcrzZ6UyTYKrRZW+lyel0KLyHjFsYfA8xrZC2 IesWVNfGOE/O7Q7whZ+Ru0nBPQIevtJrv0CtHYh8hVbFup1vsPvrg/XuCLlQqOa9Gy1AhH axKWYn5qK2h7mBQ0VmrVtu+FaQgKmO3uMoaDfS8sJ+omYtpz5WGcHpCRuBqa2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3ct50Fm3zrtt; Thu, 27 Feb 2025 16:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtuwe017097; Thu, 27 Feb 2025 16:55:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtuxh017094; Thu, 27 Feb 2025 16:55:56 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:56 GMT Message-Id: <202502271655.51RGtuxh017094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b67839d769dd - stable/14 - stand/kshim: Replace devclass_equal with calls to strcmp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b67839d769dd01c854ef4d4b2a5474985d26f3b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b67839d769dd01c854ef4d4b2a5474985d26f3b2 commit b67839d769dd01c854ef4d4b2a5474985d26f3b2 Author: John Baldwin AuthorDate: 2025-01-11 04:03:02 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:25:39 +0000 stand/kshim: Replace devclass_equal with calls to strcmp Reviewed by: imp, markj, emaste Differential Revision: https://reviews.freebsd.org/D48412 (cherry picked from commit 40d7ba08773751ff7d0df1a3f112b32d1d04e5ec) --- stand/kshim/bsd_kernel.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index abe81ccc6c1d..1e3b5d245ca7 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -559,27 +559,6 @@ static TAILQ_HEAD(, module_data) module_head = static TAILQ_HEAD(, devclass) devclasses = TAILQ_HEAD_INITIALIZER(devclasses); -static uint8_t -devclass_equal(const char *a, const char *b) -{ - char ta, tb; - - if (a == b) - return (1); - - while (1) { - ta = *a; - tb = *b; - if (ta != tb) - return (0); - if (ta == 0) - break; - a++; - b++; - } - return (1); -} - int bus_generic_resume(device_t dev) { @@ -897,7 +876,7 @@ device_get_method(device_t dev, const char *what) mtod = dev->dev_module->driver->methods; while (mtod->func != NULL) { - if (devclass_equal(mtod->desc, what)) { + if (strcmp(mtod->desc, what) == 0) { return (mtod->func); } mtod++; @@ -950,7 +929,7 @@ device_probe_and_attach(device_t dev) bus_name_parent = device_get_name(device_get_parent(dev)); TAILQ_FOREACH(mod, &module_head, entry) { - if (!devclass_equal(mod->bus_name, bus_name_parent)) + if (strcmp(mod->bus_name, bus_name_parent) != 0) continue; dc = devclass_find(mod->mod_name); @@ -1083,7 +1062,7 @@ devclass_find(const char *classname) devclass_t dc; TAILQ_FOREACH(dc, &devclasses, link) { - if (devclass_equal(dc->name, classname)) + if (strcmp(dc->name, classname) == 0) return (dc); } return (NULL); From nobody Thu Feb 27 14:16:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLG13HXz5qGFg; Thu, 27 Feb 2025 14:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLG0XR8z3xNp; Thu, 27 Feb 2025 14:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cQIDUrjfcOKIWbS7/Y1GDBK0hFUhPWSb9itP96aN8I=; b=COyuw4g5kTsrUG9T3+LOcXLZx5lyX834oOR+0ebRagOC277kF0nP2BX+wdvXIPbjoTBb5z E+8n9HA2AGtlxWknLIueOVf9dM4FRObbQ2gw70q1tPuFx17wOTLC0B/3vGo4FQhVjz6Ef0 O/avblWaj1YWTUepivPIfO7o5xEQ9OKW3G4RKQzePgWu5IQjMxF0Tqn01+K90D7pjnz/rU Cn9ybOot0vbzmYS6UEvcgTreMhzXZkBcglJMNjuLPrGC6NoCkAQid13IkVk7KrMOkOVW3Q mP7/ElX55JHuoWIE2yXA6HXblkfheyDVGEnQ5AvrSNsKe//TcT58XbogpKqtmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665798; a=rsa-sha256; cv=none; b=EmBKRt23X0VhoRo0563YR+5m4/zSEw6pzPqvQLPPNz3ccO/leN+2hXUWh3mwqmYNPLn4X1 EWHvizTr8Mc/JO3b8KidF+7m9RYMxlhyvvrqn1fuWw/3dYe5NR/DXWT60F+X2rXrn9Q73a SY7fxJzWlIyZcqivCD3wSp9YyT37zSG4nb1fvyR97cbt0iFpsDhcFSaBzu1/2V7wdOgx9Y mu4wCvqn8BhLdSd17/BJYtApWia3cbDwfHdXOrOhHOHtDX9hwhuP5wixba9E3DDDvPJ55D 3U2ht7KyLMkpjoJ5VFvvx0X98+5ucsjlLYI2ObXf8UoWLwnd1872KrKo/M/8HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cQIDUrjfcOKIWbS7/Y1GDBK0hFUhPWSb9itP96aN8I=; b=XLzmIKq6WEysaUYmNsQgIzzd5bpj/N9IpvrSjZ/WWxGmxwT5XUy9/8Il4WH6JEnT0HTmX/ OWJzEGd+HK8pWio8kJiJmKhQbl7kJzBJC9lY7XHnhKCNm0JuQW5zQa30Z8VOmZT59y+Cum lqzB46iFCO8wEZS0MHafz89oa7knrkWI14BfJD3dz2skatwlBVohyG8UbtBxTYzNa6AzpU eD1d6wttzgCEXE9esTRVFISkeNdHwk3eKuC3I19YBIGhSdZfQW7XJHoYpAvisPlQpOAsqZ ALyii06k7e+UW90uYexdIP6OwhPrpF9seRC26ZWQpDnEWNI3+t3Cu4iAphxADw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLF70QvzmqL; Thu, 27 Feb 2025 14:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGb7N015835; Thu, 27 Feb 2025 14:16:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGbtb015832; Thu, 27 Feb 2025 14:16:37 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:37 GMT Message-Id: <202502271416.51REGbtb015832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 81770095f3d3 - stable/14 - macio: Set resource map size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 81770095f3d3bac499d9f7092b98b9495e73b812 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=81770095f3d3bac499d9f7092b98b9495e73b812 commit 81770095f3d3bac499d9f7092b98b9495e73b812 Author: Justin Hibbits AuthorDate: 2024-04-11 01:42:31 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 macio: Set resource map size PR: 278278 Fixes: af081ec6f7cf ("powerpc: powermac: Use bus_generic_rman_*") (cherry picked from commit f03a2e7b59d98629bc9a81882ce7ca534bd4f224) --- sys/powerpc/powermac/macio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c index f6ad815064e8..0af6c8aed348 100644 --- a/sys/powerpc/powermac/macio.c +++ b/sys/powerpc/powermac/macio.c @@ -700,6 +700,7 @@ macio_map_resource(device_t bus, device_t child, int type, length, args.memattr); if (map->r_vaddr == NULL) return (ENOMEM); + map->r_size = length; map->r_bustag = &bs_le_tag; map->r_bushandle = (bus_space_handle_t)map->r_vaddr; return (0); From nobody Thu Feb 27 15:59:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3bcm10qCz5qKXh; Thu, 27 Feb 2025 15:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3bcl4Qvvz43HP; Thu, 27 Feb 2025 15:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740671959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZcINcqUqiKkNO3qxq0fG9f4C2FHXQa6XM5+TV6epi9E=; b=IA+0NliFpHzY5i8T6hLxAhEMhrJWb9/vdk+e+z8yp6vCqAa718ES9Wm8BrtXss5ZDvJqLi rJ0pz0BAdNGv796UAEDrOs/c8/5KVguKiLu+EUI3z8VuCHgqqX/WOZr9RCU96Ob0gA6icj MheKCoKEpLTM5bvi5fQZ2bqgJFCir/yt2WR+1866nI2yi/65PD6wTSrRDBUPlWHykasD3K WY+8ad1s93gCsikVGLjlh7IhCp1JBNNxuf4A8KhsL8/kGZofNDTt8lvRXkbvyP87Je8oLW PookOO73a6nhJZvGuk2HYQ+c8qD7BTxFK3pPgvu78IPiI0rBLHMITvH5t9wGyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740671959; a=rsa-sha256; cv=none; b=UzNv+/A+emvwZQfo0L0UqYfJFtNpb9jyXrGeDKLjFyaXdOJHgXgav8zz6xefTDxgfXHV6B GMNdREWByC44fx23olNEq5QH/zjmKXhPTX4U3fOe2x272SAf7jBVzmLYwzE5lZtNIQbjzs vB36SDqo5VtQw0x4aytI7C1RVlj7WSzX0NQj3BZjBgvFjJomQRXpad9G+aFMVn3fsjDdoH 1ozQhbE9xWQEzp7PhoiBOrryCdh4zI9FJFdnkPJdfFeaXOEj3qeps9gAg1fQsvsPLLiJgT Ija517DlUooLRi4vxqMLKgQ37KxM985t/KfdFirYHOsXHrRxg6ocSEB4w7myug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740671959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZcINcqUqiKkNO3qxq0fG9f4C2FHXQa6XM5+TV6epi9E=; b=LkBjlXQqsyT1Ca5569yh5cXapXNbl43KTiFMRliA2zcQho+Zw/dgJZBQ4mDKYkFKBBpA2x oAuSO1lPTNCmsHj14wAeuUD1kacG9FfzbCNRYcO0AUE9wItlFAiH/ZpLq+j3AWWnZaRsRB NaZ7VkFNPHs6eUzqvCYD3k4NHhxKKU2UaGpH0jyYjfBdEGQWxhs4QqUjdOq0CUB/qtitY1 Mk3Gqb4xG1UJ9FMaFbUxnfq7YuQQGKgZR4KoS7vpGcokBMAMzfxHaaD6d/Z+chD51xBnl8 ygpaGJAzpy4+KCNbWDXKnaMhUIAsFGi46QaKt4l0JK+AjjWwfkafr5WbZ6DSGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3bcl3zzfzpR5; Thu, 27 Feb 2025 15:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RFxJ8R004627; Thu, 27 Feb 2025 15:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RFxJ36004624; Thu, 27 Feb 2025 15:59:19 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:59:19 GMT Message-Id: <202502271559.51RFxJ36004624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 69beb162848b - main - netinet: Make in_localaddr() return bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69beb162848b15c967d3b45ac56501dbd8b94e91 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=69beb162848b15c967d3b45ac56501dbd8b94e91 commit 69beb162848b15c967d3b45ac56501dbd8b94e91 Author: Zhenlei Huang AuthorDate: 2025-02-27 15:58:20 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-27 15:58:20 +0000 netinet: Make in_localaddr() return bool It is used as a boolean function everywhere. No functional change intended. MFC after: 1 week --- sys/netinet/in.c | 8 ++++---- sys/netinet/in.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 4c0908937ddc..5a28eecc6945 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -127,10 +127,10 @@ static struct sx in_control_sx; SX_SYSINIT(in_control_sx, &in_control_sx, "in_control"); /* - * Return 1 if an internet address is for a ``local'' host + * Return true if an internet address is for a ``local'' host * (one to which we have a connection). */ -int +bool in_localaddr(struct in_addr in) { u_long i = ntohl(in.s_addr); @@ -140,10 +140,10 @@ in_localaddr(struct in_addr in) CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if ((i & ia->ia_subnetmask) == ia->ia_subnet) - return (1); + return (true); } - return (0); + return (false); } /* diff --git a/sys/netinet/in.h b/sys/netinet/in.h index e42422341ada..0ebd238d6638 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -675,7 +675,7 @@ struct in_ifaddr; bool in_ifnet_broadcast(struct in_addr, struct ifnet *); bool in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); -int in_localaddr(struct in_addr); +bool in_localaddr(struct in_addr); bool in_localip(struct in_addr); bool in_localip_fib(struct in_addr, uint16_t); int in_ifhasaddr(struct ifnet *, struct in_addr); From nobody Thu Feb 27 21:04:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3kNj2c9Hz59WmB; Thu, 27 Feb 2025 21:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNj1y5Cz43pT; Thu, 27 Feb 2025 21:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AMNaQgsr4OdFuWfiIFVEZrWAVDTMiHxpKhrGJzznsW4=; b=hZNamV94P1Tm9Qi1V+3TTPnyDoPTlX5HkjGRNwXRfelkMxpJZcaWGsgbjiZFTLc07luee2 w1WZsG7xdR7u2JkEPlm08dUD5AZVZFCTUy9wRFpBYl5kxCQyS/QRuMeIZpgMK64vXAJlMR WeG76wrJ6TnAkXKqNFJ14udY0wWJCb2EQ+ERtYLtt9Dgy4SEzj/9nGsBRXkeBcq6dvKK3v EKYn4wjd6T/9HYZnpc8eA/F2pcM1ELzwp6v6NRkfxv1/VBJwG7DMuhJzL86YcfjNiEN8Ze 7COhwPC5Qrcg3s/l/Fh8DEF60COmOjkfr/oCsSMeBC5269RjRz7U+hGr3Q6FUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690261; a=rsa-sha256; cv=none; b=OSmWAPNw0Hs+ldXn2M2DsXk1bY5Z5zl7srnAelTvRem54ZeEkvHaY2NAinyDD/TmrrxGIy 1fp5+Qe9IQE/14MC9Ip3xinWuz0EAS1FpsmXfmxpMZSlhN9qt/hDHOKu+Y6urzTk+zNnDa jtg160P6zBvBWparkNiecVNpPIcUGosKkAIFUDiJxoSNyyleJwrXWbBtgRih6xI5BdD8GQ x3VQg89Ky+GddI7U3jknsbsm6SBKMXXDcNEdKPk10sspYbODtYpOCFI262ZKFBsdUNohZ1 VMJmjmq35QiD/WLnj0IPhBd8qEHl2BtrI5WPfb8eCDSl0JWTI8T6/Y9wapyQfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AMNaQgsr4OdFuWfiIFVEZrWAVDTMiHxpKhrGJzznsW4=; b=cm0qLrBZRmxllIAd2NmGwALdqT/moiShpjs8LXiBFMEvzm2NnkfYpt+NDSktNp3TmKJDwG cUkFXkuj0SSDPAH/5/0ABwdRdJSLoq5JJ83Kb1vb5QsntFnGuIudpFYI0m8HS8h3zOz8X/ Tsg9E7c9Bsz4LIq3tAhAGMc9ZglM8UG2T6x4vBZ0JSaTK34ULvWzXr9lERZFLOxQ8ii0qs Bx9uNBAa3o0rG8toskJUL6gy0EtD0wU2moUcI7uGX0up7NPu3CCvSvm6wBiUgDiytVzjBN v9O7TKOVb7eEdxZIlZWeirw1gkPcTSwOHMtWPXM3Pit0/o+TkY41klv0nmGGUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3kNj1YKqz10GD; Thu, 27 Feb 2025 21:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4Lgq085475; Thu, 27 Feb 2025 21:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Lff085472; Thu, 27 Feb 2025 21:04:21 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:21 GMT Message-Id: <202502272104.51RL4Lff085472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9a39e5f46bed - stable/14 - LinuxKPI: 802.11: ensure to select the correct channel width List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a39e5f46bedab6aa3be65c0fb2e1ebbf34df230 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9a39e5f46bedab6aa3be65c0fb2e1ebbf34df230 commit 9a39e5f46bedab6aa3be65c0fb2e1ebbf34df230 Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 01:57:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 LinuxKPI: 802.11: ensure to select the correct channel width If HT is enabled but not using CHW=40 set CHW=20 to make sure we do not get stuck on any other value. If VHT and the VHT Operation element Channel Width field is 0 (use 20/40) do not update the bandwidth but stick with what HT selected. This is better than disabling VHT alltogether for 20/40 and allows us to work on VHT20 and VHT40 APs it seems. We will have to do more work to can align with the chanctx or deal with Operating Mode Notification Action frames in LinuxKPI or net80211. Sponsored by: The FreeBSD Foundation (cherry picked from commit 3e022a91c91cf1b967d7de7b6fe81c6632fe1207) --- sys/compat/linuxkpi/common/src/linux_80211.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b7d3d7a298fc..5db1512394cc 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -401,6 +401,8 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0) sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + else + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; /* * 802.11n-2009 20.6 Parameters for HT MCSs gives the mandatory/ @@ -450,6 +452,13 @@ lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) sta->deflink.vht_cap.cap = ni->ni_vhtcap; sta->deflink.vht_cap.vht_mcs = ni->ni_vht_mcsinfo; + /* + * If VHT20/40 are selected do not update the bandwidth + * from HT but stya on VHT. + */ + if (ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_USE_HT) + goto skip_bw; + width = (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); switch (width) { #if 0 @@ -467,7 +476,7 @@ lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) #endif sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; } - +skip_bw: rx_nss = 0; rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; From nobody Thu Feb 27 14:16:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLH1LD2z5qFx5; Thu, 27 Feb 2025 14:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLH0gtzz3wyr; Thu, 27 Feb 2025 14:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G4y9gMueCn/4POpmx+NrrIZZ3wzDf/obajeS7G5nsGM=; b=KwV9ZA9Te0P+oXx/7z2IHI6+vi2uoc8eZFnA59dGuWoGq362+5aZcLdwNtsF7awyoJrEBq RFnMRe/UQHIdlDs6eBftzfGnbGhE+LIYmEPEGe0dlO++QxG5hR++94jlUsicuMX/R/U1F9 YdnefCbY1l4FeKHDv1qcIawFHjMJKvDq/o7AueAyWOlfxVnOB8w8CYdCF9ZbOAygCkOk+p /yE1N1WSlXr40TUSf0USgVOskWCDiIKSZ7zOEDsN20QQFBHcYGvdvgLRB/VxrTLclOnJZb oax2WMVjxzE6WCE3e6l17kqf2+bRz8WInyTfgxW3nbzhQvch94nDwvM0Ns2Hbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665799; a=rsa-sha256; cv=none; b=bTudMSn2kJhl/uo64oqXqhBsQSoLqaZuf9fXPCrYwHu/UVAKCg/ZPevn2R9FToSUcOUFhn MA+a4ufXXG3u+0m502iavB6cF1PmoqSmN5dVxOE3bSyZYg1w4O07YYl034iE3uJmBrIZDI 7jdgeeuMwT6bsIMiIWS+leUiFoDe5qVQfu+S1Npu6OQrFBc0481YtGilQ1TAt0U0TXiXrW vRO8wcBvzRD6S+aYUolCp5Tke3mT3iqUAL6ZXMJeFAJ11G4N1O0uENimMijWoGu51MzZdd dUhmcy7EGW/hj40otjWKZXza0CPgJo/EAilANjxtJm8iBazulkj9VonB7Y1rAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G4y9gMueCn/4POpmx+NrrIZZ3wzDf/obajeS7G5nsGM=; b=dyn75OpIII6m4mg6nE2FYsMa7v1zccYPMoDLRrSTjvOvhqQIAFkdp2qofpJBhkX6g3XGf6 +lpEIPY8vttYS9Qbf393+1ZLGV9ajPpAnvb+zYmEkL3QQ1aKqzw8qc+o8Eh5Ecx1J8n/1x aDGLeFj7/JNm6aVVvq8xbbDU4lA2g11q/A7lrdH1cSW6AJKKBTk3qe626eqJonc6/zV+8z 5DTlT4PsRIOdkRx3DpX+MFl6oDC7F2j6q4k0HeRvDMpOvgrbZD1acUCfTYPXFXbdym/p5D qaXJAsToUzlxnjDhOkNcrwempqFVW6AXY5zio/3wwXer0hjC7+rHUfc4gFEfdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLH0CR7zmZN; Thu, 27 Feb 2025 14:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGcsT015879; Thu, 27 Feb 2025 14:16:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGcoA015876; Thu, 27 Feb 2025 14:16:38 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:38 GMT Message-Id: <202502271416.51REGcoA015876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 64ab61b1284a - stable/14 - powerpc nexus: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 64ab61b1284a1e9d578c1df61a63cff7f2004b5f Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=64ab61b1284a1e9d578c1df61a63cff7f2004b5f commit 64ab61b1284a1e9d578c1df61a63cff7f2004b5f Author: John Baldwin AuthorDate: 2024-01-23 17:37:02 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc nexus: Use bus_generic_rman_* Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43436 (cherry picked from commit 7b5a5e4eef504d2972b6b5f6abfff8058be6371e) --- sys/powerpc/powerpc/nexus.c | 129 ++++---------------------------------------- 1 file changed, 11 insertions(+), 118 deletions(-) diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index c5f460baf44e..a2043c3cfdf9 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -68,12 +68,8 @@ static struct rman mem_rman; static device_probe_t nexus_probe; static device_attach_t nexus_attach; -static bus_activate_resource_t nexus_activate_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_alloc_resource_t nexus_alloc_resource; -static bus_deactivate_resource_t nexus_deactivate_resource; +static bus_get_rman_t nexus_get_rman; static bus_map_resource_t nexus_map_resource; -static bus_release_resource_t nexus_release_resource; static bus_unmap_resource_t nexus_unmap_resource; #ifdef SMP @@ -94,12 +90,13 @@ static device_method_t nexus_methods[] = { /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), + DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), + DEVMETHOD(bus_alloc_resource, bus_generic_rman_alloc_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), + DEVMETHOD(bus_get_rman, nexus_get_rman), DEVMETHOD(bus_map_resource, nexus_map_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), @@ -232,121 +229,17 @@ nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, return (intr); } -/* - * Allocate a resource on behalf of child. NB: child is usually going to be a - * child of one of our descendants, not a direct child of nexus0. - */ -static struct resource * -nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +static struct rman * +nexus_get_rman(device_t bus, int type, u_int flags) { - struct rman *rm; - struct resource *rv; - switch (type) { case SYS_RES_IRQ: - rm = &intr_rman; - break; + return (&intr_rman); case SYS_RES_MEMORY: - rm = &mem_rman; - break; + return (&mem_rman); default: return (NULL); } - - rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); - if (rv == NULL) - return (NULL); - rman_set_rid(rv, *rid); - - if ((flags & RF_ACTIVE) != 0) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); -} - -static int -nexus_activate_resource(device_t bus __unused, device_t child __unused, - int type, int rid __unused, struct resource *r) -{ - - if (type == SYS_RES_MEMORY) { - vm_paddr_t start; - void *p; - - start = (vm_paddr_t) rman_get_start(r); - if (bootverbose) - printf("nexus mapdev: start %jx, len %jd\n", - (uintmax_t)start, rman_get_size(r)); - - p = pmap_mapdev(start, (vm_size_t) rman_get_size(r)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(r, p); - rman_set_bustag(r, &bs_be_tag); - rman_set_bushandle(r, (u_long)p); - } - return (rman_activate_resource(r)); -} - -static int -nexus_deactivate_resource(device_t bus __unused, device_t child __unused, - int type __unused, int rid __unused, struct resource *r) -{ - - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - bus_size_t psize; - - psize = rman_get_size(r); - pmap_unmapdev(rman_get_virtual(r), psize); - } - - return (rman_deactivate_resource(r)); -} - -static int -nexus_adjust_resource(device_t bus, device_t child __unused, int type, - struct resource *r, rman_res_t start, rman_res_t end) -{ - struct rman *rm; - - switch (type) { - case SYS_RES_IRQ: - rm = &intr_rman; - break; - case SYS_RES_MEMORY: - rm = &mem_rman; - break; - default: - return (EINVAL); - } - if (rm == NULL) - return (ENXIO); - if (rman_is_region_manager(r, rm) == 0) - return (EINVAL); - return (rman_adjust_resource(r, start, end)); -} - -static int -nexus_release_resource(device_t bus, device_t child, int type, - int rid, struct resource *r) -{ - int error; - - if ((rman_get_flags(r) & RF_ACTIVE) != 0) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); - } - return (rman_release_resource(r)); } static int From nobody Thu Feb 27 14:17:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLn2Mfkz5qFY0; Thu, 27 Feb 2025 14:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLn0Zcyz3xMT; Thu, 27 Feb 2025 14:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eym0QiXoc1fofSrOB57wTdgEztu+wS1aUaMYtfS2MZ8=; b=TKxg6EutWmvxNCqOyE/8xx5xL23+nixCUF22sB0GoVzoMC1lcQrtn8bBNNQQxn/G5KAcdP YjsgEv6q3RduXda21FQZSKUzO/TltDtf4uIeph7LUVruHX7pvA8xIyvQsG2zZuxBp611xq u8SuKmeDNaAm9fUdym7XOikXiMxQF+8aUAFtYnaNtZYgB8Y4tYYytukIy508eklt2SDMPT ZJVuIbOuVgb99fW7ULWn0/WfNM1PaPNy76XaNvqC/kbHhj//HP1g7fRsI40Ajhc+5DU5iR x4N5b2frWzuNTFVLpoklC6XMG1ES9syw6CLGznBnTeqRF75H9j4rwSqT0nExpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665825; a=rsa-sha256; cv=none; b=QzUaMWDmuNl5FlJMLiPlGCUmXi5Zsu5HMYDAg5/5aG/FTcIcB6aBK6H/jHupJwutrHW4J7 1bdDBsSZ1NleQYSPeKdKNQ4+/gdTFR5YPcLeZZcecyKpyaCIzbWZPeu+0ay/vMm6+wDC7S fiZXnuhr1bJ1AQUlGOmD2eTxE90WgGCcRrlfdSpn+Kco3F+UMaRxRcXGmfNEAUWjUDIUu+ KYev/A/pBIsMiJUe/u+nHFjG1sJVNxK0LUM+3p4zr41RRnCT8xnuDBUeMBzNW2lNaYTQqc 2QBuQ4+QH8zcfiJbqIprltT4mscRFmKSVFrG/lPMa3IIFgdWYpyq/wOI+urkZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eym0QiXoc1fofSrOB57wTdgEztu+wS1aUaMYtfS2MZ8=; b=gkgSbiznHBa4CdUr0ZzmiXZCJhSf7vLr1wO2uV4/arhqU1QSloCqmXDTamEe34iXhOWInD 8QHWktEFKUmyXQF6Bb0GrNRRt/R5oKsisAdGf3o2cRYbDigXtZ4d7Gt6lOt+O/jvFYZOzL 1VEU9X5c/bxaSveQd3siff/EV0mpXjUP3Y2XvFgG8TL3rXIIRr1bXDC7vrsgkSJA2x8Wn/ 1Hm9o827jtO7b3TeDGj0XvVYPMAMxMgtjBs4VzX5QzaQGxdeXpREn6KwP4exeGCBtTBdxm 1pme6INav61aR0X7PefRyq0hgOHRO5fuS8N2kBP+gcmgsL76gysOKXRX6YqDVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLn05T2zmdx; Thu, 27 Feb 2025 14:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH49T016710; Thu, 27 Feb 2025 14:17:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH4wf016707; Thu, 27 Feb 2025 14:17:04 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:04 GMT Message-Id: <202502271417.51REH4wf016707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1b0dd6b64b8e - stable/14 - pci_host_generic: Fix build without PCI_RES_BUS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1b0dd6b64b8e0d75362d70e1e68c2e55f90acffc Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1b0dd6b64b8e0d75362d70e1e68c2e55f90acffc commit 1b0dd6b64b8e0d75362d70e1e68c2e55f90acffc Author: John Baldwin AuthorDate: 2024-02-16 20:09:46 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Fix build without PCI_RES_BUS Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation (cherry picked from commit 66d37dbedfbf2dc94ccf49e6983c3652d5909b91) --- sys/dev/pci/pci_host_generic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 386b8411d29a..520462972a66 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -537,10 +537,14 @@ struct resource * pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; +#endif struct resource *res; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) sc = device_get_softc(dev); +#endif switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) From nobody Thu Feb 27 14:17:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLq2Qcrz5qG2J; Thu, 27 Feb 2025 14:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLq207bz3xH2; Thu, 27 Feb 2025 14:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zvtayANn1VHjv/z+T+oPa+EGnUSK6AdKtfjLAQN5bRE=; b=ezEhM1BxCcgWE75LDt45NjIG9xsFrq1lYvsEcQKVOTuf50KPNeY9oBAgDuwUGiMToVvGsq VwNSaNW1pBe8wO62Yw9SAWQvLtBq5w+xZuZ28W7oVa5MgkQoi9EkjYulDuBrk1h9/ytYlU Wg22ctqQZt/JZpYvykl+pDS4Eq4PfE+T3h8Kc+NvXIw+uu6ugWFdUzl1mvN9lSCrw2wfYV Joy3/iayEhkwVc5Yq73JLOEeA5wUjCT8Z+XmYA8nKeM3ASX+oF+iaUGQT8NFG4bacJecgZ HuBTOQ41DBjpG7NGKYcjCSdurQH/M1Y1vKINBuge20KE2XzlVycFVUor5pJeiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665827; a=rsa-sha256; cv=none; b=OWcRgaew9SThkdQhbfAk9ScT6OjiNw46scT7DRtG1ckOH56mGliNsas1vudx9miWmVv2bM gTQdC/XXUDzCoPI/woOxBzP+/vYFdtwGh/0z5dSIHY3kExsh3931btRwTNkyjcBJhdLuzp vqp7j25mYnfiq4hNBFRAkP3D9ySXmgBm2sDuxGjVppqEEn5oWyf8r+h/6lvrUYF64+3gxR 083Iac5xNDDg1kL5B/CKq56mKVFmu7wzyRnpUyQA0v5ywpsYkMLqn2UYGkD7yPC4Xlrwtr eMIobcFpccya2wgxmAO98FjcTBwbTqUP8KbcCHgtsiUAZam/dfOdrxDyKWGciQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zvtayANn1VHjv/z+T+oPa+EGnUSK6AdKtfjLAQN5bRE=; b=vH8yep0RHBU8WetZwhbhYT2omKQAHpUx1sWKhKAU69BiGIzeBVLTgpHzyUuT4hU/U/QdOU VHH2QFoRm1HW7KgfXO6xT/i9bs27+ZwCCq3fMfwcnUPXMw2gsLfHb0ltKSTbkl2ZemtVov vURFHYqRhrUlL+ZfkKjw3TUR9NrF8Woj7IoM+7z2RFqL4sveC5QCc3ZgEobC/bZgWuMMmV lERhuVMsBTrlzTnaJbSbBp6WxixFi4P52TvJ+1GqxI2qbmOU2vv61BCAyQ+NBtJ22X6uCh GGV45BeTXoB7z2RKMHtZMG/6SvSPYa4udvX6WsRfspyznGJn2uPXQ+s7jqn2/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLq1blNzmqQ; Thu, 27 Feb 2025 14:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH7J7016785; Thu, 27 Feb 2025 14:17:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH7Me016782; Thu, 27 Feb 2025 14:17:07 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:07 GMT Message-Id: <202502271417.51REH7Me016782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1ee7a9a25053 - stable/14 - powerpc psim: Fix infinite recursion in multiple bus methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ee7a9a2505398989ecbf44a73d56c945de8561b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1ee7a9a2505398989ecbf44a73d56c945de8561b commit 1ee7a9a2505398989ecbf44a73d56c945de8561b Author: John Baldwin AuthorDate: 2024-02-17 07:17:42 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 powerpc psim: Fix infinite recursion in multiple bus methods Similar to 68a3ff041129208ea98a3bd5142061176ab4165e, the default case needs to call bus_generic_* to pass the request up the tree, not bus_* which will just call this method again. Fixes: d7c16b333455 powerpc psim: Use bus_generic_rman_* (cherry picked from commit 61d9bd21e9d6c3f876c4c8549fafaaaa4de75983) --- sys/powerpc/psim/iobus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index c572a1fdc12b..eea0255aa21c 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -370,7 +370,7 @@ iobus_release_resource(device_t bus, device_t child, int type, int rid, return (bus_generic_rman_release_resource(bus, child, type, rid, res)); case SYS_RES_IRQ: - return (bus_release_resource(bus, type, rid, res)); + return (bus_generic_release_resource(bus, child, type, rid, res)); default: return (EINVAL); } @@ -383,7 +383,7 @@ iobus_activate_resource(device_t bus, device_t child, int type, int rid, switch (type) { case SYS_RES_IRQ: - return (bus_activate_resource(bus, type, rid, res)); + return (bus_generic_activate_resource(bus, child, type, rid, res)); case SYS_RES_IOPORT: case SYS_RES_MEMORY: return (bus_generic_rman_activate_resource(bus, child, type, @@ -400,7 +400,7 @@ iobus_deactivate_resource(device_t bus, device_t child, int type, int rid, switch (type) { case SYS_RES_IRQ: - return (bus_deactivate_resource(bus, type, rid, res)); + return (bus_generic_deactivate_resource(bus, child, type, rid, res)); case SYS_RES_IOPORT: case SYS_RES_MEMORY: return (bus_generic_rman_deactivate_resource(bus, child, type, From nobody Thu Feb 27 14:17:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM02bdkz5qFxB; Thu, 27 Feb 2025 14:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM027x7z3xDH; Thu, 27 Feb 2025 14:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=diA3GpNGK0FHDQGDtjNVL3p7BnNSg/yAlNjLvzidHZ0=; b=d697H0WIy3uvEer9WcR9mi9TNktQvPwtEY2Z+zHXoiJZlNo5WPSP3V3xmC6FerfjQaWSaU +Xvc39JFa/eSSZYXDx2PMx5oFZbU8qlPTFwX8Ti3U0Frhfw7BEbRPmQ8rDlz5IfzvgIb9q SzjzhRpLd5awkBouKs6tGcWa4ojmEdbqnqg6Dz0eQkf66DawXM7bxtnti/CvGiTBCrq/+T jGlKSFHamdPXh5F/8UQYI7CzjMhJfHILpJqzHLryZbyVT7oGuuT9kjbmwiL2JPvV1q7qd+ nOeTpsSwVfjhGj4Et84jwekhpSg8juMYaF5kISubm0pUeCs2ruBoQMKhFWBSAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665836; a=rsa-sha256; cv=none; b=wDJTG6hgGZfMHqR4PuMsBEFUD7QPUQLTrE0zaz9hB30gFSeQ5nkCp9fbFpdBlk946+/V9c BtJHgwuaj8JGB4GW+tmUZaz1flnZF8qCqh34LsLqpYkuFwPW33OlVhfbj5SEYAoYUdldX5 y6Y2agaDzhmPRmPqAPJ6PaQP9cc37jD39L49sHAktTjkgyZ+m1uXs+mu+HZbe0WxgvBKk8 Z+7CKATuKCMbQ87Iot1DNXkDXPcDZQffkJVV0Zs/xqvA2kIompq8qU4zPinzkSNI7pwoDq UCIN+e5dMsiHGevOmuDpR2IadtFinnXBMpQbRgClYtRmHssu9HY57cLs24WPsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=diA3GpNGK0FHDQGDtjNVL3p7BnNSg/yAlNjLvzidHZ0=; b=yIX8SwyCImRSftzIUQR92YWuSUetW0VWQJulEtLAF1hBcE/3zs4y3dYdfwqMSEXvw5JiU0 5GsUyt+l3Em2pWMKaJbkTe4OAB5jyjJKCkTOSl9aqnGYEWdLIMTOpuUUEfHDp327Tre6pd PHJpx1WGcTIvAxmR7OkJd/Pjl+VgCa+9hKJlppxaZMb/O7+hOV/t4zXNPuA9XHGPQhfdGO VvGdENb8BZHytckpX0t8icIZ8QlLdfqoNbIqZfRsx1/p2Fm2YyvJ1p5sWqSxr9BWiomNuq DyDzjgZit9ko0E3Ut/q4d1DS2r9KxZhKi/rBFvfFsmHnbRhh6V8fB1273yE2kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM01kMhzmqT; Thu, 27 Feb 2025 14:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHGe2017050; Thu, 27 Feb 2025 14:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHGut017047; Thu, 27 Feb 2025 14:17:16 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:16 GMT Message-Id: <202502271417.51REHGut017047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0ed9854b5bf4 - stable/14 - Revert "new-bus: Disable assertions for rman mismatches for activate/deactivate" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0ed9854b5bf406b3d2bfda700ed749d3da015050 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0ed9854b5bf406b3d2bfda700ed749d3da015050 commit 0ed9854b5bf406b3d2bfda700ed749d3da015050 Author: John Baldwin AuthorDate: 2024-03-13 20:19:10 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 Revert "new-bus: Disable assertions for rman mismatches for activate/deactivate" With recent fixes to the ACPI and pcib drivers to translate mapping requests of child resources into mappings of sub-ranges of parent resources these assertions should now be true. This reverts commit ed88eef140a1c3d57d546f409c216806dd3da809. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43691 (cherry picked from commit f980f48f1369cda3f1f5e84e54e45b738bf0dd0b) --- sys/kern/subr_bus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f08a7718e071..bd54977cc6f1 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4377,12 +4377,12 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { struct resource_map map; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS struct rman *rm; #endif int error; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS rm = BUS_GET_RMAN(dev, type, rman_get_flags(r)); KASSERT(rman_is_region_manager(r, rm), ("%s: rman %p doesn't match for resource %p", __func__, rm, r)); @@ -4425,12 +4425,12 @@ bus_generic_rman_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { struct resource_map map; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS struct rman *rm; #endif int error; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS rm = BUS_GET_RMAN(dev, type, rman_get_flags(r)); KASSERT(rman_is_region_manager(r, rm), ("%s: rman %p doesn't match for resource %p", __func__, rm, r)); From nobody Thu Feb 27 17:19:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3dP32bqpz59Jhw; Thu, 27 Feb 2025 17:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3dP31pj7z46yV; Thu, 27 Feb 2025 17:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740676759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+TtCuVhoSSHwL5vKBLkrA1ZDDvx24jRb68+m7vn34mY=; b=ypiOa1R1vm9uwnU+ydwg6NqXjvxd4/LSb58puVH+Kqm8w1CoYmdgb5ZhVrmxZLZtpTP8HK igvPJp/6+XDaRUCgrV7sqkZbo2/EA3kFK7JuMPc3nKdTBNtxIDxVXn1zh/QWVKkoGuXr7a KjFYPJPJ2YQJfqyWgJZ42BR8Y/QRQoMUo9MXYstdokAv9lK3UGN6Vu6obquR+Mpf1f/DNJ Y0x6wdeQPUuG8Oe8jV7vvpnkN6ElElVCc3KF/9Fd/9Mh6/luAjlbe8XUDgd52iamowbEIo 0LoopJETO1T2XDE4HOTMl09Ru1ORJlUldbWsio5H9ccYOABcs+CkrYO7m8mq8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740676759; a=rsa-sha256; cv=none; b=bqDMDtYtMLl++kUiEp1bk1Y22fGE77LdPBbU7LrBi1A1pL7p0W22yskHJdZJNua0meQ3Sw /kn1fKIT122Lx4wyVnszAkitJPpXIEgnxjKxazmCoHgQEC1OkgPwpr1tHrJRHpDLjP0eLW HpltVE6vpo4IJFHc4BEvr1pmDOx5xp9ayv0hHKN2TtEqfZfTeTz8jXl2TcOLbt8lyUk7br ub4Y8lO5Z9nIZNylg1lXVDULl3om2ncUrEky8N+gsZ0YWJB+nBprnJIC/pUZRxBim+p3Lc wMpptIJ6nQwMWxMMp7fgFrJc4tG+Et9GUqXa64WXju+DbAbkKyc4pvD+wLm1RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740676759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+TtCuVhoSSHwL5vKBLkrA1ZDDvx24jRb68+m7vn34mY=; b=D7RGlAmpzIDeV/NMuovmIZC5lln748z3SmoisJzSSAykNdBVirUS7CKvhtWYFTgweFn8wS EulR4esVY73soK2y7LqgK9A4kF/MTmkPCy2Ll4pk3q7Gf/PlKwhBIHxmo1/GDj9l6pq45g Eno7AZtZ9b6pnptFKoTVIajlMPF1l7vq6eDidRfEZWXN//hN0p3vPAbP1XQVOUc2OewkiV cSju2pNBxWKy5bs05MGplV6f2ltLNGVyzdkUXDs3tbx4smB/AmlKroVhdTY3NGI5wFlMT3 uUwCZ+Vu25n7PuYkw/YVCnJaoy4KL9AwmxsADlCUwpvUJAV12bH4AqxtwqDNPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3dP31HwlzsS6; Thu, 27 Feb 2025 17:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RHJJNx056780; Thu, 27 Feb 2025 17:19:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RHJJ1q056777; Thu, 27 Feb 2025 17:19:19 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:19:19 GMT Message-Id: <202502271719.51RHJJ1q056777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 513cd54856e1 - stable/14 - Use bus_generic_detach directly instead of a wrapper List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 513cd54856e1730dea9d709477319ff075f5112d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=513cd54856e1730dea9d709477319ff075f5112d commit 513cd54856e1730dea9d709477319ff075f5112d Author: John Baldwin AuthorDate: 2024-11-05 01:30:13 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:08:57 +0000 Use bus_generic_detach directly instead of a wrapper Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47386 (cherry picked from commit d62d10eb1229c9aa0b3cf1b18872df59c18155db) --- sys/dev/acpica/acpi_container.c | 10 +--------- sys/dev/adb/adb_bus.c | 8 +------- sys/dev/mdio/mdio.c | 10 +--------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/sys/dev/acpica/acpi_container.c b/sys/dev/acpica/acpi_container.c index 43da3cdc47e1..057f72716fed 100644 --- a/sys/dev/acpica/acpi_container.c +++ b/sys/dev/acpica/acpi_container.c @@ -39,7 +39,6 @@ ACPI_MODULE_NAME("CONTAINER") static int acpi_syscont_probe(device_t); static int acpi_syscont_attach(device_t); -static int acpi_syscont_detach(device_t); static int acpi_syscont_alloc_msi(device_t, device_t, int count, int maxcount, int *irqs); static int acpi_syscont_release_msi(device_t bus, device_t dev, @@ -55,7 +54,7 @@ static device_method_t acpi_syscont_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_syscont_probe), DEVMETHOD(device_attach, acpi_syscont_attach), - DEVMETHOD(device_detach, acpi_syscont_detach), + DEVMETHOD(device_detach, bus_generic_detach), /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), @@ -109,13 +108,6 @@ acpi_syscont_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -acpi_syscont_detach(device_t dev) -{ - - return (bus_generic_detach(dev)); -} - static int acpi_syscont_alloc_msi(device_t bus, device_t dev, int count, int maxcount, int *irqs) diff --git a/sys/dev/adb/adb_bus.c b/sys/dev/adb/adb_bus.c index ac09231fb914..144cce51b9f4 100644 --- a/sys/dev/adb/adb_bus.c +++ b/sys/dev/adb/adb_bus.c @@ -43,7 +43,6 @@ static int adb_bus_probe(device_t dev); static int adb_bus_attach(device_t dev); -static int adb_bus_detach(device_t dev); static void adb_bus_enumerate(void *xdev); static void adb_probe_nomatch(device_t dev, device_t child); static int adb_print_child(device_t dev, device_t child); @@ -58,7 +57,7 @@ static device_method_t adb_bus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, adb_bus_probe), DEVMETHOD(device_attach, adb_bus_attach), - DEVMETHOD(device_detach, adb_bus_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), @@ -189,11 +188,6 @@ adb_bus_enumerate(void *xdev) config_intrhook_disestablish(&sc->enum_hook); } -static int adb_bus_detach(device_t dev) -{ - return (bus_generic_detach(dev)); -} - static void adb_probe_nomatch(device_t dev, device_t child) { diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c index 55122edd16cc..b3446445901d 100644 --- a/sys/dev/mdio/mdio.c +++ b/sys/dev/mdio/mdio.c @@ -59,14 +59,6 @@ mdio_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -mdio_detach(device_t dev) -{ - - bus_generic_detach(dev); - return (0); -} - static int mdio_readreg(device_t dev, int phy, int reg) { @@ -108,7 +100,7 @@ static device_method_t mdio_methods[] = { DEVMETHOD(device_identify, mdio_identify), DEVMETHOD(device_probe, mdio_probe), DEVMETHOD(device_attach, mdio_attach), - DEVMETHOD(device_detach, mdio_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), /* bus interface */ From nobody Thu Feb 27 14:17:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YML2gkRz5qGFX; Thu, 27 Feb 2025 14:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YML2D1Vz3xXW; Thu, 27 Feb 2025 14:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EUDEZhQcxZnjWG56B1tQAXwYAa1s9dJdZCY5MRIHG5s=; b=Q4bMrWk9lW3rae4dUI+WW3OlEG9/+OV6n9INukZuXJifzdBkWBUoLhr2PHQ2kaWl7iiZQB CxN2eDnpVRdIT0yM23UThRXixSMkGuLA+NMHszddEyKatQP2zDnpK3qLLUuMgo5rXRMiDw qvnz1GuvhbH+0VxZWLcrWRL4c2w7gF2VM5/DVF/I8jssLqzy6tYEpjMXeYYQfW4xKITqM7 ttzpqXK7yBcs9oOFsAl392Z2dxvXAJ9zPnnCiBpCGLwcIvfqQ8q8C2nVrltNZ/eC9yP9ny t363w3UmP914YmHKJ0xiJwYPLPd/0ehP5HGaCASwf1rhN+5jTLG3N2jOeh+Yjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665854; a=rsa-sha256; cv=none; b=Hun1SrbGefuFXDb7ezDTF39kZZHx+ntoj5SYdQWoCiS0LrO/tqC7fXZsbw912L2VjyNrkV SVq64Kcs43j1AKFcdcfghNZaJSTdf67wdd1PM3zX/NtOCX7BOYHA5oFRYecTZuQuVcAYop AON/P0fW/hplSK0mxmPGJh8TUJnqxxGmR6Ud3y8ssudh5awNEz4cJ5A1EJCOZyLAUjzBrg xMVIhQk/eOigZkAwieMWKmgtLCVl4t7/0exaJaKJhMHtjz3SnnhP0LD2Bi1n9+dnQX0ofZ B/6Nje32sGZ42UmIXaxUXVweW3XN/WQnhqlfw0H68RVWdf9F+0+ePOKSaYDo6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EUDEZhQcxZnjWG56B1tQAXwYAa1s9dJdZCY5MRIHG5s=; b=Q4pdg8tjjfsOU4kOgrSkviijqumage6dcv1ipUA8luhk8hN4j+Jul+kRs/iR0AiDxcR8Be 1Mbi5HtS8SuGgxPVWpjjKu7BYSW819XXd9et2TWslyJ8gbSv21gEHk9K5vTwSsmdsXQw3U bKduI51Y9oA16LCO7i5vp0r/B024HGwjaRU/Vz7PdlQlLSiy2nfDkXxCkewiGs1n9KjV1M m5CX5DjlUbIW9GzrDCismgEA/HKUWMXb8hurOVqlLdzRNZXmIB0KfauGA0KNXNJP3uAjX0 nuacSRhsFZj5716ME+6iXnrrPCjLFJqeqFAZ4sT9Vjq3K0iW6p0wwAtDUWRW5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YML1cTbzm7S; Thu, 27 Feb 2025 14:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHYxr017607; Thu, 27 Feb 2025 14:17:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHY3C017604; Thu, 27 Feb 2025 14:17:34 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:34 GMT Message-Id: <202502271417.51REHY3C017604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 59cec1382dd8 - stable/14 - pci: Renove #ifdef PCI_IOV from declarations now used unconditionally List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 59cec1382dd81b816d4c98c185350b08b9d39fb3 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=59cec1382dd81b816d4c98c185350b08b9d39fb3 commit 59cec1382dd81b816d4c98c185350b08b9d39fb3 Author: Jessica Clarke AuthorDate: 2024-08-08 22:35:09 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:24 +0000 pci: Renove #ifdef PCI_IOV from declarations now used unconditionally Fixes: 971c9f57d7e6 ("pci: Narrow the scope of recently-added PCI_IOV #ifdefs") (cherry picked from commit 104ee24349c033b63a50bd89ddc431a0d3ef9902) --- sys/dev/pci/pci_private.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index d3dd41abdb62..f4164f32293b 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -65,16 +65,12 @@ bus_get_dma_tag_t pci_get_dma_tag; bus_get_resource_list_t pci_get_resource_list; bus_delete_resource_t pci_delete_resource; bus_alloc_resource_t pci_alloc_resource; -#ifdef PCI_IOV bus_adjust_resource_t pci_adjust_resource; -#endif bus_release_resource_t pci_release_resource; bus_activate_resource_t pci_activate_resource; bus_deactivate_resource_t pci_deactivate_resource; -#ifdef PCI_IOV bus_map_resource_t pci_map_resource; bus_unmap_resource_t pci_unmap_resource; -#endif bus_child_deleted_t pci_child_deleted; bus_child_detached_t pci_child_detached; bus_child_pnpinfo_t pci_child_pnpinfo_method; From nobody Thu Feb 27 14:17:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM82ZCbz5qFxD; Thu, 27 Feb 2025 14:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM828jtz3xRy; Thu, 27 Feb 2025 14:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eTaOfm1QqJ+o43VfMWgKMmhMLO6obV4gBVAsGkYoo1U=; b=t8QswPO23i3MpGv33xOjql94uCaG1pTh2g9sIGa0p1WM+oEDCWAVg8fpXiS/ZMBtOXJ5xf DYdN3qCsV2bTIxCHNHNNq7iTsReWo1RNYB+w0sZ8ru0LlADueGeJHwklMvqs6d/Hq+NUBJ zljwXxwwRdYDJ0zYIQEsqK+BoysjwkQLrCHkaWaS2pr8g059GOHe0aIg6q3CH/2g4p8tL2 M3rn7fJKO/yIKElzHy20+8vE3tgMRXPWKwbX+6jm6EWB40lCnPGI4gyhKFCe1Mpcmb75WI k9NMoWSe5nfJl6i74B5Kwu7h5QOiATs8yUDZG63yY56QiWzmOSj38TVnoEkIhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665844; a=rsa-sha256; cv=none; b=oXgqgcbqTQ7/LPfdgJrtV+tchWaadTuI5oy+uHLkSmcAR3b0BlMNim4JA7hETRBYGoLnn3 inM1w627Div9GTGmHO+vdC9yuzWfIWHWk6uNZh7ZZFmZFtMbXMCwdH+dWic46UHuLNAJNW IFj8f+kHkslNj6yKwfdd74s0mUOn5kLvBoUHbZ6UtfZ9tSbNVqvl8YrEjkK7l8yhIipVSy xVB/H0a5w99mFdXfYsa0ocoFddVG3/mJA/pJhy/89jaYlUmdJOxNk/tp4YukFg1RjFzdRl mwgi+8Qk4T17xoCXhLdEWIwe6UUBJmQyAX+xVF3dkvGwXprhKY7gttS1U3+qmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eTaOfm1QqJ+o43VfMWgKMmhMLO6obV4gBVAsGkYoo1U=; b=HK+jFaMna9EdL4fOP5n1m2JRdi0pcV2JOrXBw9/U+0bto9UtE0BovDjxnszGeM/gdBfPHV BgeHAdCn/IP/DAQBKoc2Wk44/6AJSqg3RGCbOTf1m33MvtEFcjZZJeKnb76XuHVf+gI2O3 YCPEvIUxkBEt9jaP1HdMSP41salZnYulpn/cHu9DuclUMuwecK2AL2Z4b5w8EJkPx8PXob 81gVynbUpg2CrqMFZ6edGbRBN1ZASuOcHHuqg5VUJUhloAPuK111jjrc9bFv4qgDVjByQk 2dnHBUBqbeRiucBkEEkqkj/+ohD/03gMcCMZDVcvg2NOd83rI/tlxhEtpbu6QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM81g4XzmqW; Thu, 27 Feb 2025 14:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHORw017300; Thu, 27 Feb 2025 14:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHOec017296; Thu, 27 Feb 2025 14:17:24 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:24 GMT Message-Id: <202502271417.51REHOec017296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d172f42e4ba7 - stable/14 - Bump __FreeBSD_version for bus resource API change List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d172f42e4ba7ba8542ae0866aaba56e329b4ea2c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d172f42e4ba7ba8542ae0866aaba56e329b4ea2c commit d172f42e4ba7ba8542ae0866aaba56e329b4ea2c Author: John Baldwin AuthorDate: 2024-03-13 22:14:23 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 Bump __FreeBSD_version for bus resource API change Specifically, the change to remove redundant rid and type arguments from bus_* when passing an allocated struct resource. (cherry picked from commit a7b9f4d96e8bdc30db27ec7a193a8d8fdf7c652c) --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 3103da173f47..0e91a65170df 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1402501 +#define __FreeBSD_version 1402502 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Feb 27 16:55:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3csy2l90z59J84; Thu, 27 Feb 2025 16:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3csy2R2rz45wl; Thu, 27 Feb 2025 16:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yZ9ZCv4HFF79n7mhRqgNjcFMbEKdN8+UKw0rZjWFBLE=; b=mwyA7v9uBXoS7NmE3RIq3httG2DDZfOelqM4omjGc71k9tUdrj6pjWd/QuKfe7KR+Qe7Hq dbSXMetaq7aa3dhwxBQv3EhPrIsiXtXuk7HAxz8oiX73dCB5Ll4WALDLqojatGYSb/wFp8 Nh6Jh6UcP6PXHkeglMueK3q/b27GrDbnOv/2sWb2IodYlfpFe1AHQ/x0smkw3x0G4fWfy7 W5cx8keLfHyIgjeF5iBMscufIzmkt/XhsbcG87eUfAodM6XEjs93QOHsj33YcmLVVgD2ee mcTFW7irKMU7ErzasD5jqRrS+XaSGN3B1S2J/0axyaCJtMp80cxe+VHQJjNZGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675350; a=rsa-sha256; cv=none; b=hcLUeziTmnOaosuwR9+uJp+REA6CZBSrHgGGWGClzhQQQ7gezY0MaUv3gmKrISSNyZ+Wom O1bw63dwDTYVdi1wgrLCrN0pC0zphdj5DwFw3nfczamhAXBHbio/Wqb0NHcrcdszj8x+DZ xXUHgXQq1jBzY83y6yDNEWs+0FPQ2Rd/fV+KJBpbxZXb3oUzE0zWzl1AjByaT9nDUS9CY8 /xAYp5+u1QyflLzGHytNvAfnmFo7ysSvAmUa7McEJHWrozCx3Oaq4M02KhHh0g5gDJho2x T5kpcrHHXk/ylPoix6GK0IOQL1f2zf6pXMLbVQ48FSa6pTw52yzu5rqZcF/MBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yZ9ZCv4HFF79n7mhRqgNjcFMbEKdN8+UKw0rZjWFBLE=; b=PG0qflSXfssADMr/hrhpO00FGmRgb5Ef4EQii2NenDERNSY1yw0QOdA5BwNrCa3hVvJKQA z+39OAD5jECAJu3irLYWU+li0pdK6NC4jokBfTcFt5xjGn3GeAc8kT+FYbxKyxX/aYewhh GgkGhwc1OOvwRZggscHVXGsENm4KuQZKjMbIfWX8MQubd7EW/mWlciu7gAeHQK+5lj5E+I tN1tFGEdnDiN6Z/w8JUy0iyTT30V+b9ojhFO1kWalSVBe8wSt6mP70r9t2ctAxAqt4jhiv RCQY2S3IEtFpxmteR7zdRkN8hOBUHPboGKSX7fZq31a20vNcGFF7pAxDS0yHlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3csy1yCFzrGl; Thu, 27 Feb 2025 16:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtoWo016883; Thu, 27 Feb 2025 16:55:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtowk016880; Thu, 27 Feb 2025 16:55:50 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:50 GMT Message-Id: <202502271655.51RGtowk016880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1ab14e185ae1 - stable/14 - Check for errors when detaching children first, not last List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ab14e185ae192e7be26fb9d10be1a8db315972b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1ab14e185ae192e7be26fb9d10be1a8db315972b commit 1ab14e185ae192e7be26fb9d10be1a8db315972b Author: John Baldwin AuthorDate: 2024-11-05 01:30:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:17:49 +0000 Check for errors when detaching children first, not last These detach routines in these drivers all ended with 'return (bus_generic_detach())' meaning that if any child device failed to detach, the parent driver was left in a mostly destroyed state, but still marked attached. Instead, bus drivers should detach child drivers first and return errors before destroying driver state in the parent. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47387 (cherry picked from commit d412c07617eb35435668b024bc2cecda05f57f1f) --- sys/arm/nvidia/as3722.c | 7 ++++++- sys/arm/nvidia/drm2/tegra_dc.c | 7 ++++++- sys/arm/nvidia/drm2/tegra_hdmi.c | 8 +++++++- sys/arm/nvidia/drm2/tegra_host1x.c | 7 ++++++- sys/arm/nvidia/tegra_abpmisc.c | 7 ++++++- sys/arm/nvidia/tegra_efuse.c | 7 ++++++- sys/arm/nvidia/tegra_i2c.c | 7 ++++++- sys/arm/nvidia/tegra_mc.c | 7 ++++++- sys/arm/nvidia/tegra_rtc.c | 7 ++++++- sys/arm/ti/ti_adc.c | 7 ++++++- sys/arm64/nvidia/tegra210/max77620.c | 7 ++++++- sys/arm64/nvidia/tegra210/max77620_rtc.c | 7 ++++++- sys/dev/dwwdt/dwwdt.c | 7 ++++++- sys/dev/ena/ena.c | 6 +++++- sys/dev/fdt/simplebus.c | 7 ++++++- sys/dev/gve/gve_main.c | 7 ++++++- sys/dev/iicbus/pmic/act8846.c | 7 ++++++- sys/dev/mana/gdma_main.c | 7 ++++++- sys/powerpc/mpc85xx/pci_mpc85xx.c | 7 ++++++- sys/powerpc/powermac/cuda.c | 7 ++++++- sys/powerpc/powermac/pmu.c | 7 ++++++- 21 files changed, 126 insertions(+), 21 deletions(-) diff --git a/sys/arm/nvidia/as3722.c b/sys/arm/nvidia/as3722.c index 537cd4f6e24a..1feb6d400aa8 100644 --- a/sys/arm/nvidia/as3722.c +++ b/sys/arm/nvidia/as3722.c @@ -343,6 +343,11 @@ static int as3722_detach(device_t dev) { struct as3722_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -351,7 +356,7 @@ as3722_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm/nvidia/drm2/tegra_dc.c b/sys/arm/nvidia/drm2/tegra_dc.c index f086570e3f09..f79cb76aa10d 100644 --- a/sys/arm/nvidia/drm2/tegra_dc.c +++ b/sys/arm/nvidia/drm2/tegra_dc.c @@ -1394,6 +1394,11 @@ static int dc_detach(device_t dev) { struct dc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -1413,7 +1418,7 @@ dc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_dc_methods[] = { diff --git a/sys/arm/nvidia/drm2/tegra_hdmi.c b/sys/arm/nvidia/drm2/tegra_hdmi.c index 641787a40e71..16454601ec13 100644 --- a/sys/arm/nvidia/drm2/tegra_hdmi.c +++ b/sys/arm/nvidia/drm2/tegra_hdmi.c @@ -1273,6 +1273,12 @@ static int hdmi_detach(device_t dev) { struct hdmi_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); + sc = device_get_softc(dev); TEGRA_DRM_DEREGISTER_CLIENT(device_get_parent(sc->dev), sc->dev); @@ -1295,7 +1301,7 @@ hdmi_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_hdmi_methods[] = { diff --git a/sys/arm/nvidia/drm2/tegra_host1x.c b/sys/arm/nvidia/drm2/tegra_host1x.c index 7d5044d5403b..84f6229e76ca 100644 --- a/sys/arm/nvidia/drm2/tegra_host1x.c +++ b/sys/arm/nvidia/drm2/tegra_host1x.c @@ -587,6 +587,11 @@ static int host1x_detach(device_t dev) { struct host1x_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -609,7 +614,7 @@ host1x_detach(device_t dev) if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t host1x_methods[] = { diff --git a/sys/arm/nvidia/tegra_abpmisc.c b/sys/arm/nvidia/tegra_abpmisc.c index 88f9ecde3f31..1f54a918f63b 100644 --- a/sys/arm/nvidia/tegra_abpmisc.c +++ b/sys/arm/nvidia/tegra_abpmisc.c @@ -166,13 +166,18 @@ static int tegra_abpmisc_detach(device_t dev) { struct tegra_abpmisc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->abp_misc_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->abp_misc_res); if (sc->strap_opt_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 1, sc->strap_opt_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_abpmisc_methods[] = { diff --git a/sys/arm/nvidia/tegra_efuse.c b/sys/arm/nvidia/tegra_efuse.c index 7c88bcb3fe03..a7af16504ab3 100644 --- a/sys/arm/nvidia/tegra_efuse.c +++ b/sys/arm/nvidia/tegra_efuse.c @@ -500,6 +500,11 @@ static int tegra_efuse_detach(device_t dev) { struct tegra_efuse_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); dev_sc = NULL; @@ -510,7 +515,7 @@ tegra_efuse_detach(device_t dev) if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_efuse_methods[] = { diff --git a/sys/arm/nvidia/tegra_i2c.c b/sys/arm/nvidia/tegra_i2c.c index 6b68b859a037..94e130ec3623 100644 --- a/sys/arm/nvidia/tegra_i2c.c +++ b/sys/arm/nvidia/tegra_i2c.c @@ -740,6 +740,11 @@ static int tegra_i2c_detach(device_t dev) { struct tegra_i2c_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); tegra_i2c_hw_init(sc); @@ -753,7 +758,7 @@ tegra_i2c_detach(device_t dev) LOCK_DESTROY(sc); if (sc->iicbus) device_delete_child(dev, sc->iicbus); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm/nvidia/tegra_mc.c b/sys/arm/nvidia/tegra_mc.c index bad75f274af0..4c567657a96b 100644 --- a/sys/arm/nvidia/tegra_mc.c +++ b/sys/arm/nvidia/tegra_mc.c @@ -280,6 +280,11 @@ static int tegra_mc_detach(device_t dev) { struct tegra_mc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -290,7 +295,7 @@ tegra_mc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_mc_methods[] = { diff --git a/sys/arm/nvidia/tegra_rtc.c b/sys/arm/nvidia/tegra_rtc.c index b489967c946e..d2cc4d29f202 100644 --- a/sys/arm/nvidia/tegra_rtc.c +++ b/sys/arm/nvidia/tegra_rtc.c @@ -266,6 +266,11 @@ static int tegra_rtc_detach(device_t dev) { struct tegra_rtc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -276,7 +281,7 @@ tegra_rtc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_rtc_methods[] = { diff --git a/sys/arm/ti/ti_adc.c b/sys/arm/ti/ti_adc.c index 5a3a337afff5..d13dd87001de 100644 --- a/sys/arm/ti/ti_adc.c +++ b/sys/arm/ti/ti_adc.c @@ -915,6 +915,11 @@ static int ti_adc_detach(device_t dev) { struct ti_adc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -938,7 +943,7 @@ ti_adc_detach(device_t dev) if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t ti_adc_methods[] = { diff --git a/sys/arm64/nvidia/tegra210/max77620.c b/sys/arm64/nvidia/tegra210/max77620.c index a27edf01889d..47a7ca343067 100644 --- a/sys/arm64/nvidia/tegra210/max77620.c +++ b/sys/arm64/nvidia/tegra210/max77620.c @@ -450,6 +450,11 @@ static int max77620_detach(device_t dev) { struct max77620_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -458,7 +463,7 @@ max77620_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm64/nvidia/tegra210/max77620_rtc.c b/sys/arm64/nvidia/tegra210/max77620_rtc.c index b3ef0fd8da79..26e611ef20e6 100644 --- a/sys/arm64/nvidia/tegra210/max77620_rtc.c +++ b/sys/arm64/nvidia/tegra210/max77620_rtc.c @@ -367,11 +367,16 @@ static int max77620_rtc_detach(device_t dev) { struct max77620_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } /* diff --git a/sys/dev/dwwdt/dwwdt.c b/sys/dev/dwwdt/dwwdt.c index e1787bb549ca..b5eb6138db93 100644 --- a/sys/dev/dwwdt/dwwdt.c +++ b/sys/dev/dwwdt/dwwdt.c @@ -309,6 +309,7 @@ static int dwwdt_detach(device_t dev) { struct dwwdt_softc *sc = device_get_softc(dev); + int error; if (dwwdt_started(sc)) { /* @@ -318,6 +319,10 @@ dwwdt_detach(device_t dev) return (EBUSY); } + error = bus_generic_detach(dev); + if (error != 0) + return (error); + EVENTHANDLER_DEREGISTER(watchdog_list, sc->sc_evtag); sc->sc_evtag = NULL; @@ -337,7 +342,7 @@ dwwdt_detach(device_t dev) sc->sc_mem_res); } - return (bus_generic_detach(dev)); + return (0); } static int diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index e9d4530e9085..f0b6cec1bb61 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -4030,6 +4030,10 @@ ena_detach(device_t pdev) return (EBUSY); } + rc = bus_generic_detach(pdev); + if (rc != 0) + return (rc); + ether_ifdetach(adapter->ifp); ifmedia_removeall(&adapter->media); @@ -4096,7 +4100,7 @@ ena_detach(device_t pdev) free(ena_dev, M_DEVBUF); - return (bus_generic_detach(pdev)); + return (0); } /****************************************************************************** diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index 4c6f5921b713..6868dd9cf4bb 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -203,12 +203,17 @@ int simplebus_detach(device_t dev) { struct simplebus_softc *sc; + int rv; + + rv = bus_generic_detach(dev); + if (rv != 0) + return (rv); sc = device_get_softc(dev); if (sc->ranges != NULL) free(sc->ranges, M_DEVBUF); - return (bus_generic_detach(dev)); + return (0); } void diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index e40f77b08e85..0e40656ca928 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -861,6 +861,11 @@ gve_detach(device_t dev) { struct gve_priv *priv = device_get_softc(dev); if_t ifp = priv->ifp; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); ether_ifdetach(ifp); @@ -877,7 +882,7 @@ gve_detach(device_t dev) taskqueue_free(priv->service_tq); if_free(ifp); - return (bus_generic_detach(dev)); + return (0); } static device_method_t gve_methods[] = { diff --git a/sys/dev/iicbus/pmic/act8846.c b/sys/dev/iicbus/pmic/act8846.c index af3ee0ede5e5..f0963e5d2d45 100644 --- a/sys/dev/iicbus/pmic/act8846.c +++ b/sys/dev/iicbus/pmic/act8846.c @@ -226,11 +226,16 @@ static int act8846_detach(device_t dev) { struct act8846_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t act8846_methods[] = { diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 70985f4fbf65..b9316e872816 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -1879,6 +1879,11 @@ static int mana_gd_detach(device_t dev) { struct gdma_context *gc = device_get_softc(dev); + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); mana_remove(&gc->mana); @@ -1890,7 +1895,7 @@ mana_gd_detach(device_t dev) pci_disable_busmaster(dev); - return (bus_generic_detach(dev)); + return (0); } diff --git a/sys/powerpc/mpc85xx/pci_mpc85xx.c b/sys/powerpc/mpc85xx/pci_mpc85xx.c index 7409d8c4e07b..4f58c9e55626 100644 --- a/sys/powerpc/mpc85xx/pci_mpc85xx.c +++ b/sys/powerpc/mpc85xx/pci_mpc85xx.c @@ -674,12 +674,17 @@ static int fsl_pcib_detach(device_t dev) { struct fsl_pcib_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); mtx_destroy(&sc->sc_cfg_mtx); - return (bus_generic_detach(dev)); + return (0); } static int diff --git a/sys/powerpc/powermac/cuda.c b/sys/powerpc/powermac/cuda.c index 97f60f269559..f134f0e17663 100644 --- a/sys/powerpc/powermac/cuda.c +++ b/sys/powerpc/powermac/cuda.c @@ -260,6 +260,11 @@ cuda_attach(device_t dev) static int cuda_detach(device_t dev) { struct cuda_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -268,7 +273,7 @@ static int cuda_detach(device_t dev) { bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memr); mtx_destroy(&sc->sc_mutex); - return (bus_generic_detach(dev)); + return (0); } static uint8_t diff --git a/sys/powerpc/powermac/pmu.c b/sys/powerpc/powermac/pmu.c index f9d9d4d40c72..07ebfdf8aad3 100644 --- a/sys/powerpc/powermac/pmu.c +++ b/sys/powerpc/powermac/pmu.c @@ -525,6 +525,11 @@ static int pmu_detach(device_t dev) { struct pmu_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -536,7 +541,7 @@ pmu_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memr); mtx_destroy(&sc->sc_mutex); - return (bus_generic_detach(dev)); + return (0); } static uint8_t From nobody Fri Feb 28 00:54:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3qVB0cV4z5Jtwx; Fri, 28 Feb 2025 00:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3qVB022Nz3Lhq; Fri, 28 Feb 2025 00:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740704066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HR750Z3sdCJVOLQEHS7hjm5QlrRe/8ziK5ifxZRoFEo=; b=fmhCNzRPrvC7LbNNeGg2vbthv2Usuqj01C/lb1T04x7sKAohOUB4DxA/BErGdjdTf0Ra46 KPMEOtvs/BYir7DliaVLKSBUkjc9WJD5SGR3eMB/cTfUY3WEHxDOma+jw5HwPsfrqdiS24 Lta15YsQ9mHud2Lme8XJN7vS9ZTe/vD9F3mYOCPdMumRxkZ9iENkgozmurVGH/XOttYOxk 53/pwRp4g1+7PMWsc7Ss/ch0vD/zpgyxGmPjGmnHmOvYvVUBnKAF918AvE6cJ3LFAa9D6/ KS779n6lqN6QUzLm+YZlEzB9pLaZwWoZdAGGHgjoTXvhoUEE0WX7lsSvkJOnGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740704066; a=rsa-sha256; cv=none; b=opB1FFsltRQPijtZsxO5/GlRYM3ykX6VxSSnNglN/tI/pGHdrQVJN7YGB33QMT3hLU872Z npZzzKh6sTpHjFeX5V0iyfYBUynzt5UxhX52vaG9LDU4kg6pD90VPAjbdJezEDocfyylF2 SvKtJAQyawRJp05zPCR0gqH8O/zavfL/Ch2dIvbXqljee8vCzAg/6Yl3+gZkYEhp9tUjoc s7RrosGW9Z4O9r9vzN1xHAWN6LrRcABiVrdf8Pnbtw7BisGz5TzwpeFJT+WyVZtKc1b6l9 FkVHa7rwKRR5RWJoABUZbmw0qyEB0odL0x6ucRqk1B+nEhuWxEBex390FHBXGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740704066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HR750Z3sdCJVOLQEHS7hjm5QlrRe/8ziK5ifxZRoFEo=; b=uFmRzGNPLLGKO44RcLxRqxVAEzBHsnoShy9I1b6A6UqsR+95h91+pJGLdZj2Pr4FqM6hsW 3E2mE8K7VO271LOUr4lf/AwShfsWzHFyCnFmGtrLe+QcGkKReb3har22tTio1ur456vx/B PWKBikdWoK+xItT+dR47d31HcmjIY/IcfCdkkg7uLuy7KlW8EUhEg90cSkF6UIo/YI0YSl aCcM8/KPnqlx4N2WFlcCVxLZKPf03gIn9aZebLDQIsCITrVdiPcHpc9Z/t17Oi553gED/N FKjsgmI9ExnxHExhu4GOqIQT5FexjvS2CgNJg9VlDD4d/3ZUC/wvZ5SEPE2IRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3qV96Q46z152M; Fri, 28 Feb 2025 00:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S0sPvJ015015; Fri, 28 Feb 2025 00:54:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S0sPQO015012; Fri, 28 Feb 2025 00:54:25 GMT (envelope-from git) Date: Fri, 28 Feb 2025 00:54:25 GMT Message-Id: <202502280054.51S0sPQO015012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: a24b044a1e3b - releng/13.5 - 13.5: Update to RC1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: a24b044a1e3b2bca2a4ebaa048d388158d6d1a14 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=a24b044a1e3b2bca2a4ebaa048d388158d6d1a14 commit a24b044a1e3b2bca2a4ebaa048d388158d6d1a14 Author: Colin Percival AuthorDate: 2025-02-28 00:48:37 +0000 Commit: Colin Percival CommitDate: 2025-02-28 00:48:37 +0000 13.5: Update to RC1 Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index fee92b14d847..7d74035f3adf 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="BETA3" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Feb 27 14:17:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YMJ0pRnz5qG2R; Thu, 27 Feb 2025 14:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMJ06chz3xXS; Thu, 27 Feb 2025 14:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcmeIKxE9R4ObTfG7gMl9/tMdA9kbnWJg7EbGBpLhwE=; b=xvUJtPsMXI8cBle9P/QfN3r4u07n6gJn4zwovjjcgBu2rqywzlaWrJJ/V0zxMBwyeHemcd /Hnvl1QKwliaBxziVz3vgMkQtOAS5BlT4M5+MvE0qHMxwlbhK5bbWOOIxYqlNUsEJNcS7O 44hOCS3DuzvEHkWc9O7bXBNvFCjG2G0P9SYgbsCfI8e9Rk6Bir++OqKBH85n9ZtPMlR4VT H5DW4U3F9zm0ChqKGmykGrbf3qhNwR+DdTnAtx/lpw8JDSp8DzZC6+/EhbF/tivqfLbgfr mDVBqiD1F0UMwJUTdth2hm1GGjOieMdsQbOjctQR34xEx+//JhTFUIAqilkV/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665852; a=rsa-sha256; cv=none; b=gHNZHUHVgwNb/mt085z2ny4SZytNSa8f576OZ4RfU+iIWCYfKmoQF3fYrgnT7PfILvVJAX 720ucC7h3zsliGwutE2OX9ykrJv3yfhD9WdJnCawb9yJyvQXEz23S3flj+DfGg9bi4JDA1 +VUcv2W78zt3eAEtKqfUMhm98IaGdgYKTHVR2TQ0S8MFXWPAfkupSQUyQIhn4Ta79EcOij 0h4aXqgFIjTZcRUsqAJgre9qlCi1Oh19p4vf1seMYQ7CG+p0Vk5/NZMBn72XzOJV6RLLWO 1VbLgjKqIwxPEs+8s3kInDl3eGfa2kxe+ZjoULhY7qeRGV0qpMM48cIuPb5rrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcmeIKxE9R4ObTfG7gMl9/tMdA9kbnWJg7EbGBpLhwE=; b=AjCuEz6AaNtMHSKYMSj28xPDurCc84BHnnr7tC+MfRJdvyetEFO2AyPgjsZOKuugwXbAkk LawfcUVsrWU6/VMaIXxWyhTvJC5YlCPO7xqR0K7AKgB3bAHgAKVggnmPfPIFlDwieJDwBp +uEf75lh3QEaMY44+q25mqGP2T58apoTAZxHqARtA2rCvecn53ngtCvrY8VWuUDSWKKjqu 6EZP5TeDiVgcCAXrIoNvr9iwJnBWmXWwCARo8UBLWUuO0u+rCufPUwLqHbAKW0wXrLUNAQ d6vE4KpTN7naN5zzX1I786S8ZMk1qAJzwTc/OLmZQgmhbcqeu0dueTQmqLuMzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YMH6qYtzmQK; Thu, 27 Feb 2025 14:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHVop017539; Thu, 27 Feb 2025 14:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHVPJ017536; Thu, 27 Feb 2025 14:17:31 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:31 GMT Message-Id: <202502271417.51REHVPJ017536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 60662799b126 - stable/14 - pci: Only add special VF handling for direct children in bus methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 60662799b1268ddbed2896223a77493b8def436c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=60662799b1268ddbed2896223a77493b8def436c commit 60662799b1268ddbed2896223a77493b8def436c Author: John Baldwin AuthorDate: 2024-06-05 16:50:05 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci: Only add special VF handling for direct children in bus methods For activate/deactivate resource, use a more standard check at the start of the function since the addition of the PCI_IOV code made this more complex. For the three recently added methods, just add the typical check at the beginning that I missed. This wasn't always fatal as if your system only had PCI device_t's as children of PCI bus devices it would happen to work ok, but if you have a non-PCI child device (e.g. an ATA channel) then dereferencing ivars for non-direct-children could fault. Reported by: Cirrus-CI (via emaste) Reviewed by: emaste Fixes: 871b33ad65ba pci: Consistently use pci_vf_* for suballocated VF memory resources Differential Revision: https://reviews.freebsd.org/D45499 (cherry picked from commit 56b822a17cde5940909633c50623d463191a7852) --- sys/dev/pci/pci.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 8ff31beca696..4be3210840fc 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -5702,6 +5702,10 @@ pci_activate_resource(device_t dev, device_t child, int type, int rid, struct pci_devinfo *dinfo; int error; + if (device_get_parent(child) != dev) + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + dinfo = device_get_ivars(child); #ifdef PCI_IOV if (dinfo->cfg.flags & PCICFG_VF) { @@ -5724,18 +5728,17 @@ pci_activate_resource(device_t dev, device_t child, int type, int rid, if (error) return (error); + /* Device ROMs need their decoding explicitly enabled. */ + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) + pci_write_bar(child, pci_find_bar(child, rid), + rman_get_start(r) | PCIM_BIOS_ENABLE); + /* Enable decoding in the command register when activating BARs. */ - if (device_get_parent(child) == dev) { - /* Device ROMs need their decoding explicitly enabled. */ - if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) - pci_write_bar(child, pci_find_bar(child, rid), - rman_get_start(r) | PCIM_BIOS_ENABLE); - switch (type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - error = PCI_ENABLE_IO(dev, child, type); - break; - } + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + error = PCI_ENABLE_IO(dev, child, type); + break; } return (error); } @@ -5747,6 +5750,10 @@ pci_deactivate_resource(device_t dev, device_t child, int type, struct pci_devinfo *dinfo; int error; + if (device_get_parent(child) != dev) + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + dinfo = device_get_ivars(child); #ifdef PCI_IOV if (dinfo->cfg.flags & PCICFG_VF) { @@ -5771,11 +5778,9 @@ pci_deactivate_resource(device_t dev, device_t child, int type, return (error); /* Disable decoding for device ROMs. */ - if (device_get_parent(child) == dev) { - if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) - pci_write_bar(child, pci_find_bar(child, rid), - rman_get_start(r)); - } + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) + pci_write_bar(child, pci_find_bar(child, rid), + rman_get_start(r)); return (0); } @@ -5786,6 +5791,10 @@ pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, { struct pci_devinfo *dinfo; + if (device_get_parent(child) != dev) + return (bus_generic_adjust_resource(dev, child, type, r, start, + end)); + dinfo = device_get_ivars(child); if (dinfo->cfg.flags & PCICFG_VF) { switch (rman_get_type(r)) { @@ -5809,6 +5818,10 @@ pci_map_resource(device_t dev, device_t child, int type, struct resource *r, { struct pci_devinfo *dinfo; + if (device_get_parent(child) != dev) + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + dinfo = device_get_ivars(child); if (dinfo->cfg.flags & PCICFG_VF) { switch (rman_get_type(r)) { @@ -5832,6 +5845,9 @@ pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, { struct pci_devinfo *dinfo; + if (device_get_parent(child) != dev) + return (bus_generic_unmap_resource(dev, child, type, r, map)); + dinfo = device_get_ivars(child); if (dinfo->cfg.flags & PCICFG_VF) { switch (rman_get_type(r)) { From nobody Thu Feb 27 14:17:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLy0ngvz5qG9s; Thu, 27 Feb 2025 14:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLy0DzCz3xBC; Thu, 27 Feb 2025 14:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VYTropdEDUYsxQnEzH7426OkbyxfL8u8JBGnDguToqE=; b=vm6+r6hcCT1QJUZdRwAp20h6BuYjzm3+9949MzKqL1MV685ACdFz9uRCRp3bR6bfbLJESn ceHeDoH8M6X+7Bxxq9NHUYH9NUZHom3HPwZp2xDBKeek3txWMLYTNvaeNb0DNhF8HDrbFm eqRwJgis62mqCZ4E+b7MD/WmLLZB78anvuUCSkv9HBLLjI2WRvFQaBqg/aHJ3wZfObTZm2 O77c2VU5dyyi6YwfXtT2ey2wy6YYf3VFqtB2yTF9o9j+iTS3pobBGg/UN7sUt+CyTkdkgV tcCBIwGnsBbCRkO8NZeRbb+4bqcYZIIqKFgXMAd8dz0JyExecI9EIsD2CFBzYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665834; a=rsa-sha256; cv=none; b=JYUlwhobY1TufSMv1nnJNjMk/lI1v29Jsh3mlH4bfvoCTa8QVhNuCLzUZwgL0gCxhIRPoW dJa0e7wNZlCWBGEeBFMNWfXd734ZzDh89u8qK3xXc8MkpUQ8WV1Lkc3izipPJKptzQJzVG jYX3zaO3n+KfiBcqilYBes5c8ozsji8WTENUz8Adcq6tQa3wUDkNF9eft4eiDrMpD4ME6P 4AsY/s9IRLGCxVm6Pm92HXLJNRGC0ziQsrGzd3v0IEbHx5ac/Khe/Tx3zzqAKR9qxeeEdn b6srsZCQTUPS4lN1S9IXQz0tMSNTs7UoFRRWEUQl91YW6uiAdOckUSWXxUG0/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VYTropdEDUYsxQnEzH7426OkbyxfL8u8JBGnDguToqE=; b=WbLXPhoki5WKbdpwMKmYX+Fmo9Hh+cSXpC+K0Elml8yP7oxSV9pvVyblcymwWg2Hb6EaLj tQjOofmIFlElDgS0JecEDdNHE517a8hu1NjYntP6wK1hJSltTxyxBRGv3L5as9uOKqtR6c /nKqabKhzAG6lNttY2YvCnRUHE4MAJGrzou9G5j02r6mymqrIEQLHqqszHo33wpt2zyVLG F79c3SmozINrwfhL70jICOBY9NNJQh5ci7MULZkbNdTPYdflCahNWsqNG3xxzAR3A0oe0B umDwGrLNp3A4R3fuHOAWTffNJpJcK8FzDno9jypcZWFAB/f0iXRL+qAUcfB+ZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLx6rf6zmqS; Thu, 27 Feb 2025 14:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHDf4016986; Thu, 27 Feb 2025 14:17:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHDJX016983; Thu, 27 Feb 2025 14:17:13 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:13 GMT Message-Id: <202502271417.51REHDJX016983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 799a372ecfb3 - stable/14 - pci_host_generic: Pass a valid end address in generic_pcie_translate_resource List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 799a372ecfb32ba405d34692caccce28be71fd02 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=799a372ecfb32ba405d34692caccce28be71fd02 commit 799a372ecfb32ba405d34692caccce28be71fd02 Author: John Baldwin AuthorDate: 2024-03-05 04:52:54 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Pass a valid end address in generic_pcie_translate_resource The generic_pcie_containing_range helper added in commit d79b6b8ec267 assumed that the passed in (start, end) range used to locate the containing mapping range was a valid address range (with end >= start). The previous version of generic_pcie_translate_resource_common only used the start address to locate a mapping range, so the end address of 0 did not matter, but an end of 0 now causes the first range to match and an incorrect translation for resources using a later range. PR: 277211 Reported by: dch, tuexen Reviewed by: tuexen Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D44205 (cherry picked from commit 332dbd3a2f08a887014a425d2532af93503588ce) --- sys/dev/pci/pci_host_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 67b329b58685..0f85e23eb028 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -538,7 +538,7 @@ generic_pcie_translate_resource(device_t bus, int type, rman_res_t newend; /* unused */ return (generic_pcie_translate_resource_common( - bus, type, start, 0, newstart, &newend)); + bus, type, start, start, newstart, &newend)); } struct resource * From nobody Thu Feb 27 14:16:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLR0lYsz5qGFP; Thu, 27 Feb 2025 14:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLR0K5Hz3x9S; Thu, 27 Feb 2025 14:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kVxoiZm87AuwS/ECDPSViv6BJoRpv2a8miKqtUq6mI=; b=PVOn4DBaSDuFDU3nU+d81Jlhf2xC1xP8aZXgSSXxZIIng5iemqGFXPC/62wZOzHkgFVas3 inghoVjUAWUk40yBf92wX0RknleP23AEkJRmh68cdh4Y45beMz1gVWjX6K96S9I0h9CHfB h4aAL0/rixqKIDd9K2iGv4KcJhf/1lOBq22uE5QZhN6y+QA8cW4CmO8zn8CRbetXbb+Nm9 kGY/0ubhaJNliliUhBLtxzwpPR4s4vHMSjs259oJgPrx01Hc0ROKHlALBgN0/k5cS87DOq 8EXV25ao8XDks5TDc9CEmn+GRG3BTqwiH4/tKr1KhoQrDZHUeEGL0VodZ9oIoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665807; a=rsa-sha256; cv=none; b=GBlFHiHR2GTMuyY+2mKRJDpAma3Pm7IMkoL24Ts8261jrno768WfeZNiW2EE84FKcT4LB4 vuJE5ov/atMpBNvVMo7g4+mThahzYTalfjBYQKAhsUdDvrtYNRt0cG+7w0KQZPVQUqn2OH ExfB2pJXZ7r5Q6Mr6LrCmX5l5FYL37yqJt5enrfgmmwhzcptVlanZCOw/7BOI1TganrKVo i1z4FsywE8TYHe6zToqzP5mB40EhzzfAKndkQXJzLiYuLREixYegNfRDvXGz9Yk3tn4YfG 8MlS3Y+TAtkEB2Oa5Pmx9tL9UIau4UAJMtFIIfIDn4U6sXu9z+gM02OMVG/clQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kVxoiZm87AuwS/ECDPSViv6BJoRpv2a8miKqtUq6mI=; b=rzVU5V89BD3bktLNPnwXtvGMMaPT255fyxFBBNzolWtggE1LMk4yAPjik4E6Bqb131OaGi AGvZ13lvG+Hkp9ZtW1s5iYHdERA58xXiCpRuMVgIhlG9Ar/ko/JSQigQfyces5cqal4zrA 8YLeBtBK9lmahV+lJ2FYdOyLEqKK50Gs22igxhqG9KHKwwunuUg3ABnfDLCA3QpfNichpN YX4XRvcAfLj5a4243QZObJVT0p/p80SfiFnema1p7LYgZgN9F3fNFyavke+RbP295ArTB9 VdZkxSQfDsoyqJKWzkN/qJ1WBXYNvmm18vQSlj9Dnu0CspY9eDWEYRKGLRBr+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLQ70Jczmdt; Thu, 27 Feb 2025 14:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGkoX016127; Thu, 27 Feb 2025 14:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGkM7016124; Thu, 27 Feb 2025 14:16:46 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:46 GMT Message-Id: <202502271416.51REGkM7016124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 57720609f705 - stable/14 - powerpc: Add RF_LITTLEENDIAN resource flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57720609f705edaea4afc245d6f877530b741f69 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=57720609f705edaea4afc245d6f877530b741f69 commit 57720609f705edaea4afc245d6f877530b741f69 Author: John Baldwin AuthorDate: 2024-01-23 17:38:36 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 powerpc: Add RF_LITTLEENDIAN resource flag If this powerpc-specific flag is set on a resource, then the little-endian bus tag is always used when mapping that resource. Make use of this flag in the mpc85xx/fsl_sata driver to avoid setting the SATA BAR's bus tag after bus_alloc_resource. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43553 (cherry picked from commit a82470212b7659afb7d3287e2ccae72d5e496b71) --- sys/powerpc/include/resource.h | 7 +++++++ sys/powerpc/mpc85xx/fsl_sata.c | 3 +-- sys/powerpc/powerpc/nexus.c | 10 ++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/powerpc/include/resource.h b/sys/powerpc/include/resource.h index 9477572176e0..e7e9493569cc 100644 --- a/sys/powerpc/include/resource.h +++ b/sys/powerpc/include/resource.h @@ -41,4 +41,11 @@ #define SYS_RES_IOPORT 4 /* i/o ports */ #define PCI_RES_BUS 5 /* PCI bus numbers */ +/* + * A powerpc-specific resource flag to request little-endian bus tags + * for a resource. + */ + +#define RF_LITTLEENDIAN RF_SPARE1 + #endif /* !_MACHINE_RESOURCE_H_ */ diff --git a/sys/powerpc/mpc85xx/fsl_sata.c b/sys/powerpc/mpc85xx/fsl_sata.c index 9279a8d43810..5fdd05282676 100644 --- a/sys/powerpc/mpc85xx/fsl_sata.c +++ b/sys/powerpc/mpc85xx/fsl_sata.c @@ -353,9 +353,8 @@ fsl_sata_attach(device_t dev) } ch->r_mid = 0; if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &ch->r_mid, RF_ACTIVE))) + &ch->r_mid, RF_ACTIVE | RF_LITTLEENDIAN))) return (ENXIO); - rman_set_bustag(ch->r_mem, &bs_le_tag); fsl_sata_dmainit(dev); fsl_sata_slotsalloc(dev); fsl_sata_init(dev); diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index a2043c3cfdf9..826e75daa374 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -276,14 +276,20 @@ nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, panic("%s:%d SYS_RES_IOPORT handling not implemented", __func__, __LINE__); /* XXX: untested map->r_bushandle = start; - map->r_bustag = nexus_get_bus_tag(NULL, NULL); + if ((rman_get_flags(r) & RF_LITTLEENDIAN) != 0) + map->r_bustag = &bs_le_tag; + else + map->r_bustag = nexus_get_bus_tag(NULL, NULL); map->r_size = length; map->r_vaddr = NULL; */ break; case SYS_RES_MEMORY: map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); - map->r_bustag = nexus_get_bus_tag(NULL, NULL); + if ((rman_get_flags(r) & RF_LITTLEENDIAN) != 0) + map->r_bustag = &bs_le_tag; + else + map->r_bustag = nexus_get_bus_tag(NULL, NULL); map->r_size = length; map->r_bushandle = (bus_space_handle_t)map->r_vaddr; break; From nobody Thu Feb 27 16:55:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3ct40bhDz59J85; Thu, 27 Feb 2025 16:55:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct404rjz469x; Thu, 27 Feb 2025 16:55:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kFuIaVY3wmwive1sSFJ7/WEgzcyGsbedvplOTC1InNk=; b=lA8lupZpgCPBrUmtRrxxoSYqKHP+689EQNd/oHHrrOGiPqLZDC4fPrVCKAkl7nCMk6ocWT /I5r2nozaHMT91FDlLdQZXQK3QFG2wQILD0FWr5JKVekBC76qXHAZwRIkuaxXhAEX5sw7w t+l/zxzLhG0eH69+/Cg/nIn5XfwzONX6zj4kogXaq3Ps9e3G24PWmpRRgZwrPt7ID4xG54 7NCmUrExTQ7KIDMZrxcPP2oeIzq5XrjpE6KoV328pdGJVVGeAKG5dnKyDpl/3xdvKtJovC tBP5sOpyDdePYwqNhW55X0Z/4AShMp2/8HZtoByhfU1iKGaV/Cc7YJX06RcucA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675356; a=rsa-sha256; cv=none; b=yylgvdE05TyVK2miJPXDFIV01ohCf+sguF8qnwjwImYmHXQXkKoE0PUgNq8OGbm/RfWUR6 2/KLLfS0YS5t9DCLVzhMrWLnSyB/i3RXVEPzqmpPKiQNVJ3GatCTf7sqCbai36qTyXtrWP 075lAkbPHOL3gvRTtsMF7D/6WCu6bRgOcjpY6VCBIMHgFb5vpBjnDYPeYOW3XH12i+6zbv ojRmEcYwb+Ip6QtVucB9/ONiAcDo139D7gaIqbfNafVGZTuOgksiZK6CZf2AU8tiKp0Tnq rp1b2SWnjtRjaHYyvGO0G7HerS0WU2o3GRmeSrMc9AUjZP6cDaIxcobmEavM8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kFuIaVY3wmwive1sSFJ7/WEgzcyGsbedvplOTC1InNk=; b=ERrkwNnk5Ez/PKcQHrr8EqWIHWFJJb5SDeKh5TWkBgPQabaqMb2z/WUsdKtWFVMJIjW8Ig NLQaglhwtO00FoZajKKr0sQ+1I/YZ/lkkbP7abFowhFZSNLB/5g5kaXyyE5S881XDQux7E xwmAqqcN3vT+HsyLqOE26/pxrSgQck8hc2fvAjyOAU2/h8BmBEGkCZvNCT5nLu1AW9eqvZ rssKS/58wGh5iZuQI97MeSO0DEmZ5yuCKNGphCK4cKE/hn3erimEG0gqEISdvy94wpXycd xzbI/L2dLTsh0pEYGlqkD1ssd35mg5CJt6Tm+gF76cnkA9uOqCL2eJEKu9giHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3ct36kpmzrts; Thu, 27 Feb 2025 16:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGttVD017062; Thu, 27 Feb 2025 16:55:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGttdQ017059; Thu, 27 Feb 2025 16:55:55 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:55 GMT Message-Id: <202502271655.51RGttdQ017059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aa2b4a172621 - stable/14 - stand/usb: Quiet warnings so this builds again List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aa2b4a172621037e34ee3154e09f574c4135fdb4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aa2b4a172621037e34ee3154e09f574c4135fdb4 commit aa2b4a172621037e34ee3154e09f574c4135fdb4 Author: John Baldwin AuthorDate: 2025-01-11 04:02:46 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:25:10 +0000 stand/usb: Quiet warnings so this builds again Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D48411 (cherry picked from commit f6f5aa8a2df5910b0769ab7cd0e6199c9b2ab624) --- stand/usb/Makefile | 2 +- stand/usb/test/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stand/usb/Makefile b/stand/usb/Makefile index 0a1c9e0022ee..a9c20fc340ad 100644 --- a/stand/usb/Makefile +++ b/stand/usb/Makefile @@ -35,7 +35,7 @@ INTERNALLIB= CFLAGS+= -DBOOTPROG=\"usbloader\" CFLAGS+= -ffunction-sections -fdata-sections -CFLAGS+= -Wformat -Wall +CFLAGS+= -Wformat -Wall -Wno-unused CFLAGS+= -g CFLAGS+= -fno-pic diff --git a/stand/usb/test/Makefile b/stand/usb/test/Makefile index 74e501a39ae7..d92ef6dddecb 100644 --- a/stand/usb/test/Makefile +++ b/stand/usb/test/Makefile @@ -35,6 +35,7 @@ PROG= usbloader SRCS= CFLAGS+= -Wall +CFLAGS+= -Wno-error=missing-prototypes -Wno-error=unused-parameter CFLAGS+= -g .if ${MACHINE_CPUARCH} == "amd64" From nobody Thu Feb 27 14:16:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YL40bp6z5qGFK; Thu, 27 Feb 2025 14:16:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL402Tsz3xHv; Thu, 27 Feb 2025 14:16:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mkuol3FMJKvBZSCpSUuUKGWEs17KyFnSe3UAzOqpLwE=; b=v9Yv1RvUxuSmSlwXyl8E2J8iG9wZLk2LefrH7sDyiNCxG4kdNSNFGXfjvUFYRYBSUtgtuV OxCslvU0fqi2+1FGsKlePn33O5iouCllIQwxn6KdUdyZhiQnqqgMoiDgpxLKcXC87BPzjA AcngHQQWuNn0QvGmMRzEVNh57rKFcCaZK6i494rIScI4B4kj8LBbcySyg7YHbK2nQq/lPu T2jXqcdi5qP6idOW2NGHcEpckm88+T8vMBQ2vXEW9ajLy97g7JrLFgaATLMP3odm8fyym0 F3INkCw3NvsRA14iVo3IJLkdgwmIjgjOSQNPc+II/12/Yu1NYuF8oT43C/e3KQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665788; a=rsa-sha256; cv=none; b=lMZqEhoTsc56H9r/PsjnQwNosmMwJG3IgePkciQcOfKLwiAYaTI7xgfUuqEZaP5PtRkKWB 5nZ1oJm0dORqCJdSdxBGhs1uRoG+CBVFlbLmcvpJ2x/OUoM64vhgkJIpIRS0PuvMSkmBf8 F2HL5o6txKY7RXhws04Igqve7WxQdnms3IFSlpdjqJSIbA+kI+7mDJtjwN7mlIjtm7qZyc Wdn23ulhpxV0xmTZHDYb4sNo2M9H6UXx9SKbONkuyrBoAvBZG0XV/szCZCoMlEQ8Xnwdnk /ykuVNnpjfRJilR4DjT87c6wXE8eSRLk9gzQMRDDo5Bsz7JYgYmrZJ2rw/GWBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mkuol3FMJKvBZSCpSUuUKGWEs17KyFnSe3UAzOqpLwE=; b=YdRrYDUB/HpXzr5lqOm5bvzipBcf86X9t0b3+ErIdPLAMNQmyWMqcgJAAB2zdewNcJOcR/ 24MCxx8oCkiIM4Qa3yzaPio7iq0sFJLA4pAJ6rHW29z+leZ5OAtiJEvQMTV/K1cmL/aOp3 MrThceBqnkV9OyB+evXkqSLs3h6/ZMKzsprzSqishy+Wq7psawFko2UAO0IitCJl4I04e0 t63eEnkQP8pf62DXFsT2QLZ0YtQ7pub58HFNV/E96F/dbHMrDCFKfA81+nzvawpBKCUurX JqQp+NzDbqIR8edx9OO5tbVZ6WcDb58vVT54n1uKCu5QrrVJymyS7OGJOPD3gA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YL36YBPzmbV; Thu, 27 Feb 2025 14:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGR9h015518; Thu, 27 Feb 2025 14:16:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGRC8015515; Thu, 27 Feb 2025 14:16:27 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:27 GMT Message-Id: <202502271416.51REGRC8015515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a5275ec0a89f - stable/14 - pcib: Add helper routines for [de]activating PCI_RES_BUS resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a5275ec0a89f6145603e22b8973daedb609d3f39 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a5275ec0a89f6145603e22b8973daedb609d3f39 commit a5275ec0a89f6145603e22b8973daedb609d3f39 Author: John Baldwin AuthorDate: 2024-01-23 17:35:08 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:19 +0000 pcib: Add helper routines for [de]activating PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43427 (cherry picked from commit 23e3b83ab61a440ccce20da7fbf1340d58db361c) --- sys/dev/pci/pci_subr.c | 32 ++++++++++++++++++++++++++++++++ sys/dev/pci/pcib_private.h | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c index 71485875ebe3..d0f6c9500b17 100644 --- a/sys/dev/pci/pci_subr.c +++ b/sys/dev/pci/pci_subr.c @@ -379,6 +379,38 @@ pci_domain_release_bus(int domain, device_t dev, int rid, struct resource *r) #endif return (rman_release_resource(r)); } + +int +pci_domain_activate_bus(int domain, device_t dev, int rid, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_domain *d; +#endif + + if (domain < 0 || domain > PCI_DOMAINMAX) + return (EINVAL); +#ifdef INVARIANTS + d = pci_find_domain(domain); + KASSERT(rman_is_region_manager(r, &d->pd_bus_rman), ("bad resource")); +#endif + return (rman_activate_resource(r)); +} + +int +pci_domain_deactivate_bus(int domain, device_t dev, int rid, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_domain *d; +#endif + + if (domain < 0 || domain > PCI_DOMAINMAX) + return (EINVAL); +#ifdef INVARIANTS + d = pci_find_domain(domain); + KASSERT(rman_is_region_manager(r, &d->pd_bus_rman), ("bad resource")); +#endif + return (rman_deactivate_resource(r)); +} #endif /* PCI_RES_BUS */ #endif /* NEW_PCIB */ diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h index d4c66407d739..bc0b48d9f031 100644 --- a/sys/dev/pci/pcib_private.h +++ b/sys/dev/pci/pcib_private.h @@ -160,6 +160,10 @@ int pci_domain_adjust_bus(int domain, device_t dev, struct resource *r, rman_res_t start, rman_res_t end); int pci_domain_release_bus(int domain, device_t dev, int rid, struct resource *r); +int pci_domain_activate_bus(int domain, device_t dev, int rid, + struct resource *r); +int pci_domain_deactivate_bus(int domain, device_t dev, int rid, + struct resource *r); struct resource *pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); From nobody Thu Feb 27 14:17:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YMF5ykSz5qGLk; Thu, 27 Feb 2025 14:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMF5McRz3xHd; Thu, 27 Feb 2025 14:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+UII0slfC6Zt51HS/8KmdalOtDSZ4tNO6ZM6KgbsSo=; b=cNv7h7ymMlaI0/fr4UvxIGvnBWs4z2qGyVnARkLaPO6LInBexWYbOY9b+2FzOkHUjWDbT9 0pCnpKnuubqiFiim6TBBEoAexWOxgdoFXPg/G8r1zwsaNDHr4P9yF3MKLKFhGFd9MOUU7y puMzucbloQkbBkX0lMx9i08Cw2xluEVRR9etsNUbQYXFAL0uV2hrO/Od+uY3zmWZsEdFZb 6YuiWvE0h2/2rOEe4Hp4aNHX61UDDMxh8iFixLBXirmvD3JB5uaJez0DU5ZfK3+mZqR34V RPcuMAOGTmDZpImPxw8NLQa7SUv217dreRcnVlZ9LAArqLQ5hsZ2qUJ4T3KDnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665849; a=rsa-sha256; cv=none; b=SvYUS3+k47WrrmI1KHSxcehzaT0Vy48lG8YjU3fAvcqhW1d/PKxZp0D+pfG4DCInbsFuNA bnkQMrw9QkO8w/F3eBfxSJm6TDEI3D3JJxn8d8W3t+vlLx8pRGQSMmQ4u6CC3xQwIC84GD G5LdZVObGKaTu419W8j2AcX3ls5eNd22cnPcPrlI67C5VKZOCw8jNaHkQma49IT07IOnaW 2KsQf5jqk+gsvJcbUalwHgogAgQpDgtI8GtHus1LDbWlW/H7Af3zhw2jZZmwWn87bdjn6f qTXvhIw0skLxxG0DgcaA9iZ3Ly8GL/d+7WUmVc4aMFvVPq1DigT2PpCISkQSaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+UII0slfC6Zt51HS/8KmdalOtDSZ4tNO6ZM6KgbsSo=; b=nU+F5rCQ/R5twgiD3c4bXZr8Rp4LOr9DrBWb3YAoeV+npQJE3WbAZd6dL+o0W7YuU1Gmyy vL6VmBxP6561yMuhG81CVxTCBjPCuJ0XndFdDen8XcfQgJfjWK5HP5nsXDGzBjcYveaGH4 MoE/MtDKbV3g9TiOQvTn/DUrngYOmGLN1xL57T4Amz/a7kxuvZICVSRJoIJkoY1ZMFRPx3 qqp8H0CuWt0bzUlMaI058pkvs9UnrnqQ8VGF0JjoIKvG00LTltjO7iYzwdP06PrWAAn05q feCcgjqX7sRPAWlO2M5P4+bBef9+VT9jqz9EFxv3wWzsF6SD4TxORcON5ChZvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YMF4vQSzmZY; Thu, 27 Feb 2025 14:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHTDM017468; Thu, 27 Feb 2025 14:17:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHTxw017465; Thu, 27 Feb 2025 14:17:29 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:29 GMT Message-Id: <202502271417.51REHTxw017465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0787c99b477e - stable/14 - pci(4): unbreak the build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0787c99b477e92b6beb22d3c9e5a8c27fae29c12 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0787c99b477e92b6beb22d3c9e5a8c27fae29c12 commit 0787c99b477e92b6beb22d3c9e5a8c27fae29c12 Author: Enji Cooper AuthorDate: 2024-06-05 04:16:48 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci(4): unbreak the build `argsp` is not defined in `generic_pcie_unmap_resource(..)`. Remove the parameter passed to `bus_generic_unmap_resource(..)` as this parameter is never passed to `generic_pcie_unmap_resource(..)`. Fixes: 98056127ddfa ("acpi/pci/vmd: Fix a nit with nested resource mapping requests") Reported by: Jenkins (aarch64, armv6, armv7, etc) Differential Revision: https://reviews.freebsd.org/D45493 (cherry picked from commit 637ee1391957acb3ae0f68aef3e2fad76a5ae338) --- sys/dev/pci/pci_host_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 4fd8c3b42250..19a2ec419ad0 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -672,7 +672,7 @@ generic_pcie_unmap_resource(device_t dev, device_t child, int type, case SYS_RES_MEMORY: break; default: - return (bus_generic_unmap_resource(dev, child, type, r, argsp, map)); + return (bus_generic_unmap_resource(dev, child, type, r, map)); } range = generic_pcie_containing_range(dev, type, rman_get_start(r), From nobody Thu Feb 27 16:55:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3ct15rpKz59J61; Thu, 27 Feb 2025 16:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct15GbMz46Gf; Thu, 27 Feb 2025 16:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlL8ipzl4X9KKNfPHq0Lip2lRTPr3I2PAj8HIFugKeo=; b=sh0cCDxGeZQJ83Scmq2sA74XX2f1NvFLB+jpI16Q1RqnltZdnPi2jXzNJZhKYuxU+oN5xB 0Gzgoq3YagjOvArgbS9tggzN3Bn+ulq+hjBVKfqVrcceClDjE8SKtBBqKTICYVw7sej4Ar aIrla68CldtbY4WspgqhA5ei2Umd4f4E/PYClU+DK0I5OV+gdi+jLherdady/kHq+zAVvJ 6qTrq/kEGFkNzt+/8UXewvcpx6Tlu3DxN1zj3CYUlHmB5Y2aC5EeBG+Zfjo89Pu9cdySAo dIPoUTzxrhi9DLcaUyHEHz37fL4q2KuAPL/izGGmKfktWiXcS8qGZdh+f9FVnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675353; a=rsa-sha256; cv=none; b=AAI5l+yyJEkm8OybkXNZh548ki7qF9xq9C82/HSKTYrgImo+CHxAjSpSazn3VDwUgyLyVT KXcjiwOV9JqnwCCuZMYjBI6d4V/G6nWWE+1V0QeATNcaBk+5TQGOg5BQ31F7Y9vY5iio7E 6jeHPQ/WmPgbeGKJuWWOFKh7ZcFjHFZgd9xgRPNR8jQgqMqLznLr7bexzFv/uuVyrzZzls EsdqcGB+cjsG9tHkeFMSA5uhvapGWXGLagU/MbKE9pGiH0db+++zk+B7jrHwBLMxgodWJn ty2TghVbqX5d04w85w9ofdpGu4jsshycKE+o7a9qey0qYSGU76o05RyUi3/iOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlL8ipzl4X9KKNfPHq0Lip2lRTPr3I2PAj8HIFugKeo=; b=i2x8Ei5q/UAYgx+1/LRI9QxRpdXGIfhKINnHEAJUW+Sz1EgR8eOT0FiNxu/47T/IzQBert 8r0HbH8pxGgZNmMUL+9S8zE+BXL7YodPlRLaHOWd78IUiq+UOhrBrGqGIdqdL4adKoG/TO IrbvoLggUNl7MQoyCpAyPiXSjvGLgCBqlNgsv7NGjOmrKzTfpSJV7tVzbD11W5UmDGIrbl kvl7mqsDHG7MYYu7AWUZc2gpt9JNmoIdpHGS3IpITMnbRuhDzf0jsG44xdNNtmHH9gQueE XTAWLkp8Ep9RMYfiiJF95Q+OUWY23EYfj8s8bA8tFMHN6BEXs6aJ8zimfx+1uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3ct14ZRpzrkC; Thu, 27 Feb 2025 16:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtrdR016987; Thu, 27 Feb 2025 16:55:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtrBn016984; Thu, 27 Feb 2025 16:55:53 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:53 GMT Message-Id: <202502271655.51RGtrBn016984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4aed8b3b613c - stable/14 - new-bus: Add bus_(identify|attach|detach)_children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4aed8b3b613c5e1499336e4d7ec7e9a3ac3d9a12 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4aed8b3b613c5e1499336e4d7ec7e9a3ac3d9a12 commit 4aed8b3b613c5e1499336e4d7ec7e9a3ac3d9a12 Author: John Baldwin AuthorDate: 2024-12-06 22:25:04 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:19:24 +0000 new-bus: Add bus_(identify|attach|detach)_children These correspond to the current implementations of bus_generic_(probe|attach|detach) but with more accurate names and semantics. The intention is to deprecate bus_generic_(probe|attach) and reimplement bus_generic_detach in a future commit. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47673 (cherry picked from commit 46297859a74563dde6fc5bff9f9ecded9fb61ba6) bus_generic_(probe|attach|detach) will not be changed in stable/14, but providing the new APIs in stable/14 permits drivers to use the new APIs. --- sys/kern/subr_bus.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++----- sys/sys/bus.h | 4 ++++ sys/sys/param.h | 2 +- 3 files changed, 65 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 5d1a13c08892..b71a46edc544 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3401,6 +3401,22 @@ bus_generic_add_child(device_t dev, u_int order, const char *name, int unit) */ int bus_generic_probe(device_t dev) +{ + bus_identify_children(dev); + return (0); +} + +/** + * @brief Ask drivers to add child devices of the given device. + * + * This function allows drivers for child devices of a bus to identify + * child devices and add them as children of the given device. NB: + * The driver for @param dev must implement the BUS_ADD_CHILD method. + * + * @param dev the parent device + */ +void +bus_identify_children(device_t dev) { devclass_t dc = dev->devclass; driverlink_t dl; @@ -3419,8 +3435,6 @@ bus_generic_probe(device_t dev) continue; DEVICE_IDENTIFY(dl->driver, dev); } - - return (0); } /** @@ -3432,14 +3446,29 @@ bus_generic_probe(device_t dev) */ int bus_generic_attach(device_t dev) +{ + bus_attach_children(dev); + return (0); +} + +/** + * @brief Probe and attach all children of the given device + * + * This function attempts to attach a device driver to each unattached + * child of the given device using device_probe_and_attach(). If an + * individual child fails to attach this function continues attaching + * other children. + * + * @param dev the parent device + */ +void +bus_attach_children(device_t dev) { device_t child; TAILQ_FOREACH(child, &dev->children, link) { device_probe_and_attach(child); } - - return (0); } /** @@ -3453,7 +3482,7 @@ int bus_delayed_attach_children(device_t dev) { /* Probe and attach the bus children when interrupts are available */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + config_intrhook_oneshot((ich_func_t)bus_attach_children, dev); return (0); } @@ -3467,6 +3496,32 @@ bus_delayed_attach_children(device_t dev) */ int bus_generic_detach(device_t dev) +{ + int error; + + error = bus_detach_children(dev); + if (error != 0) + return (error); + + return (0); +} + +/** + * @brief Detach drivers from all children of a device + * + * This function attempts to detach a device driver from each attached + * child of the given device using device_detach(). If an individual + * child fails to detach this function stops and returns an error. + * NB: Children that were successfully detached are not re-attached if + * an error occurs. + * + * @param dev the parent device + * + * @retval 0 success + * @retval non-zero a device would not detach + */ +int +bus_detach_children(device_t dev) { device_t child; int error; diff --git a/sys/sys/bus.h b/sys/sys/bus.h index c1391c4a7284..91a54b93a1db 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -597,8 +597,12 @@ void bus_delete_resource(device_t dev, int type, int rid); int bus_child_present(device_t child); int bus_child_pnpinfo(device_t child, struct sbuf *sb); int bus_child_location(device_t child, struct sbuf *sb); + +void bus_attach_children(device_t dev); +int bus_detach_children(device_t dev); void bus_enumerate_hinted_children(device_t bus); int bus_delayed_attach_children(device_t bus); +void bus_identify_children(device_t dev); static __inline struct resource * bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) diff --git a/sys/sys/param.h b/sys/sys/param.h index 0e91a65170df..914433bace0e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1402502 +#define __FreeBSD_version 1402503 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Feb 27 14:16:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLV5cshz5qGJj; Thu, 27 Feb 2025 14:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLV3S7Mz3xGR; Thu, 27 Feb 2025 14:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gtk4Cx5/p8mcrwK33jqA3UkU8UlgLFEpjklLv994960=; b=V5+oRgZfy86HZ8jD9BjIaUATjW4xM6x+UsY3rYQiwwxVIJdx41iPYDwA68c2WBt4UERPc4 gpiwEzZUqb+qhZTguGYRIMOjKIn1GZNwOnu2Hmxu9aJf6IwmJRwgFgHnssDsUcU1158LMm izUp0+1FavE+3Jkh3THrzk+ubLggs1WbP/TTrgmKIZ4PGMIgqO2/yMwqhhaF85tyeCkaTW rwFiutL5CqjAN+/Vo/v0mOeeSU01V4srrLA2HXOs+B8n3PPWOlJjYegAalQfLzR5QD9w3S hze50YlEQlzPpygAOGopgbbY05s0QRFYzcujVWArWqWMv3E6TjJJhrz2Hxxr8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665810; a=rsa-sha256; cv=none; b=NQGKUQadbxd/V2mkIpwCm+U08CmibXODoEP8GsoyWszEi/GbOUMWRHQ3xS0nK3JvhBP/CT p8rUwHyC5wa6RNkoLPj01lM1t4fy+mHQqb24MnvXaK+RasdFZqyZCXKmu0ET/rYnBo93BA 9U9tbLjcq+IXWqhN3vYHmxGYVWhD8E5Z6+fDRocwKIFCCUju2S/NsvZyh65hSR6IO36q0I ohp933UW+Xu9xdN1Q495lS59knrpm5nu5zZUCTOr4pUUvaoIs+o3KRP2zXT9bg9s1v5UBJ 6IWltTOoLlpA334PyCpUBQ+RKgg4ovkCjBROST13QnWM5a9JcAPnOoH1TgXByA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gtk4Cx5/p8mcrwK33jqA3UkU8UlgLFEpjklLv994960=; b=d8DtXVvklXr8udNWWbDwtwbUbkFVvHsZAnbG9vhpwKkpGhmL5mbECSBwJQ5YpM3b65QA20 AUXLZjZZQshnje/3cDeuxJHCiPBNzc6BMTCyEySBZ7SOESLkrupGHp6OKo0l/DdwGpdMs9 ocOuGjeK7KQdxiu00vE1IGeodaiSRT/wF7PjPlS3lDBy3uiWXNz2iR6JfaqaNTaPjXS+T1 kY8dhT1ZBSCn0ofwxm1W3Q9d3OhTkseyMiPM61J33f7xgtPNw+vUtEZ2AcZO6fE0rTGLzE nd1XEn+j78bdzbYfKFtywVGbEbU3ujsxuzmMnnWVQWVOaBJ1Q88WhVct19GDrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLV32cTzmqN; Thu, 27 Feb 2025 14:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGosD016233; Thu, 27 Feb 2025 14:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGoQT016230; Thu, 27 Feb 2025 14:16:50 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:50 GMT Message-Id: <202502271416.51REGoQT016230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 621c8145b81a - stable/14 - pcib: Refine handling of resources allocated from bridge windows List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 621c8145b81a42e412256e5b6a4088d8e54042d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=621c8145b81a42e412256e5b6a4088d8e54042d8 commit 621c8145b81a42e412256e5b6a4088d8e54042d8 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pcib: Refine handling of resources allocated from bridge windows Fix a long-standing layering violation in the original NEW_PCIB code by not passing suballocated resources up to the parent bus for activation and mapping. Instead, handle activation and mapping of sub-allocated resources in this driver. When mapping resources, request a mapping from a suitable sub-region of the resource allocated from the parent bus for the associated bridge window. Note that this does require passing RF_ACTIVE (with RF_UNMAPPED) when allocating bridge window resources from the parent. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43690 (cherry picked from commit b377ff8110e3489eb6e6b920b51a2384dfc4eb0b) --- sys/dev/pci/pci_pci.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 5286d4e82e53..02fa8cf1fb9e 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -66,6 +66,10 @@ static bus_alloc_resource_t pcib_alloc_resource; #ifdef NEW_PCIB static bus_adjust_resource_t pcib_adjust_resource; static bus_release_resource_t pcib_release_resource; +static bus_activate_resource_t pcib_activate_resource; +static bus_deactivate_resource_t pcib_deactivate_resource; +static bus_map_resource_t pcib_map_resource; +static bus_unmap_resource_t pcib_unmap_resource; #endif static int pcib_reset_child(device_t dev, device_t child, int flags); @@ -108,12 +112,16 @@ static device_method_t pcib_methods[] = { #ifdef NEW_PCIB DEVMETHOD(bus_adjust_resource, pcib_adjust_resource), DEVMETHOD(bus_release_resource, pcib_release_resource), + DEVMETHOD(bus_activate_resource, pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, pcib_deactivate_resource), + DEVMETHOD(bus_map_resource, pcib_map_resource), + DEVMETHOD(bus_unmap_resource, pcib_unmap_resource), #else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_reset_child, pcib_reset_child), @@ -381,7 +389,7 @@ alloc_ranges(rman_res_t start, rman_res_t end, void *arg) device_printf(as->sc->dev, "allocating non-ISA range %#jx-%#jx\n", start, end); as->res[as->count] = bus_alloc_resource(as->sc->dev, SYS_RES_IOPORT, - &rid, start, end, end - start + 1, 0); + &rid, start, end, end - start + 1, RF_ACTIVE | RF_UNMAPPED); if (as->res[as->count] == NULL) as->error = ENXIO; else @@ -454,7 +462,7 @@ pcib_alloc_window(struct pcib_softc *sc, struct pcib_window *w, int type, else { rid = w->reg; res = bus_alloc_resource(sc->dev, type, &rid, w->base, w->limit, - w->limit - w->base + 1, flags); + w->limit - w->base + 1, flags | RF_ACTIVE | RF_UNMAPPED); if (res != NULL) pcib_add_window_resources(w, &res, 1); } @@ -2001,7 +2009,7 @@ pcib_alloc_new_window(struct pcib_softc *sc, struct pcib_window *w, int type, count = roundup2(count, (rman_res_t)1 << w->step); rid = w->reg; res = bus_alloc_resource(sc->dev, type, &rid, start, end, count, - flags & ~RF_ACTIVE); + flags | RF_ACTIVE | RF_UNMAPPED); if (res == NULL) return (ENOSPC); pcib_add_window_resources(w, &res, 1); @@ -2452,6 +2460,120 @@ pcib_release_resource(device_t dev, device_t child, int type, int rid, } return (bus_generic_release_resource(dev, child, type, rid, r)); } + +static int +pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct resource_map map; + int error; + + if (!pcib_is_resource_managed(sc, type, r)) + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + + error = rman_activate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && + (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { + error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); + if (error != 0) { + rman_deactivate_resource(r); + return (error); + } + + rman_set_mapping(r, &map); + } + return (0); +} + +static int +pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct resource_map map; + int error; + + if (!pcib_is_resource_managed(sc, type, r)) + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + + error = rman_deactivate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && + (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + } + return (0); +} + +static struct resource * +pcib_find_parent_resource(struct pcib_window *w, struct resource *r) +{ + for (int i = 0; i < w->count; i++) { + if (rman_get_start(w->res[i]) <= rman_get_start(r) && + rman_get_end(w->res[i]) >= rman_get_end(r)) + return (w->res[i]); + } + return (NULL); +} + +static int +pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct resource_map_request args; + struct pcib_window *w; + struct resource *pres; + rman_res_t length, start; + int error; + + w = pcib_get_resource_window(sc, type, r); + if (w == NULL) + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + pres = pcib_find_parent_resource(w, r); + if (pres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(pres); + args.length = length; + return (bus_generic_map_resource(dev, child, type, pres, &args, map)); +} + +static int +pcib_unmap_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct pcib_window *w; + + w = pcib_get_resource_window(sc, type, r); + if (w != NULL) { + r = pcib_find_parent_resource(w, r); + if (r == NULL) + return (ENOENT); + } + return (bus_generic_unmap_resource(dev, child, type, r, map)); +} #else /* * We have to trap resource allocation requests and ensure that the bridge From nobody Thu Feb 27 14:16:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLN5qRpz5qGFN; Thu, 27 Feb 2025 14:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLN58c4z3xNx; Thu, 27 Feb 2025 14:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2vEXuue7FZ1DZVSyjfYtn7Z/GGbUdQVCqlvIJaWZpb4=; b=SJvXYKZW+NdvLEW3j38VeUkfpQ30mNkm4EUC7w6KoWs22tGfEYnShcDn+RpvdahHjXaenT cc5FfugatrBcpHwOFrljKtRiAslxNNbJ1tOcvzmwS0oWYczHSP91nOqqNea48Rkuex/lBn 9PxqrzWf6OnZReE3H6/vn3PerPTnwSrYrt5eOSBeu3X2+l2q1GVNtrAmM5V5H6DGFUFnnC jIHVrOpTn815SGB3FACROAN5nsRx+TP7MTiMv1he1wjTLvO49eno1LSgPz0j7gJ+8/W7GU LBT72lVtJhJaGgqEXHFJgwd+J0tTjsnjaVYQ5YSJZJ74gvqnkWKunpRn6JW3DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665804; a=rsa-sha256; cv=none; b=J6mnUJ78LanQr16KqerKzaxWnV4gdnjtexjPP0vkeru6YAWFyk8Gwpdg50sYTr3ZuGqfVM ELUp71WTw/ejGzyqa4s42iyb18AY7zEesBMnKbBFNsRDDuil57eVzU8Ha4Q8fEpEQityyv X1xVuPDG7JfO8x2DK5CW7+T59oa0I0976f+YCLr28aQM5Zu1io4DRW3AKPslcAwJFA6AyO arhf3C9VJ9tg8YRBpS0Bb2gFhvD9noPajyljrnGTl8mzdDxuWShF71frSrjc9MSLTyBgHu KGrPV1YDgC8zG775DkdAavQBnK5vBzw3q/3iO6p8Fqim7RBXDzXW9JwWKXzAkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2vEXuue7FZ1DZVSyjfYtn7Z/GGbUdQVCqlvIJaWZpb4=; b=mOPvOcxQu8EIBH7UekLUZG1Cc4KI3gcNKelZcrN+oeuA8pcHbUuSscTp964TIhpDAD1Co2 2SQBz+kN10QofWsOVpaBL79nf5X1tKd5ybCppga8zKbGMZhgJVZq7dHhjI0mG0z8K7i7FJ xYruNbpWldtpzWt+qMphlhNPZbR6HTbXYHcRd2lNSEfXqIN6wo3HFCvyAjt2bsfkXQlDyt 3HRZ1TISMbZw5IRTi5JXQV9JTH73JDV0ktiJykNwaatMYEsm4F/rqHdpqFBZ/xhRcSanCS PLhZw+jZ/o4/EHieDZZmnS2J1cymcTmphtwDUbivVk/Rx+THIpuCY2kunb0tiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLN4kwgzmZQ; Thu, 27 Feb 2025 14:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGiWj016060; Thu, 27 Feb 2025 14:16:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGiZu016057; Thu, 27 Feb 2025 14:16:44 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:44 GMT Message-Id: <202502271416.51REGiZu016057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a93707671c05 - stable/14 - ofw_pcib: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a93707671c053f1e583983d51b1e1a6091eedfef Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a93707671c053f1e583983d51b1e1a6091eedfef commit a93707671c053f1e583983d51b1e1a6091eedfef Author: John Baldwin AuthorDate: 2024-01-23 17:38:09 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 ofw_pcib: Use bus_generic_rman_* - Implement bus_map/unmap_resource pulling bits from the previous ofw_pcib_activate/deactivate_resource. One difference here is that the bus_unmap_resource implementation uses bus_space_unmap instead of pmap_unmapdev as a complement to the existing use of bus_space_map. - Use bus_generic_rman_* in various routines for memory and I/O port resources. - Use pci_domain_* for PCI_RES_BUS in ofw_pcib_activate/deactivate_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43441 (cherry picked from commit 0b60d7a60099e6ce81e0fb012946a1e77b0626c4) --- sys/dev/ofw/ofw_pcib.c | 215 ++++++++++++++++++++++++++++--------------------- 1 file changed, 123 insertions(+), 92 deletions(-) diff --git a/sys/dev/ofw/ofw_pcib.c b/sys/dev/ofw/ofw_pcib.c index 6e0f5fe3dd5f..6855070f992e 100644 --- a/sys/dev/ofw/ofw_pcib.c +++ b/sys/dev/ofw/ofw_pcib.c @@ -65,6 +65,7 @@ /* * bus interface. */ +static struct rman *ofw_pcib_get_rman(device_t, int, u_int); static struct resource * ofw_pcib_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int ofw_pcib_release_resource(device_t, device_t, int, int, @@ -75,6 +76,10 @@ static int ofw_pcib_deactivate_resource(device_t, device_t, int, int, struct resource *); static int ofw_pcib_adjust_resource(device_t, device_t, int, struct resource *, rman_res_t, rman_res_t); +static int ofw_pcib_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int ofw_pcib_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int ofw_pcib_translate_resource(device_t bus, int type, rman_res_t start, rman_res_t *newstart); @@ -96,7 +101,6 @@ static phandle_t ofw_pcib_get_node(device_t, device_t); * local methods */ static int ofw_pcib_fill_ranges(phandle_t, struct ofw_pci_range *); -static struct rman *ofw_pcib_get_rman(struct ofw_pci_softc *, int, u_int); /* * Driver methods. @@ -111,11 +115,14 @@ static device_method_t ofw_pcib_methods[] = { DEVMETHOD(bus_write_ivar, ofw_pcib_write_ivar), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, ofw_pcib_get_rman), DEVMETHOD(bus_alloc_resource, ofw_pcib_alloc_resource), DEVMETHOD(bus_release_resource, ofw_pcib_release_resource), DEVMETHOD(bus_activate_resource, ofw_pcib_activate_resource), DEVMETHOD(bus_deactivate_resource, ofw_pcib_deactivate_resource), DEVMETHOD(bus_adjust_resource, ofw_pcib_adjust_resource), + DEVMETHOD(bus_map_resource, ofw_pcib_map_resource), + DEVMETHOD(bus_unmap_resource, ofw_pcib_unmap_resource), DEVMETHOD(bus_translate_resource, ofw_pcib_translate_resource), #ifdef __powerpc__ DEVMETHOD(bus_get_bus_tag, ofw_pcib_bus_get_bus_tag), @@ -418,80 +425,50 @@ static struct resource * ofw_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; - struct resource *rv; - struct rman *rm; - int needactivate; - - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; sc = device_get_softc(bus); - +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { - return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid, - start, end, count, flags | needactivate)); - } + case PCI_RES_BUS: + return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid, + start, end, count, flags)); #endif - - rm = ofw_pcib_get_rman(sc, type, flags); - if (rm == NULL) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_alloc_resource(bus, child, type, rid, + start, end, count, flags)); + default: return (bus_generic_alloc_resource(bus, child, type, rid, - start, end, count, flags | needactivate)); - } - - rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == NULL) { - device_printf(bus, "failed to reserve resource for %s\n", - device_get_nameunit(child)); - return (NULL); + start, end, count, flags)); } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); } static int ofw_pcib_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; - struct rman *rm; - int error; sc = device_get_softc(bus); - +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_release_bus(sc->sc_pci_domain, child, rid, res)); #endif - - rm = ofw_pcib_get_rman(sc, type, rman_get_flags(res)); - if (rm == NULL) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + default: return (bus_generic_release_resource(bus, child, type, rid, res)); } - KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); - - if (rman_get_flags(res) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, res); - if (error != 0) - return (error); - } - return (rman_release_resource(res)); } static int @@ -537,26 +514,59 @@ static int ofw_pcib_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; - bus_space_handle_t handle; - bus_space_tag_t tag; - struct ofw_pci_range *rp; - vm_paddr_t start; - int space; - int rv; sc = device_get_softc(bus); - - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) { +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_activate_bus(sc->sc_pci_domain, child, rid, + res)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_activate_resource(bus, child, type, rid, + res)); + default: return (bus_generic_activate_resource(bus, child, type, rid, res)); } +} + +static int +ofw_pcib_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct ofw_pci_softc *sc; + struct ofw_pci_range *rp; + rman_res_t length, start; + int error, space; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + break; + default: + return (EINVAL); + } - start = (vm_paddr_t)rman_get_start(res); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); /* * Map this through the ranges list */ + sc = device_get_softc(dev); for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && rp->pci_hi != 0; rp++) { if (start < rp->pci || start >= rp->pci + rp->size) @@ -572,7 +582,7 @@ ofw_pcib_activate_resource(device_t bus, device_t child, int type, int rid, break; default: space = -1; - } + } if (type == space) { start += (rp->host - rp->pci); @@ -581,23 +591,35 @@ ofw_pcib_activate_resource(device_t bus, device_t child, int type, int rid, } if (bootverbose) - printf("ofw_pci mapdev: start %jx, len %jd\n", - (rman_res_t)start, rman_get_size(res)); + printf("ofw_pci mapdev: start %jx, len %jd\n", start, length); - tag = BUS_GET_BUS_TAG(child, child); - if (tag == NULL) + map->r_bustag = BUS_GET_BUS_TAG(child, child); + if (map->r_bustag == NULL) return (ENOMEM); - rman_set_bustag(res, tag); - rv = bus_space_map(tag, start, - rman_get_size(res), 0, &handle); - if (rv != 0) - return (ENOMEM); + error = bus_space_map(map->r_bustag, start, length, 0, + &map->r_bushandle); + if (error != 0) + return (error); - rman_set_bushandle(res, handle); - rman_set_virtual(res, (void *)handle); /* XXX for powerpc only ? */ + /* XXX for powerpc only? */ + map->r_vaddr = (void *)map->r_bushandle; + map->r_size = length; + return (0); +} - return (rman_activate_resource(res)); +static int +ofw_pcib_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + bus_space_unmap(map->r_bustag, map->r_bushandle, map->r_size); + return (0); + default: + return (EINVAL); + } } #ifdef __powerpc__ @@ -613,43 +635,50 @@ static int ofw_pcib_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - vm_size_t psize; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct ofw_pci_softc *sc; - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) { + sc = device_get_softc(bus); +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->sc_pci_domain, child, rid, + res)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + default: return (bus_generic_deactivate_resource(bus, child, type, rid, res)); } - - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); - - return (rman_deactivate_resource(res)); } static int ofw_pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { - struct rman *rm; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; sc = device_get_softc(bus); +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_adjust_bus(sc->sc_pci_domain, child, res, start, end)); #endif - - rm = ofw_pcib_get_rman(sc, type, rman_get_flags(res)); - if (rm == NULL) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_adjust_resource(bus, child, type, res, + start, end)); + default: return (bus_generic_adjust_resource(bus, child, type, res, start, end)); } - KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); - KASSERT(!(rman_get_flags(res) & RF_ACTIVE), - ("active resources cannot be adjusted")); - - return (rman_adjust_resource(res, start, end)); } static phandle_t @@ -711,9 +740,11 @@ ofw_pcib_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) } static struct rman * -ofw_pcib_get_rman(struct ofw_pci_softc *sc, int type, u_int flags) +ofw_pcib_get_rman(device_t bus, int type, u_int flags) { + struct ofw_pci_softc *sc; + sc = device_get_softc(bus); switch (type) { case SYS_RES_IOPORT: return (&sc->sc_io_rman); From nobody Thu Feb 27 14:16:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLC6Fjlz5qGJf; Thu, 27 Feb 2025 14:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLC5l5xz3x9H; Thu, 27 Feb 2025 14:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/zmUIpqLuWE22dqqYkFDAAhvZ5cizYJ484HakKZHzY8=; b=QisaTcXS4010bxcpfV0JWwhc7ygw/iYyOhAc/F4eXZ2C9vq03hcbntxHEPYKMY9Hqq3+yq RbP+XgTp1iQd4D7gpfZzW9qREK3xW3nDHfVMfwteVVu8X2e3fpv5B6QQSxSXSzqA21nB6a FiTXrrYMenvFcf4vlGMtju1rvaTCQWN/0x6YrAZ5M8O0/Jh5YMKkyStLD0tkf1ofPHguKq EIHNsyHxj+n8m61+bV+wIqnNqyqxJyhKCMb8fMwCwCETvdWyLmpV0mDPr43gkvk11N5rIG 6ZLaXciW8vkHuGCTgoX8lEi2BEe8ycgRBqjtuYA7Tjr9sACW968gfiSFqhydTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665795; a=rsa-sha256; cv=none; b=pWbm0BxmgUOmF3qAic0++0ffFUjVvwm4SMLNSs48wc0WCpltxHU6quOQsbblbQWmxY7Kuu 3sOd22n0jaInkUXYGwrULmsrzQqmfViijQeMR8mAv3Z743bDymc40C+W2NNE53qZn/BUeW Bgo+tHjcJsjl3RBi4D+KegbydewwviMpu9KJ4aljpP2jAzkuonIfm+q4pNvrVXAggTz0l0 Umu4r/0crTBrLHoEmW8RJyvTmRTpwtwRrMu8jOTsSmKDBPjhNR9JgwXjSLyHqSFHp2X8bf K9QgHfBotfYXXRyJ0vKrnINGdJqxz0nhBhiEF7jhw+U1l6hxUSRlkSzf4qfeMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/zmUIpqLuWE22dqqYkFDAAhvZ5cizYJ484HakKZHzY8=; b=GSJunuBYw4EuXRoUSeqmx/FjbAXuxeyctlc3u2hVRYN4BZ9uuZw8j8p4+X8ZdsrnKZ2bIU qoJhAOnmXAyFHU9kQCPYd5kRbs7xTMzlt6diRHfRjjZYvMp+JizshWXUjavg+VtT4fChCP EAZp3Gb2+il2jnuCI2BI9ewrF39oJ59iTNU0R8UCJ3mrQZEXmeiaC9wofEQpNYVWikO/wT MK0ktqt3gASG8E1TC5tk8SOFoVtjcZod+On9tccuuimDAzgH2aH8pAna+58v7RLX1VHzPg zdP0CJP8aSYx0PZBjkR6wRLPa5K78evf+w9RB954zXUgJ9DTp2AxWB3/i6AQvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLC5HKhzmZL; Thu, 27 Feb 2025 14:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGZfZ015760; Thu, 27 Feb 2025 14:16:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGZDE015757; Thu, 27 Feb 2025 14:16:35 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:35 GMT Message-Id: <202502271416.51REGZDE015757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 14c7df4ec04f - stable/14 - powerpc mpc85xx: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14c7df4ec04f8a79f7c4db119a26bd23bbb4a509 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=14c7df4ec04f8a79f7c4db119a26bd23bbb4a509 commit 14c7df4ec04f8a79f7c4db119a26bd23bbb4a509 Author: John Baldwin AuthorDate: 2024-01-23 17:36:37 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc mpc85xx: Use bus_generic_rman_* - Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY for bus_activate/deactivate/adjust/release_resource. - Implement bus_map/unmap_resource. - Add an implementation of bus_adjust_resource. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43434 (cherry picked from commit 5a7e717fb790842eddf766363d337ec879b3b513) --- sys/powerpc/mpc85xx/lbc.c | 185 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 137 insertions(+), 48 deletions(-) diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c index 3652b20984a6..52e28a5fb1cb 100644 --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -70,13 +70,20 @@ static MALLOC_DEFINE(M_LBC, "localbus", "localbus devices information"); static int lbc_probe(device_t); static int lbc_attach(device_t); static int lbc_shutdown(device_t); -static int lbc_activate_resource(device_t bus __unused, device_t child __unused, - int type, int rid __unused, struct resource *r); -static int lbc_deactivate_resource(device_t bus __unused, - device_t child __unused, int type __unused, int rid __unused, +static int lbc_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int lbc_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *map); +static int lbc_activate_resource(device_t bus, device_t child, + int type, int rid, struct resource *r); +static int lbc_deactivate_resource(device_t bus, + device_t child, int type __unused, int rid, struct resource *r); +static struct rman *lbc_get_rman(device_t, int, u_int); static struct resource *lbc_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int lbc_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int lbc_print_child(device_t, device_t); static int lbc_release_resource(device_t, device_t, int, int, struct resource *); @@ -96,10 +103,14 @@ static device_method_t lbc_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, NULL), + DEVMETHOD(bus_get_rman, lbc_get_rman), DEVMETHOD(bus_alloc_resource, lbc_alloc_resource), + DEVMETHOD(bus_adjust_resource, lbc_adjust_resource), DEVMETHOD(bus_release_resource, lbc_release_resource), DEVMETHOD(bus_activate_resource, lbc_activate_resource), DEVMETHOD(bus_deactivate_resource, lbc_deactivate_resource), + DEVMETHOD(bus_map_resource, lbc_map_resource), + DEVMETHOD(bus_unmap_resource, lbc_unmap_resource), /* OFW bus interface */ DEVMETHOD(ofw_bus_get_devinfo, lbc_get_devinfo), @@ -673,22 +684,31 @@ lbc_shutdown(device_t dev) return(0); } +static struct rman * +lbc_get_rman(device_t bus, int type, u_int flags) +{ + struct lbc_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + return (&sc->sc_rman); + default: + return (NULL); + } +} + static struct resource * lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct lbc_softc *sc; struct lbc_devinfo *di; struct resource_list_entry *rle; - struct resource *res; - struct rman *rm; - int needactivate; /* We only support default allocations. */ if (!RMAN_IS_DEFAULT_RANGE(start, end)) return (NULL); - sc = device_get_softc(bus); if (type == SYS_RES_IRQ) return (bus_alloc_resource(bus, type, rid, start, end, count, flags)); @@ -703,6 +723,10 @@ lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, if (type == SYS_RES_IOPORT) type = SYS_RES_MEMORY; + /* + * XXX: We are supposed to return a value to the user, so this + * doesn't seem right. + */ rid = &di->di_bank; rle = resource_list_find(&di->di_res, type, *rid); @@ -715,32 +739,8 @@ lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, count = rle->count; end = start + count - 1; - sc = device_get_softc(bus); - - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - - rm = &sc->sc_rman; - - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) { - device_printf(bus, "failed to reserve resource %#jx - %#jx " - "(%#jx)\n", start, end, count); - return (NULL); - } - - rman_set_rid(res, *rid); - rman_set_bustag(res, &bs_be_tag); - rman_set_bushandle(res, rman_get_start(res)); - - if (needactivate) - if (bus_activate_resource(child, type, *rid, res)) { - device_printf(child, "resource activation failed\n"); - rman_release_resource(res); - return (NULL); - } - - return (res); + return (bus_generic_rman_alloc_resource(bus, child, type, rid, start, + end, count, flags)); } static int @@ -762,36 +762,125 @@ lbc_print_child(device_t dev, device_t child) return (rv); } +static int +lbc_adjust_resource(device_t dev, device_t child, int type, struct resource *r, + rman_res_t start, rman_res_t end) +{ + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(dev, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_adjust_resource(dev, type, r, start, end)); + default: + return (EINVAL); + } +} + static int lbc_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { - int err; + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(dev, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_release_resource(dev, type, rid, res)); + default: + return (EINVAL); + } +} - if (rman_get_flags(res) & RF_ACTIVE) { - err = bus_deactivate_resource(child, type, rid, res); - if (err) - return (err); +static int +lbc_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + return (bus_activate_resource(bus, type, rid, r)); + default: + return (EINVAL); } +} - return (rman_release_resource(res)); +static int +lbc_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + return (bus_deactivate_resource(bus, type, rid, r)); + default: + return (EINVAL); + } } static int -lbc_activate_resource(device_t bus __unused, device_t child __unused, - int type __unused, int rid __unused, struct resource *r) +lbc_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) { + struct resource_map_request args; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); - /* Child resources were already mapped, just activate. */ - return (rman_activate_resource(r)); + map->r_bustag = &bs_be_tag; + map->r_bushandle = start; + map->r_size = length; + map->r_vaddr = NULL; + return (0); } static int -lbc_deactivate_resource(device_t bus __unused, device_t child __unused, - int type __unused, int rid __unused, struct resource *r) +lbc_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) { - return (rman_deactivate_resource(r)); + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + return (0); } static const struct ofw_bus_devinfo * From nobody Thu Feb 27 14:16:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLB5j6Dz5qGFL; Thu, 27 Feb 2025 14:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLB5FGLz3wr3; Thu, 27 Feb 2025 14:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyFmOywq9/LrA5eC90px5xQyOkD7Fx+nLXL0RplQsUE=; b=X/lwNrG+gpqEJYwdMeo6s5LfNuvQ/m5C5Eewur11NJ6FqSQbns71vSbCxQo6Rb2qSPZrc+ pA3ykLpjxR4EmCRCQ3J8GwI2KcrUlpuLzHOmW+8Oa5trkgZC9hwooFgbENmHzu5+R4KPfY aqnBxJcog/W8fCqS0i2exgZGsglGVBpobcM5+Xq+fb9awJjWA6IdK9xmzFxUj5mC8q6hLq 7a25oW8vAs4NT74rbhyp2M5Zi0r5rf3+bPNhl9wIxExGY3C9ip1cYyITmzWWPfLVLwgpFG km1jDwVy6QxMFGroJlNhGfbzMPjF+YzYq+DuMV64YXHPLdYhTLom/wAMowRAoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665794; a=rsa-sha256; cv=none; b=jsROjTyjMxGPmJ1KHl7Hcp5HfixxUx5Igf+l+AEDlQZMKsUmK+GnfAOwA5MZTT4kOWvZhK AQ0f7OIDam099WiiZA21wqDLTWtdq+hewVcDx/+ESglOLLW4lSEhk5JOAD/nkqzMRw3vk2 6p+O60Gwm7q8Lpkx9ik3IguV8MWO/zAL611MuzWqb0CqAvHHVolOtZBvKgN77rCVTOM3/c 3OHLlOlwh9RWq0Dc2MujfHIQnlwIkCXDOeMVA3uiuHrtgG+JQX9qrICChHkek9EzIW/rFg 54Djyp+kXAlL/gBq2IUi9KR9ur7YBdCwWmYu5dWvDxkNVMjZlUgERZHSRbvkZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyFmOywq9/LrA5eC90px5xQyOkD7Fx+nLXL0RplQsUE=; b=rB+OhOkvc45vUplsDECd/nJCyMb/+ta20Dhf4eZhlmGoPgf2gNTH8QO16m4874/TE37/Ux fP5O+rcwg0uhwBtw9Rtfh5CMNMC9rfRLeAVeBZn8AOFuBmXWS/MDS3xbD8VfZvZWa4cwOg cqnaLmEF73XBZhbbXAl7zwDmecVcytilN+l8Ph8cd/ydX8KFAhdA4fIMRUq0AwQY3NbGA6 2l74ERPf+hcSuCgEywkKhMKNj/6AUx1cQBGEy4VZbKX3LhhkZasmbveKsxt6Y6q9njNB/N enjwD8sjzwXDwORUfn1aJSMQ6eBSLekZFZBZlj1kooTHGbAyxZN/aG6Y5DJmqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLB4cDxzmQD; Thu, 27 Feb 2025 14:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGYu8015726; Thu, 27 Feb 2025 14:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGYWT015723; Thu, 27 Feb 2025 14:16:34 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:34 GMT Message-Id: <202502271416.51REGYWT015723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 326dfed42c7e - stable/14 - powerpc psim: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 326dfed42c7ead51f63a60424441d332a7444c57 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=326dfed42c7ead51f63a60424441d332a7444c57 commit 326dfed42c7ead51f63a60424441d332a7444c57 Author: John Baldwin AuthorDate: 2024-01-23 17:36:26 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc psim: Use bus_generic_rman_* - Split out bits of iobus_activate/deactive_resource to implement iobus_map/unmap_resource. - Use bus_generic_rman_* methods in several bus methods to handle memory and I/O port resources. - Add an implementation of bus_adjust_resource. Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43433 (cherry picked from commit d7c16b333455faef4236d98bb6e671651e87a66d) --- sys/powerpc/psim/iobus.c | 183 +++++++++++++++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 60 deletions(-) diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index 4ec0f1664e1c..497ef42d82e6 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -70,13 +70,21 @@ static int iobus_print_child(device_t dev, device_t child); static void iobus_probe_nomatch(device_t, device_t); static int iobus_read_ivar(device_t, device_t, int, uintptr_t *); static int iobus_write_ivar(device_t, device_t, int, uintptr_t); +static struct rman *iobus_get_rman(device_t, int, u_int); static struct resource *iobus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int iobus_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int iobus_activate_resource(device_t, device_t, int, int, struct resource *); static int iobus_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int iobus_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, + struct resource_map *); +static int iobus_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int iobus_release_resource(device_t, device_t, int, int, struct resource *); @@ -100,10 +108,14 @@ static device_method_t iobus_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, iobus_get_rman), DEVMETHOD(bus_alloc_resource, iobus_alloc_resource), + DEVMETHOD(bus_adjust_resource, iobus_adjust_resource), DEVMETHOD(bus_release_resource, iobus_release_resource), DEVMETHOD(bus_activate_resource, iobus_activate_resource), DEVMETHOD(bus_deactivate_resource, iobus_deactivate_resource), + DEVMETHOD(bus_map_resource, iobus_map_resource), + DEVMETHOD(bus_unmap_resource, iobus_unmap_resource), { 0, 0 } }; @@ -293,26 +305,32 @@ iobus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) return (EINVAL); } -static struct resource * -iobus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, - u_int flags) +static struct rman * +iobus_get_rman(device_t bus, int type, u_int flags) { struct iobus_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; +static struct resource * +iobus_alloc_resource(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, + u_int flags) +{ switch (type) { case SYS_RES_MEMORY: case SYS_RES_IOPORT: - rm = &sc->sc_mem_rman; - break; + return (bus_generic_rman_alloc_resource(bus, child, type, rid, + start, end, count, flags)); case SYS_RES_IRQ: return (bus_alloc_resource(bus, type, rid, start, end, count, flags)); @@ -321,80 +339,125 @@ iobus_alloc_resource(device_t bus, device_t child, int type, int *rid, device_get_nameunit(child)); return (NULL); } +} - rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == NULL) { - device_printf(bus, "failed to reserve resource for %s\n", - device_get_nameunit(child)); - return (NULL); - } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } +static int +iobus_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ - return (rv); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_adjust_resource(bus, type, r, start, end)); + default: + return (EINVAL); + } } static int iobus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - if (rman_get_flags(res) & RF_ACTIVE) { - int error = bus_deactivate_resource(child, type, rid, res); - if (error) - return error; - } - return (rman_release_resource(res)); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + case SYS_RES_IRQ: + return (bus_release_resource(bus, type, rid, res)); + default: + return (EINVAL); + } } static int iobus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - struct iobus_softc *sc; - void *p; - - sc = device_get_softc(bus); - if (type == SYS_RES_IRQ) + switch (type) { + case SYS_RES_IRQ: return (bus_activate_resource(bus, type, rid, res)); - - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - p = pmap_mapdev((vm_paddr_t)rman_get_start(res) + sc->sc_addr, - (vm_size_t)rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_le_tag); - rman_set_bushandle(res, (u_long)p); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, res)); + default: + return (EINVAL); } - - return (rman_activate_resource(res)); } static int iobus_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - u_int32_t psize; - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); + switch (type) { + case SYS_RES_IRQ: + return (bus_deactivate_resource(bus, type, rid, res)); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + default: + return (EINVAL); } +} - return (rman_deactivate_resource(res)); +static int +iobus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + struct iobus_softc *sc; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + sc = device_get_softc(bus); + map->r_vaddr = pmap_mapdev_attr((vm_paddr_t)start + sc->sc_addr, + (vm_size_t)length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_le_tag; + map->r_bushandle = (vm_offset_t)map->r_vaddr; + map->r_size = length; + return (0); +} + +static int +iobus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + return (0); + default: + return (EINVAL); + } } From nobody Thu Feb 27 16:57:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3cvK6LrNz59JCt; Thu, 27 Feb 2025 16:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3cvK5cnFz45x2; Thu, 27 Feb 2025 16:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iOJpLiq8aWTbGsTA6X9aIv0QDTZHoqy9gbr5Ql/aLGE=; b=ZtJ+gvXeW7ey1Xe+rgF1oe5SdPIIdp1ABq6FLFVODTrS8qAd+pdtmpVVr5YEzYLXKSYLkn PY92ogb9UPsf3n9bJ8Yy6dysQBG76pqSsLke7S+il0gMWOqP0A2KI0vay4NqITtzZQ+7s0 VgtAHGnwB8U45QQNLOLoylzGacQvkZZFvtFkrTKVrYy5PxibXkA1CZGHPrfhXd19oHEBpx 1Wnz6D/HLkd2NI3vx1/7KHKcsvNJI7fTmgh7hoWVMjG7y9//KSoVFxKn1D8PflR+WeWFLO +91L4bsaeNKzg6V29+PqB7CaIZnSvu7wE+flKIlR/+M7jHpUgYTkSHLGy4EWaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675421; a=rsa-sha256; cv=none; b=g0eC3W8+yrcrUDT53kD7CqdtTtKuayJ/bjp/j4przw0nUfYORoMvNaIAlI1pRTBaMiJRHv v6Xw3M42tCH3nb8wz85Eam9Iw9eyDXqcsXhuUDYaKWKIFZxvKNii8TzwxsfnJnJ4BQiaKG 9UCiNS3Y6ag1wQl/XUMyfsz61nuPdF/kqBXefYzPWygGO55xUin+yLKGViIk5iZQe9pC2g 5Op0v/1HJ52JFOh+9rQ8QqAluJZD1HRaPsbCmwltXclO3L/xAlVpLgwov0KupLxvbGDXNA aqAUGGvkirEuyWEygzpMly/D6SZt3BJeNG2hs9dWVUzFkPk75o1EdTmyZ+XeSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iOJpLiq8aWTbGsTA6X9aIv0QDTZHoqy9gbr5Ql/aLGE=; b=vSUqaAHeLBJNd4Ku6jiMhHM80q7IqAdG5PHUO1XGR+4X+ZK+y1kPQUbzYtFv+q/IAzMsZ/ bnrhcHrHTSh4F+TpEmjIRD7FaRHtcBVOoX+YkptIsC4yvjYl+sl0FHZtVsnww02tduKVN5 W5txh4SUhoPGGWuBx+1sUhLAvfcDZ8oAMJR1UUYb0DhxNdQ+bIkNaKjXb0x7Jm0TUaTIvI Wzv6OlguaOWDmSPJIaKnbZa5Zj2WqihfvzE/46wEjEDGbGQ6ciYH5UvZIOnfeys1p2wNLL 4Ixj9idP/FHTpL6BtzI1jY8nsjVmBdKhTd5W+9/eT5jBa9rnSHXLhgtkZGhXew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3cvK4wqkzrvS; Thu, 27 Feb 2025 16:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGv1WG017551; Thu, 27 Feb 2025 16:57:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGv1FS017548; Thu, 27 Feb 2025 16:57:01 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:57:01 GMT Message-Id: <202502271657.51RGv1FS017548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 6b33d9dc46c2 - main - vm_page: expose page_alloc_after List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b33d9dc46c2f1cbb91273771198b71d7cbdb328 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=6b33d9dc46c2f1cbb91273771198b71d7cbdb328 commit 6b33d9dc46c2f1cbb91273771198b71d7cbdb328 Author: Doug Moore AuthorDate: 2025-02-27 16:55:33 +0000 Commit: Doug Moore CommitDate: 2025-02-27 16:55:33 +0000 vm_page: expose page_alloc_after vm_page_alloc() just calls vm_page_alloc_after(), after it has found the predecessor of a page parameter. Many callers of vm_page_alloc() already know that predecessor. Letting them pass that to vm_page_alloc_after() directly could save a little redundant calculation. Reviewed by: alc Tested by: pho Differential Revision: https://reviews.freebsd.org/D49103 --- sys/vm/swap_pager.c | 23 ++++++++++++++++------- sys/vm/vm_fault.c | 10 ++++++---- sys/vm/vm_page.c | 8 +++----- sys/vm/vm_page.h | 1 + sys/vm/vnode_pager.c | 22 ++++++++++++++-------- 5 files changed, 40 insertions(+), 24 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 3d02f365cad9..dbe0b6710367 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1415,9 +1415,11 @@ swap_pager_getpages_locked(struct pctrie_iter *blks, vm_object_t object, * Allocate readahead and readbehind pages. */ if (rbehind != NULL) { + pindex = ma[0]->pindex; + /* Stepping backward from pindex, mpred doesn't change. */ for (i = 1; i <= *rbehind; i++) { - p = vm_page_alloc(object, ma[0]->pindex - i, - VM_ALLOC_NORMAL); + p = vm_page_alloc_after(object, pindex - i, + VM_ALLOC_NORMAL, mpred); if (p == NULL) break; p->oflags |= VPO_SWAPINPROG; @@ -1426,9 +1428,11 @@ swap_pager_getpages_locked(struct pctrie_iter *blks, vm_object_t object, *rbehind = i - 1; } if (rahead != NULL) { + p = ma[reqcount - 1]; + pindex = p->pindex; for (i = 0; i < *rahead; i++) { - p = vm_page_alloc(object, - ma[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); + p = vm_page_alloc_after(object, pindex + i + 1, + VM_ALLOC_NORMAL, p); if (p == NULL) break; p->oflags |= VPO_SWAPINPROG; @@ -1982,9 +1986,14 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) if (m != NULL) { if (!vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL)) break; - } else if ((m = vm_page_alloc(object, blks.index + i, - VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL)) == NULL) - break; + } else { + m = vm_radix_iter_lookup_le(&pages, + blks.index + i); + m = vm_page_alloc_after(object, blks.index + i, + VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL, m); + if (m == NULL) + break; + } /* Get the page from swap, and restart the scan. */ vm_object_pip_add(object, 1); diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 8c7fe9e37af1..c97a7cd998df 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -2085,7 +2085,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map __unused, vm_pindex_t dst_pindex, pindex, src_pindex; vm_prot_t access, prot; vm_offset_t vaddr; - vm_page_t dst_m; + vm_page_t dst_m, mpred; vm_page_t src_m; bool upgrade; @@ -2157,9 +2157,11 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map __unused, * with the source object, all of its pages must be dirtied, * regardless of whether they can be written. */ + mpred = (src_object == dst_object) ? + vm_page_mpred(src_object, src_pindex) : NULL; for (vaddr = dst_entry->start, dst_pindex = 0; vaddr < dst_entry->end; - vaddr += PAGE_SIZE, dst_pindex++) { + vaddr += PAGE_SIZE, dst_pindex++, mpred = dst_m) { again: /* * Find the page in the source object, and copy it in. @@ -2197,9 +2199,9 @@ again: /* * Allocate a page in the destination object. */ - dst_m = vm_page_alloc(dst_object, (src_object == + dst_m = vm_page_alloc_after(dst_object, (src_object == dst_object ? src_pindex : 0) + dst_pindex, - VM_ALLOC_NORMAL); + VM_ALLOC_NORMAL, mpred); if (dst_m == NULL) { VM_OBJECT_WUNLOCK(dst_object); VM_OBJECT_RUNLOCK(object); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index e4c2aadf5d56..e9c371e62d70 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -162,8 +162,6 @@ SYSCTL_PROC(_vm, OID_AUTO, page_blacklist, CTLTYPE_STRING | CTLFLAG_RD | static uma_zone_t fakepg_zone; -static vm_page_t vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex, - int req, vm_page_t mpred); static void vm_page_alloc_check(vm_page_t m); static vm_page_t vm_page_alloc_nofree_domain(int domain, int req); static bool _vm_page_busy_sleep(vm_object_t obj, vm_page_t m, @@ -2173,7 +2171,7 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) * the resident page in the object with largest index smaller than the given * page index, or NULL if no such page exists. */ -static vm_page_t +vm_page_t vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex, int req, vm_page_t mpred) { @@ -5045,8 +5043,8 @@ retrylookup: !vm_page_tryxbusy(ma[i])) break; } else { - ma[i] = vm_page_alloc(object, m->pindex + i, - VM_ALLOC_NORMAL); + ma[i] = vm_page_alloc_after(object, + m->pindex + i, VM_ALLOC_NORMAL, ma[i - 1]); if (ma[i] == NULL) break; } diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 5a166d9ba44c..05c16212a995 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -608,6 +608,7 @@ void vm_page_activate (vm_page_t); void vm_page_advise(vm_page_t m, int advice); vm_page_t vm_page_mpred(vm_object_t, vm_pindex_t); vm_page_t vm_page_alloc(vm_object_t, vm_pindex_t, int); +vm_page_t vm_page_alloc_after(vm_object_t, vm_pindex_t, int, vm_page_t); vm_page_t vm_page_alloc_domain_after(vm_object_t, vm_pindex_t, int, int, vm_page_t); vm_page_t vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req, diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 842d4ab89b90..d5d312b3cf71 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -1042,19 +1042,23 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count, i = bp->b_npages = 0; if (rbehind) { vm_pindex_t startpindex, tpindex; - vm_page_t p; + vm_page_t mpred, p; VM_OBJECT_WLOCK(object); startpindex = m[0]->pindex - rbehind; - if ((p = TAILQ_PREV(m[0], pglist, listq)) != NULL && - p->pindex >= startpindex) - startpindex = p->pindex + 1; + if ((mpred = TAILQ_PREV(m[0], pglist, listq)) != NULL && + mpred->pindex >= startpindex) + startpindex = mpred->pindex + 1; - /* tpindex is unsigned; beware of numeric underflow. */ + /* + * tpindex is unsigned; beware of numeric underflow. + * Stepping backward from pindex, mpred doesn't change. + */ for (tpindex = m[0]->pindex - 1; tpindex >= startpindex && tpindex < m[0]->pindex; tpindex--, i++) { - p = vm_page_alloc(object, tpindex, VM_ALLOC_NORMAL); + p = vm_page_alloc_after(object, tpindex, + VM_ALLOC_NORMAL, mpred); if (p == NULL) { /* Shift the array. */ for (int j = 0; j < i; j++) @@ -1089,9 +1093,11 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count, if (endpindex > object->size) endpindex = object->size; - for (tpindex = m[count - 1]->pindex + 1; + p = m[count - 1]; + for (tpindex = p->pindex + 1; tpindex < endpindex; i++, tpindex++) { - p = vm_page_alloc(object, tpindex, VM_ALLOC_NORMAL); + p = vm_page_alloc_after(object, tpindex, + VM_ALLOC_NORMAL, p); if (p == NULL) break; bp->b_pages[i] = p; From nobody Thu Feb 27 14:17:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YM36J3Jz5qFY1; Thu, 27 Feb 2025 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM35cH3z3xPg; Thu, 27 Feb 2025 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZTTwMC19pYLW6+Yj9n3SYb9PTjDdsreiaykl3kxWv2Y=; b=Jf2M7ZtG9e/ru5P/NlzmyqkvaACuEGX6ObiLt0xyfhpacH9/rZcRkJkVAv3gj4gdmGX+I5 4JpLGp5CO0SntxId4VDfaFUsY+WU/pYoC0P5TjX0zae6pfSpQKVup+rqPP7pWAIMx6pMTB qd48vW9jLaUHjxcASoZbQ4WQHwwhIUQ9GIvedwVvwtbwdHcwMRgBOrRC6NsFnIodlinp2D yPUDob2YrQ8njYun8xdGJH7NODKVZmZQjv8ReXlIisnLywxYpcdwUR63a3Y0dJhRNHo4S1 OoK7Oqyot+TZVP07MWM+QZdfNw+RWegKlO30w0+A15oe9qEkVx6pzyqonRJREQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665839; a=rsa-sha256; cv=none; b=e1yyT+r4Jz7DMwUC7cEfi2J7zpiDQhHwHRkjq18Qy1JUPp94SfT3dyjdYar12VE1AdT+cm BGo/AXFk14nODT3O6VyCZfiDuJPB9vqpMeg/ABcYwPoXWzEc5YCuMrL4cXK6y5J7XtWejy 4xztERwNZ8a96tSdy7Mrxo3kw9/0ZdqrduRitq3Izi0LuNPKl6TZYuhwfGN4AQ/twJCWZU 9z7FCtLMIjhLTqb86fPO4XwkQzOVoG2+56RIfqiC4EFGGlzknszxv8CM2VrsU/2QVcSLIs DwHPNN+Go9KZRgHSKKFHw6R/GSXXPdJbTSWUCiuikF7tBkO1MzYYhVszj/FKyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZTTwMC19pYLW6+Yj9n3SYb9PTjDdsreiaykl3kxWv2Y=; b=L5SkaXOnOyWP1k948hqKb+Cu8J5V0PJFGYTn9YW8ntuX5KIMicXOd5QFyBpzEPR42F/23d FztYnBgdxUnrDUvqLbtirQHEBWLHZb5+45w1Br0YgFGLQaskur+u4zyviBTYHzUtGM389q WdJmMTPlWRIlYZBoBw5z4F7EuQ4neOgNUCzdWt3dzagieuVsjeFZLcPkcnjYBFgcvz8AKI vwJ+drU4Wz2ex6om3VKs18hiilvZqyIKXgHcZxM7tU5Z3qlmQ4mR+iqSm3AUsRpyeXx5YC RBu3mTpGoWRZDyjB4h59EQGVsB48Ly8uQZW2ZIBEK2apRmQ9N3lcWcwI4rsNmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YM34rwCzm7R; Thu, 27 Feb 2025 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHJwd017156; Thu, 27 Feb 2025 14:17:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHJCl017153; Thu, 27 Feb 2025 14:17:19 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:19 GMT Message-Id: <202502271417.51REHJCl017153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e14fd50dd810 - stable/14 - new-bus: Introduce a simpler bus API for managing resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e14fd50dd810a0b5fcdda002755a1942e202aaeb Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e14fd50dd810a0b5fcdda002755a1942e202aaeb commit e14fd50dd810a0b5fcdda002755a1942e202aaeb Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 new-bus: Introduce a simpler bus API for managing resources Remove the 'type' and 'rid' arguments from the wrapper bus API functions (e.g. bus_release_resource) that accept a struct resource. The "new" versions extract the 'type' and/or 'rid' from the passed in resource object via rman_get_type and rman_get_rid. This commit adds the new API as functions with a _new suffix. Wrapper macros choose between the old and new functions based on the number of arguments provided to the macro. This commit does not change the ABI but can be safely MFCd to older branches so long as older kernels use rman_set_type when allocating resources. Future commits will push the removal of these extraneous arguments through the bus implementation. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44124 (cherry picked from commit 9edb8d0aedef2f1e13ed1f8134deb3f8291d2fe9) --- sys/kern/subr_bus.c | 42 ++++++++++++++++++++++++++++++++++++++++++ sys/sys/bus.h | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index ffad54c34925..5d1a13c08892 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4618,6 +4618,13 @@ bus_adjust_resource(device_t dev, int type, struct resource *r, rman_res_t start return (BUS_ADJUST_RESOURCE(dev->parent, dev, type, r, start, end)); } +int +bus_adjust_resource_new(device_t dev, struct resource *r, rman_res_t start, + rman_res_t end) +{ + return (bus_adjust_resource(dev, rman_get_type(r), r, start, end)); +} + /** * @brief Wrapper function for BUS_TRANSLATE_RESOURCE(). * @@ -4647,6 +4654,13 @@ bus_activate_resource(device_t dev, int type, int rid, struct resource *r) return (BUS_ACTIVATE_RESOURCE(dev->parent, dev, type, rid, r)); } +int +bus_activate_resource_new(device_t dev, struct resource *r) +{ + return (bus_activate_resource(dev, rman_get_type(r), rman_get_rid(r), + r)); +} + /** * @brief Wrapper function for BUS_DEACTIVATE_RESOURCE(). * @@ -4661,6 +4675,13 @@ bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r) return (BUS_DEACTIVATE_RESOURCE(dev->parent, dev, type, rid, r)); } +int +bus_deactivate_resource_new(device_t dev, struct resource *r) +{ + return (bus_deactivate_resource(dev, rman_get_type(r), rman_get_rid(r), + r)); +} + /** * @brief Wrapper function for BUS_MAP_RESOURCE(). * @@ -4676,6 +4697,13 @@ bus_map_resource(device_t dev, int type, struct resource *r, return (BUS_MAP_RESOURCE(dev->parent, dev, type, r, args, map)); } +int +bus_map_resource_new(device_t dev, struct resource *r, + struct resource_map_request *args, struct resource_map *map) +{ + return (bus_map_resource(dev, rman_get_type(r), r, args, map)); +} + /** * @brief Wrapper function for BUS_UNMAP_RESOURCE(). * @@ -4691,6 +4719,13 @@ bus_unmap_resource(device_t dev, int type, struct resource *r, return (BUS_UNMAP_RESOURCE(dev->parent, dev, type, r, map)); } +int +bus_unmap_resource_new(device_t dev, struct resource *r, + struct resource_map *map) +{ + return (bus_unmap_resource(dev, rman_get_type(r), r, map)); +} + /** * @brief Wrapper function for BUS_RELEASE_RESOURCE(). * @@ -4708,6 +4743,13 @@ bus_release_resource(device_t dev, int type, int rid, struct resource *r) return (rv); } +int +bus_release_resource_new(device_t dev, struct resource *r) +{ + return (bus_release_resource(dev, rman_get_type(r), rman_get_rid(r), + r)); +} + /** * @brief Wrapper function for BUS_SETUP_INTR(). * diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 5d5336591ea6..c1391c4a7284 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -613,6 +613,43 @@ bus_alloc_resource_anywhere(device_t dev, int type, int *rid, return (bus_alloc_resource(dev, type, rid, 0, ~0, count, flags)); } +/* Compat shims for simpler bus resource API. */ +int bus_adjust_resource_new(device_t child, struct resource *r, + rman_res_t start, rman_res_t end); +int bus_activate_resource_new(device_t dev, struct resource *r); +int bus_deactivate_resource_new(device_t dev, struct resource *r); +int bus_map_resource_new(device_t dev, struct resource *r, + struct resource_map_request *args, struct resource_map *map); +int bus_unmap_resource_new(device_t dev, struct resource *r, + struct resource_map *map); +int bus_release_resource_new(device_t dev, struct resource *r); + +#define _BUS_API_MACRO(_1, _2, _3, _4, _5, NAME, ...) NAME + +#define bus_adjust_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, bus_adjust_resource, \ + bus_adjust_resource_new)(__VA_ARGS__) + +#define bus_activate_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_activate_resource, \ + INVALID, bus_activate_resource_new)(__VA_ARGS__) + +#define bus_deactivate_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_deactivate_resource, \ + INVALID, bus_deactivate_resource_new)(__VA_ARGS__) + +#define bus_map_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, bus_map_resource, \ + bus_map_resource_new)(__VA_ARGS__) + +#define bus_unmap_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_unmap_resource, \ + bus_unmap_resource_new)(__VA_ARGS__) + +#define bus_release_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_release_resource, \ + INVALID, bus_release_resource_new)(__VA_ARGS__) + /* * Access functions for device. */ From nobody Thu Feb 27 15:33:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3b3R6CV1z5qKD6; Thu, 27 Feb 2025 15:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3b3R5rKkz42jr; Thu, 27 Feb 2025 15:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740670435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wXAnIej6HVpWmVv+tzuiyKZl7HSi/4cwfAves/XImQQ=; b=h8fQGh93QU+6xBzPnFe3RAvhWI10iLdteye9PhAHvECRZzrzeryIGuwxxFBsoR10PPBc/B 0Jk0Sdi8Zx4R9Y/oeMDJ7BTsrYSQXdBR/6iGx83iuYah2VGVm0YdU2cf3LmXsdJJR4XaTg v9y20a68ZKZG4wnXY8HiNIrqEymxIuIgESsjLs4d+K+EZFAPhvRhqhH5fUtYsxeyG3PilI WrKKdfBQRLApqyJzadoHy3Y6gQlhyk1JVDNbg/C2b5uJYme5uSLOXlFRRMcVmgYCkDOCIC G+CYwdhm/U2lY4cvxuy+vvpERcQN6f2nzQI3Ea7sFXqhTZ4qo0D3b6C6H4Tpcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740670435; a=rsa-sha256; cv=none; b=FSNaVmsrjRH2nVcZaEc9+T5ZMypKmWbNLZL5vH+BzIXp9qe5sLjipr82VKTDm5drtFc/yI Rb393JZCAVW1ZB9+0DFZjPYskivT17vHfTzfh/210k5Eh/QQoyI5PDgVoRTG8bqEgdGquv +EuoiI4D1uOpmnzC/IGV87SHr2by3efUvlJnWFA2JN3At2QAo1q2fFZoPa1bFNWc52b6gj GhArif/eP+EQMvDJu8Uv9P8DJLP3aab1yjGzSCiyIUMhkCEq/uxiYeqjTuBMJPlDwlLKli E6tTGZyTU9RsSNh4PA/X7LpFJUM7uYRPX6QqQAW1+T5KUS2OnGE+Y0JTuOIf6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740670435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wXAnIej6HVpWmVv+tzuiyKZl7HSi/4cwfAves/XImQQ=; b=de5h13ACnRr3rnZNEbNOgc45XuhPyLPT+9zZhhDikHhdVdAuUC0gnJGjeu3zoL4Pg7gibH s0iEfF13VCDNYBQzGmdffKNP0VEBwzty74idpSqOyJBLZ7hvOXmgiFiNxJ4MNJcOmVDGDo 4FOB+kSKo9nyWgkz5VvqixFd+fDvIuy6dmgbdpJ5fxS9GujqgZxHOsguG+i0Q098p1FA0d 66Bw8enPJ9TOaqWV7RS9UX/mQeWkop872P02XkEOnJVEvTiSt67/HUvt2tGBojfZkaKL3g 2EpdFWPmXe3CBBDFaTV5NIRUlOlZ9w1XpGwbAignAfVU5Lo4TxvruXAz6qFylg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3b3R59BtzpvY; Thu, 27 Feb 2025 15:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RFXt0Q065948; Thu, 27 Feb 2025 15:33:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RFXtl7065945; Thu, 27 Feb 2025 15:33:55 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:33:55 GMT Message-Id: <202502271533.51RFXtl7065945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: f6f116cdbd2a - main - pf: Make af-to work on outbound interface List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6f116cdbd2a406d2913df5368299ba4cdbf40a1 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=f6f116cdbd2a406d2913df5368299ba4cdbf40a1 commit f6f116cdbd2a406d2913df5368299ba4cdbf40a1 Author: Kajetan Staszkiewicz AuthorDate: 2025-02-23 18:13:48 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-02-27 15:28:27 +0000 pf: Make af-to work on outbound interface Currently af-to works only on inbound interface by creating a reversed NAT state key which is used to match traffic returning on the outbound interface. Such limitation is not necessary. When an af-to state is created for an outbound rule do not reverse the NAT state key, making it work just like if it was created for a normal NAT rule. Depending on firewall design it might be easier and more natural to use af-to on the outbound interface. Reviewed by: kp Approved by: kp (mentor) Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D49122 --- sys/net/pfvar.h | 7 +- sys/netpfil/pf/pf.c | 245 +++++++++++++++++++++++------------------ sys/netpfil/pf/pf_lb.c | 42 ++----- tests/sys/netpfil/pf/nat64.sh | 247 +++++++++++++++++++++++++++++++++++------- 4 files changed, 368 insertions(+), 173 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b481f767725d..b9b7f71c07d1 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1005,9 +1005,10 @@ struct pf_state_key { TAILQ_HEAD(, pf_kstate) states[2]; }; -#define PF_REVERSED_KEY(key, family) \ - ((key[PF_SK_WIRE]->af != key[PF_SK_STACK]->af) && \ - (key[PF_SK_WIRE]->af != (family))) +#define PF_REVERSED_KEY(state, family) \ + (((state)->key[PF_SK_WIRE]->af != (state)->key[PF_SK_STACK]->af) && \ + ((state)->key[PF_SK_WIRE]->af != (family)) && \ + ((state)->direction == PF_IN)) /* Keep synced with struct pf_kstate. */ struct pf_state_cmp { diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 24ddf75936de..72e648b84b2f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -351,9 +351,13 @@ static int pf_create_state(struct pf_krule *, struct pf_krule *, static int pf_state_key_addr_setup(struct pf_pdesc *, struct pf_state_key_cmp *, int); static int pf_tcp_track_full(struct pf_kstate **, - struct pf_pdesc *, u_short *, int *); + struct pf_pdesc *, u_short *, int *, + struct pf_state_peer *, struct pf_state_peer *, + u_int8_t, u_int8_t); static int pf_tcp_track_sloppy(struct pf_kstate **, - struct pf_pdesc *, u_short *); + struct pf_pdesc *, u_short *, + struct pf_state_peer *, struct pf_state_peer *, + u_int8_t, u_int8_t); static int pf_test_state(struct pf_kstate **, struct pf_pdesc *, u_short *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, @@ -458,7 +462,7 @@ BOUND_IFACE(struct pf_kstate *st, struct pf_pdesc *pd) * Initially set to all, because we don't know what interface we'll be * sending this out when we create the state. */ - if (st->rule->rt == PF_REPLYTO || (pd->af != pd->naf)) + if (st->rule->rt == PF_REPLYTO || (pd->af != pd->naf && st->direction == PF_IN)) return (V_pfi_all); /* @@ -1739,11 +1743,18 @@ pf_state_key_setup(struct pf_pdesc *pd, u_int16_t sport, u_int16_t dport, */ bzero(&(*nk)->addr[0], sizeof((*nk)->addr[0])); bzero(&(*nk)->addr[1], sizeof((*nk)->addr[1])); + if (pd->dir == PF_IN) { + PF_ACPY(&(*nk)->addr[pd->didx], &pd->nsaddr, pd->naf); + PF_ACPY(&(*nk)->addr[pd->sidx], &pd->ndaddr, pd->naf); + (*nk)->port[pd->didx] = pd->nsport; + (*nk)->port[pd->sidx] = pd->ndport; + } else { + PF_ACPY(&(*nk)->addr[pd->sidx], &pd->nsaddr, pd->naf); + PF_ACPY(&(*nk)->addr[pd->didx], &pd->ndaddr, pd->naf); + (*nk)->port[pd->sidx] = pd->nsport; + (*nk)->port[pd->didx] = pd->ndport; + } - PF_ACPY(&(*nk)->addr[pd->didx], &pd->nsaddr, pd->naf); - PF_ACPY(&(*nk)->addr[pd->sidx], &pd->ndaddr, pd->naf); - (*nk)->port[pd->didx] = pd->nsport; - (*nk)->port[pd->sidx] = pd->ndport; switch (pd->proto) { case IPPROTO_ICMP: (*nk)->proto = IPPROTO_ICMPV6; @@ -5934,24 +5945,25 @@ nextrule: nat64 = pd->af != pd->naf; if (nat64) { - struct pf_state_key *_sk; int ret; if (sk == NULL) sk = (*sm)->key[pd->dir == PF_IN ? PF_SK_STACK : PF_SK_WIRE]; if (nk == NULL) nk = (*sm)->key[pd->dir == PF_IN ? PF_SK_WIRE : PF_SK_STACK]; - if (pd->dir == PF_IN) - _sk = sk; - else - _sk = nk; - - ret = pf_translate(pd, - &_sk->addr[pd->didx], - _sk->port[pd->didx], - &_sk->addr[pd->sidx], - _sk->port[pd->sidx], - virtual_type, icmp_dir); + + if (pd->dir == PF_IN) { + ret = pf_translate(pd, &sk->addr[pd->didx], + sk->port[pd->didx], &sk->addr[pd->sidx], + sk->port[pd->sidx], virtual_type, + icmp_dir); + } else { + ret = pf_translate(pd, &sk->addr[pd->sidx], + sk->port[pd->sidx], &sk->addr[pd->didx], + sk->port[pd->didx], virtual_type, + icmp_dir); + } + if (ret < 0) goto cleanup; @@ -6383,37 +6395,15 @@ pf_translate(struct pf_pdesc *pd, struct pf_addr *saddr, u_int16_t sport, static int pf_tcp_track_full(struct pf_kstate **state, struct pf_pdesc *pd, - u_short *reason, int *copyback) + u_short *reason, int *copyback, struct pf_state_peer *src, + struct pf_state_peer *dst, u_int8_t psrc, u_int8_t pdst) { struct tcphdr *th = &pd->hdr.tcp; - struct pf_state_peer *src, *dst; u_int16_t win = ntohs(th->th_win); u_int32_t ack, end, data_end, seq, orig_seq; - u_int8_t sws, dws, psrc, pdst; + u_int8_t sws, dws; int ackskew; - if (pd->dir == (*state)->direction) { - if (PF_REVERSED_KEY((*state)->key, pd->af)) { - src = &(*state)->dst; - dst = &(*state)->src; - } else { - src = &(*state)->src; - dst = &(*state)->dst; - } - psrc = PF_PEER_SRC; - pdst = PF_PEER_DST; - } else { - if (PF_REVERSED_KEY((*state)->key, pd->af)) { - src = &(*state)->src; - dst = &(*state)->dst; - } else { - src = &(*state)->dst; - dst = &(*state)->src; - } - psrc = PF_PEER_DST; - pdst = PF_PEER_SRC; - } - if (src->wscale && dst->wscale && !(tcp_get_flags(th) & TH_SYN)) { sws = src->wscale & PF_WSCALE_MASK; dws = dst->wscale & PF_WSCALE_MASK; @@ -6733,23 +6723,11 @@ pf_tcp_track_full(struct pf_kstate **state, struct pf_pdesc *pd, } static int -pf_tcp_track_sloppy(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason) +pf_tcp_track_sloppy(struct pf_kstate **state, struct pf_pdesc *pd, + u_short *reason, struct pf_state_peer *src, struct pf_state_peer *dst, + u_int8_t psrc, u_int8_t pdst) { struct tcphdr *th = &pd->hdr.tcp; - struct pf_state_peer *src, *dst; - u_int8_t psrc, pdst; - - if (pd->dir == (*state)->direction) { - src = &(*state)->src; - dst = &(*state)->dst; - psrc = PF_PEER_SRC; - pdst = PF_PEER_DST; - } else { - src = &(*state)->dst; - dst = &(*state)->src; - psrc = PF_PEER_DST; - pdst = PF_PEER_SRC; - } if (tcp_get_flags(th) & TH_SYN) if (src->state < TCPS_SYN_SENT) @@ -6932,15 +6910,29 @@ pf_test_state(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason) STATE_LOOKUP(&key, *state, pd); if (pd->dir == (*state)->direction) { - src = &(*state)->src; - dst = &(*state)->dst; - psrc = PF_PEER_SRC; - pdst = PF_PEER_DST; + if (PF_REVERSED_KEY(*state, pd->af)) { + src = &(*state)->dst; + dst = &(*state)->src; + psrc = PF_PEER_DST; + pdst = PF_PEER_SRC; + } else { + src = &(*state)->src; + dst = &(*state)->dst; + psrc = PF_PEER_SRC; + pdst = PF_PEER_DST; + } } else { - src = &(*state)->dst; - dst = &(*state)->src; - psrc = PF_PEER_DST; - pdst = PF_PEER_SRC; + if (PF_REVERSED_KEY(*state, pd->af)) { + src = &(*state)->src; + dst = &(*state)->dst; + psrc = PF_PEER_SRC; + pdst = PF_PEER_DST; + } else { + src = &(*state)->dst; + dst = &(*state)->src; + psrc = PF_PEER_DST; + pdst = PF_PEER_SRC; + } } switch (pd->virtual_proto) { @@ -6967,13 +6959,14 @@ pf_test_state(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason) return (PF_DROP); } if ((*state)->state_flags & PFSTATE_SLOPPY) { - if (pf_tcp_track_sloppy(state, pd, reason) == PF_DROP) + if (pf_tcp_track_sloppy(state, pd, reason, src, dst, + psrc, pdst) == PF_DROP) return (PF_DROP); } else { int ret; ret = pf_tcp_track_full(state, pd, reason, - ©back); + ©back, src, dst, psrc, pdst); if (ret == PF_DROP) return (PF_DROP); } @@ -7069,26 +7062,32 @@ pf_test_state(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason) struct pf_state_key *nk; int afto, sidx, didx; - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) nk = (*state)->key[pd->sidx]; else nk = (*state)->key[pd->didx]; afto = pd->af != nk->af; - sidx = afto ? pd->didx : pd->sidx; - didx = afto ? pd->sidx : pd->didx; + + if (afto && (*state)->direction == PF_IN) { + sidx = pd->didx; + didx = pd->sidx; + } else { + sidx = pd->sidx; + didx = pd->didx; + } if (afto || PF_ANEQ(pd->src, &nk->addr[sidx], pd->af) || nk->port[sidx] != pd->osport) pf_change_ap(pd->m, pd->src, pd->sport, pd->ip_sum, - pd->pcksum, &nk->addr[pd->sidx], + pd->pcksum, &nk->addr[sidx], nk->port[sidx], pd->virtual_proto == IPPROTO_UDP, pd->af, nk->af); if (afto || PF_ANEQ(pd->dst, &nk->addr[didx], pd->af) || nk->port[didx] != pd->odport) pf_change_ap(pd->m, pd->dst, pd->dport, pd->ip_sum, - pd->pcksum, &nk->addr[pd->didx], + pd->pcksum, &nk->addr[didx], nk->port[didx], pd->virtual_proto == IPPROTO_UDP, pd->af, nk->af); @@ -7114,12 +7113,12 @@ pf_sctp_track(struct pf_kstate *state, struct pf_pdesc *pd, { struct pf_state_peer *src; if (pd->dir == state->direction) { - if (PF_REVERSED_KEY(state->key, pd->af)) + if (PF_REVERSED_KEY(state, pd->af)) src = &state->dst; else src = &state->src; } else { - if (PF_REVERSED_KEY(state->key, pd->af)) + if (PF_REVERSED_KEY(state, pd->af)) src = &state->src; else src = &state->dst; @@ -7679,15 +7678,21 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, struct pf_state_key *nk; int afto, sidx, didx; - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) nk = (*state)->key[pd->sidx]; else nk = (*state)->key[pd->didx]; afto = pd->af != nk->af; - sidx = afto ? pd->didx : pd->sidx; - didx = afto ? pd->sidx : pd->didx; - iidx = afto ? !iidx : iidx; + + if (afto && (*state)->direction == PF_IN) { + sidx = pd->didx; + didx = pd->sidx; + iidx = !iidx; + } else { + sidx = pd->sidx; + didx = pd->didx; + } switch (pd->af) { #ifdef INET @@ -7894,7 +7899,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, STATE_LOOKUP(&key, *state, pd); if (pd->dir == (*state)->direction) { - if (PF_REVERSED_KEY((*state)->key, pd->af)) { + if (PF_REVERSED_KEY(*state, pd->af)) { src = &(*state)->src; dst = &(*state)->dst; } else { @@ -7902,7 +7907,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, dst = &(*state)->src; } } else { - if (PF_REVERSED_KEY((*state)->key, pd->af)) { + if (PF_REVERSED_KEY(*state, pd->af)) { src = &(*state)->dst; dst = &(*state)->src; } else { @@ -7958,7 +7963,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, struct pf_state_key *nk; - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) nk = (*state)->key[pd->sidx]; else nk = (*state)->key[pd->didx]; @@ -7967,8 +7972,14 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, int afto, sidx, didx; afto = pd->af != nk->af; - sidx = afto ? pd2.didx : pd2.sidx; - didx = afto ? pd2.sidx : pd2.didx; + + if (afto && (*state)->direction == PF_IN) { + sidx = pd2.didx; + didx = pd2.sidx; + } else { + sidx = pd2.sidx; + didx = pd2.didx; + } if (afto) { if (pf_translate_icmp_af(nk->af, @@ -8073,7 +8084,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, (*state)->key[PF_SK_STACK]) { struct pf_state_key *nk; - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) nk = (*state)->key[pd->sidx]; else nk = (*state)->key[pd->didx]; @@ -8082,8 +8093,14 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, int afto, sidx, didx; afto = pd->af != nk->af; - sidx = afto ? pd2.didx : pd2.sidx; - didx = afto ? pd2.sidx : pd2.didx; + + if (afto && (*state)->direction == PF_IN) { + sidx = pd2.didx; + didx = pd2.sidx; + } else { + sidx = pd2.sidx; + didx = pd2.didx; + } if (afto) { if (pf_translate_icmp_af(nk->af, @@ -8183,12 +8200,12 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, STATE_LOOKUP(&key, *state, pd); if (pd->dir == (*state)->direction) { - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) src = &(*state)->src; else src = &(*state)->dst; } else { - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) src = &(*state)->dst; else src = &(*state)->src; @@ -8207,7 +8224,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, struct pf_state_key *nk; - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) nk = (*state)->key[pd->sidx]; else nk = (*state)->key[pd->didx]; @@ -8216,8 +8233,14 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, int afto, sidx, didx; afto = pd->af != nk->af; - sidx = afto ? pd2.didx : pd2.sidx; - didx = afto ? pd2.sidx : pd2.didx; + + if (afto && (*state)->direction == PF_IN) { + sidx = pd2.didx; + didx = pd2.sidx; + } else { + sidx = pd2.sidx; + didx = pd2.didx; + } if (afto) { if (pf_translate_icmp_af(nk->af, @@ -8325,7 +8348,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, (*state)->key[PF_SK_STACK]) { struct pf_state_key *nk; - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) nk = (*state)->key[pd->sidx]; else nk = (*state)->key[pd->didx]; @@ -8334,9 +8357,15 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, int afto, sidx, didx; afto = pd->af != nk->af; - sidx = afto ? pd2.didx : pd2.sidx; - didx = afto ? pd2.sidx : pd2.didx; - iidx = afto ? !iidx : iidx; + + if (afto && (*state)->direction == PF_IN) { + sidx = pd2.didx; + didx = pd2.sidx; + iidx = !iidx; + } else { + sidx = pd2.sidx; + didx = pd2.didx; + } if (afto) { if (nk->af != AF_INET6) @@ -8437,7 +8466,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, (*state)->key[PF_SK_STACK]) { struct pf_state_key *nk; - if (PF_REVERSED_KEY((*state)->key, pd->af)) + if (PF_REVERSED_KEY(*state, pd->af)) nk = (*state)->key[pd->sidx]; else nk = (*state)->key[pd->didx]; @@ -8446,9 +8475,15 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, int afto, sidx, didx; afto = pd->af != nk->af; - sidx = afto ? pd2.didx : pd2.sidx; - didx = afto ? pd2.sidx : pd2.didx; - iidx = afto ? !iidx : iidx; + + if (afto && (*state)->direction == PF_IN) { + sidx = pd2.didx; + didx = pd2.sidx; + iidx = !iidx; + } else { + sidx = pd2.sidx; + didx = pd2.didx; + } if (afto) { if (nk->af != AF_INET) @@ -8732,7 +8767,9 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, PF_STATE_UNLOCK(s); return; } else { - skip_test = true; + if (r_dir == PF_IN) { + skip_test = true; + } } } @@ -9014,7 +9051,9 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, PF_STATE_UNLOCK(s); return; } else { - skip_test = true; + if (r_dir == PF_IN) { + skip_test = true; + } } } diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index d1ba2495dc30..cb1d7af258f3 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -1053,37 +1053,19 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) } if (pd->proto == IPPROTO_ICMPV6 && pd->naf == AF_INET) { - if (pd->dir == PF_IN) { - NTOHS(pd->ndport); - if (pd->ndport == ICMP6_ECHO_REQUEST) - pd->ndport = ICMP_ECHO; - else if (pd->ndport == ICMP6_ECHO_REPLY) - pd->ndport = ICMP_ECHOREPLY; - HTONS(pd->ndport); - } else { - NTOHS(pd->nsport); - if (pd->nsport == ICMP6_ECHO_REQUEST) - pd->nsport = ICMP_ECHO; - else if (pd->nsport == ICMP6_ECHO_REPLY) - pd->nsport = ICMP_ECHOREPLY; - HTONS(pd->nsport); - } + NTOHS(pd->ndport); + if (pd->ndport == ICMP6_ECHO_REQUEST) + pd->ndport = ICMP_ECHO; + else if (pd->ndport == ICMP6_ECHO_REPLY) + pd->ndport = ICMP_ECHOREPLY; + HTONS(pd->ndport); } else if (pd->proto == IPPROTO_ICMP && pd->naf == AF_INET6) { - if (pd->dir == PF_IN) { - NTOHS(pd->ndport); - if (pd->ndport == ICMP_ECHO) - pd->ndport = ICMP6_ECHO_REQUEST; - else if (pd->ndport == ICMP_ECHOREPLY) - pd->ndport = ICMP6_ECHO_REPLY; - HTONS(pd->ndport); - } else { - NTOHS(pd->nsport); - if (pd->nsport == ICMP_ECHO) - pd->nsport = ICMP6_ECHO_REQUEST; - else if (pd->nsport == ICMP_ECHOREPLY) - pd->nsport = ICMP6_ECHO_REPLY; - HTONS(pd->nsport); - } + NTOHS(pd->ndport); + if (pd->ndport == ICMP_ECHO) + pd->ndport = ICMP6_ECHO_REQUEST; + else if (pd->ndport == ICMP_ECHOREPLY) + pd->ndport = ICMP6_ECHO_REPLY; + HTONS(pd->ndport); } /* get the destination address and port */ diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 94c6c5fd8c8f..0bba1470c4c5 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -26,7 +26,7 @@ . $(atf_get_srcdir)/utils.subr -nat64_setup() +nat64_setup_base() { pft_init @@ -51,22 +51,70 @@ nat64_setup() jexec dst ping -c 1 192.0.2.1 jexec rtr pfctl -e +} + +nat64_setup_in() +{ + nat64_setup_base pft_set_rules rtr \ "set reassemble yes" \ "set state-policy if-bound" \ "pass in on ${epair}b inet6 from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" } -atf_test_case "icmp_echo" "cleanup" -icmp_echo_head() +nat64_setup_out() +{ + nat64_setup_base + jexec rtr sysctl net.inet6.ip6.forwarding=1 + # AF translation happens post-routing, traffic must be directed + # towards the outbound interface using routes for the original AF. + # jexec rtr ifconfig ${epair_link}a inet6 2001:db8:2::1/64 up no_dad + jexec rtr route add -inet6 64:ff9b::/96 -iface ${epair_link}a; + pft_set_rules rtr \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "pass quick inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in quick on ${epair}b from any to 64:ff9b::/96" \ + "pass out quick on ${epair_link}a from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" \ + "block" +} + +atf_test_case "icmp_echo_in" "cleanup" +icmp_echo_in_head() +{ + atf_set descr 'Basic NAT64 ICMP echo test on inbound interface' + atf_set require.user root +} + +icmp_echo_in_body() +{ + nat64_setup_in + + # One ping + atf_check -s exit:0 -o ignore \ + ping6 -c 1 64:ff9b::192.0.2.2 + + # Make sure packets make it even when state is established + atf_check -s exit:0 \ + -o match:'5 packets transmitted, 5 packets received, 0.0% packet loss' \ + ping6 -c 5 64:ff9b::192.0.2.2 +} + +icmp_echo_in_cleanup() +{ + pft_cleanup +} + +atf_test_case "icmp_echo_out" "cleanup" +icmp_echo_out_head() { - atf_set descr 'Basic NAT64 ICMP echo test' + atf_set descr 'Basic NAT64 ICMP echo test on outbound interface' atf_set require.user root } -icmp_echo_body() +icmp_echo_out_body() { - nat64_setup + nat64_setup_out # One ping atf_check -s exit:0 -o ignore \ @@ -78,21 +126,21 @@ icmp_echo_body() ping6 -c 5 64:ff9b::192.0.2.2 } -icmp_echo_cleanup() +icmp_echo_out_cleanup() { pft_cleanup } -atf_test_case "fragmentation" "cleanup" -fragmentation_head() +atf_test_case "fragmentation_in" "cleanup" +fragmentation_in_head() { - atf_set descr 'Test fragmented packets' + atf_set descr 'Test fragmented packets on inbound interface' atf_set require.user root } -fragmentation_body() +fragmentation_in_body() { - nat64_setup + nat64_setup_in atf_check -s exit:0 -o ignore \ ping6 -c 1 -s 1280 64:ff9b::192.0.2.2 @@ -105,21 +153,48 @@ fragmentation_body() ping6 -c 3 -s 10000 -b 20000 64:ff9b::192.0.2.2 } -fragmentation_cleanup() +fragmentation_in_cleanup() { pft_cleanup } -atf_test_case "tcp" "cleanup" -tcp_head() +atf_test_case "fragmentation_out" "cleanup" +fragmentation_out_head() { - atf_set descr 'TCP NAT64 test' + atf_set descr 'Test fragmented packets on outbound interface' atf_set require.user root } -tcp_body() +fragmentation_out_body() { - nat64_setup + nat64_setup_out + + atf_check -s exit:0 -o ignore \ + ping6 -c 1 -s 1280 64:ff9b::192.0.2.2 + + atf_check -s exit:0 \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ + ping6 -c 3 -s 2000 64:ff9b::192.0.2.2 + atf_check -s exit:0 \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ + ping6 -c 3 -s 10000 -b 20000 64:ff9b::192.0.2.2 +} + +fragmentation_out_cleanup() +{ + pft_cleanup +} + +atf_test_case "tcp_in" "cleanup" +tcp_in_head() +{ + atf_set descr 'TCP NAT64 test on inbound interface' + atf_set require.user root +} + +tcp_in_body() +{ + nat64_setup_in echo "foo" | jexec dst nc -l 1234 & @@ -135,21 +210,81 @@ tcp_body() fi } -tcp_cleanup() +tcp_in_cleanup() { pft_cleanup } -atf_test_case "udp" "cleanup" -udp_head() +atf_test_case "tcp_out" "cleanup" +tcp_out_head() { - atf_set descr 'UDP NAT64 test' + atf_set descr 'TCP NAT64 test on outbound interface' atf_set require.user root } -udp_body() +tcp_out_body() { - nat64_setup + nat64_setup_out + + echo "foo" | jexec dst nc -l 1234 & + + # Sanity check & delay for nc startup + atf_check -s exit:0 -o ignore \ + ping6 -c 1 64:ff9b::192.0.2.2 + + rcv=$(nc -w 3 -6 64:ff9b::c000:202 1234) + if [ "${rcv}" != "foo" ]; + then + echo "rcv=${rcv}" + atf_fail "Failed to connect to TCP server" + fi +} + +tcp_out_cleanup() +{ + pft_cleanup +} + +atf_test_case "udp_in" "cleanup" +udp_in_head() +{ + atf_set descr 'UDP NAT64 test on inbound interface' + atf_set require.user root +} + +udp_in_body() +{ + nat64_setup_in + + echo "foo" | jexec dst nc -u -l 1234 & + + # Sanity check & delay for nc startup + atf_check -s exit:0 -o ignore \ + ping6 -c 1 64:ff9b::192.0.2.2 + + rcv=$(echo bar | nc -w 3 -6 -u 64:ff9b::c000:202 1234) + if [ "${rcv}" != "foo" ]; + then + echo "rcv=${rcv}" + atf_fail "Failed to connect to UDP server" + fi +} + +udp_in_cleanup() +{ + pft_cleanup +} + +atf_test_case "udp_out" "cleanup" +udp_out_head() +{ + atf_set descr 'UDP NAT64 test on outbound interface' + atf_set require.user root +} + +udp_out_body() +{ + nat64_setup_out echo "foo" | jexec dst nc -u -l 1234 & @@ -165,21 +300,54 @@ udp_body() fi } -udp_cleanup() +udp_out_cleanup() +{ + pft_cleanup +} + +atf_test_case "sctp_in" "cleanup" +sctp_in_head() +{ + atf_set descr 'SCTP NAT64 test on inbound interface' + atf_set require.user root +} + +sctp_in_body() +{ + nat64_setup_in + if ! kldstat -q -m sctp; then + atf_skip "This test requires SCTP" + fi + + echo "foo" | jexec dst nc --sctp -N -l 1234 & + + # Sanity check & delay for nc startup + atf_check -s exit:0 -o ignore \ + ping6 -c 1 64:ff9b::192.0.2.2 + + rcv=$(echo bar | nc --sctp -w 3 -6 64:ff9b::c000:202 1234) + if [ "${rcv}" != "foo" ]; + then + echo "rcv=${rcv}" + atf_fail "Failed to connect to SCTP server" + fi +} + +sctp_in_cleanup() { pft_cleanup } -atf_test_case "sctp" "cleanup" -sctp_head() +atf_test_case "sctp_out" "cleanup" +sctp_out_head() { - atf_set descr 'SCTP NAT64 test' + atf_set descr 'SCTP NAT64 test on outbound interface' atf_set require.user root } -sctp_body() +sctp_out_body() { - nat64_setup + nat64_setup_out if ! kldstat -q -m sctp; then atf_skip "This test requires SCTP" fi @@ -198,7 +366,7 @@ sctp_body() fi } -sctp_cleanup() +sctp_out_cleanup() { pft_cleanup } @@ -212,7 +380,7 @@ tos_head() tos_body() { - nat64_setup + nat64_setup_in # Ensure we can distinguish ToS on the destination jexec dst pfctl -e @@ -862,11 +1030,16 @@ v6_gateway_cleanup() atf_init_test_cases() { - atf_add_test_case "icmp_echo" - atf_add_test_case "fragmentation" - atf_add_test_case "tcp" - atf_add_test_case "udp" - atf_add_test_case "sctp" + atf_add_test_case "icmp_echo_in" + atf_add_test_case "icmp_echo_out" + atf_add_test_case "fragmentation_in" + atf_add_test_case "fragmentation_out" + atf_add_test_case "tcp_in" + atf_add_test_case "tcp_out" + atf_add_test_case "udp_in" + atf_add_test_case "udp_out" + atf_add_test_case "sctp_in" + atf_add_test_case "sctp_out" atf_add_test_case "tos" atf_add_test_case "no_v4" atf_add_test_case "range" From nobody Thu Feb 27 14:17:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLv6T6Gz5qGFV; Thu, 27 Feb 2025 14:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLv5qNLz3xPV; Thu, 27 Feb 2025 14:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyNxCC95qpxUUEkLIoGJofHa/X7BBPNU0JnuTMWUIik=; b=UiOnKHc89wweE7YWUgiea4/OyElU4RiDPmyYJFmNQj7Qz2Hp8A8Ey3DxvxjzJQZXuya8Pt 7YVvr8HNbMb5Epbg9hheGJQA55xDkiGhk3KiaHJ0xUdqluk78ld+76tu4DuTVTAWKzA88x O9lCRw32ltBaAZ3Spbu8J1k6bDy52tbP4WDCIojxT9d9x8qr5bIyYkvELcDUFoHsPTrTn2 Eo6rJ9YT6rDlagGuAvdpGqX8rDzS9bndKxIu+Js1tNN++HY+6ZPbJgONh870TXe0X1JEK6 I9T7nHumkNSfKROT2h4yIFuFvz+Nfw/zI9vXzdilJ1e2nkpv5igrEz3A5MDjDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665831; a=rsa-sha256; cv=none; b=vyCdGxtZNIxw2lIfReceZFnYrsIJ9jv9nYo9Zx/gbgDCvWXSCkyW0I5sU8MFHb/PNpAfme E2TelvU/OZKPmtbWnd6yxyCNlA4MsJjsg4YZAUEIM1IUj45dd8bvhx2avaJvejg3icIo5O vTzOzi7SpsaroaQvtCr+NbLXvfp5jdqZwRJT0GOUbXdK8dVRkqVBG5dgxYzG00vsZiiYq9 vRre0Nz0GdAaFaDKdpj3E7HJHA++QDGqfmNno/j7s6B05TQUVowo63uD3SnU4phyf9jGSs 9mxAfZ0kQJZnol6f8gsy0JtInLROFaWg4UMcXrG7pZadVtgBQCQib2+ErH3XNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyNxCC95qpxUUEkLIoGJofHa/X7BBPNU0JnuTMWUIik=; b=DCnfQxhQALl04ImLzf5h3j37PzTchuiJAxWZ+K9LhuchkpCrAXmXP0Gr7qhrLocp3n24FN rWpOTNJITOb7d7gWYNPLHZsuC92Ug+nL1RdXJd08iC8dGUvTcZ5dNT0o7+H5FstRe/o+gY ARUtkgxk8C6UgmKBoInUcd9biSzyZtowpMslWKUROLjEmxoeRu2+Hm7sL9YgrvzhldarH5 9jiXfioroXo/PeRzCFiZJvquaIwFH9gihPNZuHTC/3tId8VsxNvxnEwOABsME90ZlSgIyr cj2D/tQmTsGHuMJj3h3yzvKHrOfOlHuQkzLduVv2AxlK0LWYta1bNp9cfVZbhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLv5PcMzmZX; Thu, 27 Feb 2025 14:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHBU3016916; Thu, 27 Feb 2025 14:17:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHBpu016913; Thu, 27 Feb 2025 14:17:11 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:11 GMT Message-Id: <202502271417.51REHBpu016913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7f2360a108f9 - stable/14 - bhnd_chipc: Make use of bus_generic_rman_* to simplify some code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7f2360a108f910d5f126c39dcb968c8a720520e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7f2360a108f910d5f126c39dcb968c8a720520e6 commit 7f2360a108f910d5f126c39dcb968c8a720520e6 Author: John Baldwin AuthorDate: 2024-02-27 19:44:22 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 bhnd_chipc: Make use of bus_generic_rman_* to simplify some code This uses bus_generic_rman_alloc/release_resource to reduce some code duplication. However, I've left the custom activate/deactivate methods as-is. Differential Revision: https://reviews.freebsd.org/D43939 (cherry picked from commit 3a48dfe115f35abac6c2d9ec03a6a574baeaf0bc) --- sys/dev/bhnd/cores/chipc/chipc.c | 68 +++++++++++++--------------------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c index 0510a3195015..f99f42fb3ac3 100644 --- a/sys/dev/bhnd/cores/chipc/chipc.c +++ b/sys/dev/bhnd/cores/chipc/chipc.c @@ -123,13 +123,13 @@ static void chipc_disable_otp_power(struct chipc_softc *sc); static int chipc_enable_sprom_pins(struct chipc_softc *sc); static void chipc_disable_sprom_pins(struct chipc_softc *sc); -static int chipc_try_activate_resource(struct chipc_softc *sc, +static int chipc_try_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r, bool req_direct); static int chipc_init_rman(struct chipc_softc *sc); static void chipc_free_rman(struct chipc_softc *sc); -static struct rman *chipc_get_rman(struct chipc_softc *sc, int type); +static struct rman *chipc_get_rman(device_t dev, int type, u_int flags); /* quirk and capability flag convenience macros */ #define CHIPC_QUIRK(_sc, _name) \ @@ -747,10 +747,13 @@ chipc_free_rman(struct chipc_softc *sc) * * @param sc The chipc device state. * @param type The resource type (e.g. SYS_RES_MEMORY, SYS_RES_IRQ, ...) + * @param flags Resource flags (e.g. RF_PREFETCHABLE) */ static struct rman * -chipc_get_rman(struct chipc_softc *sc, int type) +chipc_get_rman(device_t dev, int type, u_int flags) { + struct chipc_softc *sc = device_get_softc(dev); + switch (type) { case SYS_RES_MEMORY: return (&sc->mem_rman); @@ -782,7 +785,7 @@ chipc_alloc_resource(device_t dev, device_t child, int type, rle = NULL; /* Fetch the resource manager, delegate request if necessary */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, flags); if (rm == NULL) { /* Requested resource type is delegated to our parent */ rv = bus_generic_rl_alloc_resource(dev, child, type, rid, @@ -851,31 +854,13 @@ chipc_alloc_resource(device_t dev, device_t child, int type, return (NULL); /* Make our rman reservation */ - rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); + rv = bus_generic_rman_alloc_resource(dev, child, type, rid, start, end, + count, flags); if (rv == NULL) { chipc_release_region(sc, cr, RF_ALLOCATED); return (NULL); } - rman_set_rid(rv, *rid); - - /* Activate */ - if (flags & RF_ACTIVE) { - error = bus_activate_resource(child, type, *rid, rv); - if (error) { - device_printf(dev, - "failed to activate entry %#x type %d for " - "child %s: %d\n", - *rid, type, device_get_nameunit(child), error); - - chipc_release_region(sc, cr, RF_ALLOCATED); - rman_release_resource(rv); - - return (NULL); - } - } - /* Update child's resource list entry */ if (rle != NULL) { rle->res = rv; @@ -900,7 +885,7 @@ chipc_release_resource(device_t dev, device_t child, int type, int rid, sc = device_get_softc(dev); /* Handled by parent bus? */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_rl_release_resource(dev, child, type, rid, r)); @@ -912,13 +897,8 @@ chipc_release_resource(device_t dev, device_t child, int type, int rid, return (EINVAL); /* Deactivate resources */ - if (rman_get_flags(r) & RF_ACTIVE) { - error = BUS_DEACTIVATE_RESOURCE(dev, child, type, rid, r); - if (error) - return (error); - } - - if ((error = rman_release_resource(r))) + error = bus_generic_rman_release_resource(dev, child, type, rid, r); + if (error != 0) return (error); /* Drop allocation reference */ @@ -943,7 +923,7 @@ chipc_adjust_resource(device_t dev, device_t child, int type, sc = device_get_softc(dev); /* Handled by parent bus? */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_adjust_resource(dev, child, type, r, start, end)); @@ -978,16 +958,17 @@ chipc_adjust_resource(device_t dev, device_t child, int type, * as RF_ACTIVE if bhnd direct resource allocation fails. */ static int -chipc_try_activate_resource(struct chipc_softc *sc, device_t child, int type, +chipc_try_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r, bool req_direct) { + struct chipc_softc *sc = device_get_softc(dev); struct rman *rm; struct chipc_region *cr; bhnd_size_t cr_offset; rman_res_t r_start, r_end, r_size; int error; - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) return (EINVAL); @@ -1033,21 +1014,18 @@ static int chipc_activate_bhnd_resource(device_t dev, device_t child, int type, int rid, struct bhnd_resource *r) { - struct chipc_softc *sc; struct rman *rm; int error; - sc = device_get_softc(dev); - /* Delegate non-locally managed resources to parent */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r->res)); if (rm == NULL || !rman_is_region_manager(r->res, rm)) { return (bhnd_bus_generic_activate_resource(dev, child, type, rid, r)); } /* Try activating the chipc region resource */ - error = chipc_try_activate_resource(sc, child, type, rid, r->res, + error = chipc_try_activate_resource(dev, child, type, rid, r->res, false); if (error) return (error); @@ -1064,20 +1042,17 @@ static int chipc_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - struct chipc_softc *sc; struct rman *rm; - sc = device_get_softc(dev); - /* Delegate non-locally managed resources to parent */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_activate_resource(dev, child, type, rid, r)); } /* Try activating the chipc region-based resource */ - return (chipc_try_activate_resource(sc, child, type, rid, r, true)); + return (chipc_try_activate_resource(dev, child, type, rid, r, true)); } /** @@ -1095,7 +1070,7 @@ chipc_deactivate_resource(device_t dev, device_t child, int type, sc = device_get_softc(dev); /* Handled by parent bus? */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_deactivate_resource(dev, child, type, rid, r)); @@ -1396,6 +1371,7 @@ static device_method_t chipc_methods[] = { DEVMETHOD(bus_activate_resource, chipc_activate_resource), DEVMETHOD(bus_deactivate_resource, chipc_deactivate_resource), DEVMETHOD(bus_get_resource_list, chipc_get_resource_list), + DEVMETHOD(bus_get_rman, chipc_get_rman), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 21:48:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3lMv6FSvz5Jk9s; Thu, 27 Feb 2025 21:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3lMv5f1Tz3MQS; Thu, 27 Feb 2025 21:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740692923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q74/qWq25vJqxPhiLPxF13tPYgL09M3WvVxMbuHnjcA=; b=EnfmGAylylPvhgREbVW+Y/h3RLHEWrLikudb8L7ROkCtWfgdGav2n8KD05Eq4GCqdswbbI HrKjo8tt0zyM9ZaInOtexMZgAyyHR7JJL9axVun7Iv/P84LP45JOlf4snL6fIn4EewmTR7 96ojvsG0sQKXRYW1TBje8MthVB5u1VjuTror6HL+Fgd5EaJg3PzG4Ok4d7iDVsj4TUkySH 92ZUQ3DabrpACoMxvm8vRdfJ9j615f7qYbzC8QeCYMn7H+N8WnEiiqn6ApYcYiaHIdp29c hf+WVb9bBwDkHshf0wVTWLWBQJlFi8284h46Glfc8lsPiEzeDHAlameuOTO2ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740692923; a=rsa-sha256; cv=none; b=X6xqlPvd9sfnj9uXeC02WEVC2oDtW0rh0VrY+DPrLB4yHLBbWBrC7z4El2WoSEz+p6hjrH qI30FETsbg8F9PlEeDfCJbDFeqfUXGIdcekGFB0j6QBgn3cUZ53Yey0ior7nO9fjXbd/fN X5mjA8nL2CSs9cmIp4w4MpNh2DJo1b01zW6/2jw07OHqHsBEXn4F9bipMW4VzdoMWyisib Zc10JYOMWxHXfQkjQZcv7/nFbWoOSGAa90ZRApuPO7gtVrOwuYRJQBXc38SlnkNwaTTHbp BlSz9Nh3aYoPxdflHClw4tuJe9B6nR9MsbtmpEO3hHKI/3AMSzenph0XeP3j6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740692923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q74/qWq25vJqxPhiLPxF13tPYgL09M3WvVxMbuHnjcA=; b=OIm+S0RH5W9X+7MHjDossrLQXutJsQ9UTQjQKM3tXspS8DgXycRSqX3tpUtutCbqgpbVQW a2X1WFctU3fdeAsFqpAI0EelfBq57nEHJ1+qYb7qlU8JJHIOPQVJ3tueekcZ7rQeyoZQpa XJHiBftsttr/Pn7t/qklo20DhI+iKAp/MIHy+xIvGweChzhlv4pNVWx0zMjz67AYKoICKp IdQPoFbV+fM/Ewz78EBoQrkKvlzTXobNSyQMhUPJrmi8hbTzRO/mcY9MgeFqLap0/WRkX6 lyGSZqFc2BNhQNWzadqwFsp8+aEpzOfmONcExsa6vYvnKVNZYbksEGeXX/AHpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3lMv5528z10h9; Thu, 27 Feb 2025 21:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RLmh5I060854; Thu, 27 Feb 2025 21:48:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RLmh5w060851; Thu, 27 Feb 2025 21:48:43 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:48:43 GMT Message-Id: <202502272148.51RLmh5w060851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Igor Ostapenko Subject: git: db06c8fd7f5b - stable/14 - kyuafile.5: ATF metadata mapping reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: db06c8fd7f5bbe0b49bd0f5cd63920326b9105ce Auto-Submitted: auto-generated The branch stable/14 has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=db06c8fd7f5bbe0b49bd0f5cd63920326b9105ce commit db06c8fd7f5bbe0b49bd0f5cd63920326b9105ce Author: Igor Ostapenko AuthorDate: 2025-01-26 17:15:32 +0000 Commit: Igor Ostapenko CommitDate: 2025-02-27 21:43:35 +0000 kyuafile.5: ATF metadata mapping reference Reviewed by: ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48190 (cherry picked from commit 68206add1173920065092c06eea40c90bb73b5c5) --- contrib/kyua/doc/kyuafile.5.in | 45 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/contrib/kyua/doc/kyuafile.5.in b/contrib/kyua/doc/kyuafile.5.in index a667f5dc2816..4fe5f12fd9b1 100644 --- a/contrib/kyua/doc/kyuafile.5.in +++ b/contrib/kyua/doc/kyuafile.5.in @@ -122,6 +122,7 @@ of the test program and a collection of optional metadata settings for all the test cases in the test program. Any metadata properties defined by the test cases themselves override the metadata values defined here. +The mapping to ATF metadata naming for each property is provided below. .Pp .Em Plain test programs are those that return 0 on success and non-0 on failure; in general, most test @@ -153,10 +154,16 @@ The following metadata properties can be passed to any test program definition: Whitespace-separated list of machine architecture names allowed by the test. If empty or not defined, the test is allowed to run on any machine architecture. +.Pp +ATF: +.Va require.arch .It Va allowed_platforms Whitespace-separated list of machine platform names allowed by the test. If empty or not defined, the test is allowed to run on any machine platform. +.Pp +ATF: +.Va require.machine .It Va custom.NAME Custom variable defined by the test where .Sq NAME @@ -171,8 +178,14 @@ in it, you will have to use a special Lua syntax to define the property. Refer to the .Sx EXAMPLES section below for clarification. +.Pp +ATF: +.Va X-NAME .It Va description Textual description of the test. +.Pp +ATF: +.Va descr .It Va execenv The name of the execution environment to be used for running the test. If empty or not defined, the @@ -220,6 +233,9 @@ All non-alphanumeric characters are replaced with .Sq kyua_usr_tests_sys_netpfil_pf_pass_block_v4 is an example for /usr/tests/sys/netpfil/pf/pass_block:v4 test case. .El +.Pp +ATF: +.Va execenv .It Va execenv_jail_params Additional test-specific whitespace-separated parameters of .Fx @@ -242,6 +258,9 @@ configuration. It can be overridden via .Va execenv_jail_params if needed. +.Pp +ATF: +.Va execenv.jail.params .It Va is_exclusive If true, indicates that this test program cannot be executed along any other programs at the same time. @@ -251,19 +270,36 @@ value of a setting, must set themselves as exclusive to prevent failures due to race conditions. Defaults to false. +.Pp +ATF: +.Va is.exclusive .It Va required_configs Whitespace-separated list of configuration variables that the test requires to be defined before it can run. +.Pp +ATF: +.Va require.config .It Va required_disk_space Amount of available disk space that the test needs to run successfully. +.Pp +ATF: not mapped .It Va required_files Whitespace-separated list of paths that the test requires to exist before it can run. +.Pp +ATF: +.Va require.files .It Va required_memory Amount of physical memory that the test needs to run successfully. +.Pp +ATF: +.Va require.memory .It Va required_programs Whitespace-separated list of basenames or absolute paths pointing to executable binaries that the test requires to exist before it can run. +.Pp +ATF: +.Va require.progs .It Va required_user If empty, the test has no restrictions on the calling user for it to run. If set to @@ -272,8 +308,14 @@ the test needs to not run as root. If set to .Sq root , the test must run as root. +.Pp +ATF: +.Va require.user .It Va timeout Amount of seconds that the test is allowed to execute before being killed. +.Pp +ATF: +.Va timeout .El .Ss Recursion To reference test programs in another subdirectory, a different @@ -450,7 +492,8 @@ but required_user='root' metadata property reminds that the jail execution environment requires .Xr kyua 1 being running with root privileges, and the test is skipped otherwise with -the respective message. The combination of +the respective message. +The combination of .Va execenv set to .Sq jail From nobody Thu Feb 27 17:03:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3d3M6JhXz59JZH; Thu, 27 Feb 2025 17:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3d3M5RGgz46G7; Thu, 27 Feb 2025 17:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBwSrxgXhIYMmOHgqtJsQLyHPS9/O/GtFPv8/3Xo9ZM=; b=fK8XPCzmdYpZolzK44flYCbzGOF07gnWXLihh8XiCPLZqEZJXlsFVhPpO610MfJsIbUTjE C5tFb4C/NrXQWQVSRPqidxhamZyT2Cwxu/3ZyDBFUybs9WHMjsvXXZ8HG4ShNAocFNKl2a S78XemmCcuDLuVjDIIvVxamn46NYmuStdsnkn47sFlCQ5nJa+feC4ZfgV2bXpCCSMwzmPy DxFtWPnP/wFKkzL0PLE6epdhy6j1CRoIiwSWGAWFqRTXXO1ALps6vflZxR/05AAGblnoUO 1AA/5YgtJfzUQjrsYSoyGUXBkdcK8/Sfy2XggQfoz/C+bDrb1rVsu9rLeh7F4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675839; a=rsa-sha256; cv=none; b=er2Q4WtgSjomQLS1kdhxPmNyJZeRXlCxsfSn8EJT4W5/0YAYqgQL9M3iufr0TvXSkHf85+ w4KyMr3LQIeO9Q1bfevGiG3KNlRMeEH4WnkvquDi4CtaPXJgK74MhrQqMmozuyLiXjj7Uk aF+LH41vqE88mbVBB/fag4cLYOhUmR4cwQVAAtwDYetXoKJWP0CbwnnqHcnan9nNSjA48N EgK9FgsMKbmC9xjqpjdvvo732cE2FeTzKY0B4GoYnN1259z4EgDDTMnNZkIfzbyt0TDelv 84fk82KX7BpTLmE1vENM5iYTH0k2XVql89vyqq/142ejtwQuqXld6MwZUyJClQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBwSrxgXhIYMmOHgqtJsQLyHPS9/O/GtFPv8/3Xo9ZM=; b=pz6ra1e7Cm5Bop7/r9SGwqRMkx+UvvkGhVr0fBtgLDnln86AQoXA55sH4c/O+0aa3uYanQ zchJlrKVT6/zgvuDxOTYidVTvf3WedHwSXwXgPYEixgogBWseGMp2fzQrcD3HgEMWT1AZI 4SjSKLDEkndwm69eEMg8LSR39Qw48zhzkC+VuAxCHoWMAIOERQQbCUfgaTMQDXRNXp/WDm ggK3V8bVqcGbmBQ4FZGj2xIn6iiJHe71oSq34OVcbueCR5+CJgZrm10lkwNkuQcDBSFq/D EYnClNOgegax5RZBzf/rfVvjidqfGS7ZReh8SULx/VVLYCStZsK8v1lVEtFrvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3d3M4vQyzr26; Thu, 27 Feb 2025 17:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RH3xaC036996; Thu, 27 Feb 2025 17:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RH3xqh036993; Thu, 27 Feb 2025 17:03:59 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:03:59 GMT Message-Id: <202502271703.51RH3xqh036993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0f1708d8570d - stable/14 - cxgbe: Tidy TOE tunables under hw.cxgbe List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f1708d8570d10e023b9f9af847b12ef48ea9bf8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0f1708d8570d10e023b9f9af847b12ef48ea9bf8 commit 0f1708d8570d10e023b9f9af847b12ef48ea9bf8 Author: John Baldwin AuthorDate: 2024-12-10 20:30:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:03:06 +0000 cxgbe: Tidy TOE tunables under hw.cxgbe - Only two of these tunables are used for RATELIMIT without TCP_OFFLOAD. - Mark t4_tmr_idx_ofld and t4_pktc_idx_ofld static. - Move hw.cxgbe.cop_managed_offloading under hw.cxgbe.toe since it is specific to TOE. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47765 (cherry picked from commit 90652188232458891a2922fb5a542971aa58055d) --- sys/dev/cxgbe/t4_main.c | 19 +++++++++++-------- usr.sbin/cxgbetool/cxgbetool.8 | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 011978ce131b..6b3a68b352ad 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -318,15 +318,17 @@ static int t4_nofldtxq = -NOFLDTXQ; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq, CTLFLAG_RDTUN, &t4_nofldtxq, 0, "Number of offload TX queues per port"); -#define NOFLDRXQ 2 -static int t4_nofldrxq = -NOFLDRXQ; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq, CTLFLAG_RDTUN, &t4_nofldrxq, 0, - "Number of offload RX queues per port"); - #define NOFLDTXQ_VI 1 static int t4_nofldtxq_vi = -NOFLDTXQ_VI; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq_vi, CTLFLAG_RDTUN, &t4_nofldtxq_vi, 0, "Number of offload TX queues per VI"); +#endif + +#if defined(TCP_OFFLOAD) +#define NOFLDRXQ 2 +static int t4_nofldrxq = -NOFLDRXQ; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq, CTLFLAG_RDTUN, &t4_nofldrxq, 0, + "Number of offload RX queues per port"); #define NOFLDRXQ_VI 1 static int t4_nofldrxq_vi = -NOFLDRXQ_VI; @@ -334,12 +336,12 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq_vi, CTLFLAG_RDTUN, &t4_nofldrxq_vi, 0, "Number of offload RX queues per VI"); #define TMR_IDX_OFLD 1 -int t4_tmr_idx_ofld = TMR_IDX_OFLD; +static int t4_tmr_idx_ofld = TMR_IDX_OFLD; SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_timer_idx_ofld, CTLFLAG_RDTUN, &t4_tmr_idx_ofld, 0, "Holdoff timer index for offload queues"); #define PKTC_IDX_OFLD (-1) -int t4_pktc_idx_ofld = PKTC_IDX_OFLD; +static int t4_pktc_idx_ofld = PKTC_IDX_OFLD; SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_pktc_idx_ofld, CTLFLAG_RDTUN, &t4_pktc_idx_ofld, 0, "holdoff packet counter index for offload queues"); @@ -686,9 +688,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l4_errors, CTLFLAG_RDTUN, * TOE tunables. */ static int t4_cop_managed_offloading = 0; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, cop_managed_offloading, CTLFLAG_RDTUN, +SYSCTL_INT(_hw_cxgbe_toe, OID_AUTO, cop_managed_offloading, CTLFLAG_RDTUN, &t4_cop_managed_offloading, 0, "COP (Connection Offload Policy) controls all TOE offload"); +TUNABLE_INT("hw.cxgbe.cop_managed_offloading", &t4_cop_managed_offloading); #endif #ifdef KERN_TLS diff --git a/usr.sbin/cxgbetool/cxgbetool.8 b/usr.sbin/cxgbetool/cxgbetool.8 index a25a227669ed..995a4146deb3 100644 --- a/usr.sbin/cxgbetool/cxgbetool.8 +++ b/usr.sbin/cxgbetool/cxgbetool.8 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd April 14, 2022 +.Dd December 10, 2024 .Dt CXGBETOOL 8 .Os .Sh NAME @@ -553,7 +553,7 @@ Install the Connection Offload Policy (COP) in A COP offers fine-grained control over which connections get offloaded and with what parameters. Set -.Cm hw.cxgbe.cop_managed_offloading="1" +.Cm hw.cxgbe.toe.cop_managed_offloading="1" in loader.conf to ensure that t4_tom will not offload any connection before a COP is installed. Note that t4_tom must be loaded and operational (IFCAP_TOE enabled) as always From nobody Thu Feb 27 17:51:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3f5m67P3z59LfK; Thu, 27 Feb 2025 17:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3f5m54yjz493w; Thu, 27 Feb 2025 17:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740678668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohf5Ljt3FQTKHILIshEKdshRoDG4GqH2bvVVFs1xCI0=; b=UCrmrtg8njMC6+Ih1ds9WJblyHEHU5cZqp42xbc7LzIDcAamoOKC9q79Gk6MbFUPan48lZ L7rBW4d1NzuvSyP5eqVtw04HTD4p96SaWSihp50xfCu0SCfviJoE28ob97H8vk28ZpFzwq XwaLtKaZJjiG1bpAXi147j4KGAymMbulQWy18vqN8jGW8XiKT8mYS/jwaRvjssIQlSj9OH yOldS4JuQDB906LYh/bDo/BAEWkExtxDum+HUNfuXjd6wmm5poEFSQhQ0jEch+jHNcIWtW 9X2P59tgS01v61XpEO9c5epDKB/m9HteqJK6u33fIb0RjgCYBdPVNd+UbzYSog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740678668; a=rsa-sha256; cv=none; b=t8jbgf/5PqUKmslQbbT8ldN+GUX6fnfgs2LJB0dGAizrYTQXwQNlBN1/qTqA0VCr3XkYbR y7EAAEkfuvMceze+JHcRhF7HpqNPl6D3mSw5yVKz5tyhlACr3/4K0etAHuGJI4IZvRD5Am SPOYGq/5Q+dixYlBh5jmpO4G468Vh4dytdGCa+TMK5JcoAKFhELkNT5uMhFDoYFEXhbHtO HH077USOWBYaENYzBdg4z2uKZ40xHkZ66dah41HJ51azxKUroqrwmy9LkYGzwyxEgnBjAo 1hz38WOk1uYbbDuLypunJuwq8YPMU24aXc8Vp4/8Qz3HTqHdNflJkj6QW5n00Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740678668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohf5Ljt3FQTKHILIshEKdshRoDG4GqH2bvVVFs1xCI0=; b=Knj4drBw7XkzdDCwT42u/IFJSq4V+3TPaaQzIHMzcOoOBXekmjUwOBCbQIFVJMi6K4DQHF IjQuNkVTagvd9Dhy6NH5F1W9LqFAdiRP6NTD7YcdGHTj1HLnjPqucVdkA1UvtUExx23dPf EtfIyK+pN1akVezl6eQODIhas67tqH3tjkaetHktA0Z9E//Iae1YfySBvyGvYa6rlETLLj cJDggaPrJ2zoW7IacEgwf9sP+G6ygKx/2CU566yCVQpYWxaRuBvZf3trvpNeX+/HgFo7n6 N3OuzIJsev07UkmMWH6fo1f7c+0nOh22Q9IqaToReXAltWswMoKUYvwL0c453A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3f5m4ckqzskT; Thu, 27 Feb 2025 17:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RHp8Pd025468; Thu, 27 Feb 2025 17:51:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RHp8xu025465; Thu, 27 Feb 2025 17:51:08 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:51:08 GMT Message-Id: <202502271751.51RHp8xu025465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 2980318b2747 - main - sh.1: extend the section about getopts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2980318b2747711433c4408e89cb1b208aac9748 Auto-Submitted: auto-generated The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=2980318b2747711433c4408e89cb1b208aac9748 commit 2980318b2747711433c4408e89cb1b208aac9748 Author: Piotr Paweł Stefaniak AuthorDate: 2025-02-22 15:57:05 +0000 Commit: Piotr Paweł Stefaniak CommitDate: 2025-02-27 17:39:29 +0000 sh.1: extend the section about getopts Provide more details about the influence of optargs' first character on the shell's behavior in regard to invalid arguments. Also do some minor word-smithing. Original submission by rea@ Differential Revision: https://reviews.freebsd.org/D49106 --- bin/sh/sh.1 | 60 ++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 3d3f200a8e17..768193905c49 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 10, 2025 +.Dd February 27, 2025 .Dt SH 1 .Os .Sh NAME @@ -2356,29 +2356,61 @@ Move the specified .Ar job or the current job to the foreground. .It Ic getopts Ar optstring var -The POSIX -.Ic getopts -command. -The -.Ic getopts -command deprecates the older -.Xr getopt 1 -command. -The first argument should be a series of letters, each possibly +Parse command-line options and arguments. +The first argument +.Va optstring +should be a series of letters, each possibly followed by a colon which indicates that the option takes an argument. -The specified variable is set to the parsed option. +The specified variable +.Va var +is set to the parsed option. The index of the next argument is placed into the shell variable .Va OPTIND . If an option takes an argument, it is placed into the shell variable .Va OPTARG . -If an invalid option is encountered, +.Pp +If the found character +is not specified by +.Va optstring +or if it is missing a required argument, +the option is considered invalid and: +.Bl -offset indent +.It +If the first character of +.Va optstring +is not a colon then +.Va OPTARG +is unset, .Ar var is set to -.Ql \&? . -It returns a false value (1) when it encounters the end of the options. +.Ql \&? +and a diagnostic message is written to stderr. +.It +If the first character of +.Va optstring +is a colon then +.Va OPTARG +is set to the the option character found, +.Ar var +is set to +.Ql \&: +when a required argument is missing or to +.Ql \&? +when the option was not specified by +.Va optstring , +and no diagnostic message is written to stderr. +.El +.Pp +.Ic getopts +returns a false value (1) when it encounters the end of the options. A new set of arguments may be parsed by assigning .Li OPTIND=1 . +The POSIX +.Ic getopts +command deprecates the older +.Xr getopt 1 +command. .It Ic hash Oo Fl rv Oc Op Ar command ... The shell maintains a hash table which remembers the locations of commands. With no arguments whatsoever, the From nobody Thu Feb 27 14:16:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLb2t1Dz5qGFS; Thu, 27 Feb 2025 14:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLZ6lX9z3xP7; Thu, 27 Feb 2025 14:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mFN780bje7cBIs/h6sGWuEeu/Wk1kH+75HmXh8652rs=; b=PIZJ+cvIHBT504Y9tcqR7FM7yOFxptVwHFst9A4WEjAspt44cujN1rsh3In3ZbBYRueNls qNCHYKcbB/k8+fijGEaaaaYs2Dh8EKJ4mIuIPxGBTXwhoADnIONG1ZSQiBgxf6zQOnqMv6 UMFQXjx7a32/xAzx6phrNK8NI1rEPgEtaJE+0GaQMG0tZABqmd99zBzAdYIEGq4IRuH9s2 wIuck3ajNJ8pxs14N/9iar/H1qyX7XGO2zE8rgFInL16JpOzLhOaU1sHBmAu81KFsYlNTT 60fHVze64OfyWVPOLMlm8zZg4B2aVovgKlEhNYclE1bQlf5gkWOj+239I1EVvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665814; a=rsa-sha256; cv=none; b=r+dd5199VmIBx3MRqqDqVEhA28vaSZA94e9iC4QC75ZdJlwEF97cIcrOthcpv44mJw3Ebp oc++0eUWiZlRTERYdsmeQEjA8RFNvQnCk8/wXcJt4f4N7Mq6RHVglsnqN1Ngp6z8jiSKCA iNtjDMuFbarMnn7YulNAGwzH6EsHvLqIWtTQm/nj8LjAkQQ8m2Iq4VAZPE1Tn7nZijbNlf +uXdowhS2xVvVa5cWVH/e+ibDBELESoXeE2HLGRXd3Fr0yeEUCpOxQLFUITPv09OzafsHq gn81/y+tlpAFBnwh2ZVkU0RJ3QcKF+p3lgokStCissnfZ+vf4uJRx8TaFa2hKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mFN780bje7cBIs/h6sGWuEeu/Wk1kH+75HmXh8652rs=; b=HOioeTYu5CHNuEn1hRmyBRg8lNGOWNRdFF05S9QzvaHU+csITO+IBaVL/noM7sDtemqDxM McHMQk+vbr1InyrC/b4+1d5SF3zoriaKYu1+BRLvhb2BhTgE67CSZ4AKwm+FnriDSYJeR5 lVpVMh3HL+7xlR6bLXhHpVjN5XbgVGZBdCLTE+80LhrhMmDB0OMN/YB0mpZb8lXa48zxOs 73k4J1+uVCOoSCp0FtuYKTBhfsYlLB8wof1YIbBU+6ngIUdjjpeIKAYjOhwZKA/gXSZukg dSmyJWOXpctGaoMwH00ulCWrtkQO8hzW30ndSjFRArfl5H6RQgt/SlfSfuuzfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLZ6DxSzmZR; Thu, 27 Feb 2025 14:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGs6N016379; Thu, 27 Feb 2025 14:16:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGs9o016376; Thu, 27 Feb 2025 14:16:54 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:54 GMT Message-Id: <202502271416.51REGs9o016376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b9ec2a943df7 - stable/14 - pci_host_generic: Don't rewrite resource start address for translation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b9ec2a943df7331a9ae067723c79243fe73771ee Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b9ec2a943df7331a9ae067723c79243fe73771ee commit b9ec2a943df7331a9ae067723c79243fe73771ee Author: John Baldwin AuthorDate: 2024-02-14 22:07:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Don't rewrite resource start address for translation Allocate resources from the parent device for decoded physical address ranges. When child resources suballocated from rman's are mapped, translate those mapping requests into a mapping request of the associated physical address range in a bus_map_resource method. While here, convert generic_pcie_rman to a bus_get_rman method and use bus_generic_rman_* for operations on child resources. Factor out a generic_pcie_containing_range to share logic between bus_translate_resource and bus_*map_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43894 (cherry picked from commit d79b6b8ec267e7eef6e07cf4245159705e24acd5) --- sys/dev/pci/pci_host_generic.c | 366 ++++++++++++++++++++++++++--------------- sys/dev/pci/pci_host_generic.h | 1 + 2 files changed, 235 insertions(+), 132 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 02ca010a14d7..45a478634d20 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -85,7 +85,7 @@ pci_host_generic_core_attach(device_t dev) uint64_t size; char buf[64]; int domain, error; - int rid, tuple; + int flags, rid, tuple, type; sc = device_get_softc(dev); sc->dev = dev; @@ -173,19 +173,26 @@ pci_host_generic_core_attach(device_t dev) phys_base = sc->ranges[tuple].phys_base; pci_base = sc->ranges[tuple].pci_base; size = sc->ranges[tuple].size; - if (phys_base == 0 || size == 0) + rid = tuple + 1; + if (size == 0) continue; /* empty range element */ switch (FLAG_TYPE(sc->ranges[tuple].flags)) { case FLAG_TYPE_PMEM: sc->has_pmem = true; + flags = RF_PREFETCHABLE; + type = SYS_RES_MEMORY; error = rman_manage_region(&sc->pmem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_MEM: + flags = 0; + type = SYS_RES_MEMORY; error = rman_manage_region(&sc->mem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_IO: + flags = 0; + type = SYS_RES_IOPORT; error = rman_manage_region(&sc->io_rman, pci_base, pci_base + size - 1); break; @@ -197,11 +204,44 @@ pci_host_generic_core_attach(device_t dev) "error = %d\n", error); goto err_rman_manage; } + error = bus_set_resource(dev, type, rid, phys_base, size); + if (error != 0) { + device_printf(dev, + "failed to set resource for range %d: %d\n", tuple, + error); + goto err_rman_manage; + } + sc->ranges[tuple].res = bus_alloc_resource_any(dev, type, &rid, + RF_ACTIVE | RF_UNMAPPED | flags); + if (sc->ranges[tuple].res == NULL) { + device_printf(dev, + "failed to allocate resource for range %d\n", tuple); + goto err_rman_manage; + } } return (0); err_rman_manage: + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + if (sc->ranges[tuple].size == 0) + continue; /* empty range element */ + switch (FLAG_TYPE(sc->ranges[tuple].flags)) { + case FLAG_TYPE_PMEM: + case FLAG_TYPE_MEM: + type = SYS_RES_MEMORY; + break; + case FLAG_TYPE_IO: + type = SYS_RES_IOPORT; + break; + default: + continue; + } + if (sc->ranges[tuple].res != NULL) + bus_release_resource(dev, type, tuple + 1, + sc->ranges[tuple].res); + bus_delete_resource(dev, type, tuple + 1); + } rman_fini(&sc->io_rman); err_io_rman: rman_fini(&sc->mem_rman); @@ -222,7 +262,7 @@ int pci_host_generic_core_detach(device_t dev) { struct generic_pcie_core_softc *sc; - int error; + int error, tuple, type; sc = device_get_softc(dev); @@ -230,6 +270,25 @@ pci_host_generic_core_detach(device_t dev) if (error != 0) return (error); + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + if (sc->ranges[tuple].size == 0) + continue; /* empty range element */ + switch (FLAG_TYPE(sc->ranges[tuple].flags)) { + case FLAG_TYPE_PMEM: + case FLAG_TYPE_MEM: + type = SYS_RES_MEMORY; + break; + case FLAG_TYPE_IO: + type = SYS_RES_IOPORT; + break; + default: + continue; + } + if (sc->ranges[tuple].res != NULL) + bus_release_resource(dev, type, tuple + 1, + sc->ranges[tuple].res); + bus_delete_resource(dev, type, tuple + 1); + } rman_fini(&sc->io_rman); rman_fini(&sc->mem_rman); rman_fini(&sc->pmem_rman); @@ -349,8 +408,9 @@ generic_pcie_write_ivar(device_t dev, device_t child, int index, } static struct rman * -generic_pcie_rman(struct generic_pcie_core_softc *sc, int type, int flags) +generic_pcie_get_rman(device_t dev, int type, u_int flags) { + struct generic_pcie_core_softc *sc = device_get_softc(dev); switch (type) { case SYS_RES_IOPORT: @@ -371,8 +431,6 @@ pci_host_generic_core_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { struct generic_pcie_core_softc *sc; - struct rman *rm; - int error; sc = device_get_softc(dev); @@ -381,76 +439,79 @@ pci_host_generic_core_release_resource(device_t dev, device_t child, int type, return (pci_domain_release_bus(sc->ecam, child, rid, res)); } #endif + return (bus_generic_rman_release_resource(dev, child, type, rid, res)); +} - rm = generic_pcie_rman(sc, type, rman_get_flags(res)); - if (rm != NULL) { - KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); - if (rman_get_flags(res) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, res); - if (error) - return (error); - } - return (rman_release_resource(res)); +static struct pcie_range * +generic_pcie_containing_range(device_t dev, int type, rman_res_t start, + rman_res_t end) +{ + struct generic_pcie_core_softc *sc = device_get_softc(dev); + uint64_t pci_base; + uint64_t size; + int i, space; + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (NULL); } - return (bus_generic_release_resource(dev, child, type, rid, res)); + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + pci_base = sc->ranges[i].pci_base; + size = sc->ranges[i].size; + if (size == 0) + continue; /* empty range element */ + + if (start < pci_base || end >= pci_base + size) + continue; + + switch (FLAG_TYPE(sc->ranges[i].flags)) { + case FLAG_TYPE_MEM: + case FLAG_TYPE_PMEM: + space = SYS_RES_MEMORY; + break; + case FLAG_TYPE_IO: + space = SYS_RES_IOPORT; + break; + default: + continue; + } + + if (type == space) + return (&sc->ranges[i]); + } + return (NULL); } static int generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, rman_res_t end, rman_res_t *new_start, rman_res_t *new_end) { - struct generic_pcie_core_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; - int i, space; - bool found; + struct pcie_range *range; - sc = device_get_softc(dev); /* Translate the address from a PCI address to a physical address */ switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: - found = false; - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - pci_base = sc->ranges[i].pci_base; - phys_base = sc->ranges[i].phys_base; - size = sc->ranges[i].size; - - if (start < pci_base || start >= pci_base + size) - continue; - - switch (FLAG_TYPE(sc->ranges[i].flags)) { - case FLAG_TYPE_MEM: - case FLAG_TYPE_PMEM: - space = SYS_RES_MEMORY; - break; - case FLAG_TYPE_IO: - space = SYS_RES_IOPORT; - break; - default: - space = -1; - continue; - } - - if (type == space) { - *new_start = start - pci_base + phys_base; - *new_end = end - pci_base + phys_base; - found = true; - break; - } + range = generic_pcie_containing_range(dev, type, start, end); + if (range == NULL) + return (ENOENT); + if (range != NULL) { + *new_start = start - range->pci_base + range->phys_base; + *new_end = end - range->pci_base + range->phys_base; } break; default: /* No translation for non-memory types */ *new_start = start; *new_end = end; - found = true; break; } - return (found ? 0 : ENOENT); + return (0); } static int @@ -469,48 +530,32 @@ pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, { struct generic_pcie_core_softc *sc; struct resource *res; - struct rman *rm; sc = device_get_softc(dev); + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { - return (pci_domain_alloc_bus(sc->ecam, child, rid, start, end, - count, flags)); - } + case PCI_RES_BUS: + res = pci_domain_alloc_bus(sc->ecam, child, rid, start, end, + count, flags); + break; #endif - - rm = generic_pcie_rman(sc, type, flags); - if (rm == NULL) - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, - type, rid, start, end, count, flags)); - - if (bootverbose) { - device_printf(dev, - "rman_reserve_resource: start=%#jx, end=%#jx, count=%#jx\n", - start, end, count); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + res = bus_generic_rman_alloc_resource(dev, child, type, rid, + start, end, count, flags); + break; + default: + res = bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags); + break; + } + if (res == NULL) { + device_printf(dev, "%s FAIL: type=%d, rid=%d, " + "start=%016jx, end=%016jx, count=%016jx, flags=%x\n", + __func__, type, *rid, start, end, count, flags); } - - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - goto fail; - - rman_set_rid(res, *rid); - - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res)) { - rman_release_resource(res); - goto fail; - } - return (res); - -fail: - device_printf(dev, "%s FAIL: type=%d, rid=%d, " - "start=%016jx, end=%016jx, count=%016jx, flags=%x\n", - __func__, type, *rid, start, end, count, flags); - - return (NULL); } static int @@ -519,33 +564,22 @@ generic_pcie_activate_resource(device_t dev, device_t child, int type, { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; -#endif - rman_res_t start, end; - int res; -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) sc = device_get_softc(dev); - if (type == PCI_RES_BUS) { +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_activate_bus(sc->ecam, child, rid, r)); - } #endif - - if ((res = rman_activate_resource(r)) != 0) - return (res); - - start = rman_get_start(r); - end = rman_get_end(r); - res = generic_pcie_translate_resource_common(dev, type, start, end, - &start, &end); - if (res != 0) { - rman_deactivate_resource(r); - return (res); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(dev, child, type, + rid, r)); + default: + return (bus_generic_activate_resource(dev, child, type, rid, + r)); } - rman_set_start(r, start); - rman_set_end(r, end); - - return (BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, - rid, r)); } static int @@ -554,50 +588,115 @@ generic_pcie_deactivate_resource(device_t dev, device_t child, int type, { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; -#endif - int res; -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) sc = device_get_softc(dev); - if (type == PCI_RES_BUS) { - return (pci_domain_deactivate_bus(sc->ecam, child, rid, r)); - } #endif - if ((res = rman_deactivate_resource(r)) != 0) - return (res); - switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->ecam, child, rid, r)); +#endif case SYS_RES_IOPORT: case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; + return (bus_generic_rman_deactivate_resource(dev, child, type, + rid, r)); default: - break; + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); } - - return (res); } static int generic_pcie_adjust_resource(device_t dev, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; - struct rman *rm; sc = device_get_softc(dev); +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_adjust_bus(sc->ecam, child, res, start, end)); #endif + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(dev, child, type, res, + start, end)); + default: + return (bus_generic_adjust_resource(dev, child, type, res, + start, end)); + } +} + +static int +generic_pcie_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct pcie_range *range; + rman_res_t length, start; + int error; + + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (EINVAL); +#endif + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + } - rm = generic_pcie_rman(sc, type, rman_get_flags(res)); - if (rm != NULL) - return (rman_adjust_resource(res, start, end)); - return (bus_generic_adjust_resource(dev, child, type, res, start, end)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + range = generic_pcie_containing_range(dev, type, rman_get_start(r), + rman_get_end(r)); + if (range == NULL || range->res == NULL) + return (ENOENT); + + args.offset = start - range->pci_base; + args.length = length; + return (bus_generic_map_resource(dev, child, type, range->res, &args, + map)); +} + +static int +generic_pcie_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + struct pcie_range *range; + + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (EINVAL); +#endif + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + range = generic_pcie_containing_range(dev, type, + rman_get_start(r), rman_get_end(r)); + if (range == NULL || range->res == NULL) + return (ENOENT); + r = range->res; + break; + default: + break; + } + return (bus_generic_unmap_resource(dev, child, type, r, map)); } static bus_dma_tag_t @@ -613,6 +712,7 @@ static device_method_t generic_pcie_methods[] = { DEVMETHOD(device_attach, pci_host_generic_core_attach), DEVMETHOD(device_detach, pci_host_generic_core_detach), + DEVMETHOD(bus_get_rman, generic_pcie_get_rman), DEVMETHOD(bus_read_ivar, generic_pcie_read_ivar), DEVMETHOD(bus_write_ivar, generic_pcie_write_ivar), DEVMETHOD(bus_alloc_resource, pci_host_generic_core_alloc_resource), @@ -621,6 +721,8 @@ static device_method_t generic_pcie_methods[] = { DEVMETHOD(bus_deactivate_resource, generic_pcie_deactivate_resource), DEVMETHOD(bus_release_resource, pci_host_generic_core_release_resource), DEVMETHOD(bus_translate_resource, generic_pcie_translate_resource), + DEVMETHOD(bus_map_resource, generic_pcie_map_resource), + DEVMETHOD(bus_unmap_resource, generic_pcie_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/dev/pci/pci_host_generic.h b/sys/dev/pci/pci_host_generic.h index 8e72ac6e5cef..2d7583b861c8 100644 --- a/sys/dev/pci/pci_host_generic.h +++ b/sys/dev/pci/pci_host_generic.h @@ -63,6 +63,7 @@ struct pcie_range { #define FLAG_TYPE_IO 0x1 #define FLAG_TYPE_MEM 0x2 #define FLAG_TYPE_PMEM 0x3 + struct resource *res; }; struct generic_pcie_core_softc { From nobody Thu Feb 27 21:11:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3kYL37l2z59Wbc; Thu, 27 Feb 2025 21:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kYK74TKz45xr; Thu, 27 Feb 2025 21:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OK6X8UmxkDgVUKbJqrmNv0is0JHvQAyeRWS6vPYyIfI=; b=VzST+2TJgUKKOif54Sr2viyHTxTgiau/0va6i7zF2yMjPAJPGMvzTBx3gexFKHaPMCdm4n OSvBRbgYi2cKXErF5bjyqrcoz+plavU8cNvqI2jgxLEl6hzWRABQL328CueQmxBy2cBXBB peTrYqn/tPu6Oep1t0vWKwcwfb4DPpK8MRC7W3FEVdoxbQk0AzGiC2RvnzTdxgDf0Qf5nu gBoE+PSabCpHfRL01jc1CUKJWdYc5TlMyCaJvAY63LadkE7agAAE/oGNebM9qtQTVvaCuF Q4To9l6AmTnEws2+KioTQdfKmNA4d+9vqaaH4YlJIdeUVROgCICsT8MSVlKBCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690710; a=rsa-sha256; cv=none; b=TLIv/bdLX2eNSBO0/YuiORPgUB1sctuF8PMraKb4k3l8w5d1bE/BfW/O8aKAmlb13TNV0N L2ZOfPiOqj1Dc12/xKtM+E8cuFU3CD/koQovTtkGnyNOBqoJRLNfUTb3rB70aC64wVaQCa A4U1bfxqepb3Ql9J9j5AEyDXULK9iDJBTr6PcmZ7g3o6tsLLlKxRtFYv56e9HaXW1dRyOr X8h4JGR7KqmX0t+PP/oYNjdd6VeOslC1Au0KEM1+O98l9yHOi6GRjsnI8EAyAS9x5l1/yq S/QLdHIsT7SiKwyTux0qJEYJQvAyOT1ZKJnSK7MlN0zSAQz+8qgnf2kVpkISdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OK6X8UmxkDgVUKbJqrmNv0is0JHvQAyeRWS6vPYyIfI=; b=NvJ3XqMq4zurEzTHExrIsbJgNXV4si3+nrUkvf3K7bQbduIAa2xDJnxLKTYMKuyjonC96d D4dXGt/OY4z3KCPN1VuRLku/w6NAdMbSVNEXDPzM2ek/0cdR40Ulhi+xSyKaslRSVnQuZn 8yhPwbQyPd4vlzIX/QUrJKoJEnJF+QcLxYmmUwsj/q6tTxbx7T44KMzLBDdYP4QWBdmVjX s6xPsR9HT7o1m41Cw4XIgPXhwEtXqvGkvfs8wC5wnH3RG9v1gPbrjpbkHmR3Q8j0tmvcCU GZheZu2HQGU/8SeRLTfQ/dDCOFRzuIFrUGrj+b9KsG9uWLK4qUI0Gm9fVHk4XQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3kYK6Z70z10K7; Thu, 27 Feb 2025 21:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RLBnPG098614; Thu, 27 Feb 2025 21:11:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RLBna7098611; Thu, 27 Feb 2025 21:11:49 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:11:49 GMT Message-Id: <202502272111.51RLBna7098611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4fd887f08b00 - stable/13 - queue: Fix STAILQ_ASSERT_EMPTY() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4fd887f08b000173c196e954b510752025ff3fc0 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4fd887f08b000173c196e954b510752025ff3fc0 commit 4fd887f08b000173c196e954b510752025ff3fc0 Author: Olivier Certner AuthorDate: 2025-02-27 20:59:41 +0000 Commit: Olivier Certner CommitDate: 2025-02-27 21:11:10 +0000 queue: Fix STAILQ_ASSERT_EMPTY() The 'while' part corresponding to the 'do' was missing. Did not notice the problem as later commits using it have been stashed and never reworked up to now, and it is currently unused in the tree. While here, fix spacing after the '#define' in the !(_KERNEL && INVARIANS) part. Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") MFC after: 1 minute Sponsored by: The FreeBSD Foundation (cherry picked from commit d3c4b002d1fd54ac69c1714e208051867ee56dc4) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 0b1e1f9fba55..31a220bcdcc0 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -356,7 +356,7 @@ struct { \ #define STAILQ_ASSERT_EMPTY(head) do { \ if (!STAILQ_EMPTY((head))) \ panic("stailq %p is not empty", (head)); \ -} +} while (0) /* * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) @@ -370,7 +370,7 @@ struct { \ } while (0) #else #define QMD_STAILQ_CHECK_EMPTY(head) -#define STAILQ_ASSERT_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) #define QMD_STAILQ_CHECK_TAIL(head) #endif /* (_KERNEL && INVARIANTS) */ From nobody Thu Feb 27 14:17:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLz2tvDz5qG2M; Thu, 27 Feb 2025 14:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLz15GRz3xPb; Thu, 27 Feb 2025 14:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WtGqKK6Noe0LGu+K5LInQeyjSHnLo/fZqIXTq1aSnAA=; b=BiCdp45hANMsINouHWEFosjwen9KPnzBFVye+YOPcMRLuN9XMqEvfH+DMIKGWkDiJXj2sq EdHzPVtkREUZVSnYoiYxm6bNGHshrnulPoT2uODXDm+9X5pbvuywPzF/QiCpN4GB4Rz8I3 fsKQHzd5OIEovsCCuwFMCwlUduX+o33cZHFZQYL4ygX3Zhksj6v5c6o478Ijf8jOFROfbT 339tYuohr4ie+wu7NVyt7FZlMLcgUW0qBXtSml177BHVGGEa66Uqd9wvRvYpiJ5B+PMe6N JfogacaPSmqEX3zEl6Qumql17LAMA2XHwmrB2q61OxrCCPjE2Ltb6MzQW2ThDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665835; a=rsa-sha256; cv=none; b=RniANNx8LEscAfREUmGh0hG0cQE3u+dsFpIB13JdUs1Rd2xDJQRBCjN5VTMqJDlbtQCuD6 fEYXWCfSg3tv0IEe0XHdMAkwe1raS6zo63NPpozEkW+c7qLYwWWB/mIP+dO9zH9/b2w4t9 9HMnFZuxpIDwcU83v7kRx61byzR481lHcWRbW49gqJyT1EX0ABpp1Qfu8jTWKOchYQsQXB cJyQ90cMwh7FXBCJbA+YkO1Js4zLSli1Jgrxek26sOGmGIuTl7SzjE10A7EANhA6qng0Y3 jiLq8I5uTjOcOuH2R1+81NS42HaW67KgJKcs6dyWARExFbah0gySShNB0+Lu6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WtGqKK6Noe0LGu+K5LInQeyjSHnLo/fZqIXTq1aSnAA=; b=RGMdu0ZlHbA8b+KyMZJzj86bo7yMfkIbcUxSmQePyTEXygOTVJwZRg5o8pxT7SVq53S70a 8+DOrLAPMcVzaB8BzpCXH7aXpRTDzWO0Jr1tIPsBQM/Hux/VfJ+gumm16JpSLWGPkZQsj7 syW/1ZCAddnOIp+/WvKwRxsWLP4w4wdxsJDInSYUodZdgdVB2Rv9mj+RPy7WSs3t3f3+de M182Mx79xGaLds1K7iOgTbcpRJCK2arvs0FnKZ+csXhTiB+ne8yaywpfaSbpZqC6ATqOYd weo0sk2tR1aIyWDLVGcj2qdRiUfR7M+s2urtVYHWGIUGf+EWqGFiOFuUoD9Ofw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLz0gs7zm7P; Thu, 27 Feb 2025 14:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHEBG017018; Thu, 27 Feb 2025 14:17:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHEDa017015; Thu, 27 Feb 2025 14:17:14 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:14 GMT Message-Id: <202502271417.51REHEDa017015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: fff81f9d4e14 - stable/14 - pci_host_generic: Simplify generic_pcie_translate_resource List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fff81f9d4e140e0ff03ff338f541d3f2c13982f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fff81f9d4e140e0ff03ff338f541d3f2c13982f6 commit fff81f9d4e140e0ff03ff338f541d3f2c13982f6 Author: John Baldwin AuthorDate: 2024-03-05 04:53:21 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Simplify generic_pcie_translate_resource Inline generic_pcie_translate_resource_common into its sole caller. No functional change. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D44206 (cherry picked from commit 291079d0ebdd078840ccb27aaa5d286e03e2e7e6) --- sys/dev/pci/pci_host_generic.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 0f85e23eb028..da49edcf91f5 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -504,8 +504,8 @@ generic_pcie_containing_range(device_t dev, int type, rman_res_t start, } static int -generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, - rman_res_t end, rman_res_t *new_start, rman_res_t *new_end) +generic_pcie_translate_resource(device_t dev, int type, rman_res_t start, + rman_res_t *new_start) { struct pcie_range *range; @@ -513,34 +513,20 @@ generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: - range = generic_pcie_containing_range(dev, type, start, end); + range = generic_pcie_containing_range(dev, type, start, start); if (range == NULL) return (ENOENT); - if (range != NULL) { - *new_start = start - range->pci_base + range->phys_base; - *new_end = end - range->pci_base + range->phys_base; - } + *new_start = start - range->pci_base + range->phys_base; break; default: /* No translation for non-memory types */ *new_start = start; - *new_end = end; break; } return (0); } -static int -generic_pcie_translate_resource(device_t bus, int type, - rman_res_t start, rman_res_t *newstart) -{ - rman_res_t newend; /* unused */ - - return (generic_pcie_translate_resource_common( - bus, type, start, start, newstart, &newend)); -} - struct resource * pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) From nobody Thu Feb 27 14:16:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLK38Kvz5qFXv; Thu, 27 Feb 2025 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLK2WYLz3wys; Thu, 27 Feb 2025 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ihQVPaY/E+OywMuFy9GJxWOhdLeSoR79zz+I/4QUlQ=; b=NybVgevjHR8u1IRSw1VxfYipR9lqBYhhhVTVrUIxpi7GkThjeqaUiabPgClIDAsufYNXVE q9t9nOYHrPIrOrv2A8xxFrwQHkz31NDfbGN4Q0vfx8wf83KEaVo8c3G7SbiRiLxhm67yGW QK/9T23XXa7E6B3AsQq15/WmtIsK8HWPywSHRhMrrA40TalaIlVb3+ou2enFnsIiWj3CeB OHJOohs58Q3DiLlINnTBaI4/k6aDYfRLdjbHu42lul0QDVIyQnrJDzzOf9dGxvA/CLQUYN 0F3dAVcu4KwGvLJTxY8CC7NOqs8kc1ejSYA/g/6JkkUHqb33R/4MxdZMC7gYDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665801; a=rsa-sha256; cv=none; b=NclYjqGeL0L4XV+my/3Kvd8wxTAi2EhI5zdfWOu2O8mGxRkEmjnKhoS9iYmU2JqSuwhv3n 3FmnO8i5QBS/QQGQ96IzdvcB3dcT1S2TEIWEmU+xVPVshAvltL+kcK6KGOR9RzzA80D863 YyMFpbCnU2ZbadW8AYWMyUUpS0UA53+nROeZVJuIoJKdYC4cOhJRQO5eb8kYSt7uM34JA9 iPgBlErtb9yXgNspSLHk+VS9QLAh0ElvaYilVwShPjVQ3u1E4n11joAKGNPjoK6NgAjThP F6kitWeBFDvb1fvB/VmN9PBnWWtoml7SlUIlVWqoRq68WILAeH3YHqFsU4k1TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ihQVPaY/E+OywMuFy9GJxWOhdLeSoR79zz+I/4QUlQ=; b=RRn5/xJtDHFztKNI1J8xICLZPcODdmjK6Qn0q66UUw1CcA52lGLvNtDmlrmxR9wdJBxQb0 XCSIa+wslMONBc8iaGMf2WVookBVuTtMiJEA9tfeq+w3ZtFF9tfSTKjwAjoaR1+fFGCipm BMJpLWXummlTtKRmm3QuYJMnEJOuDDJRgDAhIeSMiOwBBUObJoKt/dmvTwTIH65HAMpErc ON76WTuV4UwnUckiAO306ZG28AvOy8rBunn/AwHp6/BaC0YDINC2nS5Y6LUuVAVpyq9T3i KZbZyr9xi5YUaRb24uDZvK9Rc/RWLxmbbxeKxpSSG3HRmCFJx3dWEIUwbmK1yA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLK2474zmZP; Thu, 27 Feb 2025 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGfCE015951; Thu, 27 Feb 2025 14:16:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGfC0015948; Thu, 27 Feb 2025 14:16:41 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:41 GMT Message-Id: <202502271416.51REGfC0015948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e389a717877b - stable/14 - arm mv_pcib: Use bus_generic_rman_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e389a717877bca69241f41cb4015743f2058ab25 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e389a717877bca69241f41cb4015743f2058ab25 commit e389a717877bca69241f41cb4015743f2058ab25 Author: John Baldwin AuthorDate: 2024-01-23 17:37:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 arm mv_pcib: Use bus_generic_rman_* - Implement bus_get_rman pulling bits from mv_pcib_alloc_resource. - Implement bus_map/unmap_resource pulling bits from mv_pcib_activate/deactivate_resource. - Use bus_generic_rman_* to handle memory and I/O resources for mv_pcib_alloc/activate/adjust/deactivate/release_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43438 (cherry picked from commit 4e1d94d99798b9176b477062a9c7502c33d3e810) --- sys/arm/mv/mv_pci.c | 180 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 157 insertions(+), 23 deletions(-) diff --git a/sys/arm/mv/mv_pci.c b/sys/arm/mv/mv_pci.c index f6aa52611c86..64736d8c1108 100644 --- a/sys/arm/mv/mv_pci.c +++ b/sys/arm/mv/mv_pci.c @@ -343,10 +343,21 @@ static int mv_pcib_mem_init(struct mv_pcib_softc *); static int mv_pcib_probe(device_t); static int mv_pcib_attach(device_t); +static struct rman *mv_pcib_get_rman(device_t, int, u_int); static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int mv_pcib_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int mv_pcib_release_resource(device_t, device_t, int, int, struct resource *); +static int mv_pcib_activate_resource(device_t, device_t, int, int, + struct resource *r); +static int mv_pcib_deactivate_resource(device_t, device_t, int, int, + struct resource *r); +static int mv_pcib_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int mv_pcib_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int mv_pcib_read_ivar(device_t, device_t, int, uintptr_t *); static int mv_pcib_write_ivar(device_t, device_t, int, uintptr_t); @@ -371,10 +382,14 @@ static device_method_t mv_pcib_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, mv_pcib_read_ivar), DEVMETHOD(bus_write_ivar, mv_pcib_write_ivar), + DEVMETHOD(bus_get_rman, mv_pcib_get_rman), DEVMETHOD(bus_alloc_resource, mv_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, mv_pcib_adjust_resource), DEVMETHOD(bus_release_resource, mv_pcib_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_activate_resource, mv_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, mv_pcib_deactivate_resource), + DEVMETHOD(bus_map_resource, mv_pcib_map_resource), + DEVMETHOD(bus_unmap_resource, mv_pcib_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -877,20 +892,30 @@ mv_pcib_init_all_bars(struct mv_pcib_softc *sc, int bus, int slot, return (0); } +static struct rman * +mv_pcib_get_rman(device_t dev, int type, u_int flags) +{ + struct mv_pcib_softc *sc = device_get_softc(dev); + + switch (type) { + case SYS_RES_IOPORT: + return (&sc->sc_io_rman); + case SYS_RES_MEMORY: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct mv_pcib_softc *sc = device_get_softc(dev); - struct rman *rm = NULL; - struct resource *res; switch (type) { case SYS_RES_IOPORT: - rm = &sc->sc_io_rman; - break; case SYS_RES_MEMORY: - rm = &sc->sc_mem_rman; break; #ifdef PCI_RES_BUS case PCI_RES_BUS: @@ -912,21 +937,32 @@ mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, (end > sc->sc_mem_base + sc->sc_mem_size - 1)) return (NULL); - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - return (NULL); - - rman_set_rid(res, *rid); - rman_set_bustag(res, fdtbus_bs_tag); - rman_set_bushandle(res, start); + return (bus_generic_rman_alloc_resource(dev, child, type, rid, + start, end, count, flags)); +} - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res)) { - rman_release_resource(res); - return (NULL); - } +static int +mv_pcib_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ +#ifdef PCI_RES_BUS + struct mv_pcib_softc *sc = device_get_softc(dev); +#endif - return (res); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(dev, child, type, r, + start, end)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: + return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, + end)); +#endif + default: + return (bus_generic_adjust_resource(dev, child, type, r, + start, end)); + } } static int @@ -935,15 +971,113 @@ mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, { #ifdef PCI_RES_BUS struct mv_pcib_softc *sc = device_get_softc(dev); +#endif - if (type == PCI_RES_BUS) + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(dev, child, type, + rid, res)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: return (pci_domain_release_bus(sc->ap_segment, child, rid, res)); #endif - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) + default: return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, rid, res)); + } +} + +static int +mv_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ +#ifdef PCI_RES_BUS + struct mv_pcib_softc *sc = device_get_softc(dev); +#endif + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(dev, child, type, + rid, r)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: + return (pci_domain_activate_bus(sc->ap_segment, child, rid, r)); +#endif + default: + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + } +} + +static int +mv_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ +#ifdef PCI_RES_BUS + struct mv_pcib_softc *sc = device_get_softc(dev); +#endif + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(dev, child, type, + rid, r)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->ap_segment, child, rid, + r)); +#endif + default: + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + } +} + +static int +mv_pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t length, start; + int error; - return (rman_release_resource(res)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + map->r_bustag = fdtbus_bs_tag; + map->r_bushandle = start; + map->r_size = length; + return (0); +} + +static int +mv_pcib_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (0); + default: + return (EINVAL); + } } static int From nobody Thu Feb 27 14:16:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YLf392nz5qFrN; Thu, 27 Feb 2025 14:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLf2cBtz3xMD; Thu, 27 Feb 2025 14:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YXUr+Ky+kqeJ7TxEFAwfjnixXTFHw6Km/rXZebiv+tg=; b=DUMk59ag0fua3rRUNhf/47QavqZxAgozqnXidbBscY1y3/SJF0aRcYL+SxWwhkmd62pVQa cDfOfsoCGwIZ+daIVDS+GeOYvalOc53zIC+T1iA1qj4nLfvXJzurg+MtvTg3FRqPyyNfqq qoU3ajW3oW4SKZbaIxedHdCZ2cdl4ZEFFa29Br6OPA3mo+eTKZqPSIi6ue2CuLK5RjASaN tt9y6UPj6XK1mmeQe8fG0TqjaUpXZJa9HRvZ2Ew9goIxe4/PbwT9yZjsLxkQXIxS7wmi7N uQvu0fJbgHm2dPuCjYA1Zl5LbCUPzJdlRvl+aDydrlB/dXSil3IDNEI4L9eYog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665818; a=rsa-sha256; cv=none; b=FklNnLtUeGbMWA0AEqyrhSN1Z0pw8ej23lRfgct2V68E1/DJsyKlrybwBoqCPtoxd2MYVt kiRw8bq9vf7I3/TSBd6Gcsk3uCpGcv5sFerKj7i3dhZAwvKnV3fH7fBzgzSXO6pTnfwdba 54+mFkDzPliVvp936mMt5/P9Q2A2RmbebTQxwWbu/6kaEczzgTsbBR78Yk5aQJoCictK5U Y7XViSWoBCV23t50Gbhp4wakqGDVCbteVbYE+UxMFopNkK3U3VerpE1UnFZ3EBBHU2zwqz 5UOdgTjkcaw71bJyOzYPWxBnuUKscWsg8c6Cpye5kmFPi2V14yMwK/s+wPX6kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YXUr+Ky+kqeJ7TxEFAwfjnixXTFHw6Km/rXZebiv+tg=; b=H4a6HMPG73i7VxPiTpGcwpDiZ+Oorjw2v71ODLtpHsQPlNN/6ror29HV+iET0hrPxhCKPl L8JOi+cg38D6OJ5wMPa5btEPpaUUIoru46q9Vr1hTgpSyr+TIDWueg4GHy3Dd40YGQWIr8 7iS9aaac+jm3H6GLrsZTlOMa36reGh36lNrqG5ch2WcNnr7b5Fukml4+S1x7mQ0UJ4uY2+ +eLNZNHbveLOJPszd79t1vQSxDZ/ZGarOIbR6/9R/hGdQJGt7HAPjVkeNSWnDxqQnzmDi8 ohYXRlMrtPZP+MemasYHWzhvj485amJ8XK28b6VnukaGwU+sWS/RFbBgUu3E7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YLf20Cdzmdw; Thu, 27 Feb 2025 14:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGwDL016492; Thu, 27 Feb 2025 14:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGwsO016489; Thu, 27 Feb 2025 14:16:58 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:58 GMT Message-Id: <202502271416.51REGwsO016489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8765268c119f - stable/14 - simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resource List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8765268c119f3fe4d0a4a9e65ce3be0efd283133 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8765268c119f3fe4d0a4a9e65ce3be0efd283133 commit 8765268c119f3fe4d0a4a9e65ce3be0efd283133 Author: John Baldwin AuthorDate: 2024-02-16 00:04:50 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resource Specifically, the set/get_resource methods do not currently remap resource types, so remap the type in alloc_resource only after looking for a matching resource list entry. Fixes: 3cf553288b96 simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY (cherry picked from commit 4505c89242025f840023cdf092fdab845586f42d) --- sys/dev/fdt/simplebus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index 273e77abd642..854494eb4899 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -448,9 +448,6 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, sc = device_get_softc(bus); - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - /* * Request for the default allocation with a given rid: use resource * list stored in the local device info. @@ -471,6 +468,9 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, count = rle->count; } + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + if (type == SYS_RES_MEMORY) { /* Remap through ranges property */ for (j = 0; j < sc->nranges; j++) { From nobody Thu Feb 27 14:16:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3YL62y1dz5qGFf; Thu, 27 Feb 2025 14:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL624VVz3wtg; Thu, 27 Feb 2025 14:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BvCWGfpyi4mCtqcL8wASZhmRZFdq1wEdmS0GHwiibMA=; b=ygnD8bGNiNxOGevR2bEU7iT00lTgQdc8Mg0D0qUySxZSGx1xHgPKOt6ggjPmVC/YH4fmIy fC+CX6tKnFPBp/AafG0iKdk7TwR11+f3m3B+W3sEDzL87Xn3ksXMR7rW4W8u3DA51pVOWw SYA28AS5vAec5lD6VnN00+IHstzxtjpmlkLgUpdSi9SfwJPV5gfOwyXMNTZ2/1tulwpLzD x+wWK+krzu7Coenk/JM8pk49uBF/drZi6Y6UM25PyD8EWsjgCi9J7p5rbM0Kf/9PVgruuk c2FbYvEstCNNMAVTZAkEaSaY0Z/BB+mvWoOG4HdiG00fIgR/wnnzTS1/HC9DUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665790; a=rsa-sha256; cv=none; b=RZ5GFfUXfCToDmznrcvoebCoaCj8cU6ugGqrKD9n3DW7XymSozhIzS6uiQUArjDQ5LXL3n NwZQaT6wv13Vq6QOduhSO4U8JfTBSKW5gF7GYcVvbxBQNb46PVihwrr/uJpNfQ6LfV//x+ CQ/3YsakU6oAnRInZx2rPEmLfQlzwF8sJP9Yo1lBMaA4FTo2AEsEr0/ywo8upQ7onBxIKu HvGRgyzPqT1CuVVd4NGrcSqwl5SqQLy06GFJaA9DOrbTjRMhyGapHNQLG9ShjnaAKYF9zR jDc8itbeMC2UsEo3wzYooTXA92o6KJr1wWZYq7xGJ09tRypFMEwL+0HnUNb2Rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BvCWGfpyi4mCtqcL8wASZhmRZFdq1wEdmS0GHwiibMA=; b=JhjQsQnE038wZRajsTWb3R1jSzdlZeBUdc0NBE0QhTsvU4KGVn8Hq1d+Oai0TaTBD2KIwJ I7373Te9x8UTfOuEm9gNyYYd2TOeJf/6tXjlrUDWfrKRPQO50e6NV9gJrNeDY9aKmObp43 CU3/V+Ous3iwjs3QTdwI1aKGtLJ/aeZySu9cGLuEpi46ae2nCSBjrFp5qbqbhRH5m6uZv0 ZBVupSK2WaK1S/9WIVBK70KnEFVkfg0bQQhw4s0QmoB5Y73Ry5BxpjHZO95mE/y+iJRhBn 9AmEVn48cfDb4lHz9jJqzb3+7o0V3I8xJjE+7agg7nkNmxdYutNAmnIdltKhmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3YL61YgrzmZK; Thu, 27 Feb 2025 14:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGUdj015584; Thu, 27 Feb 2025 14:16:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGUtD015581; Thu, 27 Feb 2025 14:16:30 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:30 GMT Message-Id: <202502271416.51REGUtD015581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c96d316a888e - stable/14 - pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c96d316a888e41d1b266fd880383c7802aaf2bd8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c96d316a888e41d1b266fd880383c7802aaf2bd8 commit c96d316a888e41d1b266fd880383c7802aaf2bd8 Author: John Baldwin AuthorDate: 2024-01-23 17:35:36 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43429 (cherry picked from commit e9eb353b324a3d051f81dde91d9f9f0fc044d822) --- sys/dev/pci/pci_host_generic.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 082d083fc681..02ca010a14d7 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -517,9 +517,19 @@ static int generic_pcie_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct generic_pcie_core_softc *sc; +#endif rman_res_t start, end; int res; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) { + return (pci_domain_activate_bus(sc->ecam, child, rid, r)); + } +#endif + if ((res = rman_activate_resource(r)) != 0) return (res); @@ -542,8 +552,17 @@ static int generic_pcie_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct generic_pcie_core_softc *sc; +#endif int res; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) { + return (pci_domain_deactivate_bus(sc->ecam, child, rid, r)); + } +#endif if ((res = rman_deactivate_resource(r)) != 0) return (res); From nobody Fri Feb 28 02:50:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3t3f2kcPz5Mt4Y; Fri, 28 Feb 2025 02:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3t3f0SCZz3LBF; Fri, 28 Feb 2025 02:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uIv/vPhJtPbkqWXBVBpP8a2kJP2pHoYx1RCm7PQhQlw=; b=aeE5b7BftO+g7Q22Ru6B3TrE7y6gJiqEXHVhK6QmuSCRJ7a0wQegI8We9fBztPL+1Jtk66 w7CMa2FPLhDd1D3MzCMeGUTDXERgP9oKCiV045a0ypb7F+BW6m/PAV9oFn7cnxUc+M35fF NILi1QbEKLDs+eukYVHj3/ffUaUb18ZtUv5yFu2rHnMJGDh6ptnQAYuy8/fxjXEmWEhLYk QQqraUYB/FagwEZeMz43DDV4pG6JhK1kEHNSqPAf+t5o5VgdZYW0kUVyvb6FQv3T3qrcQ+ fokkF4ZkIzPLiJ4KWaREcItk4qj3F6lPH8hptquIGyDpvvEtjsL3HuqMAjD2Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740711006; a=rsa-sha256; cv=none; b=G6c8kdOrJuvbkdfpoR4mix6s+8oOG23QTj4lhdDkLFVozEPmVJ9q7edTfhDAYaKEvCr3om bMSPU4eyBuP1Ge4qxHanJeDGSkf6tqFhuwdV5/KIjSV+Hw1jouMBLgzUNoDp6no3eUbN79 G598k7+bw3sNmYB/sz/yC7l1G4oDpwMbLIzG1jRfC5nmRMSYj5MjaU6DP5nU4oIM5oYwiA saEZL3tZDyNMrwK1FAdOxlzfmhKDgFFmska4hPid7SxeSQ1ukSW/c/QXpJU1Jsvd6tzxMj 5uy+SPAKdFfNZ7+7jwVxdoGeAggGYKD4UX1jGoKSXEdPeO8pyms0L8SEeR1a3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uIv/vPhJtPbkqWXBVBpP8a2kJP2pHoYx1RCm7PQhQlw=; b=YUA8T6qLRpgs8csoDjEBnJrlKDyrNRI2uvsW5L8Yq39gFGJafR5ekBdp7f9Zz8qSzcO6qx vMHK9VwS5Dgij7bRg17GFLHmlqL31G97r4nhZJc9gHTYpNPXz1h47IK1AiEm98NKY95bMl 4hdBwqVCXUbtn+0kU7rajgX2Hl0bkPvp8hhpxH4sOHnAX3K5UyVAfbLEzSicK767Rwfrs+ 736AxlqePVZmMy16Hh8+8OqgCRgOUfuEXEGpaSv9sQxDMybhRZAtVY1DfkQhkznSMpy7ub LtQOn1w+Ex5+FlPNFxbZJ0ylLmxCxQObfZ2nxUr81ZbkIezpMVL7Lc3Ub0qomw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3t3f03Xkz181d; Fri, 28 Feb 2025 02:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S2o53C024193; Fri, 28 Feb 2025 02:50:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S2o5fR024189; Fri, 28 Feb 2025 02:50:05 GMT (envelope-from git) Date: Fri, 28 Feb 2025 02:50:05 GMT Message-Id: <202502280250.51S2o5fR024189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 36347cfbf7ac - main - wlanwds: convert getifaddrs() iteration to use the ifa_next pointer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36347cfbf7ac3d1db79fa369266b1cc391daf511 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=36347cfbf7ac3d1db79fa369266b1cc391daf511 commit 36347cfbf7ac3d1db79fa369266b1cc391daf511 Author: Adrian Chadd AuthorDate: 2025-02-27 02:18:23 +0000 Commit: Adrian Chadd CommitDate: 2025-02-28 02:49:49 +0000 wlanwds: convert getifaddrs() iteration to use the ifa_next pointer I don't know what I was thinking in 2017 when I wrote this, but it's very wrong. Use ifa->ifa_next to iterate, not the array index / pointer arithmetic. Differential Revision: https://reviews.freebsd.org/D49148 --- tools/tools/net80211/wlanwds/wlanwds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/net80211/wlanwds/wlanwds.c b/tools/tools/net80211/wlanwds/wlanwds.c index a9ca89e4d5b1..193a9b0a60d4 100644 --- a/tools/tools/net80211/wlanwds/wlanwds.c +++ b/tools/tools/net80211/wlanwds/wlanwds.c @@ -283,7 +283,7 @@ getlladdr(const char *ifname, uint8_t macaddr[ETHER_ADDR_LEN]) } /* Look for a matching interface */ - for (ifa = ifap; ifa != NULL; ifa++) { + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { if (strcmp(ifname, ifa->ifa_name) != 0) continue; From nobody Fri Feb 28 02:50:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3t3g3ltTz5MswV; Fri, 28 Feb 2025 02:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3t3g18BFz3LV6; Fri, 28 Feb 2025 02:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GPh4/gHIykfKpdGqahfHtau2fTNrG/TLsS04eCJoFpE=; b=el32d2sdm9zLCvnPaytOR8hwLHBRfjAHY/r0dLtinJ/NvWSOhNyAXO1a5HkAo5V9KHd55L bBLXSZbdL0T2CPJJvon3JlpoUoiJlAfQDt+EiQIAiAks7QneU/RSeUM+8PPHwBuErcJ0Bk bhRC6/sAcXTQUX4FQ2qfVQPx3VhA5XxMdarGTuKJo+/jbzJHhyu8Bqa2xaW9bJfl4EAMPx +/0bQh7ZnQZO83Pu+VzbkoKgkfXd9qavCJXqxtgCN8awPtJzu613B5eX4sZFZqlzfFmEAe qXrp6X4crEj6uBVapbUpmaCPCwcze2TrXkxHqd8rgFENvBmU1AWG2JIc9ASNvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740711007; a=rsa-sha256; cv=none; b=enSXF0exgqWJkh+pHEIqI9KCRl5FZ0uCfP/OhHgCyaVpuGsCvfCDkPYDLHyc6nbbQQLEBk 4/Oxwa5i61x2XvwUdi0/b6iLhTfdfvIGMFYmFYoLneV5IzIQYhGhlIbEvvE65kNfmLgWs5 UYObP9eTSMispgpIHSeZTCNZ5AoX28jpGfnpNw2lUR9eHqcfZ+m/4KrMLyqyNABh+0H+U0 qgONkBrP39E5P2tDLDoIwfg/4B0VibncJzRrbv1MrInhckzkHJtR70X1QVOLRQsen78kA9 WPwkxHWRT5jSymGEr9d94FH48lCrYNTdASW7X9lkPZvno82dPlDmYMtaRKkCgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GPh4/gHIykfKpdGqahfHtau2fTNrG/TLsS04eCJoFpE=; b=wbGM+EPJr6RdBk7W1pSqXs4/UwxfPTfwiRk5N8+BNleJ2LSKRnufCsYHwPUg+/tzONrB0A C7TyVy9QCMvGhW+FzoElPeARd2lS2wTzVZ6eC1RAuaYuE6ZYmXw/2jP9SK7SFB8V8pZeVU coIGvegIXdtocFLzT1BF1kzwfs+Zsq17ld6AivJitgB4DogbmtvWynA1ELUs5ctFpLUNzM XXGX/ipPh9YE43w0xBuUKPVD4v5qSIGM2GmGhWWucs4uZuMD9FcvytVMF8xhjr3aXQ1u2F BfAHw+y5G5dLMnmNu2+fKeXtKepo9pj0HGUVpxDzB5LD8fqixAzLHMVv9RiDew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3t3g0YHBz181f; Fri, 28 Feb 2025 02:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S2o6Om024456; Fri, 28 Feb 2025 02:50:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S2o6QN024451; Fri, 28 Feb 2025 02:50:06 GMT (envelope-from git) Date: Fri, 28 Feb 2025 02:50:06 GMT Message-Id: <202502280250.51S2o6QN024451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 571743bdc6e2 - main - wlanwds: use a local copy of the ifaddr sockaddr, avoid cast List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 571743bdc6e20b14589fef3568f40167399336ec Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=571743bdc6e20b14589fef3568f40167399336ec commit 571743bdc6e20b14589fef3568f40167399336ec Author: Adrian Chadd AuthorDate: 2025-02-13 18:28:22 +0000 Commit: Adrian Chadd CommitDate: 2025-02-28 02:49:49 +0000 wlanwds: use a local copy of the ifaddr sockaddr, avoid cast Using the cast results in alignment errors from LLVM. Fix it to go through void *. Differential Revision: https://reviews.freebsd.org/D48996 --- tools/tools/net80211/wlanwds/wlanwds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/net80211/wlanwds/wlanwds.c b/tools/tools/net80211/wlanwds/wlanwds.c index 193a9b0a60d4..e64b05658740 100644 --- a/tools/tools/net80211/wlanwds/wlanwds.c +++ b/tools/tools/net80211/wlanwds/wlanwds.c @@ -295,7 +295,7 @@ getlladdr(const char *ifname, uint8_t macaddr[ETHER_ADDR_LEN]) } /* Check address family */ - sdl = (struct sockaddr_dl *) ifa->ifa_addr; + sdl = (struct sockaddr_dl *)(void *)ifa->ifa_addr; if (sdl->sdl_type != IFT_ETHER) { syslog(LOG_CRIT, "%s: %s: unknown aftype (%d)\n", __func__, From nobody Fri Feb 28 02:50:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3t3h3LNSz5MtFd; Fri, 28 Feb 2025 02:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3t3h1Xw4z3LV7; Fri, 28 Feb 2025 02:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Yi8XjPj5eBqp8gnWBCBk9M6XK0R6TY3c1C35Qi6jf0=; b=Q937tzeOPM3rR3FTzsE60Iibox18w2N2IqNu1xRlecVySybyPq69SgYTYEKuD9pG3o6nMw wKNcI0+XLoJfpxmugU1tHydCSPPGVY1tZVEoHQkCnZvueqAXulSX37+O8q/2YZ+geXGF+x SnahBIi4v1PfHP8/qnTs4sG8hs6HkwXR7tIjA/izG+HLDI3qSwAoN7AaEFzjMcerQBItXp Sgb+13rMADOQcUSgAE4LSriIJYsrxRJhchLIr5JVTcFZDgNpphY6Jxbyu+XynnHjiVZqNQ PuhxwIctdbN3G0JjlakdGN2nA/jdoo+KG8RjtHjG0lpU9u8R5YLsdkVw2rh+JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740711008; a=rsa-sha256; cv=none; b=bKT8cZMbjh02urd+N1yJ72NJOx+K1C6v7UfPmFKVx3iCgYfEusofRNuAM2WS0Ne3i8rl5F akSPWW345k5mzP0/G4HIKLmTPDQiJSG3WHROjGpgbXDvecjryHZEFEwRZ0FmU2hFMDqlNZ ZGQQGSGN/7DBzuZy+GQL8K0ZPTvJUQWTAkdzXsyie8HMuw9CG74oBjwtFcB+p9ixz7WGDI ByE54X/Tr7N1vdbp6w3ZY+j+qhXMfiPkuX01jexLCXTORau9qkkGIHNy8iYrSPeUItU9fQ hzGfzm/i7upywmGdWoFu7O+emtvem1lKowK9ZQsC/fpKVhvn+Z/ENfU4szh3qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Yi8XjPj5eBqp8gnWBCBk9M6XK0R6TY3c1C35Qi6jf0=; b=fwkIQUgb5rtAgAmBoJbwHG/UTDFTp9KSy8N+lRVTjWjrZND6LTd7udwPy+j2tmrDNKkNsr AUbU+FNoZB+Ydb5POMaqgkVHksVhAtjUCaGiJ+/9ALfXLHSOgTUETSK6Elg7mDo8Kghl8P 4H/GJiZBcDXTZhDG8sUXAWFSE25RxDLPnqm4D8p3nlgMOIZc7iiGlbPiuwE+WQgnJCtjjE LZo98Kg4C1SsO7RlfScjD/rEcEioAUdvSEFSsWI557cxFugOn9Y0AMT/2aBqq9JmeFt4p/ VOpqY5qK2cEcfkS2VRGFrXB3c3UX+n0gzn5USUViZHoHsgiMLNQD19t+0btTfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3t3h14g6z18Q9; Fri, 28 Feb 2025 02:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S2o8fY024720; Fri, 28 Feb 2025 02:50:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S2o885024715; Fri, 28 Feb 2025 02:50:08 GMT (envelope-from git) Date: Fri, 28 Feb 2025 02:50:08 GMT Message-Id: <202502280250.51S2o885024715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: db80116da404 - main - wlanwds: add pidfile support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db80116da404c90e6f0d69350554291f866e8ebb Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=db80116da404c90e6f0d69350554291f866e8ebb commit db80116da404c90e6f0d69350554291f866e8ebb Author: Adrian Chadd AuthorDate: 2025-02-13 18:33:12 +0000 Commit: Adrian Chadd CommitDate: 2025-02-28 02:49:49 +0000 wlanwds: add pidfile support Add pidfile support based on "man pidfile". Differential Revision: https://reviews.freebsd.org/D48997 --- tools/tools/net80211/wlanwds/Makefile | 2 ++ tools/tools/net80211/wlanwds/wlanwds.c | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tools/tools/net80211/wlanwds/Makefile b/tools/tools/net80211/wlanwds/Makefile index 1e993cc07c21..293ddb75f9b4 100644 --- a/tools/tools/net80211/wlanwds/Makefile +++ b/tools/tools/net80211/wlanwds/Makefile @@ -2,4 +2,6 @@ PROG= wlanwds BINDIR= /usr/local/bin MAN= +LIBADD= util + .include diff --git a/tools/tools/net80211/wlanwds/wlanwds.c b/tools/tools/net80211/wlanwds/wlanwds.c index e64b05658740..f6364c3ce4da 100644 --- a/tools/tools/net80211/wlanwds/wlanwds.c +++ b/tools/tools/net80211/wlanwds/wlanwds.c @@ -68,6 +68,7 @@ #include #include #include +#include #define IEEE80211_ADDR_EQ(a1,a2) (memcmp(a1,a2,IEEE80211_ADDR_LEN) == 0) #define IEEE80211_ADDR_COPY(dst,src) memcpy(dst,src,IEEE80211_ADDR_LEN) @@ -107,9 +108,11 @@ main(int argc, char *argv[]) { const char *progname = argv[0]; const char *pidfile = NULL; + struct pidfh *pfh = NULL; int s, c, logmask, bg = 1; char msg[2048]; int log_stderr = 0; + pid_t otherpid; logmask = LOG_UPTO(LOG_INFO); while ((c = getopt(argc, argv, "efjP:s:tv")) != -1) @@ -148,6 +151,17 @@ main(int argc, char *argv[]) ifnets = argv; nifnets = argc; + if (pidfile != NULL) { + pfh = pidfile_open(pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) + errx(EXIT_FAILURE, "Daemon already running; pid: %jd.", + (intmax_t)otherpid); + + warn("Cannot open or create pidfile"); + } + } + s = socket(PF_ROUTE, SOCK_RAW, 0); if (s < 0) err(EX_OSERR, "socket"); @@ -157,8 +171,12 @@ main(int argc, char *argv[]) scanforvaps(s); /* XXX what directory to work in? */ - if (bg && daemon(0, 0) < 0) + if (bg && daemon(0, 0) < 0) { + pidfile_remove(pfh); err(EX_OSERR, "daemon"); + } + + pidfile_write(pfh); openlog("wlanwds", log_stderr | LOG_PID | LOG_CONS, LOG_DAEMON); setlogmask(logmask); @@ -167,6 +185,8 @@ main(int argc, char *argv[]) ssize_t n = read(s, msg, sizeof(msg)); handle_rtmsg((struct rt_msghdr *)msg, n); } + + pidfile_remove(pfh); return 0; } From nobody Fri Feb 28 02:50:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3t3j2stTz5Mt4f; Fri, 28 Feb 2025 02:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3t3j21GSz3LV8; Fri, 28 Feb 2025 02:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mGAPeffUKoB9XiBKnCw/tIDXAAZlPx+h8zlboZKEYh4=; b=RGbTs/BcZzle0j4ndZWhPIfDVInNS7aprBOT2eCukCUhZtU//y4jfNIYnC9Y4u5cdp0y8C y8sxhIBY5+04l0SXyr6B07QjnQwfooUDsgGTR8zZlXQW1QQBM48IMh93Ip/TeSRzZwed0N O9z0EEWEzg0qA+npkFlq65IVgHHGKbHuPc0IAe2+6pDXvvQq8guQBAT/FxuVHfCqjuu+13 enc6MzzAc7g9V+URhGDANPVDSEUbg112uE2xsngSHast3asMZSvekPqbl+kXHlQ8IB3qfD J5dAKEo2vg7A18442E2VreLtwipj22S/Y6BuXpjruXDTmdMC28iFkVI7S5ePmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740711009; a=rsa-sha256; cv=none; b=MZwz4ta9fif8JUAtOZppbJxhBnl27meeYegSvLjmqs7zlt7Z5QSo+mrTrsa4GFq9rX+6Xd 8s2au+rBdiDPx8JaGvuHYhZh0DfT1cRxvSHIePDNsF5ux+E7QABomgxiuBSBnG1+oBfUWS bTTdDk3YqlHncgk6rekPNqvmu6vcY9uS3gM94UR2yqxQJYYfHmW2dBQbq/gBMtMvnF+8/K mmsaLZ245WH3zbuc7wS/PERxneJldGXuaFLNlbZeUyid75ISAar4+bNEIl7n5aViKe4+vR NHO4UEcQN/el/oY2w4pLsPDRE1vZcjpt4fC7y3Cc0K+qcPefVskXgzoHdS+SKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740711009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mGAPeffUKoB9XiBKnCw/tIDXAAZlPx+h8zlboZKEYh4=; b=Hf4hF9sYTpBTobxaYJS0GCrsdf6mafJACiV/hrWcxzJGuD0En5OrFxY4MeMxoyPq2gKAnl BRkA5C/AHVasbxmbcpeVXjEeVY1vRbvwzlcYQW/jYo03JYrlTUxluErfk77JEvP6ctyxFs sBkJhbdyD0LQ8bgHppvPvCtc0dnQuizaX3fOX7N8NTeKW52AZqXQ4rt+UTlEvCWVmZ0iUt de8jGCK7DrYEcwBj0iks5RXbIc0X7Fz/E9+BhN6z1UVawCuJ9muVW0RVZy3leJI8AH0yxh Oa73hWFgXpBQDBfwkeGajpPxl2MzrKqga5YMiXPD9+LA7Y7u+nDFgr4XVk4l5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3t3j1Yp4z18jw; Fri, 28 Feb 2025 02:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S2o9Cl025039; Fri, 28 Feb 2025 02:50:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S2o98i025031; Fri, 28 Feb 2025 02:50:09 GMT (envelope-from git) Date: Fri, 28 Feb 2025 02:50:09 GMT Message-Id: <202502280250.51S2o98i025031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 92caff2b1b6b - main - wlanwatch: clean up to compile / run List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92caff2b1b6b3aa5da49a2cb90f3c787fc11d17e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=92caff2b1b6b3aa5da49a2cb90f3c787fc11d17e commit 92caff2b1b6b3aa5da49a2cb90f3c787fc11d17e Author: Adrian Chadd AuthorDate: 2025-02-27 02:37:42 +0000 Commit: Adrian Chadd CommitDate: 2025-02-28 02:49:49 +0000 wlanwatch: clean up to compile / run * add static where needed * delete old unused flags, dating back to the initial commit from Sam * indirect through void * where appropriate, to avoid LLVM alignment errors * PRIu64 where needed This does work, but it currently doesn't track the ifname itself, so we see ifindexes, not ifnames: Wed Feb 26 18:35:59 RTM_IEEE80211: if# 2, scan complete Wed Feb 26 18:35:59 RTM_IEEE80211: if# 2, associate with 30:de:4b:db:46:0a Wed Feb 26 18:35:59 RTM_IFINFO: if# 2, link: up, flags: .. but it does work! Differential Revision: https://reviews.freebsd.org/D49149 --- tools/tools/net80211/wlanwatch/wlanwatch.c | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/tools/tools/net80211/wlanwatch/wlanwatch.c b/tools/tools/net80211/wlanwatch/wlanwatch.c index 6e3bfd798c2d..ec6d85cc1ffb 100644 --- a/tools/tools/net80211/wlanwatch/wlanwatch.c +++ b/tools/tools/net80211/wlanwatch/wlanwatch.c @@ -63,6 +63,7 @@ #include #include #include +#include /* XXX */ enum ieee80211_notify_cac_event { @@ -74,7 +75,7 @@ enum ieee80211_notify_cac_event { static void print_rtmsg(struct rt_msghdr *rtm, int msglen); -int nflag = 0; +static int nflag = 0; int main(int argc, char *argv[]) @@ -121,22 +122,17 @@ bprintf(FILE *fp, int b, char *s) putc('>', fp); } -char metricnames[] = -"\011pksent\010rttvar\7rtt\6ssthresh\5sendpipe\4recvpipe\3expire\2hopcount" -"\1mtu"; -char routeflags[] = -"\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE\010MASK_PRESENT" -"\011CLONING\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE\016b016" -"\017PROTO2\020PROTO1\021PRCLONING\022WASCLONED\023PROTO3\024CHAINDELETE" -"\025PINNED\026LOCAL\027BROADCAST\030MULTICAST"; -char ifnetflags[] = +static char ifnetflags[] = "\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5PTP\6b6\7RUNNING\010NOARP" "\011PPROMISC\012ALLMULTI\013OACTIVE\014SIMPLEX\015LINK0\016LINK1" "\017LINK2\020MULTICAST"; -char addrnames[] = +static char addrnames[] = "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD"; -char defaultname[] = "default"; +static char defaultname[] = "default"; + +#define SOCKADDR_CNV_CONST(sa, sa_fam) \ + ((struct sa_fam *)(void *) (sa)) static const char * routename(struct sockaddr *sa) @@ -165,7 +161,7 @@ routename(struct sockaddr *sa) { struct in_addr in; char *cp; - in = ((struct sockaddr_in *)sa)->sin_addr; + in = SOCKADDR_CNV_CONST(sa, sockaddr_in)->sin_addr; cp = NULL; if (in.s_addr == INADDR_ANY || sa->sa_len < 4) @@ -220,10 +216,10 @@ routename(struct sockaddr *sa) #endif case AF_LINK: - return (link_ntoa((struct sockaddr_dl *)sa)); + return (link_ntoa(SOCKADDR_CNV_CONST(sa, sockaddr_dl))); default: - { u_short *s = (u_short *)sa; + { u_short *s = (u_short *)(void *)sa; u_short *slim = s + ((sa->sa_len + 1) >> 1); char *cp = line + sprintf(line, "(%d)", sa->sa_family); char *cpe = line + sizeof(line); @@ -340,7 +336,7 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen) fflush(stdout); break; case RTM_IEEE80211: -#define V(type) ((struct type *)(&ifan[1])) +#define V(type) ((struct type *)(void *)(&ifan[1])) ifan = (struct if_announcemsghdr *)rtm; printf("%.19s RTM_IEEE80211: if# %d, ", cnow, ifan->ifan_index); switch (ifan->ifan_what) { @@ -373,7 +369,8 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen) printf("replay failure: src %s " , ether_sprintf(V(ieee80211_replay_event)->iev_src) ); - printf("dst %s cipher %u keyix %u keyrsc %llu rsc %llu" + printf("dst %s cipher %u keyix %u keyrsc %" PRIu64 + " rsc %" PRIu64 , ether_sprintf(V(ieee80211_replay_event)->iev_dst) , V(ieee80211_replay_event)->iev_cipher , V(ieee80211_replay_event)->iev_keyix From nobody Fri Feb 28 08:13:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z41Dl1Pvjz5Vpwt; Fri, 28 Feb 2025 08:13:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z41Dk68mbz4QK5; Fri, 28 Feb 2025 08:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740730406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cXzqNO6kI+h/J0wrWyvyz+HNt7s8BkSru8PSIdvGCQc=; b=rDy9EeHmiwoKdNYE65iGk+jyp3pUJ9d6Pb2Q8YI2/nsW1Ot7coFJOqWMVi41KAhbcpqDs4 NeDDtARHsWRUiQxJuiSLOu/hDxwPEqMtiBhsPOzJNA+ZsRmpJZHi0SFJyCv7IIyfrv9iau UK6i2TFVk9sLfQBQ/Uwt7ATpSpZzM8lBZEDdWUSs0crXCQtvmHBQbDMNRwlKoQ/jQrNpaU 2RRBBLtw5i4rgSFJn4xg+SGvocq5XbfA47N3lp/YADmzGcIN/ZZ0VHeul1dMljDn8qfcWH ZG6rl8yGOucPsQq8FnGKsx6F1PwlyhuGWpaP3CRI2CQjmq1kvgDJLrILdn1RFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740730406; a=rsa-sha256; cv=none; b=duDpdzGEGBT4saqLfYJlb6mjDRnpiOY66YLMa2DnOpSfpquG7R17sL/VwrNN+rX0keqA2H L9TduHl2evMKBJTwzT3sgOySjWklU26NvC6/vRVff7m5I9JKuMhiC9QAhqB6cwWuSfBjbr 2+lQnMjgybldWGDi09vU5F8dGWgdqHzJlbfb9XKQVQHBT+XspbdhaL2OgOGTqV83thhi1i 4juXb7mopq4+ue7qgp52oV7XKVR6YI+Bw8UeyC1BzqGVW9Ci5njCESQt4wHe9b2S7gPsvF sWUShdILBeIXZFLlWdlYy6yNbQxb/OB7h3MO75wfn1VBdrOlTXZMPqcgGZzYCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740730406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cXzqNO6kI+h/J0wrWyvyz+HNt7s8BkSru8PSIdvGCQc=; b=rawjSwDcdTWF6FYECuoMsrde8mLdvpYSanWbOuLmRgrjp4eWC2PoDaVO1xtUe0YKtav/xd xwrm1SuutxzorZmCafSlrP56b0cZdB5CoMMopzTeGTV4lCDhO9idd63gRoA/aDaB8UVHYH mNHzn8/YjNapFx0QLWLP75sNDRqfl+mGtNrclJ3KnVkhASLpIEKlAAtBqVRAMH0jzm8zBt pcNnYVJxyya6Rf3WpK2+ErifoTuZioX+qbBpOtANcIQ+O0bvFf6BVkg3rvu6k6oWkyNRT8 0jZWJzn8Vzt9ad844RyAvvOOapCFUY5jVCyFAc7zQxGoIZfJMjsun/tlwSwLDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z41Dk5mMrz5W0; Fri, 28 Feb 2025 08:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S8DQf6037988; Fri, 28 Feb 2025 08:13:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S8DQiZ037985; Fri, 28 Feb 2025 08:13:26 GMT (envelope-from git) Date: Fri, 28 Feb 2025 08:13:26 GMT Message-Id: <202502280813.51S8DQiZ037985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Lo Subject: git: 5c7087c349fc - main - ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c7087c349fc1d826807aa1a11912c9e774e3321 Auto-Submitted: auto-generated The branch main has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=5c7087c349fc1d826807aa1a11912c9e774e3321 commit 5c7087c349fc1d826807aa1a11912c9e774e3321 Author: Kevin Lo AuthorDate: 2025-02-28 08:12:00 +0000 Commit: Kevin Lo CommitDate: 2025-02-28 08:12:00 +0000 ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 --- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 5f1f64e02b82..0b866e7a39af 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -297,7 +297,7 @@ static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); vf_mailbox |= hw->mbx.vf_mailbox; - hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; + hw->mbx.vf_mailbox |= vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS; return vf_mailbox; } From nobody Fri Feb 28 08:54:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z427z0HPbz59M04 for ; Fri, 28 Feb 2025 08:54:23 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z427y35Hcz3R41 for ; Fri, 28 Feb 2025 08:54:22 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-474bc1aaf52so6459511cf.1 for ; Fri, 28 Feb 2025 00:54:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; t=1740732861; x=1741337661; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=H8fKMpzSYGiWY2xWlAr/vgsLROlvzPfThcGGrc9JAmw=; b=pF09AXntMZk8H/Ey2RzIP4bCteX5yAUS/KA7TIxv0bx0F8cg9D9dKvU427bIrbP6xQ X2k+jaH2rXecZaOowlfR6thJMUzsju8P9RKYvZvLPIgjSRFhtuMvBYO7MplcpXu8X0VR sebIUhFnrHekZyuFYfffZobjCyUqkMufX5Yxk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740732861; x=1741337661; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H8fKMpzSYGiWY2xWlAr/vgsLROlvzPfThcGGrc9JAmw=; b=WcSBTMQYFrKAE5zs9j7mpb0rQAas8NsjvsWWmOBib7SbMS6wcjlJX4z0DaIy2jCR6A Lhf+7a4Ab0JldtCh4ei5bd+0aHEEMyexQec6mbsQ7TpRyzpIOgLecvDjKsO7DzqViTrg Kr3oUOK0VakvJkzfPUcmCkrAGzviSvyvJ9n+dsEd+1SDYE9DNJvqIceVyAdX1GyPz3U0 AG5X3M2iAoTeAKw8DnKlrFfgvTdFrtjdyUnGEaOFaThKKb7PchLAhuKraAN5g3ToZNjq IAC29rQoHXPzQjinnMcyss1hiGKThhDeq6dYCgog2LfCuMkd7j6GZsuo8HyBVCmFKIsY +RTA== X-Forwarded-Encrypted: i=1; AJvYcCWCGBTKydM3/2Qa6EDK1dxcoodK2thySXhu0WM+mc05k+teMSZgaa2jGBQYdyNn7/emPyMuisWf5Cg2hEZW/BjQQnOa@freebsd.org X-Gm-Message-State: AOJu0YzMx0RWW1PMHiWOSrzwRcDNRPMzzKTT+wcc5h92nI8rg2buzVBx Sl3JsXVhsXoeVkKu4NJfO9AxHXVKGwnZHN2ZwMvPf7wYY190l6E2nv0wREK5IMZUwFswq+x5ccw /m0kiG1VxF7bvf6drkbSRGxYHO9YgTt6cNXuS X-Gm-Gg: ASbGncvRKy4roDGI2M/cxZQpzR7IJ4RYJXVahpbT8e9adzOSP+okBzUswhpxWfC8IPY WYdIOUsBZHPKO19N3ss7JoFd0gfkbwv7fYV2ZnhiXlzGzjXV4bDP8ryFAISytWM9hgtaRh3YC3H tUY2NJuf9F X-Google-Smtp-Source: AGHT+IG4OE6XK2iDR8tOQiVd1//Lhn3WoNvRL+rjwI2+UnwToixP2fZII2MUvfU5T0vOUGC/ltc6eB8Bs1Hhs3wFwNw= X-Received: by 2002:ac8:5a82:0:b0:471:cfa9:2612 with SMTP id d75a77b69052e-474bc0fdc44mr30736231cf.32.1740732861238; Fri, 28 Feb 2025 00:54:21 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202502280813.51S8DQiZ037985@gitrepo.freebsd.org> In-Reply-To: <202502280813.51S8DQiZ037985@gitrepo.freebsd.org> From: Kevin Bowling Date: Fri, 28 Feb 2025 01:54:08 -0700 X-Gm-Features: AQ5f1Jr76GqwPhHbItb0i6IYOYc-q37SUz7CcgcHltpPd6rl1HkIS2Bj2PJ-ulc Message-ID: Subject: Re: git: 5c7087c349fc - main - ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 To: Kevin Lo Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Z427y35Hcz3R41 X-Spamd-Bar: ---- MFC? On Fri, Feb 28, 2025 at 1:13=E2=80=AFAM Kevin Lo wrote: > > The branch main has been updated by kevlo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5c7087c349fc1d826807aa1a11= 912c9e774e3321 > > commit 5c7087c349fc1d826807aa1a11912c9e774e3321 > Author: Kevin Lo > AuthorDate: 2025-02-28 08:12:00 +0000 > Commit: Kevin Lo > CommitDate: 2025-02-28 08:12:00 +0000 > > ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() > Reviewed by: kbowling > Differential Revision: https://reviews.freebsd.org/D49156 > --- > sys/dev/ixgbe/ixgbe_mbx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c > index 5f1f64e02b82..0b866e7a39af 100644 > --- a/sys/dev/ixgbe/ixgbe_mbx.c > +++ b/sys/dev/ixgbe/ixgbe_mbx.c > @@ -297,7 +297,7 @@ static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) > u32 vf_mailbox =3D IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); > > vf_mailbox |=3D hw->mbx.vf_mailbox; > - hw->mbx.vf_mailbox |=3D vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; > + hw->mbx.vf_mailbox |=3D vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS; > > return vf_mailbox; > } From nobody Fri Feb 28 10:29:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z44Fk64Yxz59W0C; Fri, 28 Feb 2025 10:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z44Fk5PMGz3vR0; Fri, 28 Feb 2025 10:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740738570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PxD+Ubpe3rNzUscujBl1eqsUMpH0tAKoKl+TCai6JXE=; b=yRNkv/n+xf/bBkvsphBOjkXetK+JGT3frFBBnlDSXjH4BYC3kDNhc7ywep9wFeiY1Yoe+n 33xpQxu81Q/1YrntlfyvZpy0cBVcZOEvL9s0GB3OLc96Txry3cvPmorG8aTwV9cpBHchcg WtmfF/WKYx3OkDEfy7EIhQoaUr8GSaHVKtafVYQG8Z3iSJYsjBuCd6gMYkVCEipA5fo1pb d9hADe8kaRRK7PykZT90yaAscsz0jCBrw0PXJH9zpy1qQrZItFF89ekncpEUP7Atm1V09s MegQKl+3w955f11OZ/LYEi027HSrqk9vhtE25+Uhpdy51m38hQLUbVRcc89kdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740738570; a=rsa-sha256; cv=none; b=CHSqgEugCK1yq/xzT7oT1AdfejiiYr/xvQ2nyXiOrV0Eqa9+kK3YFyOUVicMmDViwRFz8W fKL4Uu6sNhupvNCrfJqfFNg85QsUAmyG9Ezz5BN9MBMAT3xgVlFpZltN4ZBHu6u6/NCrS1 prLUpxZ5DlhlxlUjf94Evnkanal2LK2MH9DIgn//4TXUL7n+n4a1ZLv+f7h9Jc+SqHlNk3 MG0BtwxVUbQbQZeKU5M6b7QNwyotz5XXanXkUmFotAOGG1G292D5MidAGI4sQqb9LjtzBD gS2A3/R9eZ0asiND8jtiFR4bu593emBivT5D6rDRe9M7uYeHxFemZiPaxhDPrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740738570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PxD+Ubpe3rNzUscujBl1eqsUMpH0tAKoKl+TCai6JXE=; b=V/oHvSvSuZD4/xCHbD7pSSLLqhaz1ptuQjmLY+xtddJ3pKeiZnze9q1PBBVp9pgI4/Vpir Y/2WI6jD0dKuPXHAtC8JCuhsC2Lwy2Z7Rt+kIrbW6K76j1Yj5Wzbm/jerm9F8PInVci1l0 4a91RfAjqsX1OuYY7JLp8uhjsd0gpntmC6fk/GdjnyfToJko7T+gM8XBHn/Jl6CXyP/hsV 4mZkNsX4L3TmKDG5WiahlQ4zE0O2JtwOGMRaiO7+2sgc0BTlQ+Hajyj7D5sHWAGEkOQmuw 2SW5naO5nQ7dwJmgN9jbcCuEeR/D+WA0zLAkyQpw82GgonEmsDZSRFTts1EuxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z44Fk4zspz8Wf; Fri, 28 Feb 2025 10:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SATUgF083204; Fri, 28 Feb 2025 10:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SATUA7083201; Fri, 28 Feb 2025 10:29:30 GMT (envelope-from git) Date: Fri, 28 Feb 2025 10:29:30 GMT Message-Id: <202502281029.51SATUA7083201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8cebb0630046 - main - open.2: add separate paragraph for O_CREAT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cebb0630046a8eb10c551a856397ed230e73833 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8cebb0630046a8eb10c551a856397ed230e73833 commit 8cebb0630046a8eb10c551a856397ed230e73833 Author: artembunichev AuthorDate: 2025-02-27 14:21:20 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-28 10:29:12 +0000 open.2: add separate paragraph for O_CREAT PR: 284353 MFC after: 1 week --- lib/libsys/open.2 | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index 9ad5440bf239..699446b6c7c2 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -231,16 +231,36 @@ is specified and the file exists, the file is truncated to zero length. .Pp If -.Dv O_EXCL -is set with .Dv O_CREAT -and the file already -exists, +is set, but file already exists, +this flag has no effect except when +.Dv O_EXCL +is set too, in this case .Fn open fails with .Er EEXIST . This may be used to implement a simple exclusive access locking mechanism. +In all other cases, the file is created +and the access permission bits (see +.Xr chmod 2) +of the file mode +are set to the value of the third argument taken as +.Fa "mode_t mode" +and passed through the +.Xr umask 2 . +This argument does not affect whether the file is opened +for reading, writing, or for both. +The open' request for a lock on the file, created with +.Dv O_CREAT , +will never fail +(provided that the underlying file system supports locking; +see also +.Dv O_SHLOCK +and +.Dv O_EXLOCK +below). +.Pp If .Dv O_EXCL is set and the last component of the pathname is @@ -289,10 +309,6 @@ semantics can be obtained by setting for a shared lock, or .Dv O_EXLOCK for an exclusive lock. -If creating a file with -.Dv O_CREAT , -the request for the lock will never fail -(provided that the underlying file system supports locking). .Pp .Dv O_DIRECT may be used to minimize or eliminate the cache effects of reading and writing. From nobody Fri Feb 28 13:33:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z48L93zWGz5hxWm; Fri, 28 Feb 2025 13:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z48L93K8cz3Tmc; Fri, 28 Feb 2025 13:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740749617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X0eyymz0UJGE5UC5yiBWVfMTTbRuWDujUa21utLbCu0=; b=B7km4UNb4x0vinUf/FZj+CzE5E/+bqwJH9oYg+5pkb605oM26fWw7Wt7jzxKq7lmaQV/s+ rm/nARId2s/oI8j4c4thhpL8gl94kUxP8Uy7UpBVzamRPkbn9CuT2G07PN+B2oZYtLtUKj 796esk1YA4SEWh9gghjHuzskp1dJuol7dwt93+SRvT59Lza0A3dumyWGaIzgTsEulCb8IT tQL/YzK7oy4d5efgJTqxKobYZXcah2rOXpH2TLhG7FoHamYHBh7C9I6zh6UNmDGxr8Olzi FNkmfh3UdSOKoaDA/wz/wY/Ih6nsklYDwtzAa4rpRXZIu1L5AKsxzOiQZ5ahzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740749617; a=rsa-sha256; cv=none; b=AaeO3qQcIAiF+nSDlucDMLYXBjsI9VWFRXeOLG2QUJBJ45dUjj3fU6OfMaJ44T8A6K0SkI U1qviXqq2RTTwXyBmF4zgMZTnC8HQ7XZr2vprByVPbWZgDZpnL5VPB/YK8ax8TJJfSxAZ3 /IEccPAHRon63XmE+lTH1uZKWCc9/h+K6zkYQ294KEBr+2nYFpS6EH6fG+uF6j+v7H1uwF aW/4KRVBfTfPfzog3pW5TCVddxxOG3jE1UQMfVuLFhPi1QkaulVoZ48KioxGFHaaE5YR6l ItkEYy6UhMPUVdSrGow2OJpMeOLbcUvuAuzc25G6HwM/fuPfnKckZEmmxvIKFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740749617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X0eyymz0UJGE5UC5yiBWVfMTTbRuWDujUa21utLbCu0=; b=OGmQ46q/s0ODBUM16fUDYmHdW3sRzC++8TYCJOUL7tlI5uIhopQAMxnKr2D17EwJk4lVKC FoRQM0JsRRgA+cPFocCwdrcnV7KLLbbV+jHZ/15DzOYrawkX9pYsYVI5aQlkd5e8ShJ53B /w2ZqdD+/TEH/SX8xW5i8Fg9KzCSn7L3/Vd5opVZpbMO43kpx5aEqPAmX9/9UorVKAeW80 Jdr+gbcrgoqNvbn93IPl2e73j/xGSbi8J1iS3fFlgWQzWyN/Xks822BsJX3QlS5BsjqIvM ALRs+cIjfQZubFZPJxOf4GPjqRmaNVvjwMcSMyvmmHxEeu+7JGnY7vu/CuXaDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z48L92wd7zWY1; Fri, 28 Feb 2025 13:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SDXboW036909; Fri, 28 Feb 2025 13:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SDXbUg036906; Fri, 28 Feb 2025 13:33:37 GMT (envelope-from git) Date: Fri, 28 Feb 2025 13:33:37 GMT Message-Id: <202502281333.51SDXbUg036906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ae2b84d9ab9c - main - man4: Fix duplicate if_rtw89.4 MLINK List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae2b84d9ab9cb01abb035ad6e938382d1f7c1e3e Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ae2b84d9ab9cb01abb035ad6e938382d1f7c1e3e commit ae2b84d9ab9cb01abb035ad6e938382d1f7c1e3e Author: Ed Maste AuthorDate: 2025-02-28 13:31:02 +0000 Commit: Ed Maste CommitDate: 2025-02-28 13:33:14 +0000 man4: Fix duplicate if_rtw89.4 MLINK Fixes: 4262dbc57982 ("wifi manuals: Mlink + document description consistency") Sponsored by: The FreeBSD Foundation --- share/man/man4/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 8e0af19eec3d..5f950b7275da 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -764,7 +764,7 @@ 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+=rtw88.4 if_rtw89.4 +MLINKS+=rtw88.4 if_rtw88.4 MLINKS+=rtw89.4 if_rtw89.4 MLINKS+=rtwn.4 if_rtwn.4 MLINKS+=rue.4 if_rue.4 From nobody Fri Feb 28 14:11:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z49B64LLyz5m05j; Fri, 28 Feb 2025 14:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z49B63WPjz3ZXf; Fri, 28 Feb 2025 14:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740751902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCESBnRg1WdSELgFgU/WcFv+R6jUKKg+3KU2mmZeQ/8=; b=P0X42Sy6GALabND9xg2OrZVXJAa1guGOBvmiy8O3WfUmMFihLXEkembknRApKADnO3jqKN 6Ovr9ly048qsk1vChhW5G308cILE/XsUBQfLIPTLjVz+Gv4ONRyerSmjgk4x6uCCH7dxk+ O4ui8QOnoTGHXsJmDUtH6XLcBZTgm//+poI0SPXE6CHKeEnlj2Iwf+Bsw7Wakk9dP0oGyU AWiuzNVlPwrzMIUO/f2HYQuPUXOpIWLtdBj3IpA/xT6jVidZvJF/lwCdOOrT4h/Lm5yfFR cnwKiqhv7IKKEmAbL6joBxxxKo7dN11z9a6XQKlWtOjbyjjnywqgcCJ0AyQ5Xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740751902; a=rsa-sha256; cv=none; b=pVBz3TgIU2uuabrLWjr9B39Ncv4EZ4+Az3qygoJ2f7BESNXEiWDiKUKDHuSipN1sRzkW/U MDiIzrn90MaPs369B0Fwv+wjSpWSGnwiMN5L2M3tD/9gY71NeTDQg8la/GF+ZapVjexNhS ZWmcTM9cVybYBi3V1V4rntOVrh+/tRriENb/yuFvs+RvUzxAz8axJ4pNjepd0vdlYG4HZN 0FNodq+OCKlZhgpvZ/wx8scuOjf8ki6DAH8F+Nahca+/hAXsKi77VcA7HXD4MRTXpZAj8C Wzc6vb6O2Ah5rYTDU8iXRJmteMpTBRpNA8hEAKl5jemguZiFtRHUWAGYuakUjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740751902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCESBnRg1WdSELgFgU/WcFv+R6jUKKg+3KU2mmZeQ/8=; b=VvYf4l7g5ecncs9+lIPO+Wj+1zAhc+1hE9ZvFseh3cNdq4c3Raa/sKlLLTiTvVawgrFLMj 9CoLqH61w0HLkGTmjThElzXcGbW3IuXnVFleUc7seIS2x7mACHz7ZikMp1MG6fjgnP1OGT ui2CMzSdvYbJB9sOdRrc7GRws6ejFT22qXt+D7CaXhdptv7cXKrZB4coN/moTzyrVC8aji 64NjU0YNxx3TmTHVcPEzwOmsUJFHAhVsG1oWPs2EW5hMQu593g9OczOpIdg08i0qUbH/8Q 9CP07p+xTBdPBUhLYg2NDSQSv/NwGu8sGIcD8edrDkLqPE4q55KNsvzVyf/S6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z49B633q7zXG7; Fri, 28 Feb 2025 14:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SEBg7S009394; Fri, 28 Feb 2025 14:11:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SEBgOR009391; Fri, 28 Feb 2025 14:11:42 GMT (envelope-from git) Date: Fri, 28 Feb 2025 14:11:42 GMT Message-Id: <202502281411.51SEBgOR009391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: f2644d64b40f - main - routing: set net.route.multipath=0 when kernel doesn't have ROUTE_MPATH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2644d64b40f611fd4d4f66069ad8d6cf33f69df Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=f2644d64b40f611fd4d4f66069ad8d6cf33f69df commit f2644d64b40f611fd4d4f66069ad8d6cf33f69df Author: Andrey V. Elsukov AuthorDate: 2025-02-28 14:05:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-02-28 14:05:47 +0000 routing: set net.route.multipath=0 when kernel doesn't have ROUTE_MPATH MFC after: 1 week --- sys/net/route/route_ctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index d7756f2a0eb6..e5ddd7782e1e 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -109,10 +109,11 @@ SYSCTL_DECL(_net_route); #define V_rib_route_multipath VNET(rib_route_multipath) #ifdef ROUTE_MPATH #define _MP_FLAGS CTLFLAG_RW +VNET_DEFINE(u_int, rib_route_multipath) = 1; #else #define _MP_FLAGS CTLFLAG_RD +VNET_DEFINE(u_int, rib_route_multipath) = 0; #endif -VNET_DEFINE(u_int, rib_route_multipath) = 1; SYSCTL_UINT(_net_route, OID_AUTO, multipath, _MP_FLAGS | CTLFLAG_VNET, &VNET_NAME(rib_route_multipath), 0, "Enable route multipath"); #undef _MP_FLAGS From nobody Fri Feb 28 15:16:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Bck5Jhbz5m4kr; Fri, 28 Feb 2025 15:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Bck4Mfzz3kMN; Fri, 28 Feb 2025 15:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740755782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZENnwvlp8HKMqTpNRRo6sFVq52hidLjDcTkOjXVm96I=; b=POFGxXpt5HTK3lvQwq27ZFZk7w/QrZzPjVTfm56/8eKj6WvCFbAtuVqe+DTPpk8mATsJDw hSjFrFRhUGIKdAfrTN5BXAJoAdV18Izt9TpusY2plExL3lQcz+g6tsCO2NWWPm84xwE8t3 pgqjHlkboJUHWJEcFULW+/52H1xAe3FWv1i8tOhhMGKOz/IfD+FcpvfHIK14JtwmGGhVO8 4rGkIln8DDRBH68yALElOZLmm7GU9nUPW2DZz5y0n4qlbbwRkmGNf/SpJ6yN+j4p71fBBK vZMKoTitKYHlQIu+vlKhJDAspGjn8gzS6jo6utllLHsRlGqC4t8bPp98k28q2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740755782; a=rsa-sha256; cv=none; b=hGRKJnG87c4cmtUMihaoSqZ2rdKSczmBo0dDmv/alPrOEnpeAcL4B3HlmH0o3PC8ZrmXTY UResiOGBJxdKJqM6iaw7YVHmnnHV5jCKDJwEtb8UZPGGVfQUWhJnUswbVxcxh0DJRoTgQv 1ejO8im5rnLW27ppUQgE895PQ9N0itqAsAFVRH+KCO/sHEx5u3L6lK4gwa9RTl+uZ+XSvy 9iXaA8TDjJaiyc+HcuSp/jcuY09+6LkBckd/axCtZNGY/Bh7uXBYh5JCD7u+EbRE/+sY08 xQ81dWXElgV1mZyXrePjtYIj4lHEYQzk49OdArTxUyI9l6zLY6QAvLLkIGr6BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740755782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZENnwvlp8HKMqTpNRRo6sFVq52hidLjDcTkOjXVm96I=; b=CBSqBUcST8SrVTXo1slMH20LgbcYv2FJPllA5nN6FXs5it9cDWY6woOF7/dMV9VZI+F351 HUPfSYybzfYIEz/rD8G8XcsUCTCYgdSJAfWrDRxjR0kE+ibJu+enmhw/J1T/dueMTjfdZC QGgS2EzKG3h/CCZKt3Qg/mdU1XDGh3oHqE8UCtdZ5sctHYyecIN2aeu/f+iVEacghv6Fw9 coYCM8NNecvyc6J53JoAdRzVbYfbLG8D5kPnZ4L5eR/zEjwklDZZK6wtnKhpUf+1l68kwO KieZjt4UxW+BH03T/BwjEkOX+TiscWLk7MjnDfOYHM+51eE7e+CrmIgQfciLzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Bck3c3Szb5b; Fri, 28 Feb 2025 15:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SFGMeg025563; Fri, 28 Feb 2025 15:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SFGMT5025560; Fri, 28 Feb 2025 15:16:22 GMT (envelope-from git) Date: Fri, 28 Feb 2025 15:16:22 GMT Message-Id: <202502281516.51SFGMT5025560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 8a3537aaf7c1 - main - Makefile.inc1: Make package timestamps reproducible by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a3537aaf7c19f7331fcc160ab42e36fc79e408a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8a3537aaf7c19f7331fcc160ab42e36fc79e408a commit 8a3537aaf7c19f7331fcc160ab42e36fc79e408a Author: Ed Maste AuthorDate: 2025-02-27 13:17:11 +0000 Commit: Ed Maste CommitDate: 2025-02-28 15:11:52 +0000 Makefile.inc1: Make package timestamps reproducible by default Set package archive timestamps based on most recent source commit timestamp (approach suggested by bapt). I'd like to include git metadata in a file included in src tarballs, so that the build is reproducible (including the hash shown in uname etc.) outside of a git checkout. There are still details to be sorted out to do that, so this is an interim step to improve reproducibility. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49165 --- Makefile.inc1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index c9a4fee236aa..f51fe7d3b119 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -597,8 +597,12 @@ PKG_VERSION:= ${_PKG_REVISION}${EXTRA_REVISION:C/[[:space:]]//g} .endif # !defined(PKG_VERSION) .if !defined(PKG_TIMESTAMP) +.if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) +SOURCE_DATE_EPOCH!= ${GIT_CMD} -C ${SRCDIR} show -s --format=%ct HEAD +.else TIMEEPOCHNOW= %s SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime} +.endif .else SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP} .endif From nobody Fri Feb 28 15:53:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4CRv0MDyz5m7nH; Fri, 28 Feb 2025 15:53:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4CRt6Wy3z3vHZ; Fri, 28 Feb 2025 15:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bICeD2S3A81nSG1D/ngIcKicp9xvQcxwBW0BUk43ijU=; b=d5FpGRaQNkDPx/gk1ZIPO1Ysyts2GBDnXZJ5cutZ9igoY/xO4fHZM3u/mm2H+LlvDwjDxk ir5JSOx6ljMHHdGCcLWw/PEmvuK/m0o1KmA8RDZD/EttNeGMNfjonMC+G7de41Pk3quBHy i6kqqJF37Ykn+NzWxWyZoXE0Sm/Z/r5Yx+4gplaUXIB4f41yXdy6jsueONZg2r142PeUPf a5jLm3OpId7pe8feOhmxARPskWXDcPkV4+zBeTV5EFvczP6qttFf8vsz8uPdJ/8KtqAMte 1q7a9JELYRz6qqTexdqLxzPtkJBPvR4GAy7S36OFYe/+eu7lOTJrEkEOgEu59g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740758026; a=rsa-sha256; cv=none; b=iwj50cILmy4Rccc3ufgJi3FgTDpmNm116Pq0IN4KpCGEaAT0IRIydHg79PIs1lvPvt4DXC ixYSBz9zgoe9wq3uRxRFcUnRUQ8hRBZn+OQBbgkpEcb1vDKZzUv82tc3P53lBPoX6CubAQ 5cQd62fbRIBw6pHLtEX0YNQYGdw6mEvTzpDDCKz2pgQzwywxxEbG35WbFdBgx03LA7JZhk IIBL04Iwa+l/aZkBW9OdE9ZTLgZ1+NZojsHWRJTPXWVikRWV5WhaKmwFa3HQJ6ekWAcDF/ FJxFFsQnolXZbOFOyRMcwcyL0rrt4pzTgr8zjnAIK1Nmk9mcyVnhRNbyJieTmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bICeD2S3A81nSG1D/ngIcKicp9xvQcxwBW0BUk43ijU=; b=iuJ8i8LSoU8okqe2/V2nLzkuKc3aoxX7PbTgPn8AVtlHja6F2OMzrnAMYgORQMjMHDEp13 e4B5R2n6GzNxFPVaZ906uJa1bzRbslKP7eBPsU+ALO1p5Yuotb9lfzyyNLMZCYhHXEYHd4 yIRKYTj6CqiBv8j6y+4y2IcWiN3yBkmS/rrTNdHASWHPw8lX82lC7/KhtD/tRjjp4gXPKQ 78ubRUNlWnzjE/o14SYBmQ03EjPVMmPap4eKRinyQAUX/BxhzChPGTHxx3uTWA51HQNXsa k0GYUA9XFtPB6Nub796AaPcSYUcdg6wLo+yS2MY7RFgaFjI64wItmi/n4AUnjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4CRt5xPnzc9t; Fri, 28 Feb 2025 15:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SFrkiF099047; Fri, 28 Feb 2025 15:53:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SFrkfQ099044; Fri, 28 Feb 2025 15:53:46 GMT (envelope-from git) Date: Fri, 28 Feb 2025 15:53:46 GMT Message-Id: <202502281553.51SFrkfQ099044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 628715fdcc9f - main - ntp: NULL pointer deref when create_interface() fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 628715fdcc9f2226bfe0f4ebe381aaa7761cb6cc Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=628715fdcc9f2226bfe0f4ebe381aaa7761cb6cc commit 628715fdcc9f2226bfe0f4ebe381aaa7761cb6cc Author: Cy Schubert AuthorDate: 2025-02-28 15:46:23 +0000 Commit: Cy Schubert CommitDate: 2025-02-28 15:53:22 +0000 ntp: NULL pointer deref when create_interface() fails Fix NULL pointer dereference when create_interface() fails in update_interfaces(). The upstream bug report says a typo was introduced by https://bk.ntp.org/ntp-dev/ntpd/ntp_io.c?PAGE=diffs&REV=66175036PETA6g__fON8oNrjL54Ttw. ep should have been ep2. Fix obtained from upstream bug report. PR: 285065 Upstream bug: https://bugs.ntp.org/show_bug.cgi?id=3939 MFC after: 1 minute --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 6a796101b0e8..9c4f6c1553e3 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1919,7 +1919,7 @@ update_interfaces( } else { DPRINT_INTERFACE(3, - (ep, "updating ", " new - FAILED")); + (ep2, "updating ", " new - FAILED")); msyslog(LOG_ERR, "cannot bind address %s", From nobody Fri Feb 28 15:59:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4CZ25BSFz5m8fJ; Fri, 28 Feb 2025 15:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4CZ24Xxtz3vfq; Fri, 28 Feb 2025 15:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w253Sf7EY7l9d/1RYa1u1uzptYJfTy68skQBQP+F+hY=; b=rOi1NVA45nEMC9QSxrjWEMRbouBh88NGF1FaTrAlzpjzNUSprhF5gLOhnAP5mW2dAUgO03 wEwFRxkF+w4LhNrRY7D6MAqIJJSMIWoh4eu8bK9/zW4M8RDsfhLxjCJxeWTPap9ZXHDis6 QJH8wKV2iUHVr2PY+K20fQ/8EiuniHytRMxLAGnsUDDnABwHe1nFu/PJGtIjTMUal2W1ja wf+yfhddOQ61yHldUNX58tOgRGmfEbnaw/0w7VwGFgoCWLxa+8Oy33MO3Uy7Pt1J2fq07g k3pAQWC6jEfBG2/YYn/jGK32filOsl8z/1oKNOcqdx+pzo+aVgea5OQrxx2A0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740758346; a=rsa-sha256; cv=none; b=mUzY2IQlCklaOE1VbvkzdMGZCZ5f6uGdk+yPkoJqsxAvwVWeLbY++XWVaoTbD+TQ9v4PpP lq54PzU1yXyBWb4n5OkjCGIt2fJLKjKxC789qQMIYJQWPOackViBXbE+S72eoxouUq28UH W5Hw4t7Da0s9LChK/jUIg1jj56mIX2zzPtgY0MCALSSfZqOoGRuzPGj25AHZjHvhkcB4aX 6iG2D96gkN/X9RQoLuX2NIvbnlsc0IiozqCEQAvNI6DkuPMrDtdr0Bjat21oi00LNp0xc8 5rL4/uSCg/J7c7oEJj5hBnboZu94n/RNffVtWmNKgV+9sQJwdVX9vtWXyH2USA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w253Sf7EY7l9d/1RYa1u1uzptYJfTy68skQBQP+F+hY=; b=HZJ/ylRdDDP7ZKCIGi9MC25BeR/ZjtfCN7KSO4fAJwDC3Ega7Ze1U0vwE0UAOVPMYAoTHm 9d8lpBthSnZXsEzfKROEehHQG3Yzua6UAgqn2OcuH8Ew+SdM1Id5FYSVNzl2Sq8/ARn/ur zpGXpEggCEK1Qx15ddgOhA+Hx8ZTi8J9ZY28744a57bqeblIIsBJDe9yA3WLtxoCEjVtqj wkAacHTbnPi4rgdfOFHUvzuN3f4mExKZxDwBBOdjjNnXs/O+BVeUPECtpq+JQYV1pID0Ji 45dETjWF0W3KEwSY9RSal+aaSYQWGxk49N5RSfiJJD+3nDUadFZI7oOmuyoB9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4CZ2450Xzc7X; Fri, 28 Feb 2025 15:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SFx60q000889; Fri, 28 Feb 2025 15:59:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SFx6vd000886; Fri, 28 Feb 2025 15:59:06 GMT (envelope-from git) Date: Fri, 28 Feb 2025 15:59:06 GMT Message-Id: <202502281559.51SFx6vd000886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 859aa726fb86 - stable/14 - ntp: NULL pointer deref when create_interface() fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 859aa726fb8642d8f329c7a34c51356c4eaeae88 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=859aa726fb8642d8f329c7a34c51356c4eaeae88 commit 859aa726fb8642d8f329c7a34c51356c4eaeae88 Author: Cy Schubert AuthorDate: 2025-02-28 15:46:23 +0000 Commit: Cy Schubert CommitDate: 2025-02-28 15:59:00 +0000 ntp: NULL pointer deref when create_interface() fails Fix NULL pointer dereference when create_interface() fails in update_interfaces(). The upstream bug report says a typo was introduced by https://bk.ntp.org/ntp-dev/ntpd/ntp_io.c?PAGE=diffs&REV=66175036PETA6g__fON8oNrjL54Ttw. ep should have been ep2. Fix obtained from upstream bug report. PR: 285065 Upstream bug: https://bugs.ntp.org/show_bug.cgi?id=3939 (cherry picked from commit 628715fdcc9f2226bfe0f4ebe381aaa7761cb6cc) --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9d79fe493d9b..12a61ccb1d2c 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1921,7 +1921,7 @@ update_interfaces( } else { DPRINT_INTERFACE(3, - (ep, "updating ", " new - FAILED")); + (ep2, "updating ", " new - FAILED")); msyslog(LOG_ERR, "cannot bind address %s", From nobody Fri Feb 28 15:59:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4CZC6Fjpz5m8W1; Fri, 28 Feb 2025 15:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4CZC49f5z3w70; Fri, 28 Feb 2025 15:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MbhqWNKMSunNlAi+3ko0KeI4mNHw6fsxPsEVFLplDA8=; b=VXklQJVfTWfWEyLIF45kE3y2feZViDOzaWaJrqQDQlVprqfC370vv4vQYTDgp2w7BLOhwi RXIdwdect7hsmWVrltzbzwETnuxb8Z0yM9BLmtEuy4FF0yGuwJbMaV6l6YEG4jDGYJ3qMy SCNF/lug+ODZe8zwNCda9P5nOswzHkL7ZMxNGM946GO/4nxV4hjwaQWroHpGrMsT3eWniN EwcUVuLh7ofXWdmn01D4fNcp5X1oeb8iAG5sP18rq9BpcZgxCVYnN/e+mcmHb07Dl99cMs I752FZeWMfuD56CYZ66oyBnmrefFt0aYQJ5WviyJszOepQYBrBrQJEB+Xunt/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740758355; a=rsa-sha256; cv=none; b=jPhtqqIp/lBmIuZu2jmwpvuYK0YmeAxz/L66u+oQsO7IIwAEOJsXM0/Zvid+mpRnWIonUC s/rMJVvkafG6soVzHo5KCNxG38XouTSeEkq89rrJKVELFHuzcHzkzhuIfPDoieU/sMJqXM gmFwgxsNbzr2bxQznxp6juru3CEdxbVyugq4FxFt9zhl5wO44ZQSczGB6rMOV2oEMWO80a nYGWKcUEo6SLlJ4k7q6JTW1FHa2qHzB6Q6eaijvLzgNKb/8J/nouj//F4eft7J85m3Nrh4 clVOPgSN4bFVt2ut7dBfyCRFbr2V8XTRGqm6ADIKVxGkRhulV7pUHZgI5xB9Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MbhqWNKMSunNlAi+3ko0KeI4mNHw6fsxPsEVFLplDA8=; b=tkJNVwfBN9guNJJ8eikGwqa1LTKSKWIFxfBGolcfszExQ7YfHwdd5+XlMwrmjWeZL/E1tr G/YD//bF6Nc+KvUNNEAeq/KZVlQ8WteVyUqPfHbA+GkPIi6icT3SgBVc2HYdk1zHZlvlwD wcJw+9MKo55D9JQhtuD0ackRNx/Q7Rj1eyERadvF1Ivso/XaWgFdITEM5d38R4XhAH482P ugYPC4ihSAlE6JFpimeE5MSAa98/CRaQEkI/m6P/f4LHGsZjDxda1LcbY7gBjQLq0mubQ3 KTGDfNUGKMuowEXgZl0S+C5xhFohuXo+D1K5NGFdepynSMsqL58k8aQEnyne8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4CZC3Xpnzc5L; Fri, 28 Feb 2025 15:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SFxFNi001041; Fri, 28 Feb 2025 15:59:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SFxFrJ001038; Fri, 28 Feb 2025 15:59:15 GMT (envelope-from git) Date: Fri, 28 Feb 2025 15:59:15 GMT Message-Id: <202502281559.51SFxFrJ001038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: a3d32f9e6033 - stable/13 - ntp: NULL pointer deref when create_interface() fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3d32f9e6033a9083a22b7c9f25633430372e5b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a3d32f9e6033a9083a22b7c9f25633430372e5b4 commit a3d32f9e6033a9083a22b7c9f25633430372e5b4 Author: Cy Schubert AuthorDate: 2025-02-28 15:46:23 +0000 Commit: Cy Schubert CommitDate: 2025-02-28 15:58:54 +0000 ntp: NULL pointer deref when create_interface() fails Fix NULL pointer dereference when create_interface() fails in update_interfaces(). The upstream bug report says a typo was introduced by https://bk.ntp.org/ntp-dev/ntpd/ntp_io.c?PAGE=diffs&REV=66175036PETA6g__fON8oNrjL54Ttw. ep should have been ep2. Fix obtained from upstream bug report. PR: 285065 Upstream bug: https://bugs.ntp.org/show_bug.cgi?id=3939 (cherry picked from commit 628715fdcc9f2226bfe0f4ebe381aaa7761cb6cc) --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9d79fe493d9b..12a61ccb1d2c 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1921,7 +1921,7 @@ update_interfaces( } else { DPRINT_INTERFACE(3, - (ep, "updating ", " new - FAILED")); + (ep2, "updating ", " new - FAILED")); msyslog(LOG_ERR, "cannot bind address %s", From nobody Fri Feb 28 18:20:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Ghd4nvdz5nrym; Fri, 28 Feb 2025 18:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Ghd2k1mz3Smh; Fri, 28 Feb 2025 18:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740766801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J/5ntODLef3HNy+uSFM9Ybso/KV1pUsNeUIuY3gcQlg=; b=yTlKYmG/14MBy01rxcnS+6z+mYyo+UgAp0lhTp5czV0qSbTOzZ8cRx8bofTaZDDrGf2IiD lhuhYnGCgrGk1Z4S2QlFufQOrKoWH/mEdUgSk465nHKskXej103Vcva7+OTogH8r6BswI4 g5F7tlYZYLVARhp93pRmx85IMV12BqbyFRHSLale8Ku0j1eZZJ9iOJ7iIDsYV/FHXZwelW vg1MhcXofUfjxyZAQXjLClYBInc4qm3sq6RgzZYArV8SIybbfbljeICw6ynWlbeCN9EMc5 JD0NtTUWusFHDX3SU9ocMixd4h5w9gVs4ZECZ+iDoDZebaDR1xnJyIhBoiVHdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740766801; a=rsa-sha256; cv=none; b=KU2xegAQycqIvkL2NOH+wYr0d3lSHWeosQd5lIrrsSR37pPo2ykREgiZ4GrRIxYjOQw3Cs 72FYnWJTUUdC4fyt50XQvPgjkBrI0yY0UrnS2A0mUIm7toRejXYw1tvWRAdNCHttyIZ2tU Di3WnKm8NOXgSztGOqJIqC9gtHxofjpeha4Lou+qmN3ZHrhLVY5G2rczj4QA/8DrD2wf0c skduyerOR2a3kpQ+F1dCN9kqWth1lIA5O7MAAF3cleZWhMWQHhQCBOqSIkhYmX7GLalh2z 3YYGDvqIGn0M5svJ3T+pT9MfdVGk77vmUWv/DRvS5Qe/T67O05cBh9mP5vhHCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740766801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J/5ntODLef3HNy+uSFM9Ybso/KV1pUsNeUIuY3gcQlg=; b=YKUHOazuDOTeID1VXX1ANucgV93POlj93hvzLOLxKrBeSWhOM7fhmJSLFW87bHulqP2RQT pu2tWztYqVv+5omXUwke4Cs4q7pLJ/5EGg7EewyDFsUexNEU5uDVk73tZ2YNdvlO5l/Q+6 QhAvTbQivlYNJR6ft5w/gbqCGlfzKcnKa5jvDOaMT4k9D4p8b+vsRnc4wLj1vadsY1zwNx GQwErTnEBi9xZW9dfnhpNIOfrKPf89YlMOjQSJHEDW5sunzTp7hZIbezgkwCFfGjcMmwzA C5kFnydBGQLPzsMdRx8EDhZwYWVi95jODlOEWJ2WynblH0Eks/79FijyNjLnMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Ghd22CxzgpF; Fri, 28 Feb 2025 18:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SIK1M5065014; Fri, 28 Feb 2025 18:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SIK1oX065009; Fri, 28 Feb 2025 18:20:01 GMT (envelope-from git) Date: Fri, 28 Feb 2025 18:20:01 GMT Message-Id: <202502281820.51SIK1oX065009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 586bdc6f7555 - stable/14 - bsd.mkopt.mk: Avoid warning from makeman List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 586bdc6f755514519f0d2da1ac8e4c7b8077999c Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=586bdc6f755514519f0d2da1ac8e4c7b8077999c commit 586bdc6f755514519f0d2da1ac8e4c7b8077999c Author: Ed Maste AuthorDate: 2025-02-24 14:51:31 +0000 Commit: Ed Maste CommitDate: 2025-02-28 18:19:50 +0000 bsd.mkopt.mk: Avoid warning from makeman Setting WITHOUT_X where X is a __REQUIRED_OPTION produces a warning. This occurred during makeman's `make showconfig` invocatation, but the warning serves no purpose there, and clutters makeman's output. Skip the warning for the showconfig target used by makeman. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49123 (cherry picked from commit 085c0641a2ea0dee2c58b5bc6e62790a164ebd52) --- share/mk/bsd.mkopt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk index 7d43e91b042d..6ddb7af5fc0d 100644 --- a/share/mk/bsd.mkopt.mk +++ b/share/mk/bsd.mkopt.mk @@ -58,7 +58,7 @@ MK_${var}:= yes # step towards removing the options entirely. # .for var in ${__REQUIRED_OPTIONS} -.if defined(WITHOUT_${var}) +.if defined(WITHOUT_${var}) && !make(showconfig) .warning WITHOUT_${var} option ignored: it is no longer supported .endif MK_${var}:= yes From nobody Fri Feb 28 20:35:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Khh6zVsz5p54P; Fri, 28 Feb 2025 20:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Khh60sDz3hj0; Fri, 28 Feb 2025 20:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740774916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51yy4IgW+H6VI6hr+/2fXQHBcz+lW3NRmMXQ+POQZGQ=; b=PUofQ9sUiLwVK/hNaNFsT+394P8SpCIHPbUa5LYKsXOIjhPH1opXfOT4dd/Z6o2OPv2xkJ Gx1B2NQAN47XrcUnV4qpu79ax0izG77MIpBdpCM+avpGw7qB5m4eHunqu2++mM+WILY5Ig P6eHEDIJOYtOdo/qDAHRfwI/hPgZysOOiYXaXYI+kFsRMvfOD+0d/Ld6obYfbW31Vwu6BO Z/fWNs/6qzF1gu8zf5+C3mg2uQ3OIdWWRBpQa6mRzeTcDPNbTS/SnqpX+C8LLUKJ/naWtK VrnnRxclxZ8rYKsWV+crDtfpS/80ETelakri7FpIEsWLn0Thk4/6gMhiO22FjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740774916; a=rsa-sha256; cv=none; b=CnvpB9cblBrD3i8d8xuI9zol/jRr87SgVpTo+E/wbf0qm3+XL6is69nuMxl8a72pLalKsG DKB4uU5sIcNs1eqnqdAWtvvZAYgO4Oxyn6EhKnAR0hCjw+eZwFWzh6dS8AvjBDD5v8Fb0b JwtH+ujkouE6GqDRPIoaOAkrMVVytQDlFFahdIHrOq6b5Zc3lpE4GeqGic3mpGLAtr03gV 4Q6D9xlDyIUs4NKlzOXdG0vr4Qa4ulVwCuRmPGD3O+z3eDsYfYylK8Lk7xQCX4cvfjtATU K1TrcTyK+EqJfXrcFM2ZQtuB77FXvKAsLJ2zBToz14kFLJ1CEyRQIBX+vyXZsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740774916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51yy4IgW+H6VI6hr+/2fXQHBcz+lW3NRmMXQ+POQZGQ=; b=yzMgUqexRbdPYdR+H2P8ndjpZu2O1h13rTFIRc/Qha5d3i6ALmg0aLqTL4Xxdhx/sgkxuj nMYHNGFnizstxse5OYwYW8Qi06gwmIUy/TD4s93zODimnclkzIho2i/vx3y9q7WqtgFg6g mgj19swy9B0GMboTlSe7lSUwyjI+mpoKlSljRjkLsk6DzU+6mOh6OQVO7sQYKl+44ZEI3+ 9wTs9YUtT3mfObtN1b4G3cv7smk4RdWvXyPjrftHZ03c5jb83UUDyp85B3mkGXj6eiw7sK lazH0P7eXatRc+CFuhkZRUfN37F8rU+ZFiPTpkJ/QQTmlY/xxXeF2CU+x5AQ6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Khh5YwdzlLS; Fri, 28 Feb 2025 20:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SKZG0H024094; Fri, 28 Feb 2025 20:35:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SKZGSp024091; Fri, 28 Feb 2025 20:35:16 GMT (envelope-from git) Date: Fri, 28 Feb 2025 20:35:16 GMT Message-Id: <202502282035.51SKZGSp024091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 518cdd344ec5 - main - makefs: Make cd9660 Rock Ridge inodes reproducible List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 518cdd344ec51584478f39b9a9cac77fc0766ce1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=518cdd344ec51584478f39b9a9cac77fc0766ce1 commit 518cdd344ec51584478f39b9a9cac77fc0766ce1 Author: Ed Maste AuthorDate: 2025-02-26 16:44:12 +0000 Commit: Ed Maste CommitDate: 2025-02-28 20:34:52 +0000 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 --- usr.sbin/makefs/cd9660.h | 12 +++++++ usr.sbin/makefs/cd9660/iso9660_rrip.c | 67 ++++++++++++++++++++++++++++++----- usr.sbin/makefs/cd9660/iso9660_rrip.h | 2 +- 3 files changed, 71 insertions(+), 10 deletions(-) diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index b2db31460d02..c6f0e6472af3 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,6 +256,9 @@ 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 chrp_boot; /* Spec breaking options */ @@ -275,6 +285,8 @@ typedef struct _iso9660_disk { } iso9660_disk; +RB_PROTOTYPE(inode_map_tree, inode_map_node, entry, inode_map_node_cmp); + /************ FUNCTIONS **************/ int cd9660_valid_a_chars(const char *); int cd9660_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..e037f1db175f 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,9 @@ cd9660_susp_initialize(iso9660_disk *diskStructure, cd9660node *node, if (node->dot_dot_record != 0) TAILQ_INIT(&(node->dot_dot_record->head)); + 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 +104,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 +121,12 @@ cd9660_susp_finalize(iso9660_disk *diskStructure, cd9660node *node) if ((r = cd9660_susp_finalize(diskStructure, temp)) < 0) return r; } + RB_FOREACH_SAFE(mapnode, inode_map_tree, + &(diskStructure->rr_inode_map), mapnodetmp) { + RB_REMOVE(inode_map_tree, &(diskStructure->rr_inode_map), + mapnode); + free(mapnode); + } return 1; } @@ -323,7 +333,7 @@ cd9660_susp_initialize_node(iso9660_disk *diskStructure, cd9660node *node) } static void -cd9660_rrip_initialize_inode(cd9660node *node) +cd9660_rrip_initialize_inode(iso9660_disk *diskStructure, cd9660node *node) { struct ISO_SUSP_ATTRIBUTES *attr; @@ -337,7 +347,7 @@ cd9660_rrip_initialize_inode(cd9660node *node) /* PX - POSIX attributes */ attr = cd9660node_susp_create_node(SUSP_TYPE_RRIP, SUSP_ENTRY_RRIP_PX, "PX", SUSP_LOC_ENTRY); - cd9660node_rrip_px(attr, node->node); + cd9660node_rrip_px(diskStructure, attr, node->node); TAILQ_INSERT_TAIL(&node->head, attr, rr_ll); @@ -390,7 +400,8 @@ cd9660_rrip_initialize_node(iso9660_disk *diskStructure, cd9660node *node, /* PX - POSIX attributes */ current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, SUSP_ENTRY_RRIP_PX, "PX", SUSP_LOC_ENTRY); - cd9660node_rrip_px(current, parent->node); + cd9660node_rrip_px(diskStructure, current, + parent->node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); /* TF - timestamp */ @@ -405,7 +416,8 @@ cd9660_rrip_initialize_node(iso9660_disk *diskStructure, cd9660node *node, /* PX - POSIX attributes */ current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, SUSP_ENTRY_RRIP_PX, "PX", SUSP_LOC_ENTRY); - cd9660node_rrip_px(current, grandparent->node); + cd9660node_rrip_px(diskStructure, current, + grandparent->node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); /* TF - timestamp */ @@ -422,7 +434,7 @@ cd9660_rrip_initialize_node(iso9660_disk *diskStructure, cd9660node *node, TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } } else { - cd9660_rrip_initialize_inode(node); + cd9660_rrip_initialize_inode(diskStructure, node); if (node == diskStructure->rr_moved_dir) { cd9660_rrip_add_NM(node, RRIP_DEFAULT_MOVE_DIR_NAME); @@ -630,8 +642,45 @@ cd9660_createSL(cd9660node *node) } } +static int +inode_map_node_cmp(struct inode_map_node *a, struct inode_map_node *b) +{ + if (a->key < b->key) + return (-1); + if (a->key > b->key) + return (1); + return (0); +} + +RB_GENERATE(inode_map_tree, inode_map_node, entry, inode_map_node_cmp); + +static uint64_t +inode_map(iso9660_disk *diskStructure, uint64_t in) +{ + struct inode_map_node lookup = { .key = in }; + struct inode_map_node *node; + + /* + * Always assign an inode number if src inode unset. mtree mode leaves + * src inode unset for files with st_nlink == 1. + */ + if (in != 0) { + node = RB_FIND(inode_map_tree, &(diskStructure->rr_inode_map), + &lookup); + if (node != 0) + return (node->value); + } + + node = emalloc(sizeof(struct inode_map_node)); + node->key = in; + node->value = diskStructure->rr_inode_next++; + RB_INSERT(inode_map_tree, &(diskStructure->rr_inode_map), node); + return (node->value); +} + int -cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *v, fsnode *pxinfo) +cd9660node_rrip_px(iso9660_disk *diskStructure, struct ISO_SUSP_ATTRIBUTES *v, + fsnode *pxinfo) { v->attr.rr_entry.PX.h.length[0] = 44; v->attr.rr_entry.PX.h.version[0] = 1; @@ -643,8 +692,8 @@ cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *v, fsnode *pxinfo) v->attr.rr_entry.PX.uid); cd9660_bothendian_dword(pxinfo->inode->st.st_gid, v->attr.rr_entry.PX.gid); - cd9660_bothendian_dword(pxinfo->inode->st.st_ino, - v->attr.rr_entry.PX.serial); + cd9660_bothendian_dword(inode_map(diskStructure, + pxinfo->inode->st.st_ino), v->attr.rr_entry.PX.serial); return 1; } diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.h b/usr.sbin/makefs/cd9660/iso9660_rrip.h index 5e1e8b5130f0..4c738d27ba45 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.h +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.h @@ -224,7 +224,7 @@ int cd9660_susp_finalize_node(iso9660_disk *, cd9660node *); int cd9660_rrip_finalize_node(cd9660node *); /* POSIX File attribute */ -int cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *, fsnode *); +int cd9660node_rrip_px(iso9660_disk *, struct ISO_SUSP_ATTRIBUTES *, fsnode *); /* Device number */ int cd9660node_rrip_pn(struct ISO_SUSP_ATTRIBUTES *, fsnode *); From nobody Fri Feb 28 20:55:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4L7m32Vrz5p6K6; Fri, 28 Feb 2025 20:55:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4L7m2LRcz3kjq; Fri, 28 Feb 2025 20:55:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740776116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jT20TBx7XZOb+11N8AXIKOTqGIcHkNfZ+YMpspta+Pc=; b=OlTZSKopedAbVoonh8GUyxrHKPfP14lu6NnJrLlQDmOZp8kTtdjShTJovDzwTu40li0HrZ G28bAX2jiMbe7Zqp8Bj/nLReV3NQPh8qWEZz8wTikZh0n5cK/pQhx8zVoj0RuunT+njLSo 07j5IdbMSdATGGTFCEqx5bd7fMkiZVErSTV9A76htfpft+/32ANDbVCPcIZ1Kyc9MczSsX XGkErR/aY/0Rx9EMEznC87zIDKB4jlhSBmFV9zXGiKnLE3HSgf4eY0YHdptbTS1NU8N3NT MFpI6V2VHuVP8fmvbdU14k9CVe9RFv3YaWXQbLOXtLR2Egd/6aAzyvHdKhLBFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740776116; a=rsa-sha256; cv=none; b=WumGLJefqaC5Z5la3r44oxM2AiqpEut2zFt56RmU7S3m765KkFbPG+pp/eBQsOMifn8P7e gQVSdN/Dh5Z/EeRbWQITAwf9b9Ugnvzs0nKdAfPRQx/Z9zABcF0rVw0738V9Y6siLWUAyk 0UGpw236348amxW4Oo9FQ6Fo9W9rYLHsv9pEj5L1xHlh6PX/Sbnw5tKARYHu2QHxc6vzHQ wTWhUyBeu+Vx98O2xlouK7CMTyObHdlxuD22CIpT9cV/CPtYg1XJg9F6IzwiQEYVYwH6nx reI2mxfYbHHxKx/bGuoIlXrkid2os7oA5GhkFDhO2wat6oE3XdLYpv8Xo1x3vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740776116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jT20TBx7XZOb+11N8AXIKOTqGIcHkNfZ+YMpspta+Pc=; b=mU5WV6pJDe7XfmW39HQruaMpYxhDIOoKDpH3tShXBF+f2xlhawuYJrqWVPaSmPRO9ayl0S ehgzkhZZ0ijJINnemsgCdvvtNbXqV50X08wvtKVYCaiXrriHfCzd8T93wkQkoQka+FXzBa H8KMAVbrBxXwlWcIXRxbQsMWpI1tdG2bHi0rH5/E7dko1Bg80whvtzdfeXGVyCW5ywqWuk zBv2Op4nUBEH7HRsamjSJQEI6OOutAIYeqEL0Rls2y8x9ohZsFOtoj0Vj/1/bDOwVRKbag pWC7QAIBdp5Y8KRBy/5FhwpAhiv7v/ifmKCghdkBxcE1rajsurqpkHuXpkXOZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4L7m1HQRzlC2; Fri, 28 Feb 2025 20:55:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SKtGfX061191; Fri, 28 Feb 2025 20:55:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SKtGiE061188; Fri, 28 Feb 2025 20:55:16 GMT (envelope-from git) Date: Fri, 28 Feb 2025 20:55:16 GMT Message-Id: <202502282055.51SKtGiE061188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: 67787d200488 - main - tcp: make inflight data (pipe) calculation consistent List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67787d200488f0d838b20b0f483d1ca08ff6c014 Auto-Submitted: auto-generated The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=67787d200488f0d838b20b0f483d1ca08ff6c014 commit 67787d200488f0d838b20b0f483d1ca08ff6c014 Author: Cheng Cui AuthorDate: 2025-02-21 20:53:06 +0000 Commit: Cheng Cui CommitDate: 2025-02-28 20:53:12 +0000 tcp: make inflight data (pipe) calculation consistent Reviewed by: glebius, rrs, tuexen Differential Revision: https://reviews.freebsd.org/D49047 --- sys/netinet/cc/cc.c | 8 +------- sys/netinet/cc/cc_cubic.c | 8 +------- sys/netinet/cc/cc_dctcp.c | 8 +------- sys/netinet/cc/cc_htcp.c | 8 +------- sys/netinet/cc/cc_newreno.c | 8 +------- sys/netinet/tcp_input.c | 26 +++++++++++--------------- 6 files changed, 16 insertions(+), 50 deletions(-) diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index eae5b7bca4d9..a34eefcf0066 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -500,13 +500,7 @@ newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) break; case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { - if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->tp); - } else { - pipe = CCV(ccv, snd_max) - - CCV(ccv, snd_fack) + - CCV(ccv, sackhint.sack_bytes_rexmit); - } + pipe = tcp_compute_pipe(ccv->tp); CCV(ccv, snd_ssthresh) = max(2, min(CCV(ccv, snd_wnd), pipe) / 2 / mss) * mss; } diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index 91d6642eb08d..82b0d9b7fa99 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -470,13 +470,7 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) cubic_data->undo_cwnd_epoch = cubic_data->cwnd_epoch; cubic_data->undo_W_max = cubic_data->W_max; cubic_data->undo_K = cubic_data->K; - if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->tp); - } else { - pipe = CCV(ccv, snd_max) - - CCV(ccv, snd_fack) + - CCV(ccv, sackhint.sack_bytes_rexmit); - } + pipe = tcp_compute_pipe(ccv->tp); CCV(ccv, snd_ssthresh) = max(2, (((uint64_t)min(CCV(ccv, snd_wnd), pipe) * CUBIC_BETA) >> CUBIC_SHIFT) / mss) * mss; diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c index f43efe0e27c7..757bc005edb4 100644 --- a/sys/netinet/cc/cc_dctcp.c +++ b/sys/netinet/cc/cc_dctcp.c @@ -294,13 +294,7 @@ dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type) break; case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { - if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->tp); - } else { - pipe = CCV(ccv, snd_max) - - CCV(ccv, snd_fack) + - CCV(ccv, sackhint.sack_bytes_rexmit); - } + pipe = tcp_compute_pipe(ccv->tp); CCV(ccv, snd_ssthresh) = max(2, min(CCV(ccv, snd_wnd), pipe) / 2 / mss) * mss; } diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c index 13441bb49190..ab6165f2e720 100644 --- a/sys/netinet/cc/cc_htcp.c +++ b/sys/netinet/cc/cc_htcp.c @@ -325,13 +325,7 @@ htcp_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { - if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->tp); - } else { - pipe = CCV(ccv, snd_max) - - CCV(ccv, snd_fack) + - CCV(ccv, sackhint.sack_bytes_rexmit); - } + pipe = tcp_compute_pipe(ccv->tp); CCV(ccv, snd_ssthresh) = max(2, min(CCV(ccv, snd_wnd), pipe) / 2 / mss) * mss; } diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index d7172fa78bc4..de7b878152b0 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -428,13 +428,7 @@ newreno_cong_signal(struct cc_var *ccv, ccsignal_t type) break; case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { - if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->tp); - } else { - pipe = CCV(ccv, snd_max) - - CCV(ccv, snd_fack) + - CCV(ccv, sackhint.sack_bytes_rexmit); - } + pipe = tcp_compute_pipe(ccv->tp); CCV(ccv, snd_ssthresh) = max(2, ((uint64_t)min(CCV(ccv, snd_wnd), pipe) * (uint64_t)factor) / diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index e21043fac0cf..cf480ccf9772 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2660,12 +2660,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, * we have less than ssthresh * worth of data in flight. */ - if (V_tcp_do_newsack) { - awnd = tcp_compute_pipe(tp); - } else { - awnd = (tp->snd_nxt - tp->snd_fack) + - tp->sackhint.sack_bytes_rexmit; - } + awnd = tcp_compute_pipe(tp); if (awnd < tp->snd_ssthresh) { tp->snd_cwnd += imax(maxseg, imin(2 * maxseg, @@ -4098,11 +4093,7 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, (IN_CONGRECOVERY(tp->t_flags) && !IN_FASTRECOVERY(tp->t_flags))) { del_data = tp->sackhint.delivered_data; - if (V_tcp_do_newsack) - pipe = tcp_compute_pipe(tp); - else - pipe = (tp->snd_nxt - tp->snd_fack) + - tp->sackhint.sack_bytes_rexmit; + pipe = tcp_compute_pipe(tp); } else { if (tp->sackhint.prr_delivered < (tcprexmtthresh * maxseg + tp->snd_recover - tp->snd_una)) { @@ -4206,14 +4197,19 @@ tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th) int tcp_compute_pipe(struct tcpcb *tp) { - if (tp->t_fb->tfb_compute_pipe == NULL) { - return (tp->snd_max - tp->snd_una + + int pipe; + + if (tp->t_fb->tfb_compute_pipe != NULL) { + pipe = (*tp->t_fb->tfb_compute_pipe)(tp); + } else if (V_tcp_do_newsack) { + pipe = tp->snd_max - tp->snd_una + tp->sackhint.sack_bytes_rexmit - tp->sackhint.sacked_bytes - - tp->sackhint.lost_bytes); + tp->sackhint.lost_bytes; } else { - return((*tp->t_fb->tfb_compute_pipe)(tp)); + pipe = tp->snd_nxt - tp->snd_fack + tp->sackhint.sack_bytes_rexmit; } + return (imax(pipe, 0)); } uint32_t From nobody Fri Feb 28 21:18:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Lf51VC3z5p7lk; Fri, 28 Feb 2025 21:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Lf50jtVz3lwm; Fri, 28 Feb 2025 21:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740777485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxbNeZgT9e7wM0PR7s5Mvqf9VrZdmMFn5IofbMz5Mdk=; b=rzTFuJvxk10toX3eqkTKCGBmUaiVFXQr3UQo+F5rW3UILHJPRovC+zUtNbsgW31cnis3HI vMULyyHLpmLex4O2QXLJ90KOOoXtKatXNUNE4NA9ainmKUoUpqjvLod78QYoQUcOCTrx79 AuWSRuqClGEcznhGIjezphV7mjK6RHsD5uX0gJh0jDSB76WXyitDgew4GRln3cvaWaWQVz uuqWF4XUGlxmV5RhchHzZydntB5QybEl9y5P1684XJBLl3t77mXys4B1/2wo4pFM5kshKh OaoW34IDx9hxJafy5Zs+7kRNYcJpdUqHOWRe98k/DjAg1vrFNrQ60qlyRwOKaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740777485; a=rsa-sha256; cv=none; b=Ko1W+tzNWB9qj9X3Wx3ENwATxpgrYLJRO/FVdSNTBKzHKIolskhteLPugSgKG08XNxojeM 2OVHjBYpQ+ntE6tb5vOiHqOPU2cQiQku57tSfFck8R2DHqgH7ZEprD/61Hmu3NsApANJK8 IJ6hHPnLyECoCwwV4iRw/UKx0+R+ps1ddA6kefkdy+3u8m0FpVveYzPMjZVntxw/lEefBY tE4QubMJbyqsJ/348OYx5BuTKIybC8A88boumDr75cEuS6EqYpxQg209BagikWcVjyWS0i 4lhDyl2FQ2UAZCKDhuHjcKCyDM7CueK55RBzVO+IsD27hVI4hu40dmhFpqByBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740777485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxbNeZgT9e7wM0PR7s5Mvqf9VrZdmMFn5IofbMz5Mdk=; b=Snj4J7MxJrsPvZ2IShn8afPZ83oHQmh77qeK1zwyFXBjrmLnnAiYjoGdPlKwb4etmGa69f pC6XsZiQq45UIglOarIdbTk2gQrI/SwHa30AOw/z4nbSIXe81R9D3iTiQMwNX50hLh7GwP IhxxrN4Ya3jpAcsEwTWm2Q1pfxid2Ly1snqaGCQupp0Jj5cjzWYh9dH4+btjoq8Y5+VhFo Qm19GVfU+v0JjuMjqs9YTDxvKfBxiCUid5RoiAQ+d9Ua9Ux/0PuFFz7XrGlBFXL4Yx3M7H BchcKBjs4XRH2YJ2TV3cav9gemano0f19DSbGwAFfUwkiJa7UoB7Dkhl52Xc3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Lf50Hbqzm78; Fri, 28 Feb 2025 21:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SLI4cP099992; Fri, 28 Feb 2025 21:18:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SLI4dI099989; Fri, 28 Feb 2025 21:18:04 GMT (envelope-from git) Date: Fri, 28 Feb 2025 21:18:04 GMT Message-Id: <202502282118.51SLI4dI099989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 337f5e7a44c4 - main - makefs: Compare pointer against NULL, not 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 337f5e7a44c4d5ac29e0b0c0fe957bb3b9bae222 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=337f5e7a44c4d5ac29e0b0c0fe957bb3b9bae222 commit 337f5e7a44c4d5ac29e0b0c0fe957bb3b9bae222 Author: Ed Maste AuthorDate: 2025-02-28 21:16:29 +0000 Commit: Ed Maste CommitDate: 2025-02-28 21:17:34 +0000 makefs: Compare pointer against NULL, not 0 Reported by: rpokala Sponsred by: The FreeBSD Foundation Fixes: 35a2e286157a ("makefs: Record inode for all entries in mtree mode") --- usr.sbin/makefs/cd9660/iso9660_rrip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c index e037f1db175f..1b8ce42da4c0 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.c +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -667,7 +667,7 @@ inode_map(iso9660_disk *diskStructure, uint64_t in) if (in != 0) { node = RB_FIND(inode_map_tree, &(diskStructure->rr_inode_map), &lookup); - if (node != 0) + if (node != NULL) return (node->value); } From nobody Fri Feb 28 21:23:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Lly3BFTz5p8Zf; Fri, 28 Feb 2025 21:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Lly0M80z3nDl; Fri, 28 Feb 2025 21:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740777790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3kMmgIAPLwIEzVYUhJqy5P0KvQfZF9JUByVs7P7vTI=; b=IFG8drxoDiZ/k5qnMkGICOtmx9sLWS+yP47Vwn9e9Ico/9pkWE+qqxxqGd/igibGRWAcf9 OKYj3ra1Tl4JTleGCV3W/s6RFZZ+yzJwcMW3T9x4701T3yZbXpF4OVX7uBK5aNMmZchneO B1iF/GiYgMZvasOi5ERZyaAZ75RZR9gmzjM6bmIaDQrxgrWVkbnecEwmTb6jzAYqglR5ni C4bdefMiO+bzwapriqrV7vHIZmXGD9oxqGME8UA8FSkP3nPA08T5Z8wW6fPNqfw48kGNXt to55oWN1929hujXZgUmIDgs3I3DjhlpVOREEIavUEyZPEJ9T/aT0VMJG3J7zZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740777790; a=rsa-sha256; cv=none; b=jyx8v0lF2OdbLwDebRDl78S4zdOs0WqgNwYVKKPxdCgOvMrJ5RsBbMHRcO1XjY49ccyJcW xl2g1DrpOTMOOsU/LP8eg4bVWRpJxfQjHpE89exdp6mJJS89CPPqc1VY+gOXJC/xMJ8t+u gKyjwT0SvoJ2NnRMlim1fLuOJRQqGlmog8ebUQzC08sRnE3nui1Q3RJ8WWc065NTyKn9jD u+IEOVPVJjtYOSPY5MRcMfXfXJOAgLPpT2qAZ9jOeJLaeDyVN4fBStAgjw5ps1Xr1ARpzm JkmHaCHcRagWqt8H5Ao06vfziRL2HEKNEvhvWn9jenu2hbDq0dKGmQFTDAl78g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740777790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3kMmgIAPLwIEzVYUhJqy5P0KvQfZF9JUByVs7P7vTI=; b=TstJ1xIK52tVNG4zK7aQyXzENnZTdeeqY7EiKDz52acGn/DW1DkOQspuWrjCZ/5C8TNuAt JSXQT2hGohMaMGI223dUp7pMAzBBaJR8ozIW9e1ByhYMB6wnuIMeSn5MlL6Bi+W5j3O5Wk fVmvjLauyUbvuMqjsXxD73OLDUdel1VXuOO1bIsm13LtjV6HHC4K+CMsA46OrzUabXLs7F lCvgS+pwdc7In/Iqeu0omcweNq+G3ygGNrqqjoZKXJdO79VsEH8EMKkCEPTmYDULGblkqi zMt+UVPXXt57wzRLY9JXEdKrO2aa1l4IQoGIn02SXxoHTLw0DXrCo0n4gjFvBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Llx74VFzmQV; Fri, 28 Feb 2025 21:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SLN966016669; Fri, 28 Feb 2025 21:23:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SLN9M9016666; Fri, 28 Feb 2025 21:23:09 GMT (envelope-from git) Date: Fri, 28 Feb 2025 21:23:09 GMT Message-Id: <202502282123.51SLN9M9016666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9fed5151903f - stable/14 - nfscl: Add support for CB_RECALL_SLOT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9fed5151903fa609bf06f2b526a105fc21793651 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9fed5151903fa609bf06f2b526a105fc21793651 commit 9fed5151903fa609bf06f2b526a105fc21793651 Author: Rick Macklem AuthorDate: 2025-02-14 20:56:52 +0000 Commit: Rick Macklem CommitDate: 2025-02-28 21:22:03 +0000 nfscl: Add support for CB_RECALL_SLOT The callback CB_RECALL_SLOT is required for NFSv4.1/4.2. Fortunately, there does not appear to be any extant NFSv4.1/4.2 servers that use it. Since commit b97a478896e9 fixed handling of session slot shrinking, this patch adds support for CB_RECALL_SLOT, which shrinks the number of session slots as well. (cherry picked from commit 4517fbfd4251180147082f94253c4347fa44f570) --- sys/fs/nfs/nfs_commonkrpc.c | 4 ++-- sys/fs/nfs/nfs_var.h | 1 + sys/fs/nfsclient/nfs_clstate.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index e35172ee2b34..0ae3b94bef89 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -123,7 +123,6 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_da SYSCTL_INT(_vfs_nfs, OID_AUTO, dsretries, CTLFLAG_RW, &nfs_dsretries, 0, "Number of retries for a DS RPC before failure"); -static void nfs_resetslots(struct nfsclsession *); static void nfs_down(struct nfsmount *, struct thread *, const char *, int, int); static void nfs_up(struct nfsmount *, struct thread *, const char *, @@ -1474,12 +1473,13 @@ nfsmout: /* * Reset slots above nfsess_foreslots that are not busy. */ -static void +void nfs_resetslots(struct nfsclsession *sep) { int i; uint64_t bitval; + mtx_assert(&sep->nfsess_mtx, MA_OWNED); bitval = (1 << sep->nfsess_foreslots); for (i = sep->nfsess_foreslots; i < NFSV4_SLOTS; i++) { if ((sep->nfsess_slots & bitval) == 0 && diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index c726d956fee2..8b8b3f5ce961 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -780,6 +780,7 @@ int newnfs_request(struct nfsrv_descript *, struct nfsmount *, struct nfsclient *, struct nfssockreq *, vnode_t, NFSPROC_T *, struct ucred *, u_int32_t, u_int32_t, u_char *, int, u_int64_t *, struct nfsclsession *); +void nfs_resetslots(struct nfsclsession *); int newnfs_connect(struct nfsmount *, struct nfssockreq *, struct ucred *, NFSPROC_T *, int, bool, struct __rpc_client **); void newnfs_disconnect(struct nfsmount *, struct nfssockreq *); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index a666792c17f9..e803c2cfb973 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3938,6 +3938,24 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) *tl = txdr_unsigned(NFSV4_CBSLOTS - 1); } break; + case NFSV4OP_CBRECALLSLOT: + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + highslot = fxdr_unsigned(uint32_t, *tl); + NFSLOCKCLSTATE(); + clp = nfscl_getclntsess(sessionid); + if (clp == NULL) + error = NFSERR_SERVERFAULT; + if (error == 0) { + tsep = nfsmnt_mdssession(clp->nfsc_nmp); + mtx_lock(&tsep->nfsess_mtx); + if ((highslot + 1) < tsep->nfsess_foreslots) { + tsep->nfsess_foreslots = (highslot + 1); + nfs_resetslots(tsep); + } + mtx_unlock(&tsep->nfsess_mtx); + } + NFSUNLOCKCLSTATE(); + break; default: if (i == 0 && minorvers != NFSV4_MINORVERSION) error = NFSERR_OPNOTINSESS; From nobody Fri Feb 28 21:27:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Lrg4LRpz59JBM; Fri, 28 Feb 2025 21:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Lrg3YQKz3nTJ; Fri, 28 Feb 2025 21:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740778035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56D4b2vBzg1FwcwiS/iBWuVyr7Xgdj57dEszbuy/dhg=; b=UsrXPmKo2LNHQJJXMSyjhX17g848DDWmdvTVmZcCpv04StIQ2hSu2NQ+eT6uB8dsBHDr0V uUS7m834y4rsgOJt2epMBant/sKw935XMGkLwqHnkiw6y2B9h2Wjya42P6E235V86ereH9 j5pZZghps7mO3icxyCwxJNS+9j5W/qBWnFpJUCI6Zjr7yfjwL7rmbwXS7r/MpRT+jBSzSj xrynqOLRYFreWoNwwTKrzsnHQi5z8tiPpnMApleEm3fS33wLuGxmW2fvErOpbhvE2X/PjB v84XbCcyL0z9K5nUOreaeXSaHOd+0MDiRg5wD7LPlfPO1Jqduf+l43y5sgXuzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740778035; a=rsa-sha256; cv=none; b=AanZ8xQX5CLy0fQx+nBGDnP+j3eEjxiCIfiRKtl6LjwIGvSmTR8wTD92bz3sY6Ajmp0Gwy a4I8Y13miMikGxZ+3ZCXv1niS+TiE9IjzbxN9DBF95SUaWoy9ktRyEIbkr0/su2dUfVClR yXS6qR4GBI17uwnM8bp9yhWRy4ZIvlz6LVZ5T/ZBQekp1e4hjuQdhgvBHYrcSzxfnHhGW6 P1qJhd8gUgJ+ObY2NO+i/AxU1xBfunPMdU/uVWCiVQLo8lSOOVEz8Dw6XoegIvkrli22ql zuyoXnu6D5+8oqLG3sq/5aXuupNM90NW/Z7kNUAXSDqt36E0KKbE4KT/9Liz+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740778035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56D4b2vBzg1FwcwiS/iBWuVyr7Xgdj57dEszbuy/dhg=; b=si/eF/PPKFPEh7GRQU+k0PeyYP9vFeoQE30M8Ac1c2rZQjEMKcUlMsNXbBhwMIWavAFcLC RGAlwXgOtdLcXUCdDEEKTnFRGWzTRRvb0UC8M0Zq0a/dO7g8o0eoBbY27tteLkhJAJpTUi IFNQWyty+pThHAOjKEKawVRYTvv7yuBOXA23SHWparUPpOAvJplWiDDTFNXfKJt4Q4b2NI aG4MJ2k68qlInaVQoe/LECkSHRqoiX1RxDPxuSf/CHnjLp0EyTLUdifKHisAu/UMX5HW/t W6H6kah2MH86oJCLzNmBEuiK3PjRse7rVB7wJsI88LSKypSLPqOCD/3aSk6DMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Lrg2r2KzmdD; Fri, 28 Feb 2025 21:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SLRFu5017955; Fri, 28 Feb 2025 21:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SLRFBF017952; Fri, 28 Feb 2025 21:27:15 GMT (envelope-from git) Date: Fri, 28 Feb 2025 21:27:15 GMT Message-Id: <202502282127.51SLRFBF017952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 310646a92ab4 - stable/14 - param.h: Bump _FreeBSD_version for commit 9fed5151903f List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 310646a92ab448156c34a3b84494fd2166079b55 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=310646a92ab448156c34a3b84494fd2166079b55 commit 310646a92ab448156c34a3b84494fd2166079b55 Author: Rick Macklem AuthorDate: 2025-02-28 21:25:43 +0000 Commit: Rick Macklem CommitDate: 2025-02-28 21:25:43 +0000 param.h: Bump _FreeBSD_version for commit 9fed5151903f --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 914433bace0e..12a0e2098fec 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1402503 +#define __FreeBSD_version 1402504 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Feb 28 21:35:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4M1y4c76z59KKt; Fri, 28 Feb 2025 21:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4M1y38ylz3q7l; Fri, 28 Feb 2025 21:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740778518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZyHGsgoDcOnK9OcqNJ4Qnpz3DW9vRZmzRupSvYlPm8E=; b=iazo/WD4/nHBNfICx7CvcUGl1pMtSqrUIzJprQqAyiRJuVwRJhl39AHU+Qnz6DJe9M+jmq cZO3qeIf5g2hlIFb7XNc+ZJlAUcxH2kagKCYZH1kp0t5tqXr1RuFJX76J50KiBGKKfnUu6 KC4ltaCkaJQUjjjiSj5WmK2ixjuwxb138i02TaaJ01vVd6wc965bnbInb5UThILaTnE8aS 701Hpe6NjblqSsnf07tl9xDZRHFoKQHS9vUoGnYVdc9Sl8ntjh4+SvRew36svZo9P/yH5k lKrr7XWNviYeALwj1fP9E4G6eBgMWjhDiHBHN8BhM0UAx5ABkVMQHaRXr0gO6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740778518; a=rsa-sha256; cv=none; b=JH5XSvGYkdsrxOXDBQmkd/DcklcswMljJMxykAh3adUuZ0x2d0JYkYooQSwQet3lyB/Y34 XYUgdPf9NkmetX6yzXE4AXXbggyWub7HrjbMwMj5J14LzHuaeIY/FRJNEmKT6KK00oBCV3 E7h0w337droiF2lTO0i72iLwehk+302J0TZIzOzrzAzYPGoYB4bHpYAjL9AHg1YaK1QK/p JFNjum85WWrVjSVSxdsr6c7C1CcT3D7hPeoqT8gOwEybjCsRlBh2DWE2BLUrSdUIqOYTN4 wwm0rXJE+SkL7DYf9n0UknzRj7lkjZ12m1DkMwqQa0z31w+4vyDhHfjK7J1muQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740778518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZyHGsgoDcOnK9OcqNJ4Qnpz3DW9vRZmzRupSvYlPm8E=; b=bo4Fr3yPI3bZE79CiU+46M1PgkDIg56zeZZjcAEy2PGqzIVeyUsFqeXyWjZZtQFg6xEAFJ nItdHCECf1i+a1Y9XoBRW5myJ7Qc4ydspY2ObcPYGLRkN7a+A1sxl5UoGdkjM35uiPm3eB IwIdRH4fOIccZVY0AKDd8r4oHnTqx0P+/J+OIiJecFs1esONoMxGvfmPyJ4eZ3uZz7UEoJ Muzby9IKyaZ9Ru16Cv8FAKuVqaxsErNptqqv8o7S6mEG02kWDuY3Lxe9aD/7BMB69sOP5m yOS3Fw/u2QOT8E0FibsZrPd6WcFSziuJZYba4E5MoVG8n8TTTXoUAQ6191MWYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4M1y2jrJzmTF; Fri, 28 Feb 2025 21:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SLZIYl036218; Fri, 28 Feb 2025 21:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SLZIQ8036215; Fri, 28 Feb 2025 21:35:18 GMT (envelope-from git) Date: Fri, 28 Feb 2025 21:35:18 GMT Message-Id: <202502282135.51SLZIQ8036215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 76fdef764db9 - stable/14 - UPDATING: Add an entry for commit 9fed5151903f List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 76fdef764db9b21f913e56eea571172fe1608c4b Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=76fdef764db9b21f913e56eea571172fe1608c4b commit 76fdef764db9b21f913e56eea571172fe1608c4b Author: Rick Macklem AuthorDate: 2025-02-28 21:34:18 +0000 Commit: Rick Macklem CommitDate: 2025-02-28 21:34:18 +0000 UPDATING: Add an entry for commit 9fed5151903f --- UPDATING | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPDATING b/UPDATING index 9509e5405daa..f35f4267117b 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250228: + Commit 9fed5151903f modified the internal API between the + nfscommon and nfscl modules. As such, both of these modules + need to be rebuilt from sources. + __FreeBSD_version was bumped to 1402504 for this patch. + 20250117: The layout of NFS file handles for the tarfs, cd9660, and ext2fs file systems has changed. An NFS server that exports any of these file From nobody Fri Feb 28 22:34:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4NLL5kjdz59PQS; Fri, 28 Feb 2025 22:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4NLL3SLzz3ydq; Fri, 28 Feb 2025 22:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740782074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RA8bZszRB2Iazse0i1CafWLTmXU+Tr7GsDbCoHLeCBQ=; b=c2rLeSSefJApnY3DkR+7x5cHWarr7dqSvbiyBeXj577U/yGvvUlU4FpHA+K7gC7WoJp6IG 50gWGCZTCbqOZ0afPxOlwnEmFe8FPexAA1l89CD+O4mDn4twkI1ehAj8hfnBW/wG6Kua6X cGyhAQIV/5DgsTiUW6o/Os3ZiGbS5iThr1mbypkfoB5zuFEZAeMyRDfETk6rTNqe824fI7 EYrigSSMNxcIXVCxcz9lR7aSLSL06iDKoHtXncI/4ueUcL49qgVmaRHj2HIKCBTFH2CuY6 62scN7wqe5IJrSs1/r25u7f6ulIWekMl1jXw1K15InwXuSdAQxQK14/x6+d+Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740782074; a=rsa-sha256; cv=none; b=Kdl97c7U/VeTRA0485OzKZEzP9KNcvkCz1pBgv68q7go9MIm4rsLQ5zUJBTX4+jeCwmeDo cxPQE4cwfeBv3F2KoW1AJGl5wLTf4wupDEd0gRIsnfiS2nKXIH+a46NnSmbE+/A59l8r0k /dkj9A5CV1rKrj1XPF4/Z/oV85P/r1eFoUkaEOPieWsTJ9Xtv2y0jP/a7Dm+E5wzpffCGT pk2ehMu8zIlLqOklJ3pTu6gp4cw8UosSVkciKST6PUOnyvzNQ6iFB22W7OwC0aODKYU4RO Ed8xiaHFzbfg3+02B5gPRPlDBIvzopBit5rTruDWbyzZO6R4eAAOEVAyHqEYpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740782074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RA8bZszRB2Iazse0i1CafWLTmXU+Tr7GsDbCoHLeCBQ=; b=oNoSrv1vVc+ET4isd7rN3BEGdgQyC0CWTmoMrxaeBJRBVDgGxj0LrpqLHuvFJfWuhGLIbI x6GXfxcMUXeLhwQN38Wn3U56WDHdLwpVaUCbf1D15viMXcdDVS8JCMiT3VKWW4jqIKLCmr FPRnBJah6wOjD82dEVe4JnNLpMlcQ1+RcK+UBEFxZV4TOp3gW7mCg0Vq97QpWZV+rf+a3R X49gJz6WbQQcrRshW0zL5u0Ax2/5tqcC5aDr69/9ISkcwa4q5FTK989cFDwZe2rz5mE1DJ hNYAomNOraFRUiyfCl7gzwbDQKQLJRJE16ZvPO1wPX1HxDZ205jP1psEMZxh6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4NLL2nD1znVf; Fri, 28 Feb 2025 22:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SMYYXr048132; Fri, 28 Feb 2025 22:34:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SMYYHK048129; Fri, 28 Feb 2025 22:34:34 GMT (envelope-from git) Date: Fri, 28 Feb 2025 22:34:34 GMT Message-Id: <202502282234.51SMYYHK048129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 457d745d90a6 - main - release: ensure default sudo flavor is selected List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 457d745d90a6b63793c9ca17bcd7ec5ff4cd8b93 Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=457d745d90a6b63793c9ca17bcd7ec5ff4cd8b93 commit 457d745d90a6b63793c9ca17bcd7ec5ff4cd8b93 Author: Dave Cottlehuber AuthorDate: 2025-02-28 22:27:31 +0000 Commit: Dave Cottlehuber CommitDate: 2025-02-28 22:33:46 +0000 release: ensure default sudo flavor is selected pkg behaviour selects the non-default flavour, this trims 0,5GiB per cloudware image, by being explicit. Approved by: cperciva Differential Revision: https://reviews.freebsd.org/D48599 Sponsored by: SkunkWerks, GmbH PR: 284278 MFC after: 10 days --- release/scripts/pkg-stage.sh | 2 +- release/tools/oracle.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index 495c328e4724..58b6d25fcccf 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -23,7 +23,7 @@ net/wifi-firmware-kmod@release ports-mgmt/pkg shells/bash shells/zsh -security/sudo +security/sudo@default sysutils/screen sysutils/seatd sysutils/tmux diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf index 08a9a3a372b0..8a4206c05623 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -19,7 +19,7 @@ export VM_EXTRA_PACKAGES=" net/rsync panicmail security/ca_root_nss - security/sudo + security/sudo@default sysutils/firstboot-freebsd-update sysutils/firstboot-pkgs sysutils/panicmail From nobody Fri Feb 28 23:46:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4PxP5dpyz59WGk; Fri, 28 Feb 2025 23:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4PxP51Kqz45NL; Fri, 28 Feb 2025 23:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740786393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UqHv+VR6W1DZ29G22niNQa2uT5+SYyVMI0HNDdvTK9U=; b=nUvGINFgqEZuMeJgycrBAxXmjbABnMF/6QQ6FzaqBv3ePX+wMRRcPo8G7djHfKctLyuBnh cV7z4orRvkCLRGjOBlPShRm0vm3gPuEb9gl3wxbEUy955A+K2fdcgUTU678+p0/umtrLKM rE1fheF4HmxV2wKdmxANrXdLJdXQpgyuU+Ot2TsoIuXYBzLUUOSWVA+gqPiIpyZxtmm3e/ qBd1QM2W1r/9BLfURMcZqjY7H1dMMXCDjv8Q5e8GfHcbqeq7C3AH9XEhmDcD83wI2XfU6T C0vA5pUFGan8OQLhBiv7Js6UL9sY1b271Zvk0VQX5ctOY4mumjY6GuP1wuM9IQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740786393; a=rsa-sha256; cv=none; b=CxL5rBJfMGpjG8Ol67Y80axZ6WM7s6O6HIP2kjTGIRPr3bwxYtdrBFIQf0jn9qM7XPy8ri zCZjV4SGcJtsG8ykpSqwM/3RbrctYlehQ071Eg+pPm7nTq6HAnRX/f9vKNtywnrvkDgn1J b/XdL8toe5/nUzrYua7WLWqB65tLcYht2K9SivoOE+jpnr5l7ajeDnqddKUbzcuQ8nuYfZ /nDS8kiqzv1VVjlK1GYB5nadk4BlS9CCvsxp0ws7zLxqhpIfihLPT5s+xiXgN6vlywSnxD HfTRYpJISetebRK2yOh1UkH/L7hpeOaflz0CvWwWEYteyyeZE3TGlDAPSeIG3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740786393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UqHv+VR6W1DZ29G22niNQa2uT5+SYyVMI0HNDdvTK9U=; b=B+4VCOYBCsx6Tw/gZBD0lZDlKP+2X25AXKApV+kTjDMtHdHVsFGAEpSpFLOC7h37FH7NVN 7HGi3YQ2N+3H12QiXN8ouqvpxePCWjBCyAwdxmY+aORto7TDc98Rkm8YabQQey4uAPvYWG dO919qNw8PgoXqTxM/ysiC+ljx6oTilSbh/vLnfMA/i+JEIzh/JDKmhIUsDxugAt2Afyp2 pJrsyVgKu9VVluRMWleAHAKmcHkvJ4j3I0tXok5ilg1ElBNWKgjfAOb1GclONMna12exoV ZXR5T8Q1hRYwOvs7OoBHc0vW6EK96UbSQScOVoVdPJIITXiOmjfFyud8MDGzgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4PxP4JZ3zqc9; Fri, 28 Feb 2025 23:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SNkXDn079088; Fri, 28 Feb 2025 23:46:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SNkXiY079084; Fri, 28 Feb 2025 23:46:33 GMT (envelope-from git) Date: Fri, 28 Feb 2025 23:46:33 GMT Message-Id: <202502282346.51SNkXiY079084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: a80bbc4e9597 - main - netlink: refuse a send(2) that is larger than socket buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a80bbc4e9597530b91735ebf366a2a62dc27a8d8 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a80bbc4e9597530b91735ebf366a2a62dc27a8d8 commit a80bbc4e9597530b91735ebf366a2a62dc27a8d8 Author: Gleb Smirnoff AuthorDate: 2025-02-28 23:39:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-28 23:39:15 +0000 netlink: refuse a send(2) that is larger than socket buffer The Netlink RFC doesn't say that explicitly, but general discussion seems to state that a single netlink message shall be delivered in a single send(2) to the socket. So, if a single message doesn't fit into buffer it is clear EMSGSIZE. The RFC is unclear if application is allowed to send several smaller messages with a single syscall potentially overflowing the buffer and whether kernel should accept any of them. At the moment, no legit application does that. So, decision was taken not to overload nl_sosend() with a message parsing logic and deny any oversized write. Reported-by: syzbot+eb5db60d36b005dbccf5@syzkaller.appspotmail.com --- sys/netlink/netlink_domain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index a7ceae687d86..74b46114716e 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -568,6 +568,9 @@ nl_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, if (__predict_false(uio->uio_resid < sizeof(struct nlmsghdr))) return (ENOBUFS); /* XXXGL: any better error? */ + if (__predict_false(uio->uio_resid > sb->sb_hiwat)) + return (EMSGSIZE); + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); From nobody Sat Mar 1 00:12:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4QW13NY0z5Vbkn; Sat, 01 Mar 2025 00:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4QW10syvz49yd; Sat, 01 Mar 2025 00:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740787933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zmt1dEUIa3PW3aGWZYKFGzGrScVRKADL3rdFnIyFzzg=; b=iSNhNEtJq1SkKCifpTUpZB3IuxwbZBs7ouL+zIaj64Hozp7hJf3LUPOEQV6S9LAwdFFF2O tCf3Mf4m3zImD6HO84qPUEKIn7C9vqY+59YsImv3tQdPS8qwMMi+XMU1zRmcBO63v6jt2a fGOa57+cLDpnvb/Uhbpfp7oYlKF8HAeNqHYZWnO18W2nU+JXyBanPMoF48pgj7m7zIOa+R y1i3NEL2BUXegJmlF0eh1MfMW2UrytMyTV/QSBmJhXKzTYg64AC2tzoKwz/ObMMdrXk3h6 D8f97atKBZCa4JFq2EeSOwvyYQS8Lw8KmV25R+xmYzJm7jxHBDtD85bWWVwHNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740787933; a=rsa-sha256; cv=none; b=TdUsn1X4Wm65NBbhmQxNLmbeKppAVPv0HNyKjBJHuMPrDKjxe5jW302a9pKd2neu37kUaH bkgIvlj/M244gPRMFzZ7PogQ+ylkYXN+mmEPrshbtPlr1GZESWqggO3TwiZ4CCNLe/GqE3 OPdJeO0XEuwfWEoSgR9i25rwPmbJRhX3sIp7+7T4H7sYpxp8tf1rWkRtEpm0ZMutTbvuQY qLK2BJmMEXOLM9V/hGHd13KOgfMvpPN7sAznm0Ek4yZ9Pf/ohWmbO4ZQFvVXRIT9IaWIvF XpquVonUGsIPrjofVaj8eipABI036RGwYotNnTYtnai8+yVkFQcMK7RDkrhjkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740787933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zmt1dEUIa3PW3aGWZYKFGzGrScVRKADL3rdFnIyFzzg=; b=FbwD5PlMlhpM24O3DIZWt2WsQnjQaX9/hsO5h7Cj0b2xh3OqTOnSRmF76XbmQtGqZxJCeX ue0uG8PZfiqIp5nQ+aTXgk4Dt+Lbi1uJI1Zv+D4eBCeLoD10lPXhpEhaIzRfjLccAxv64d ra1II1Q1153KMJaRbbQRUUbDxFUyiGlqikGjlkhgIGmRO0qGWrFSHLUr+DWA7+ewMmKBZo qZeemEN5pNU6I+ep4f2/a2jIafmMqg5emen3R+EN6wlb4l7f7bAqntIhUTCpCmzbuW/VOx EEFRtkIUUPDU1iSBCPAp/81nwynriDPs7OHh+cEG/80JOnGoiRV1IMwYxdZ1Ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4QW10NmFzrc2; Sat, 01 Mar 2025 00:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5210CCTU033051; Sat, 1 Mar 2025 00:12:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5210CCBG033048; Sat, 1 Mar 2025 00:12:12 GMT (envelope-from git) Date: Sat, 1 Mar 2025 00:12:12 GMT Message-Id: <202503010012.5210CCBG033048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e2dd73cf45a6 - main - open.2: minor editing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2dd73cf45a6a8d97131bdbe512ab1ff63121d85 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e2dd73cf45a6a8d97131bdbe512ab1ff63121d85 commit e2dd73cf45a6a8d97131bdbe512ab1ff63121d85 Author: Konstantin Belousov AuthorDate: 2025-02-28 23:40:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-01 00:12:07 +0000 open.2: minor editing Remove unneeded braces. Bump Dd. Suggested and reviewed by: maxim Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libsys/open.2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index 699446b6c7c2..d8540637b690 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 3, 2025 +.Dd February 28, 2025 .Dt OPEN 2 .Os .Sh NAME @@ -254,12 +254,12 @@ for reading, writing, or for both. The open' request for a lock on the file, created with .Dv O_CREAT , will never fail -(provided that the underlying file system supports locking; +provided that the underlying file system supports locking; see also .Dv O_SHLOCK and .Dv O_EXLOCK -below). +below. .Pp If .Dv O_EXCL From nobody Sat Mar 1 02:29:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4TYK2CJKz5VqD7; Sat, 01 Mar 2025 02:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4TYK1H3Yz3Ydj; Sat, 01 Mar 2025 02:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740796165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SJlRhIc165neErY+MyqM8ktpjTIkOc3mt0oDm8QB2qg=; b=U8lChoVkanrOCtcLXtMWx1G1wgYxdfw3GQxpabEHmaaFfCWwGj6OtgbkkL2x2dEfzOi0sg MKwuH9h8iH1lRXU/IeYXWzPVrsB/y1kSYHz3odfeWFdQ1540sf8i8DDIQijqN/T5kUneK2 3bnIB4+cVeGKlhhOuzp8e+3H/vPjAThrReOjlwMoGQ1WDvI41fOKLh108rvNdALWuxrJNB fV3XX7/m2QGVY169kdT9K96zQKq8gtSdTMVAdQ7d5+Twtx1D3a4Vw+Q68Mp8SCG7zxV5PW YIxu8ERr3BZExgBRaleAEODbSfjQ7rj6iTwGHXQKDrk/uLXDueKGVsi+STCkLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740796165; a=rsa-sha256; cv=none; b=tI9hj9LJ33xmXCBjFSw1Z7izMoH9KTNgJdzVEnouh2sJbfE3F3JcPi3dzkNXLsONAHfNR6 gd4wxQWcxSXPCLAGhsjt/JNUpHb/jwnIHhf03beu7PQNgvBd7r8pRk+GiI6Rvt0NliwHI6 6QYjXLhWmGl8qBJC2XEAsGCHLMGMpVF3QedkoG7gu7425/xmuRRJguH8dSbVS8l6iislS4 8i1uxr7a7DPMU5HBW/uP1r21g6VDmIXpJ7d2mGPNepJTXl78gppMUmTge488Gh3UVi/zYQ +9+f/35MYKZ9DdKvTQNTDw1KTGZvULvCf65ia88t5UBz/WKa/WiwVkS7gHOrkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740796165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SJlRhIc165neErY+MyqM8ktpjTIkOc3mt0oDm8QB2qg=; b=DNgYZq0iEf25Lr33syCjvv2aV5zUYatwn/vm1kRp1/xp8YPaKCIJu9FNku1NX9CxkhFy0t co49PYZbkA8uEkHiL7Ov95lXAMuUODzAEOgA1cw9pWXQgtLrM8/2UYSt7VWaLAFnYa027I zaKkVBEn7hX1G+pNfI3/pk19Fza0UtuO3laWVgKIrsjfTXJfsxj7G2W3c75Yn3zA77KP+Z wwOBjb0bI6HLdNkQkdHVQAH3YR0EvB0bawbe8tjWtBtXiD6S69cDIhz4ghkgCvryNfaZRX 59Bh9RjEF+xst9EgfhmX1hdn/Tjtyu2dRxWiz1eYUcGfdrcDhOOotALb3odFTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4TYK0lNtzwSB; Sat, 01 Mar 2025 02:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5212TOka078000; Sat, 1 Mar 2025 02:29:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5212TOLk077997; Sat, 1 Mar 2025 02:29:24 GMT (envelope-from git) Date: Sat, 1 Mar 2025 02:29:24 GMT Message-Id: <202503010229.5212TOLk077997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Lo Subject: git: 8ac7c651dbe0 - stable/14 - ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ac7c651dbe01791284301b9d109ad856f564b36 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=8ac7c651dbe01791284301b9d109ad856f564b36 commit 8ac7c651dbe01791284301b9d109ad856f564b36 Author: Kevin Lo AuthorDate: 2025-02-28 08:12:00 +0000 Commit: Kevin Lo CommitDate: 2025-03-01 02:28:58 +0000 ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 (cherry picked from commit 5c7087c349fc1d826807aa1a11912c9e774e3321) --- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 5f1f64e02b82..0b866e7a39af 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -297,7 +297,7 @@ static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); vf_mailbox |= hw->mbx.vf_mailbox; - hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; + hw->mbx.vf_mailbox |= vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS; return vf_mailbox; } From nobody Sat Mar 1 02:34:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4TgT5vmkz5hjnn; Sat, 01 Mar 2025 02:34:45 +0000 (UTC) (envelope-from kevlo@freebsd.org) Received: from mail.kevlo.org (ns.kevlo.org [220.134.220.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4TgS3KDvz3Zs7; Sat, 01 Mar 2025 02:34:44 +0000 (UTC) (envelope-from kevlo@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from localhost (ns.kevlo.org [local]) by ns.kevlo.org (OpenSMTPD) with ESMTPA id 498fd117; Sat, 1 Mar 2025 10:34:35 +0800 (CST) Date: Sat, 1 Mar 2025 10:34:35 +0800 From: Kevin Lo To: Kevin Bowling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5c7087c349fc - main - ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 Message-ID: References: <202502280813.51S8DQiZ037985@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3462, ipnet:220.134.0.0/16, country:TW] X-Rspamd-Queue-Id: 4Z4TgS3KDvz3Zs7 X-Spamd-Bar: ---- On Fri, Feb 28, 2025 at 01:54:08AM -0700, Kevin Bowling wrote: > > MFC? Done. Thanks for reminding me. > On Fri, Feb 28, 2025 at 1:13???AM Kevin Lo wrote: > > > > The branch main has been updated by kevlo: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=5c7087c349fc1d826807aa1a11912c9e774e3321 > > > > commit 5c7087c349fc1d826807aa1a11912c9e774e3321 > > Author: Kevin Lo > > AuthorDate: 2025-02-28 08:12:00 +0000 > > Commit: Kevin Lo > > CommitDate: 2025-02-28 08:12:00 +0000 > > > > ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() > > Reviewed by: kbowling > > Differential Revision: https://reviews.freebsd.org/D49156 > > --- > > sys/dev/ixgbe/ixgbe_mbx.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c > > index 5f1f64e02b82..0b866e7a39af 100644 > > --- a/sys/dev/ixgbe/ixgbe_mbx.c > > +++ b/sys/dev/ixgbe/ixgbe_mbx.c > > @@ -297,7 +297,7 @@ static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) > > u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); > > > > vf_mailbox |= hw->mbx.vf_mailbox; > > - hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; > > + hw->mbx.vf_mailbox |= vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS; > > > > return vf_mailbox; > > } From nobody Sat Mar 1 04:14:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Wth2kxbz5htbk; Sat, 01 Mar 2025 04:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Wth21bFz3mJG; Sat, 01 Mar 2025 04:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740802476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Itm+c4MAo2ES0EUXeoFMgQvxMGReYgpdUnCYAi3oLcE=; b=ZTTIuVYXy1uD9Y5b4DZgZsGfDlPbCDUVRmCVgRSCOs7YUiwdBBzZt2mLo0ToPO1nCojrtU 6HayPrK77EYg3QofPSx1qdtlwJTu49mS0ZX/ruUU4qqQr13+UiHHFghJPt0oSg/GRjR83/ /pnsBFk09mKlIAmKRLqWkqCS8A7pkOqwBQPyVA4xlKnT3z8z0YIJlqE0uO9OfjvqG2ocOT I/etdipzaCX1TE4nzLnBu5hqmG5iRGf/oyyZUEmRq0HwhqaTsEnyVLskgr3mqgFsNtVFto f/LSLVOTzu16arvaOhz5PFb4TmgIyRcNYG+6pgke4z6DuuPZUiuPJfmInK9y2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740802476; a=rsa-sha256; cv=none; b=lxiuM0y/TaVr4psJUuCfo3aEBVmZls5HeIVMYO+HzawO5TUkXsPPimDri5leilDbSdN9vt j4+aTM5vSE6NZOsRG2Smp31rl3MVV0VCU68nYhw7kj92U/3AeqOR43GeVcL3mZOBpUKcUp EhnoA2zoFuHjgEQ87owjlTlGf8450qHVvI3a7IDb3rnR4pdB5v4Nb3EMshMjPt/EJdzm08 GPgy8UlwqpVHl78xomMTGDgwdKTRiZEJ6/cS3T5QJ345MZzuE0TlLuamfNABUiMtgnKEVz g8kTpaaiOV/c5tlC89GiIBFfB0fa3P9bGyUk+fapcjubdOWRlKWccTL01K9JRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740802476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Itm+c4MAo2ES0EUXeoFMgQvxMGReYgpdUnCYAi3oLcE=; b=BgRbVT7RB1vGz1fXXLoFZt6/hpFIXRR2vFRYnqo92DKJ7iWeUZ4k5/uJZ6CpHNKZLC7JZl R8cidGd+qb4LR7d9TfFPIUI1u1XpvD4SYUz4gip/SwGMoDCwJp6gQZxYEIV79hn+L7xODZ doRGaNABToe4PK8HiJ1G04AYRXRMmsIw9A2f3wQ8FXrUjayI071VjMtzxCVs4462PcjgwY +fZA99WRB8o6ZUSY+cl6K3IGtsihGN/De4V/8xC2o1NXI5umbcHfescq6h/MEL3/c/wfQk 7rEkMxCjTmc6PJSz9k+C7BWZ7gsRUFah3cn76pYuz1oN3+jrHkLQKDBnW3U3tQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Wth1Vyfz10Kx; Sat, 01 Mar 2025 04:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5214EaH7083299; Sat, 1 Mar 2025 04:14:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5214EaxT083297; Sat, 1 Mar 2025 04:14:36 GMT (envelope-from git) Date: Sat, 1 Mar 2025 04:14:36 GMT Message-Id: <202503010414.5214EaxT083297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 7ee310c80ea7 - main - igc(4): Fix attach for I226-K and LMVP devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ee310c80ea7b336972f53cc48b8c3d03029941e Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=7ee310c80ea7b336972f53cc48b8c3d03029941e commit 7ee310c80ea7b336972f53cc48b8c3d03029941e Author: Eric Joyner AuthorDate: 2025-02-26 17:19:38 +0000 Commit: Eric Joyner CommitDate: 2025-02-26 18:15:38 +0000 igc(4): Fix attach for I226-K and LMVP devices Summary: The device IDs for these were in the driver's list of PCI ids to attach to, but igc_set_mac_type() had never been setup to set the correct mac type for these devices. Fix this by adding these IDs to the switch block in order for them to be recognized by the driver instead of returning an error. This fixes the igc(4) attach for the I226-K LOM on the ASRock Z790 PG-ITX/TB4 motherboard, allowing it to be recognized and used. Signed-off-by: Eric Joyner Reviewed by: kbowling@ MFC after: 3 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D49147 --- sys/dev/igc/igc_api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/igc/igc_api.c b/sys/dev/igc/igc_api.c index 9e91e7a4c73f..da499274fca4 100644 --- a/sys/dev/igc/igc_api.c +++ b/sys/dev/igc/igc_api.c @@ -109,6 +109,8 @@ s32 igc_set_mac_type(struct igc_hw *hw) case IGC_DEV_ID_I220_V: case IGC_DEV_ID_I225_K2: case IGC_DEV_ID_I225_LMVP: + case IGC_DEV_ID_I226_K: + case IGC_DEV_ID_I226_LMVP: case IGC_DEV_ID_I225_IT: case IGC_DEV_ID_I226_LM: case IGC_DEV_ID_I226_V: From nobody Sat Mar 1 04:38:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4XQk2XScz5hw9g for ; Sat, 01 Mar 2025 04:38:54 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4XQj6ZC6z3r0T for ; Sat, 01 Mar 2025 04:38:53 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-471eb0e3536so51018391cf.3 for ; Fri, 28 Feb 2025 20:38:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; t=1740803933; x=1741408733; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dhZQYuVAQT74LiW0PpGG4ltBoR2Yae9snPmUrkfZZkQ=; b=J1EXqLsSsatj0VU2zC89Q6GKn7Sv1PV6W3GAmkTUlkq+RweMIpPLff9HQ4MqiNVmny wtgrhSEX1nL42MLCsTPmrx4dLHYpV6Gw+vWwwtnL2t5hvSGXUX7KAFT3E+S0nBaWMS4o V1LCv3qSAxT5SBpsiIcH/lnV9jWbS5Zidze+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740803933; x=1741408733; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dhZQYuVAQT74LiW0PpGG4ltBoR2Yae9snPmUrkfZZkQ=; b=XsVV7kv0VpSTqGz0CQps2HDx3V6IXYBaWHWVKGoKy3/Hd+4JcF5i/jrULP005jIaG+ H6L49xAFJRLy6749XY5BqaxpNkXd6t/aW8fVfJp7Gv4zQwZ28BSGGLCAwgATaApzUTHo 6+2VcXm1tBqhOf0ktqD8Yvx+yXgpInEiH88BlmaQ6ae8WINotMNk7jzlXYWw6RdFyFZf dsR1snRaBVgM/DTedvgIN/XmhTGc6rA4PHOGuIcKOHR1EEfgc4ymkMEAGUvBDlkz1mKP 8Ai7ev708x/HWknAHDyxGSg0TLuETDX1KnfuI07yK3Y9IceaofduwpePhc0RRSFUZ3qj Q9fw== X-Forwarded-Encrypted: i=1; AJvYcCVFDf2HoYAh7qzqei0RWD1PgoVRrOsiqh6q6DJdRhfmgIgWqD9LfNdduavnOUEgzlMkka0hfvuxl7zX/EkvzUvumEVS@freebsd.org X-Gm-Message-State: AOJu0YyX2fmhFLD5cE7YcJzgf88rx8YguR5KhHtRRhnKb2pNFH1obVCv rXExtDVOe6WyL6zlcdK6HX7AD1N2rdi+sy2iFlxUkWvUvOdiA3B03Mv7JVh996FkyQYvzFFtSUE NNQOAq2BFodckK+EJlo/xk12azB0tgNnf7BTe X-Gm-Gg: ASbGncsP1bEXkciQ7vHM5dCEznK046CKOtBDpAB64vmNAmha9H/JPmyHXRum3y/vhst XeCc3hh9v9FGeLqV6q4BfmIZ2vhTsp5dBag6SQ8Rou/lK2axc36DqyBhw8I2Iu3OPEimRRaQ8N9 LqbkgqwGqT0cpveTlpqwtP1vKRUUk= X-Google-Smtp-Source: AGHT+IH46mvBLegAtcZ3O6ovxoS8p5lnbKXbgdqwFHOwl4gWhsfx5W9PDaXnZXUBhaiDbRu6bPmHFxGD++SSepKQZqg= X-Received: by 2002:a05:622a:1115:b0:474:b801:d04f with SMTP id d75a77b69052e-474bc0a1fa3mr80888351cf.25.1740803933065; Fri, 28 Feb 2025 20:38:53 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202502280813.51S8DQiZ037985@gitrepo.freebsd.org> In-Reply-To: From: Kevin Bowling Date: Fri, 28 Feb 2025 21:38:41 -0700 X-Gm-Features: AQ5f1JomG_8ufV-ZZ0SmFl31lzU4rqLPkipIxFJ1Us-1h3tqNMinnnwNeaINv9A Message-ID: Subject: Re: git: 5c7087c349fc - main - ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 To: Kevin Lo Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Z4XQj6ZC6z3r0T X-Spamd-Bar: ---- stable/13 needs MFC as well On Fri, Feb 28, 2025 at 7:34=E2=80=AFPM Kevin Lo wrote: > > On Fri, Feb 28, 2025 at 01:54:08AM -0700, Kevin Bowling wrote: > > > > MFC? > > Done. Thanks for reminding me. > > > On Fri, Feb 28, 2025 at 1:13???AM Kevin Lo wrote: > > > > > > The branch main has been updated by kevlo: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5c7087c349fc1d826807aa= 1a11912c9e774e3321 > > > > > > commit 5c7087c349fc1d826807aa1a11912c9e774e3321 > > > Author: Kevin Lo > > > AuthorDate: 2025-02-28 08:12:00 +0000 > > > Commit: Kevin Lo > > > CommitDate: 2025-02-28 08:12:00 +0000 > > > > > > ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() > > > Reviewed by: kbowling > > > Differential Revision: https://reviews.freebsd.org/D49156 > > > --- > > > sys/dev/ixgbe/ixgbe_mbx.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c > > > index 5f1f64e02b82..0b866e7a39af 100644 > > > --- a/sys/dev/ixgbe/ixgbe_mbx.c > > > +++ b/sys/dev/ixgbe/ixgbe_mbx.c > > > @@ -297,7 +297,7 @@ static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw = *hw) > > > u32 vf_mailbox =3D IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); > > > > > > vf_mailbox |=3D hw->mbx.vf_mailbox; > > > - hw->mbx.vf_mailbox |=3D vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS= ; > > > + hw->mbx.vf_mailbox |=3D vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS= ; > > > > > > return vf_mailbox; > > > } From nobody Sat Mar 1 09:39:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4g5k3Rnyz5p7Tx; Sat, 01 Mar 2025 09:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5k1k2Sz3HN1; Sat, 01 Mar 2025 09:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HKgXF6oGzTb8vm4OQ9YPJ2WgNRYwKNiZCclW2AnDuyU=; b=Y2IkZMFVmlubTwDw8XQES3YVhG8xSQ259EGbZW1d4lz3yW+5W1Bd7UP3Pw5y3vXihxeSJI otq+IeSsGczepcS1/NQ9cv9LQ/htBQO+0+5OcgcUT9ZyoIAsQjlUvJ0BkETYRuZ3wC1nDG Or9vYt1EPtJiPa9p9N66su52LHwVudFnlR50KQHKBp69fGbs57J25WTIA8LyflRsGkFw0q gY1Ek9Gzfbvp9qVunsyPeYZd3WpIfsrqJG7fBmqTeVOT9GT1TSbsMq1/3a+vb2eopa2N6o NJcXgdsB1ndhfoH/VKiOQLLYKu9P//JDZTYLaebgB2X0bl+orw6GCNOZClzyUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821978; a=rsa-sha256; cv=none; b=idUSXC1QIfuWmFEE09r2GUiu2g+/kQdF6xComKptArWcS6FJ7RCj25oF9WaQiKKPK/Uyma w1w1P+HdjxcG3doqA4p3qPwfX0SiiXJF5jE+bs5HQoTV0J9ivqppL7DWcgYBaryJHZvOQ/ SB15y6jtFMBVOBkLSz3l8ZCwN8Eb4OZ0OaJ4ziimDyBBbHb70sozw38lX+MJlcGVgmWeFX T4fNJgMR1iGIwqLNKD2MPWrD3TmOMuTfTQUtTFvOEccHcSagO8ttQc9mhpqI6NT4ylHomd V5DwCCPKD+NjHRxW8RA8uxvmiAl0azU39YJcZfylUQLHI2htlWwVMhoJQVO16Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HKgXF6oGzTb8vm4OQ9YPJ2WgNRYwKNiZCclW2AnDuyU=; b=pmIDAOUeiNyLzrYfrr3buFjZ3+5frxm8WBSBhOsd4t1heQnQ2WOmO1tTDB04cljIyf+ny5 lgHYmXGHBsOMxcjRYnbtCS4yKfb9PZevQ4AoRPz8ssWYq16NAkQNQVU/1xGFwZt9uqOOlR pwGVMZY39y7oXKVqR0x5yDjSvQ85n67kheOI+bRPiKLwC4keYLU+GBtWfCJfrVDYK3EPms k1r3unm0VLjdavX6cPQ7+VvVz9rtrF4A4PVKkMmoF/4s/8RaTt2wWhbVEPr7miX2Yu2QRQ vwguPDxl05C/OjeJx6ohKyvab0DnsXPJXZUgi4vi1nyiUab0gnZ9xCIEGr7w7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4g5k1KWkz18P8; Sat, 01 Mar 2025 09:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219dcCn084552; Sat, 1 Mar 2025 09:39:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219dcN9084549; Sat, 1 Mar 2025 09:39:38 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:38 GMT Message-Id: <202503010939.5219dcN9084549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: d3f637b744e2 - stable/14 - Refactor iwmbtfw: set default firmware_dir after argument parsing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d3f637b744e20f11ebfa3ea6d08cd2923325838a Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d3f637b744e20f11ebfa3ea6d08cd2923325838a commit d3f637b744e20f11ebfa3ea6d08cd2923325838a Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:01 +0000 Refactor iwmbtfw: set default firmware_dir after argument parsing Don't repeat firmware_dir stanza at all "if" branches: be more DRY. Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit f466ba4ca479ec500b927deadaba104469662994) --- usr.sbin/bluetooth/iwmbtfw/main.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 9c899d374e92..e4bb22af0e8a 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -451,6 +451,10 @@ main(int argc, char *argv[]) /* NOTREACHED */ } + /* Default the firmware path */ + if (firmware_dir == NULL) + firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); + /* libusb setup */ r = libusb_init(&ctx); if (r != 0) { @@ -508,10 +512,6 @@ main(int argc, char *argv[]) goto reset; } - /* Default the firmware path */ - if (firmware_dir == NULL) - firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "bseq"); if (firmware_path == NULL) goto shutdown; @@ -603,10 +603,6 @@ main(int argc, char *argv[]) goto shutdown; } - /* Default the firmware path */ - if (firmware_dir == NULL) - firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "sfi"); if (firmware_path == NULL) goto shutdown; @@ -689,10 +685,6 @@ main(int argc, char *argv[]) goto shutdown; } - /* Default the firmware path */ - if (firmware_dir == NULL) - firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); - firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "sfi"); if (firmware_path == NULL) goto shutdown; From nobody Sat Mar 1 09:39:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4g5l3sxvz5p7jC; Sat, 01 Mar 2025 09:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5l296Tz3Hb6; Sat, 01 Mar 2025 09:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CMlIynyPL0ifnYxs0OJFPwy2MUG86Ou22qkkrR4Semg=; b=NT0Tff2fPyuhI+xNbJg5DChmY5jmk6v5yoHBXvDuTFBKWGVGBh7NesAjUg/+fh/jPenCT4 jb1MV36JtaCW/gvVNW3e2YZ0A3yP3ZYU8ZRgWzSjmfdssl44whbdBkV7GZNzqQCniWr0k9 stbvFvB+iTlyQd5JdmIqnMG7qWdGE/rxr/rKVrJcrlai8lHk8yih6m0lIgVG8FRCbzBlPB fM+cYTbPW33yUtq3pLnhyQGnefpc1GvmJgSDfLK5zrX+PaMcuUyV3yuL4P8SrVapmqo/v6 +cfsCRQjyA1k53rg9xaZ1ENKY1t/g1993I0JQkYKpu4Nl5joCHKp45PjWVA2Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821979; a=rsa-sha256; cv=none; b=YdscfSX9Hxzu+pF/0huT/iUEtPMmI6PLRYYUkvTe1MxrN9s3MG/bMP+gVzSSaddNM+SKA/ 6EXmS+f6JSksYZYDqCwgxL9zDFzbGHzXVmFdCN/6kYitQuVMAXK0HjAvI9aRBEH7tBDHb1 ukhvluinHX0j6DDNL2qusEbXmv+E1ejRkqPY0fTHEHv9jAypTIdAlBY1olJA6ukElUu6o8 3qvQmUzKOwsCTc2QqC0Ve3kdwmjkI8k8VTOBooBdW6p+fNvzc31XUnp4RwNT6u+T+bjDRH /4VXQW6XQmRZNkAuF71G2bANxXGWCnsLyFg3Iu/0ZQQHooaLY8Xnnwm+dzl1MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CMlIynyPL0ifnYxs0OJFPwy2MUG86Ou22qkkrR4Semg=; b=qm+r6px50uScviuxX+pcC5n44JpZKioRlRnuErTihQkixIcbi9nOl1VGf313+usMYu+3A7 Voomm+/BHUDw1t3hLvFejfkTSamG0Y3Xq7yIKNjEG0uIyiJZTV8zIPI3uB22mW0m9Pjvt0 hdbqGK5kPa7OnWA/g2Fixj+EmGk69MpBfGJRB3hbRrhMZykfx5HjYpVwHp+v9qEa4YZYXj Ow+4jOhoxbulS5zq3oDSlTMcEvpB4KRQ2uscYSEY3jltHPMlH8j1TxA3yQBftEgPBbQsPr JUmq86zJCvVdaHUNwcev1hVmZREH4c72qTuXTXjPyQnjtG0B47ufVufcd/G5bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4g5l1lZtz18gd; Sat, 01 Mar 2025 09:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219ddMx084586; Sat, 1 Mar 2025 09:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219dd6L084583; Sat, 1 Mar 2025 09:39:39 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:39 GMT Message-Id: <202503010939.5219dd6L084583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 3d5e49294142 - stable/14 - Refactor iwmbtfw: modularize and de-constify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3d5e49294142012f0df988edfa574d4378f678b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3d5e49294142012f0df988edfa574d4378f678b8 commit 3d5e49294142012f0df988edfa574d4378f678b8 Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:12 +0000 Refactor iwmbtfw: modularize and de-constify - Move logic for firmware download into different adapter types to the own functions to allow main() to be simpler - Use enums/typedefs for exit modes, image types, etc - Purge most obvious comments: functions are named properly, so most of their invocations self-document the code. Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit 06969db312022277729dd144e3655a90007306ef) --- usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c | 1 + usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h | 8 + usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 15 +- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h | 14 +- usr.sbin/bluetooth/iwmbtfw/main.c | 526 ++++++++++++++++++---------------- 5 files changed, 298 insertions(+), 266 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c index 815b40982d5b..3a5cd9d42658 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c @@ -119,6 +119,7 @@ iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, switch (ver->hw_variant) { case 0x07: /* 7260 */ case 0x08: /* 7265 */ + // NB: don't use params, they are NULL for 7xxx asprintf(&fwname, "%s/ibt-hw-%x.%x.%x-fw-%x.%x.%x.%x.%x.%s", prefix, le16toh(ver->hw_platform), diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h index 2666d123c8f0..eb6909a1f91d 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h @@ -52,6 +52,10 @@ struct iwmbt_version { uint8_t fw_patch_num; } __attribute__ ((packed)); +/* Known values for fw_variant */ +#define FW_VARIANT_BOOTLOADER 0x06 /* Bootloader mode */ +#define FW_VARIANT_OPERATIONAL 0x23 /* Operational mode */ + struct iwmbt_boot_params { uint8_t status; uint8_t otp_format; @@ -131,6 +135,10 @@ struct iwmbt_version_tlv { bdaddr_t otp_bd_addr; }; +/* Known TLV img_type values */ +#define TLV_IMG_TYPE_BOOTLOADER 0x01 /* Bootloader mode */ +#define TLV_IMG_TYPE_OPERATIONAL 0x03 /* Operational mode */ + struct iwmbt_firmware { char *fwname; int len; diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index 1efd24ecf9f6..255181b8f4bc 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -437,7 +437,8 @@ iwmbt_enter_manufacturer(struct libusb_device_handle *hdl) } int -iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, int mode) +iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, + enum iwmbt_mm_exit mode) { int ret, transferred; static struct iwmbt_hci_cmd cmd = { @@ -447,17 +448,7 @@ iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, int mode) }; uint8_t buf[IWMBT_HCI_MAX_EVENT_SIZE]; - /* - * The mode sets the type of reset we want to perform: - * 0x00: simply exit manufacturer mode without a reset. - * 0x01: exit manufacturer mode with a reset and patches disabled - * 0x02: exit manufacturer mode with a reset and patches enabled - */ - if (mode > 2) { - iwmbt_debug("iwmbt_exit_manufacturer(): unknown mode (%d)", - mode); - } - cmd.data[1] = mode; + cmd.data[1] = (uint8_t)mode; ret = iwmbt_hci_command(hdl, &cmd, diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h index 89ee344fe587..aac885dfd153 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h @@ -58,6 +58,18 @@ struct iwmbt_hci_event_cmd_compl { uint8_t data[]; } __attribute__ ((packed)); +/* + * Manufacturer mode exit type: selects reset type, + * 0x00: simply exit manufacturer mode without a reset. + * 0x01: exit manufacturer mode with a reset and patches disabled + * 0x02: exit manufacturer mode with a reset and patches enabled + */ +enum iwmbt_mm_exit { + IWMBT_MM_EXIT_ONLY = 0x00, + IWMBT_MM_EXIT_COLD_RESET = 0x01, + IWMBT_MM_EXIT_WARM_RESET = 0x02, +}; + #define IWMBT_HCI_EVT_COMPL_SIZE(payload) \ (offsetof(struct iwmbt_hci_event_cmd_compl, data) + sizeof(payload)) #define IWMBT_HCI_EVENT_COMPL_HEAD_SIZE \ @@ -91,7 +103,7 @@ extern int iwmbt_load_fwfile(struct libusb_device_handle *hdl, const struct iwmbt_firmware *fw, uint32_t *boot_param, int offset); extern int iwmbt_enter_manufacturer(struct libusb_device_handle *hdl); extern int iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, - int mode); + enum iwmbt_mm_exit mode); extern int iwmbt_get_version(struct libusb_device_handle *hdl, struct iwmbt_version *version); extern int iwmbt_get_version_tlv(struct libusb_device_handle *hdl, diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index e4bb22af0e8a..497edcb254cf 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -215,9 +215,11 @@ iwmbt_dump_version_tlv(struct iwmbt_version_tlv *ver) ver->otp_bd_addr.b[2], ver->otp_bd_addr.b[1], ver->otp_bd_addr.b[0]); - if (ver->img_type == 0x01 || ver->img_type == 0x03) + if (ver->img_type == TLV_IMG_TYPE_BOOTLOADER || + ver->img_type == TLV_IMG_TYPE_OPERATIONAL) iwmbt_info("%s timestamp %u.%u buildtype %u build %u", - ver->img_type == 0x01 ? "Bootloader" : "Firmware", + (ver->img_type == TLV_IMG_TYPE_BOOTLOADER ? + "Bootloader" : "Firmware"), 2000 + (ver->timestamp >> 8), ver->timestamp & 0xff, ver->build_type, @@ -399,22 +401,266 @@ usage(void) exit(127); } + +/* + * Returns 0 on success. + */ +static int +handle_7260(libusb_device_handle *hdl, char *firmware_dir) +{ + int r; + struct iwmbt_version ver; + char *firmware_path = NULL; + + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + return 1; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_patch_num=0x%02x", (int) ver.fw_patch_num); + + /* fw_patch_num = >0 operational mode */ + if (ver.fw_patch_num > 0x00) { + iwmbt_info("Firmware has already been downloaded"); + return 0; + } + + firmware_path = iwmbt_get_fwname(&ver, NULL, firmware_dir, "bseq"); + if (firmware_path == NULL) + return 1; + iwmbt_debug("firmware_path = %s", firmware_path); + + r = iwmbt_enter_manufacturer(hdl); + if (r < 0) { + iwmbt_debug("iwmbt_enter_manufacturer() failed code %d", r); + return 1; + } + + /* Download firmware */ + r = iwmbt_patch_firmware(hdl, firmware_path); + free(firmware_path); + if (r < 0) { + (void)iwmbt_exit_manufacturer(hdl, IWMBT_MM_EXIT_COLD_RESET); + return 1; + } + + iwmbt_info("Firmware download complete"); + + r = iwmbt_exit_manufacturer(hdl, + (r == 0 ? IWMBT_MM_EXIT_ONLY : IWMBT_MM_EXIT_WARM_RESET)); + if (r < 0) { + iwmbt_debug("iwmbt_exit_manufacturer() failed code %d", r); + return 1; + } + + /* Once device is running in operational mode we can ignore failures */ + + /* Dump actual controller version */ + r = iwmbt_get_version(hdl, &ver); + if (r == 0) + iwmbt_dump_version(&ver); + + if (iwmbt_enter_manufacturer(hdl) < 0) + return 0; + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + (void)iwmbt_exit_manufacturer(hdl, IWMBT_MM_EXIT_ONLY); + + return 0; +} + + +/* + * Returns 0 on success. + */ +static int +handle_8260(libusb_device_handle *hdl, char *firmware_dir) +{ + int r; + uint32_t boot_param; + struct iwmbt_version ver; + struct iwmbt_boot_params params; + char *firmware_path = NULL; + + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + return 1; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); + + if (ver.fw_variant == FW_VARIANT_OPERATIONAL) { + iwmbt_info("Firmware has already been downloaded"); + return 0; + } + + if (ver.fw_variant != FW_VARIANT_BOOTLOADER){ + iwmbt_err("unknown fw_variant 0x%02x", (int) ver.fw_variant); + return 1; + } + + /* Read Intel Secure Boot Params */ + r = iwmbt_get_boot_params(hdl, ¶ms); + if (r < 0) { + iwmbt_debug("iwmbt_get_boot_params() failed!"); + return 1; + } + iwmbt_dump_boot_params(¶ms); + + /* Check if firmware fragments are ACKed with a cmd complete event */ + if (params.limited_cce != 0x00) { + iwmbt_err("Unsupported Intel firmware loading method (%u)", + params.limited_cce); + return 1; + } + + firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "sfi"); + if (firmware_path == NULL) + return 1; + iwmbt_debug("firmware_path = %s", firmware_path); + + /* Download firmware and parse it for magic Intel Reset parameter */ + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, 0, 0); + free(firmware_path); + if (r < 0) + return 1; + + iwmbt_info("Firmware download complete"); + + r = iwmbt_intel_reset(hdl, boot_param); + if (r < 0) { + iwmbt_debug("iwmbt_intel_reset() failed!"); + return 1; + } + + iwmbt_info("Firmware operational"); + + /* Once device is running in operational mode we can ignore failures */ + + /* Dump actual controller version */ + r = iwmbt_get_version(hdl, &ver); + if (r == 0) + iwmbt_dump_version(&ver); + + /* Apply the device configuration (DDC) parameters */ + firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "ddc"); + iwmbt_debug("ddc_path = %s", firmware_path); + if (firmware_path != NULL) { + r = iwmbt_init_ddc(hdl, firmware_path); + if (r == 0) + iwmbt_info("DDC download complete"); + free(firmware_path); + } + + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + + return 0; +} + + +static int +handle_9260(libusb_device_handle *hdl, char *firmware_dir) +{ + int r; + uint32_t boot_param; + struct iwmbt_version vl; + struct iwmbt_version_tlv vt; + char *firmware_path = NULL; + + r = iwmbt_get_version_tlv(hdl, &vt); + if (r < 0) { + iwmbt_debug("iwmbt_get_version_tlv() failed code %d", r); + return 1; + } + iwmbt_dump_version_tlv(&vt); + iwmbt_debug("img_type=0x%02x", (int) vt.img_type); + + if (vt.img_type == TLV_IMG_TYPE_OPERATIONAL) { + iwmbt_info("Firmware has already been downloaded"); + return 0; + } + + if (vt.img_type != TLV_IMG_TYPE_BOOTLOADER) { + iwmbt_err("unknown img_type 0x%02x", (int) vt.img_type); + return 1; + } + + /* Check if firmware fragments are ACKed with a cmd complete event */ + if (vt.limited_cce != 0x00) { + iwmbt_err("Unsupported Intel firmware loading method (%u)", + vt.limited_cce); + return 1; + } + + /* Check if secure boot engine is supported: 1 (ECDSA) or 0 (RSA) */ + if (vt.sbe_type > 0x01) { + iwmbt_err("Unsupported secure boot engine (%u)", + vt.sbe_type); + return 1; + } + + firmware_path = iwmbt_get_fwname_tlv(&vt, firmware_dir, "sfi"); + if (firmware_path == NULL) + return 1; + iwmbt_debug("firmware_path = %s", firmware_path); + + /* Download firmware and parse it for magic Intel Reset parameter */ + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, + vt.cnvi_bt >> 16 & 0x3f, vt.sbe_type); + free(firmware_path); + if (r < 0) + return 1; + + iwmbt_info("Firmware download complete"); + + r = iwmbt_intel_reset(hdl, boot_param); + if (r < 0) { + iwmbt_debug("iwmbt_intel_reset() failed!"); + return 1; + } + + iwmbt_info("Firmware operational"); + + /* Once device is running in operational mode we can ignore failures */ + + r = iwmbt_get_version(hdl, &vl); + if (r == 0) + iwmbt_dump_version(&vl); + + /* Apply the device configuration (DDC) parameters */ + firmware_path = iwmbt_get_fwname_tlv(&vt, firmware_dir, "ddc"); + iwmbt_debug("ddc_path = %s", firmware_path); + if (firmware_path != NULL) { + r = iwmbt_init_ddc(hdl, firmware_path); + if (r == 0) + iwmbt_info("DDC download complete"); + free(firmware_path); + } + + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + + return 0; +} + + int main(int argc, char *argv[]) { libusb_context *ctx = NULL; libusb_device *dev = NULL; libusb_device_handle *hdl = NULL; - static struct iwmbt_version ver; - static struct iwmbt_version_tlv ver_tlv; - static struct iwmbt_boot_params params; - uint32_t boot_param; int r; uint8_t bus_id = 0, dev_id = 0; int devid_set = 0; int n; char *firmware_dir = NULL; - char *firmware_path = NULL; int retcode = 1; enum iwmbt_device iwmbt_device; @@ -494,256 +740,30 @@ main(int argc, char *argv[]) goto shutdown; } - if (iwmbt_device == IWMBT_DEVICE_7260) { - - /* Get Intel version */ - r = iwmbt_get_version(hdl, &ver); - if (r < 0) { - iwmbt_debug("iwmbt_get_version() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version(&ver); - iwmbt_debug("fw_patch_num=0x%02x", (int) ver.fw_patch_num); - - /* fw_patch_num = >0 operational mode */ - if (ver.fw_patch_num > 0x00) { - iwmbt_info("Firmware has already been downloaded"); - retcode = 0; - goto reset; - } - - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "bseq"); - if (firmware_path == NULL) - goto shutdown; - - iwmbt_debug("firmware_path = %s", firmware_path); - - /* Check firmware file exists before changing HW mode */ - r = access(firmware_path, R_OK); - if (r) { - perror("Failed to open firmware"); - goto shutdown; - } - - /* Enter manufacturer mode */ - r = iwmbt_enter_manufacturer(hdl); - if (r < 0) { - iwmbt_debug("iwmbt_enter_manufacturer() failed code %d", r); - goto shutdown; - } - - /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_patch_firmware(hdl, firmware_path); - free(firmware_path); - if (r < 0) { - (void)iwmbt_exit_manufacturer(hdl, 0x01); - goto shutdown; - } - - iwmbt_info("Firmware download complete"); - - /* Exit manufacturer mode */ - r = iwmbt_exit_manufacturer(hdl, r == 0 ? 0x00 : 0x02); - if (r < 0) { - iwmbt_debug("iwmbt_exit_manufacturer() failed code %d", r); - goto shutdown; - } - - /* Once device is running in operational mode we can ignore failures */ - retcode = 0; - - /* Execute Read Intel Version one more time */ - r = iwmbt_get_version(hdl, &ver); - if (r == 0) - iwmbt_dump_version(&ver); - - /* Set Intel Event mask */ - if (iwmbt_enter_manufacturer(hdl) < 0) - goto reset; - r = iwmbt_set_event_mask(hdl); - if (r == 0) - iwmbt_info("Intel Event Mask is set"); - (void)iwmbt_exit_manufacturer(hdl, 0x00); - - } else if (iwmbt_device == IWMBT_DEVICE_8260) { - - /* Get Intel version */ - r = iwmbt_get_version(hdl, &ver); - if (r < 0) { - iwmbt_debug("iwmbt_get_version() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version(&ver); - iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); - - /* fw_variant = 0x06 bootloader mode / 0x23 operational mode */ - if (ver.fw_variant == 0x23) { - iwmbt_info("Firmware has already been downloaded"); - retcode = 0; - goto reset; - } - - if (ver.fw_variant != 0x06){ - iwmbt_err("unknown fw_variant 0x%02x", (int) ver.fw_variant); - goto shutdown; - } - - /* Read Intel Secure Boot Params */ - r = iwmbt_get_boot_params(hdl, ¶ms); - if (r < 0) { - iwmbt_debug("iwmbt_get_boot_params() failed!"); - goto shutdown; - } - iwmbt_dump_boot_params(¶ms); - - /* Check if firmware fragments are ACKed with a cmd complete event */ - if (params.limited_cce != 0x00) { - iwmbt_err("Unsupported Intel firmware loading method (%u)", - params.limited_cce); - goto shutdown; - } - - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "sfi"); - if (firmware_path == NULL) - goto shutdown; - - iwmbt_debug("firmware_path = %s", firmware_path); - - /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, 0, 0); - free(firmware_path); - if (r < 0) - goto shutdown; - - iwmbt_info("Firmware download complete"); - - r = iwmbt_intel_reset(hdl, boot_param); - if (r < 0) { - iwmbt_debug("iwmbt_intel_reset() failed!"); - goto shutdown; - } - - iwmbt_info("Firmware operational"); - - /* Once device is running in operational mode we can ignore failures */ - retcode = 0; - - /* Execute Read Intel Version one more time */ - r = iwmbt_get_version(hdl, &ver); - if (r == 0) - iwmbt_dump_version(&ver); - - /* Apply the device configuration (DDC) parameters */ - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "ddc"); - iwmbt_debug("ddc_path = %s", firmware_path); - if (firmware_path != NULL) { - r = iwmbt_init_ddc(hdl, firmware_path); - if (r == 0) - iwmbt_info("DDC download complete"); - free(firmware_path); - } - - /* Set Intel Event mask */ - r = iwmbt_set_event_mask(hdl); - if (r == 0) - iwmbt_info("Intel Event Mask is set"); - - } else { - - /* Get Intel version */ - r = iwmbt_get_version_tlv(hdl, &ver_tlv); - if (r < 0) { - iwmbt_debug("iwmbt_get_version_tlv() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version_tlv(&ver_tlv); - iwmbt_debug("img_type=0x%02x", (int) ver_tlv.img_type); - - /* img_type = 0x01 bootloader mode / 0x03 operational mode */ - if (ver_tlv.img_type == 0x03) { - iwmbt_info("Firmware has already been downloaded"); - retcode = 0; - goto reset; - } - - if (ver_tlv.img_type != 0x01){ - iwmbt_err("unknown img_type 0x%02x", (int) ver_tlv.img_type); - goto shutdown; - } - - /* Check if firmware fragments are ACKed with a cmd complete event */ - if (ver_tlv.limited_cce != 0x00) { - iwmbt_err("Unsupported Intel firmware loading method (%u)", - ver_tlv.limited_cce); - goto shutdown; - } - - /* Check if secure boot engine is supported: 1 (ECDSA) or 0 (RSA) */ - if (ver_tlv.sbe_type > 0x01) { - iwmbt_err("Unsupported secure boot engine (%u)", - ver_tlv.sbe_type); - goto shutdown; - } - - firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "sfi"); - if (firmware_path == NULL) - goto shutdown; - - iwmbt_debug("firmware_path = %s", firmware_path); - - /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, - ver_tlv.cnvi_bt >> 16 & 0x3f, ver_tlv.sbe_type); - free(firmware_path); - if (r < 0) - goto shutdown; - - r = iwmbt_intel_reset(hdl, boot_param); - if (r < 0) { - iwmbt_debug("iwmbt_intel_reset() failed!"); - goto shutdown; - } - - iwmbt_info("Firmware operational"); - - /* Once device is running in operational mode we can ignore failures */ - retcode = 0; - - /* Execute Read Intel Version one more time */ - r = iwmbt_get_version(hdl, &ver); - if (r == 0) - iwmbt_dump_version(&ver); - - /* Apply the device configuration (DDC) parameters */ - firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "ddc"); - iwmbt_debug("ddc_path = %s", firmware_path); - if (firmware_path != NULL) { - r = iwmbt_init_ddc(hdl, firmware_path); - if (r == 0) - iwmbt_info("DDC download complete"); - free(firmware_path); - } - - /* Set Intel Event mask */ - r = iwmbt_set_event_mask(hdl); - if (r == 0) - iwmbt_info("Intel Event Mask is set"); - - iwmbt_info("Firmware download complete"); + switch(iwmbt_device) { + case IWMBT_DEVICE_7260: + retcode = handle_7260(hdl, firmware_dir); + break; + case IWMBT_DEVICE_8260: + retcode = handle_8260(hdl, firmware_dir); + break; + case IWMBT_DEVICE_9260: + retcode = handle_9260(hdl, firmware_dir); + break; + default: + iwmbt_err("FIXME: unknown iwmbt type %d", (int)iwmbt_device); + retcode = 1; } -reset: - - /* Ask kernel driver to probe and attach device again */ - r = libusb_reset_device(hdl); - if (r != 0) - iwmbt_err("libusb_reset_device() failed: %s", - libusb_strerror(r)); + if (retcode == 0) { + /* Ask kernel driver to probe and attach device again */ + r = libusb_reset_device(hdl); + if (r != 0) + iwmbt_err("libusb_reset_device() failed: %s", + libusb_strerror(r)); + } shutdown: - - /* Shutdown */ - if (hdl != NULL) libusb_close(hdl); From nobody Sat Mar 1 09:39:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4g5n26P3z5p7sD; Sat, 01 Mar 2025 09:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5m5M3Jz3HKV; Sat, 01 Mar 2025 09:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fJrs1/8ff5aukNSrWAyn172ArOrYYWsmAOhFWmEpi4o=; b=iKOkIFjPHaFPf+pyz6e/tJoloQl2FE53Czk4AP9hE5onwO3vyMdBFKfqOs5At0lCaru0ng JI0mttvZ+bCbgBOblkPYxnA8+/L9e/6mB/MYBuBjU5HzaOauzEcQAKrnxjXy84SBfO2yjO anNZcVay1xxygH3xGnKPrbFLcN1NIks4edzeiOiYuhdc65n8m87bkmA2WwXTcH6D2l1O/N cbqr25nhRJZwLz7CYor7DymagGsGJcLrByGr9+qxkiP1OgGya8c7PiyFjxFSyBYV7zMChr r4zwMNakmtahySmmeDP3kspxVhTkYO7XGXzvmlU/KfiRAzaPFKCpPBitxVZ8XA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821980; a=rsa-sha256; cv=none; b=hn+rX7h/0Mbe6fNEW29Nhy+NuAFPWkR7jTe5auOIAtbxOtn1Z15Y4Q9DDs749o1oxqUkh6 U3HMcLX7g+eMsOthSLsi+Sc7ljosNtdfvxjLDseXs6o2TO31voATJBPYpvPBP1o5skJJOZ pww3cSGouApDeSGl/et0cSuNT4yUCSuJPnip673bVyoRRGAXWDZ7Sl1ZmfTscuXdev92Dd rfW5QIyxP/gais75ot/d0bIJsL271DkICdETpZCM+EJjDNWlTk3C7B2UbhxTXBAc1GYL7j Lf+tgbD8N1qnCnLsaszp/ho3h7l3pF3LEOX+NBBPCfM1pTnCCNZsA2mX+55QrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fJrs1/8ff5aukNSrWAyn172ArOrYYWsmAOhFWmEpi4o=; b=pMHv9cX+DCfoQ8b2wl2htv47eodCR3fU+2iWQJLQm7QbOEg0kzXJBjSf6Psyr49mvtS30n BrbgfADQzJMYKd0ufwwRX8JxZL0FjHGELYXhqqt1TtWI5JVdzUBX2KwzVXSS8ZIQtSlj+A Te6yxV7j5DcgBqopIjbIzrhI0Tsr1kjvWhg3ISA5L6OTN/4vzdqATEhsFFdnZclLHXICEo 8LabC1+PI1Q5Xn/RQ+75QRT1iUYfnD/fWaGESQxinY6Brv9WX0OGXK4xYhsNE+NPEEmVAq J5/F78Wc1QZgw1itU8S/EfTaXtY5BiscjbsM20mwLuMPfi47zsC6V/AXqD5w0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4g5m2jWxz181q; Sat, 01 Mar 2025 09:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219de58084620; Sat, 1 Mar 2025 09:39:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219denA084617; Sat, 1 Mar 2025 09:39:40 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:40 GMT Message-Id: <202503010939.5219denA084617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: f2591781f354 - stable/14 - iwmbtfw(8): don't program hardware without existing firmware image List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2591781f354b6602927e53084af61721f0a2dd7 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f2591781f354b6602927e53084af61721f0a2dd7 commit f2591781f354b6602927e53084af61721f0a2dd7 Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:26 +0000 iwmbtfw(8): don't program hardware without existing firmware image One should not start firmware update sequence just to understand that there is no firmware image to program: update sequence for 7260 requires leaving manufacturing mode and in the case of missing firmware file it will trigger complete re-initialization of BT adapter. Which, in turn, will make the USB device to go away and reappear. Since devd(8) has hooks for USB device attachment, in the case of missing firmware it used to - trigger the (failing) firmware download, - which triggers device reset, - which creates USB notification and devd(8) kicks back in. Nice infinite cycle with many notifications via syslog: {{{ Jan 3 09:00:01 kernel: ugen0.2: at usbus0 Jan 3 09:00:01 kernel: ugen0.2: at usbus0 (disconnected) Jan 3 09:00:02 kernel: ugen0.2: at usbus0 Jan 3 09:00:02 kernel: ugen0.2: at usbus0 (disconnected) }}} Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit ff4116313eb4a5e6c24a688edf5df1e19eb82042) --- usr.sbin/bluetooth/iwmbtfw/main.c | 41 +++++++++++++-------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 497edcb254cf..7af07bb68322 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -226,30 +226,6 @@ iwmbt_dump_version_tlv(struct iwmbt_version_tlv *ver) ver->build_num); } -static int -iwmbt_patch_firmware(libusb_device_handle *hdl, const char *firmware_path) -{ - struct iwmbt_firmware fw; - int ret; - - iwmbt_debug("loading %s", firmware_path); - - /* Read in the firmware */ - if (iwmbt_fw_read(&fw, firmware_path) <= 0) { - iwmbt_debug("iwmbt_fw_read() failed"); - return (-1); - } - - /* Load in the firmware */ - ret = iwmbt_patch_fwfile(hdl, &fw); - if (ret < 0) - iwmbt_debug("Loading firmware file failed"); - - /* free it */ - iwmbt_fw_free(&fw); - - return (ret); -} static int iwmbt_init_firmware(libusb_device_handle *hdl, const char *firmware_path, @@ -402,6 +378,7 @@ usage(void) } + /* * Returns 0 on success. */ @@ -409,8 +386,9 @@ static int handle_7260(libusb_device_handle *hdl, char *firmware_dir) { int r; + char *firmware_path; struct iwmbt_version ver; - char *firmware_path = NULL; + struct iwmbt_firmware fw; r = iwmbt_get_version(hdl, &ver); if (r < 0) { @@ -431,16 +409,25 @@ handle_7260(libusb_device_handle *hdl, char *firmware_dir) return 1; iwmbt_debug("firmware_path = %s", firmware_path); + r = iwmbt_fw_read(&fw, firmware_path); + free(firmware_path); + if (r <= 0) { + iwmbt_debug("iwmbt_fw_read() failed"); + return 1; + } + r = iwmbt_enter_manufacturer(hdl); if (r < 0) { iwmbt_debug("iwmbt_enter_manufacturer() failed code %d", r); + iwmbt_fw_free(&fw); return 1; } /* Download firmware */ - r = iwmbt_patch_firmware(hdl, firmware_path); - free(firmware_path); + r = iwmbt_patch_fwfile(hdl, &fw); + iwmbt_fw_free(&fw); if (r < 0) { + iwmbt_debug("Loading firmware file failed"); (void)iwmbt_exit_manufacturer(hdl, IWMBT_MM_EXIT_COLD_RESET); return 1; } From nobody Sat Mar 1 09:39:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4g5p3Ty4z5p7vt; Sat, 01 Mar 2025 09:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5n3p52z3Hdf; Sat, 01 Mar 2025 09:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8LmgIqvFBmVOHJKVYF7xR8iyYk8U2ipNlty1qhNt9w=; b=ElXiqWP9OlfnEi0dnFDS2gexza2xbqby+wpCGQH6dl/2qzSPMkp2ztbPXrHjZPIW5HnJta ettUtvyVyQo/FwYHVFwtWRWp7pbHbvLmSl2/H/kpLry7/wFU1DFRt7EfgM9zuALqOoZJU6 bL0gBo6kHz99K36WX7TdYEUhdq1XliPUUdt9QZVA/h1zUSFuxO1YdIyprh7vzU2JSUVjTK HyvmgdL20kyibrfGcvBtHw8KN/3gD3BngM1tV83FZGVdwgx8HSi0eHk5+syBJXA5G6lvOq wTRFUKO0iudmFeuogAcr563L5TmBKpbBVn9l6+h6RoHPoyT35ek/jc03jxDqvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821981; a=rsa-sha256; cv=none; b=Btlw4g3XaVbU2E8mmBMWt/w97r0mauRF01tDwsdW+S82UaHAq1LRDCQNvQwSD0l8caP3o2 Fit9BLm3Y+4G5GSJ+5v7yHZVBmw1SKUZcuZyVJOPPnlCR3bJ1CPw+4YNVOdhTXWD19pMs7 6RmbFkXiZLKbUbgjj3poAjly7dTRcfS9/SsAClevene+MG1k+FYMK/OysVGB9WEvfZf0Sw GOfQFZFIgN9Z3XQo/x/0+sSnxn44DXX5z529rooKq37Pua+uNG/SpDMwjnQbQ/EJ7ApMc3 qmdoZq7Nx5aP3rPAelKxt5GiyJ8Gnx2pyJa8cLb8ECRy+i/rfSw6e9nAl16rYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8LmgIqvFBmVOHJKVYF7xR8iyYk8U2ipNlty1qhNt9w=; b=qfARlNCF7J3PYPkLN5lbuW9Tu/+yAKF9OJVkWqBHlsHodYYjbGn/CEqcdEVhv+nnR+m7qg 4+ZpX7ATCzRbvu6agqBbrzr+ygozUVzGDssXXEG6tlYSTqFsmvaWWzHF3lp4GYAzaiLFo3 P5SmOE4YaQMWAD2/W26vdIjN1Xo0z0Hw6VMt+rk0BVTd8/5+QVs71Urk5o/oieQ3ZxJQ97 omqQm+NnAuBF2zKIE9BpFE4IMbS4lbO6A156NUqGI473VtHgpU8xGHRJSK96L92iOB0e0e V4F3zHphXlXREjW35Xi9o/hHe1grd/STYt1mvdbkGYFeQdUB2sXNTngohR8fXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4g5n3NWLz18VD; Sat, 01 Mar 2025 09:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219df7k084656; Sat, 1 Mar 2025 09:39:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219dfQg084653; Sat, 1 Mar 2025 09:39:41 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:41 GMT Message-Id: <202503010939.5219dfQg084653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 666f8246c392 - stable/14 - iwmbtfw(8): fix getopt flags, unify usage()/manual page contents List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 666f8246c39251e70f2a676bd1775f3563e73b1c Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=666f8246c39251e70f2a676bd1775f3563e73b1c commit 666f8246c39251e70f2a676bd1775f3563e73b1c Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:39 +0000 iwmbtfw(8): fix getopt flags, unify usage()/manual page contents Seems like there was an intention to use command line switches -m, -p and -v (each with argument), but there is no handling for them. Also, some enhancements to the usage()/manpage: - use FreeBSD manpage style -- square brackets -- for denoting optional arguments in usage(); - show default directory path in usage(); - update manual: -f is the optional flag; - show descriptions for -I/-D together: they are logically related. Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit 0feaf865ce8e333f834177a5656e57b5e32ad5cf) --- usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 | 6 +++--- usr.sbin/bluetooth/iwmbtfw/main.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 index 2ce828cb5ebe..87f34435d3f4 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 @@ -36,7 +36,7 @@ .Nm .Op Fl DI .Fl d Ar device_name -.Fl f Ar firmware_path +.Op Fl f Ar firmware_path .Nm .Fl h .Sh DESCRIPTION @@ -66,6 +66,8 @@ configuration to load in at runtime. .Pp The options are as follows: .Bl -tag -width "-f firmware_path" +.It Fl I +Enable informational debugging. .It Fl D Enable verbose debugging. .It Fl d Ar device_name @@ -76,8 +78,6 @@ device name. Specify the directory containing the firmware files to search and upload. .It Fl h Display usage message and exit. -.It Fl I -Enable informational debugging. .El .Sh EXIT STATUS .Ex -std diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 7af07bb68322..b27c5ad62239 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -369,10 +369,11 @@ static void usage(void) { fprintf(stderr, - "Usage: iwmbtfw (-D) -d ugenX.Y (-f firmware path) (-I)\n"); + "Usage: iwmbtfw [-DI] -d ugenX.Y [-f firmware path]\n"); fprintf(stderr, " -D: enable debugging\n"); fprintf(stderr, " -d: device to operate upon\n"); - fprintf(stderr, " -f: firmware path, if not default\n"); + fprintf(stderr, " -f: firmware path (defaults to %s)\n", + _DEFAULT_IWMBT_FIRMWARE_PATH); fprintf(stderr, " -I: enable informational output\n"); exit(127); } @@ -652,7 +653,7 @@ main(int argc, char *argv[]) enum iwmbt_device iwmbt_device; /* Parse command line arguments */ - while ((n = getopt(argc, argv, "Dd:f:hIm:p:v:")) != -1) { + while ((n = getopt(argc, argv, "Dd:f:hI")) != -1) { switch (n) { case 'd': /* ugen device name */ devid_set = 1; From nobody Sat Mar 1 13:35:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4mL567WFz5VjRL; Sat, 01 Mar 2025 13:35:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4mL524NPz3fNH; Sat, 01 Mar 2025 13:35:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740836141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEYO6t3Utso/Y5K5ZOoDoJT03gao8Aj/qF3uVSHaEYY=; b=vy7qIoCC+CZs6xQH9izuN4IGOVsNUjsZJ5cWCyMatcS1YfGj2ntsXHWQdyH33TqmAeEEL9 nOsru5VYPayuGHvmz7t0HnpayTxAxMiYM87cCULny6jG/2Voersy09UJR8/lijWWNqnJln teVQ0B76LjdLTTRl7LRSNrPLy9UXKWpR7+SIckOE6EkthSFfePEDl3gEgYEqX0XVs8nzX6 NH+XKLEJaiB0iqMEIeBLb2eqEiwjj+F7DWojyq5dUymZEwcfwZm0Iu4sn1vRuGjDlk2BIU 2BOfhAsLVCIFsYAlyPvmav7IgYBS0eIftABsBaD8VLJAmfc8s13G8l1BZ4VGVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740836141; a=rsa-sha256; cv=none; b=ZXhWCaM75DAvtOOojiTgvXqn++0MUsR2GRW+gI+3j0ksa5acG0VnZ9UXa4v4q4WYqNccS3 +h3QEzG2u5CpqXSpxrHirgehZMcj521slQe4xzo+a0nHCGhG8gCm2o5PBYvKIGD7cGsKOc sfF8ftp5kMrlSTx9w3Y5kbefyK0YF8KxyvNxx+guPjteo4j8TtzrJHJ4qiIl+QirlZxjao KtG5cFPrcQLNRtBktRUtD8Caf0YxB9VwPqM90UPQHodxuFFLRZxTOzx5ajEEqngC3kxOVk 5Y/6hC+fGKDKUIhOBF2ErFVVeTMiDn/F+b9K2hW1nlU1/3YkhMgclkL/5HQwzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740836141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEYO6t3Utso/Y5K5ZOoDoJT03gao8Aj/qF3uVSHaEYY=; b=TkxgTfwsYESy/7LtS2Q8fXFk+lG9+8Xl25g+xxN75SsLKy24aWvx9ayoxIj1WxbMPaDoI1 2KGYUkQEJ10qYPKWyBAhaB+K3C4W7F7/ViCv04QoMU5prOXBjs4I65f522eCNeBnPN2n16 CYsdsb4n0Xmlu2uPuCoh/U0f4pTb0lPuAbTnPUBym0DJtk/W6BDg9cxA/MBpLMuEyEYfKL ExUFjzZJYzXFBnGdPoh6K1kAvZ8b88ZoWxp2mrJuxieg2wvwBapBwejtXTZykNGDETKeAw YLiJp68jw584R+7cbQAZTiwD221a1UEyBcrSXHp+C25hY0hOi5RyO923DIxVqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4mL51Zk6z2pt; Sat, 01 Mar 2025 13:35:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521DZfkI030948; Sat, 1 Mar 2025 13:35:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521DZf8X030945; Sat, 1 Mar 2025 13:35:41 GMT (envelope-from git) Date: Sat, 1 Mar 2025 13:35:41 GMT Message-Id: <202503011335.521DZf8X030945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a18be39aafc1 - main - makefs: Initialize cd9660 inode map only once List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a18be39aafc1b55fd67603ee6a6d820d0fcd877f Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a18be39aafc1b55fd67603ee6a6d820d0fcd877f commit a18be39aafc1b55fd67603ee6a6d820d0fcd877f Author: Ed Maste AuthorDate: 2025-03-01 13:30:52 +0000 Commit: Ed Maste CommitDate: 2025-03-01 13:35:15 +0000 makefs: Initialize cd9660 inode map only once Error introduced during a refactoring; cd9660_susp_initialize calls itself recursively. Sponsred by: The FreeBSD Foundation Fixes: 35a2e286157a ("makefs: Record inode for all entries in mtree mode") --- usr.sbin/makefs/cd9660/iso9660_rrip.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c index 1b8ce42da4c0..31c6e38a96fe 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.c +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -70,8 +70,10 @@ cd9660_susp_initialize(iso9660_disk *diskStructure, cd9660node *node, if (node->dot_dot_record != 0) TAILQ_INIT(&(node->dot_dot_record->head)); - RB_INIT(&diskStructure->rr_inode_map); - diskStructure->rr_inode_next = 1; + 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) @@ -121,11 +123,15 @@ cd9660_susp_finalize(iso9660_disk *diskStructure, cd9660node *node) if ((r = cd9660_susp_finalize(diskStructure, temp)) < 0) return r; } - RB_FOREACH_SAFE(mapnode, inode_map_tree, - &(diskStructure->rr_inode_map), mapnodetmp) { - RB_REMOVE(inode_map_tree, &(diskStructure->rr_inode_map), - mapnode); - free(mapnode); + + if (diskStructure->rr_inode_next != 0) { + RB_FOREACH_SAFE(mapnode, inode_map_tree, + &(diskStructure->rr_inode_map), mapnodetmp) { + RB_REMOVE(inode_map_tree, + &(diskStructure->rr_inode_map), mapnode); + free(mapnode); + } + diskStructure->rr_inode_next = 0; } return 1; } From nobody Sat Mar 1 21:41:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4z793Wygz5ppMp; Sat, 01 Mar 2025 21:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4z790zZMz3RgY; Sat, 01 Mar 2025 21:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740865317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J0cjA/mOD/DPQ3FQCekvYfCQrx0nLa7iWfXBjelGG4k=; b=B4SEj9imI22gPXM3Z75ZV8qZl8tnLBlZhg7x3Jrkam3WP7cPyk6y21xfImxJU9MHf9HfmB kTq0PPocR2fUHkGgiJFjeVv5Ofk8s7B08LpophyUUdhZvtFpUFe7DhdQBLDlmVSXJGtUc/ lHmPP/HFDdLHSJNDibcDcDbpXvnOs9TQyMHt8o3y03Uz9KFpI6ViPLgoZQKvcl7hpsyt4y f1lb4pT9fcZkgXusCVb7fIAjGM0xRh9OVQljc5JB+mIChop8Q/GovEUYG6JY6MD46jRREp W6yh+Dpd0hgrK3wVEXzQFag3+CXr3gQ2eZRDLWTKWKw/i1NhrogYFnGp9IGu5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740865317; a=rsa-sha256; cv=none; b=c6B7UI5MiJqIcip1dbGlvJox2/cxqEymwRDXbldFMj4WL767WmPfJRKMHObr8riA7YWVxW Y3iIfewbUZbB5SZaxWMmFWKCMoeX7aawFyn6aoX1s9krtd4MuFGk7gc1w/EZcFNT2aWZyV 0rUdtgX4D/Bwn6D1KMq5ItttJ6xGi4IoNavWF06WTQ/GYtN4gGC+jeh42DGGBHgE122zxb 1P6YkbDeMM1fmid6dHLj9c1rPttkm5AhIW7NfCw/L+vLmWx2k2nWzrRPfByV7ArjTHCfGO SqpYKaRq9yYylPrqXnvAlpbcsCkMmB9WPpfDbK0vG/8aWXYwoUsb3x115xn+tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740865317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J0cjA/mOD/DPQ3FQCekvYfCQrx0nLa7iWfXBjelGG4k=; b=Quy62OS2pRG30BRGxs/+RS1gXdwykITAHs32dahQzFcIR2wQTfbAEIU3KqTLHO9/7C7pGe NhWTKKx8W9FIXvadtq+fVFfmZm+gvt/i7Uqa8xg8P3xCFLunGJzHyYJJ+XflojRcWJGmJh 7CX+TMMDnj+MXOd68/XxWFmRYI1UECNtLW4aEjnmQJlfR6MhZIGs2EFFUK9ZYYxmjZW/ws I9BaWK3agvrAwtsTs0cedBTg2/mc8gYg4ek1pVM2u2Nfz9i/Q7IPyOdib9X3HgxPEr7h6e IwsOfdzWE6WSDQNoxy4/HBOemsALL4LYc213bYHxSdmyywSNa8fKBH4dRZBxuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4z790M30zYjm; Sat, 01 Mar 2025 21:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521Lfuuv045737; Sat, 1 Mar 2025 21:41:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521LfuuA045734; Sat, 1 Mar 2025 21:41:56 GMT (envelope-from git) Date: Sat, 1 Mar 2025 21:41:56 GMT Message-Id: <202503012141.521LfuuA045734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: c21c8a10d739 - main - IfAPI: Update ifnet(9) man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c21c8a10d7390f59a852b8689f1de951c2e955a5 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=c21c8a10d7390f59a852b8689f1de951c2e955a5 commit c21c8a10d7390f59a852b8689f1de951c2e955a5 Author: Justin Hibbits AuthorDate: 2023-04-13 15:27:36 +0000 Commit: Justin Hibbits CommitDate: 2025-03-01 21:40:35 +0000 IfAPI: Update ifnet(9) man page Add starting documentation of the IfAPI to the ifnet(9) page. This replaces the existing struct ifnet documentation, since it's to be treated as opaque now. Reviewed by: #manpages, adrian, ziaee Differential Revision: https://reviews.freebsd.org/D47931 --- share/man/man9/Makefile | 3 + share/man/man9/ifnet.9 | 599 ++++++++++++++++++++++++++++-------------------- 2 files changed, 351 insertions(+), 251 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index ed9f2a9b9ede..8a3c36b0f8aa 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1373,6 +1373,9 @@ MLINKS+=ifnet.9 if_addmulti.9 \ ifnet.9 ifqueue.9 \ ifnet.9 ifunit.9 \ ifnet.9 ifunit_ref.9 +# IfAPI +MLINKS+=ifnet.9 ifapi.9 + MLINKS+=insmntque.9 insmntque1.9 MLINKS+=intr_event.9 intr_event_add_handler.9 \ intr_event.9 intr_event_create.9 \ diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9 index 69804a754b3a..3c45e4f29e2d 100644 --- a/share/man/man9/ifnet.9 +++ b/share/man/man9/ifnet.9 @@ -26,10 +26,11 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Nov 12, 2024 +.Dd December 10, 2024 .Dt IFNET 9 .Os .Sh NAME +.Nm if_t , .Nm ifnet , .Nm ifaddr , .Nm ifqueue , @@ -44,34 +45,34 @@ .In net/if_types.h .\" .Ss "Interface Manipulation Functions" -.Ft "struct ifnet *" +.Ft "if_t" .Fn if_alloc "u_char type" -.Ft "struct ifnet *" +.Ft "if_t" .Fn if_alloc_dev "u_char type" "device_t dev" -.Ft "struct ifnet *" +.Ft "if_t" .Fn if_alloc_domain "u_char type" "int numa_domain" .Ft void -.Fn if_attach "struct ifnet *ifp" +.Fn if_attach "if_t ifp" .Ft void -.Fn if_detach "struct ifnet *ifp" +.Fn if_detach "if_t ifp" .Ft void -.Fn if_free "struct ifnet *ifp" +.Fn if_free "if_t ifp" .Ft void -.Fn if_free_type "struct ifnet *ifp" "u_char type" +.Fn if_free_type "if_t ifp" "u_char type" .Ft void -.Fn if_down "struct ifnet *ifp" +.Fn if_down "if_t ifp" .Ft int .Fn ifioctl "struct socket *so" "u_long cmd" "caddr_t data" "struct thread *td" .Ft int -.Fn ifpromisc "struct ifnet *ifp" "int pswitch" +.Fn ifpromisc "if_t ifp" "int pswitch" .Ft int -.Fn if_allmulti "struct ifnet *ifp" "int amswitch" -.Ft "struct ifnet *" +.Fn if_allmulti "if_t ifp" "int amswitch" +.Ft "if_t" .Fn ifunit "const char *name" -.Ft "struct ifnet *" +.Ft "if_t" .Fn ifunit_ref "const char *name" .Ft void -.Fn if_up "struct ifnet *ifp" +.Fn if_up "if_t ifp" .\" .Ss "Interface Address Functions" .Ft "struct ifaddr *" @@ -81,7 +82,7 @@ .Ft "struct ifaddr *" .Fn ifa_ifwithnet "struct sockaddr *addr" "int ignore_ptp" "int fib" .Ft "struct ifaddr *" -.Fn ifaof_ifpforaddr "struct sockaddr *addr" "struct ifnet *ifp" +.Fn ifaof_ifpforaddr "struct sockaddr *addr" "if_t ifp" .Ft void .Fn ifa_ref "struct ifaddr *ifa" .Ft void @@ -89,35 +90,221 @@ .\" .Ss "Interface Multicast Address Functions" .Ft int -.Fn if_addmulti "struct ifnet *ifp" "struct sockaddr *sa" "struct ifmultiaddr **ifmap" +.Fn if_addmulti "if_t ifp" "struct sockaddr *sa" "struct ifmultiaddr **ifmap" .Ft int -.Fn if_delmulti "struct ifnet *ifp" "struct sockaddr *sa" +.Fn if_delmulti "if_t ifp" "struct sockaddr *sa" .Ft "struct ifmultiaddr *" -.Fn if_findmulti "struct ifnet *ifp" "struct sockaddr *sa" +.Fn if_findmulti "if_t ifp" "struct sockaddr *sa" +.Ss "Output queue accessors" +.Fn if_dequeue "if_t ifp" "struct mbuf *m" .Ss "Output queue macros" .Fn IF_DEQUEUE "struct ifqueue *ifq" "struct mbuf *m" .\" +.Ss "if_t accesors" +.Ft uint64_t +.Fn if_setbaudrate "if_t ifp" "uint64_t baudrate" +.Ft uint64_t +.Fn if_getbaudrate "const if_t ifp" +.Ft int +.Fn if_setcapabilities "if_t ifp" "int capabilities" +.Ft int +.Fn if_setcapabilitiesbit "if_t ifp" "int setbit" "int clearbit" +.Ft int +.Fn if_getcapabilities "const if_t ifp" +.Ft int +.Fn if_togglecapenable "if_t ifp" "int togglecap" +.Ft int +.Fn if_setcapenable "if_t ifp" "int capenable" +.Ft int +.Fn if_setcapenablebit "if_t ifp" "int setcap" "int clearcap" +.Ft int +.Fn if_getcapenable "const if_t ifp" +.Ft int +.Fn if_setcapabilities2 "if_t ifp" "int capabilities" +.Ft int +.Fn if_setcapabilities2bit "if_t ifp" "int setbit" "int clearbit" +.Ft int +.Fn if_getcapabilities2 "const if_t ifp" +.Ft int +.Fn if_togglecapenable2 "if_t ifp" "int togglecap" +.Ft int +.Fn if_setcapenable2 "if_t ifp" "int capenable" +.Ft int +.Fn if_setcapenable2bit "if_t ifp" "int setcap" "int clearcap" +.Ft int +.Fn if_getcapenable2 "const if_t ifp" +.Ft int +.Fn if_getdunit "const if_t ifp" +.Ft int +.Fn if_getindex "const if_t ifp" +.Ft int +.Fn if_getidxgen "const if_t ifp" +.Ft const char * +.Fn if_getdname "const if_t ifp" +.Ft void +.Fn if_setdname "if_t ifp" "const char *name" +.Ft const char * +.Fn if_name "if_t ifp" +.Ft int +.Fn if_setname "if_t ifp" "const char *name" +.Ft void +.Fn if_setdescr "if_t ifp" "char *descrbuf" +.Ft char * +.Fn if_allocdescr "size_t sz" "int malloc_flag" +.Ft void +.Fn if_freedescr "char *descrbuf" +.Ft int +.Fn if_getalloctype "const if_t ifp" +.Ft int +.Fn if_gettype "const if_t ifp" +.Ft int +.Fn if_setdev "if_t ifp" "void *dev" +.Ft int +.Fn if_setdrvflagbits "if_t ifp" "int if_setflags" "int clear_flags" +.Ft int +.Fn if_getdrvflags "const if_t ifp" +.Ft int +.Fn if_setdrvflags "if_t ifp" "int flags" +.Ft int +.Fn if_getlinkstate "if_t ifp" +.Ft int +.Fn if_clearhwassist "if_t ifp" +.Ft int +.Fn if_sethwassistbits "if_t ifp" "int toset" "int toclear" +.Ft int +.Fn if_sethwassist "if_t ifp" "int hwassist_bit" +.Ft int +.Fn if_gethwassist "const if_t ifp" +.Ft int +.Fn if_togglehwassist "if_t ifp" "int toggle_bits" +.Ft int +.Fn if_setsoftc "if_t ifp" "void *softc" +.Ft void * +.Fn if_getsoftc "if_t ifp" +.Ft void +.Fn if_setllsoftc "if_t ifp" "void *softc" +.Ft void * +.Fn if_getllsoftc "if_t ifp" +.Ft u_int +.Fn if_getfib "if_t ifp" +.Ft uint8_t +.Fn if_getaddrlen "if_t ifp" +.Ft int +.Fn if_gethwaddr "const if_t ifp" "struct ifreq *" +.Ft const uint8_t * +.Fn if_getbroadcastaddr "const if_t ifp" +.Ft void +.Fn if_setbroadcastaddr "if_t ifp" "const uint8_t *" +.Ft int +.Fn if_setmtu "if_t ifp" "int mtu" +.Ft int +.Fn if_getmtu "const if_t ifp" +.Ft int +.Fn if_getmtu_family "const if_t ifp" "int family" +.Ft void +.Fn if_notifymtu "if_t ifp" +.Ft int +.Fn if_setflagbits "if_t ifp" "int set" "int clear" +.Ft int +.Fn if_setflags "if_t ifp" "int flags" +.Ft int +.Fn if_getflags "const if_t ifp" +.Ft int +.Fn if_getnumadomain "if_t ifp" +.Ft int +.Fn if_sendq_empty "if_t ifp" +.Ft int +.Fn if_setsendqready "if_t ifp" +.Ft int +.Fn if_setsendqlen "if_t ifp" "int tx_desc_count" +.Ft int +.Fn if_sethwtsomax "if_t ifp" "u_int if_hw_tsomax" +.Ft int +.Fn if_sethwtsomaxsegcount "if_t ifp" "u_int if_hw_tsomaxsegcount" +.Ft int +.Fn if_sethwtsomaxsegsize "if_t ifp" "u_int if_hw_tsomaxsegsize" +.Ft u_int +.Fn if_gethwtsomax "const if_t ifp" +.Ft u_int +.Fn if_gethwtsomaxsegcount "const if_t ifp" +.Ft u_int +.Fn if_gethwtsomaxsegsize "const if_t ifp" +.Ft void +.Fn if_setnetmapadapter "if_t ifp" "struct netmap_adapter *na" +.Ft struct netmap_adapter * +.Fn if_getnetmapadapter "if_t ifp" +.Ft void +.Fn if_input "if_t ifp" "struct mbuf* sendmp" +.Ft int +.Fn if_sendq_prepend "if_t ifp" "struct mbuf *m" +.Ft struct mbuf * +.Fn if_dequeue "if_t ifp" +.Ft int +.Fn if_setifheaderlen "if_t ifp" "int len" +.Ft void +.Fn if_setrcvif "struct mbuf *m" "if_t ifp" +.Ft void +.Fn if_setvtag "struct mbuf *m" "u_int16_t tag" +.Ft u_int16_t +.Fn if_getvtag "struct mbuf *m" +.Ft int +.Fn if_vlantrunkinuse "if_t ifp" +.Ft caddr_t +.Fn if_getlladdr "const if_t ifp" +.Ft struct vnet * +.Fn if_getvnet "const if_t ifp" +.Ft void * +.Fn if_gethandle "u_char" +.Ft void +.Fn if_bpfmtap "if_t ifp" "struct mbuf *m" +.Ft void +.Fn if_etherbpfmtap "if_t ifp" "struct mbuf *m" +.Ft void +.Fn if_vlancap "if_t ifp" +.Ft int +.Fn if_transmit "if_t ifp" "struct mbuf *m" +.Ft void +.Fn if_init "if_t ifp" "void *ctx" +.Ft int +.Fn if_resolvemulti "if_t ifp" "struct sockaddr **" "struct sockaddr *" +.Ft uint64_t +.Fn if_getcounter "if_t ifp" "ift_counter counter" +.Ft struct label * +.Fn if_getmaclabel "if_t ifp" +.Ft void +.Fn if_setmaclabel "if_t ifp" "struct label *label" +.Ft struct bpf_if * +.Fn if_getbpf "if_t ifp" +.Ft uint8_t +.Fn if_getpcp "if_t ifp" +.Ft void * +.Fn if_getl2com "if_t ifp" +.Ft struct ifvlantrunk * +.Fn if_getvlantrunk "if_t ifp" +.Ft bool +.Fn if_altq_is_enabled "if_t ifp" +.\" .Ss "struct ifnet Member Functions" .Ft void -.Fn \*(lp*if_input\*(rp "struct ifnet *ifp" "struct mbuf *m" +.Fn \*(lp*if_input\*(rp "if_t ifp" "struct mbuf *m" .Ft int .Fo \*(lp*if_output\*(rp -.Fa "struct ifnet *ifp" "struct mbuf *m" +.Fa "if_t ifp" "struct mbuf *m" .Fa "const struct sockaddr *dst" "struct route *ro" .Fc .Ft void -.Fn \*(lp*if_start\*(rp "struct ifnet *ifp" +.Fn \*(lp*if_start\*(rp "if_t ifp" .Ft int -.Fn \*(lp*if_transmit\*(rp "struct ifnet *ifp" "struct mbuf *m" +.Fn \*(lp*if_transmit\*(rp "if_t ifp" "struct mbuf *m" .Ft void -.Fn \*(lp*if_qflush\*(rp "struct ifnet *ifp" +.Fn \*(lp*if_qflush\*(rp "if_t ifp" .Ft int -.Fn \*(lp*if_ioctl\*(rp "struct ifnet *ifp" "u_long cmd" "caddr_t data" +.Fn \*(lp*if_ioctl\*(rp "if_t ifp" "u_long cmd" "caddr_t data" .Ft void .Fn \*(lp*if_init\*(rp "void *if_softc" .Ft int .Fo \*(lp*if_resolvemulti\*(rp -.Fa "struct ifnet *ifp" "struct sockaddr **retsa" "struct sockaddr *addr" +.Fa "if_t ifp" "struct sockaddr **retsa" "struct sockaddr *addr" .Fc .Ss "struct ifaddr member function" .Ft void @@ -212,232 +399,98 @@ Interfaces are also associated with an output queue, defined as a .Vt "struct ifqueue" ; this structure is used to hold packets while the interface is in the process of sending another. -.Ss The ifnet Structure -The fields of -.Vt "struct ifnet" +.Ss The ifnet accessors +The accessors for +.Vt "if_t" are as follows: -.Bl -tag -width ".Va if_capabilities" -offset indent -.It Va if_softc -.Pq Vt "void *" -A pointer to the driver's private state block. -(Initialized by driver.) -.It Va if_l2com -.Pq Vt "void *" -A pointer to the common data for the interface's layer 2 protocol. -(Initialized by -.Fn if_alloc . ) -.It Va if_vnet -.Pq Vt "struct vnet *" -A pointer to the virtual network stack instance. -(Initialized by -.Fn if_attach . ) -.It Va if_home_vnet -.Pq Vt "struct vnet *" -A pointer to the parent virtual network stack, where this -.Vt "struct ifnet" -originates from. -(Initialized by -.Fn if_attach . ) -.It Va if_link -.Pq Fn TAILQ_ENTRY ifnet -.Xr queue 3 -macro glue. -.It Va if_xname -.Pq Vt "char *" -The name of the interface, -(e.g., -.Dq Li fxp0 -or -.Dq Li lo0 ) . -(Initialized by driver -(usually via -.Fn if_initname ) . ) -.It Va if_dname -.Pq Vt "const char *" -The name of the driver. -(Initialized by driver -(usually via -.Fn if_initname ) . ) -.It Va if_dunit +.Bl -tag -width indent -offset indent +.It Fn if_getbaudrate Fn if_setbaudrate +.Pq Vt u_long +The line rate of the interface, in bits per second. +.It Fn if_setcapabilities Fn if_setcapabilitiesbit Fn if_getcapabilities +.Pq Vt int +Flags describing the capabilities the interface supports (see below). +.It Fn if_getcapenable Fn if_setcapenable Fn if_setcapenablebit Fn if_togglecapenable +.Pq Vt int +Flags describing the enabled capabilities of the interface (see below). +.It Fn if_getcapabilities2 Fn if_setcapabilities2 Fn if_setcapabilities2bit +.It Fn if_getcapenable2 Fn if_setcapenable2 Fn if_setcapenable2bit Fn if_togglecapenable2 +.It Fn if_getdunit .Pq Vt int A unique number assigned to each interface managed by a particular driver. Drivers may choose to set this to .Dv IF_DUNIT_NONE if a unit number is not associated with the device. -(Initialized by driver -(usually via -.Fn if_initname ) . ) -.It Va if_refcount -.Pq Vt u_int -The reference count. -(Initialized by -.Fn if_alloc . ) -.It Va if_addrhead -.Pq Vt "struct ifaddrhead" -The head of the -.Xr queue 3 -.Li TAILQ -containing the list of addresses assigned to this interface. -.It Va if_pcount -.Pq Vt int -A count of promiscuous listeners on this interface, used to -reference-count the -.Dv IFF_PROMISC -flag. -.It Va if_carp -.Pq Vt "struct carp_if *" -A pointer to the CARP interface structure, -.Xr carp 4 . -(Initialized by the driver-specific -.Fn if_ioctl -routine.) -.It Va if_bpf -.Pq Vt "struct bpf_if *" -Opaque per-interface data for the packet filter, -.Xr bpf 4 . -(Initialized by -.Fn bpf_attach . ) -.It Va if_index +(Initialized by driver, usually via +.Fn if_initname . ) +.It Fn if_getindex .Pq Vt u_short -A unique number assigned to each interface in sequence as it is -attached. +Return the unique number assigned to the device when attached. This number can be used in a .Vt "struct sockaddr_dl" to refer to a particular interface by index (see .Xr link_addr 3 ) . -(Initialized by -.Fn if_alloc . ) -.It Va if_vlantrunk -.Pq Vt struct ifvlantrunk * -A pointer to 802.1Q trunk structure, -.Xr vlan 4 . -(Initialized by the driver-specific -.Fn if_ioctl -routine.) -.It Va if_flags -.Pq Vt int -Flags describing operational parameters of this interface (see below). -(Manipulated by generic code.) -.It Va if_drv_flags -.Pq Vt int -Flags describing operational status of this interface (see below). -(Manipulated by driver.) -.It Va if_capabilities -.Pq Vt int -Flags describing the capabilities the interface supports (see below). -.It Va if_capenable -.Pq Vt int -Flags describing the enabled capabilities of the interface (see below). -.It Va if_linkmib -.Pq Vt "void *" -A pointer to an interface-specific MIB structure exported by -.Xr ifmib 4 . -(Initialized by driver.) -.It Va if_linkmiblen -.Pq Vt size_t -The size of said structure. -(Initialized by driver.) -.It Va if_data -.Pq Vt "struct if_data" -More statistics and information; see -.Sx "The if_data structure" , -below. -(Initialized by driver, manipulated by both driver and generic -code.) -.It Va if_multiaddrs -.Pq Vt struct ifmultihead -The head of the -.Xr queue 3 -.Li TAILQ -containing the list of multicast addresses assigned to this interface. -.It Va if_amcount -.Pq Vt int -A number of multicast requests on this interface, used to -reference-count the -.Dv IFF_ALLMULTI -flag. -.It Va if_addr -.Pq Vt "struct ifaddr *" -A pointer to the link-level interface address. -(Initialized by -.Fn if_alloc . ) -.\" .It Va if_llsoftc -.\" .Pq Vt "void *" -.\" The purpose of the field is unclear. -.It Va if_snd -.Pq Vt "struct ifaltq" -The output queue. -(Manipulated by driver.) -.It Va if_broadcastaddr -.Pq Vt "const u_int8_t *" -A link-level broadcast bytestring for protocols with variable address -length. -.It Va if_bridge -.Pq Vt "void *" -A pointer to the bridge interface structure, -.Xr if_bridge 4 . -(Initialized by the driver-specific -.Fn if_ioctl -routine.) -.It Va if_label -.Pq Vt "struct label *" -A pointer to the MAC Framework label structure, -.Xr mac 4 . -(Initialized by -.Fn if_alloc . ) -.It Va if_afdata -.Pq Vt "void *" -An address family dependent data region. -.It Va if_afdata_initialized -.Pq Vt int -Used to track the current state of address family initialization. -.It Va if_afdata_lock -.Pq Vt "struct rwlock" -An -.Xr rwlock 9 -lock used to protect -.Va if_afdata -internals. -.It Va if_linktask -.Pq Vt "struct task" -A -.Xr taskqueue 9 -task scheduled for link state change events of the interface. -.It Va if_addr_lock -.Pq Vt "struct rwlock" -An -.Xr rwlock 9 -lock used to protect interface-related address lists. -.It Va if_clones -.Pq Fn LIST_ENTRY ifnet -.Xr queue 3 -macro glue for the list of clonable network interfaces. -.It Va if_groups -.Pq Fn TAILQ_HEAD "" "ifg_list" -The head of the -.Xr queue 3 -.Li TAILQ -containing the list of groups per interface. -.It Va if_pf_kif -.Pq Vt "void *" -A pointer to the structure used for interface abstraction by -.Xr pf 4 . -.It Va if_lagg -.Pq Vt "void *" -A pointer to the -.Xr lagg 4 -interface structure. -.It Va if_alloctype -.Pq Vt u_char +This is initialized by +.Fn if_alloc . +.It Fn if_getidxgen +.It Fn if_getdname Fn if_setdname +.Pq Ft "const char *" +The name of the driver. +This is initialized by driver +(usually via +.Fn if_initname ) . +.It Fn if_name Fn if_setname +.Pq Vt "char *" +The name of the interface, +(e.g., +.Ql fxp0 +or +.Dq Li lo0 ) . +This is initialized by driver, usually via +.Fn if_initname . +.It Fn if_getalloctype +.Pq Ft u_char The type of the interface as it was at the time of its allocation. It is used to cache the type passed to .Fn if_alloc , but unlike .Va if_type , it would not be changed by drivers. -.It Va if_numa_domain +.It Fn if_gettype +.It Fn if_setdev +.It Fn if_getdrvflags Fn if_setdrvflags Fn if_setdrvflagbits +.It Fn if_getlinkstate +.It Fn if_clearhwassist Fn if_sethwassistbits +.Fn if_gethwassist Fn if_sethwassist Fn if_togglehwassist +.Pq Vt u_long +A detailed interpretation of the capabilities +to offload computational tasks for +.Em outgoing +packets. +The interface driver must keep this field in accord with +the current value of +.Va if_capenable . +.It Fn if_getsoftc Fn if_setsoftc +.Pq Ft "void *" +A pointer to the driver's private state block. +This is initialized by driver at attach. +.It Fn if_setllsoftc +.It Fn if_getllsoftc +.It Fn if_getfib +.It Fn if_getaddrlen +.It Fn if_gethwaddr +.It Fn if_getbroadcastaddr Fn if_setbroadcastaddr +Access the interface broadcast addess. +.It Fn if_setmtu +.It Fn if_getmtu +Access the interface MTU. +.It Fn if_setflags Fn if_getflags Fn if_setflagbits +.Pq Vt int +Flags describing operational parameters of this interface (see below). +These flags are manipulated by generic code. +.It Fn if_getnumadomain .Pq Vt uint8_t The NUMA domain of the hardware device associated with the interface. This is filled in with a wildcard value unless the kernel is NUMA @@ -446,6 +499,63 @@ using .Fn if_alloc_dev or .Fn if_alloc_domain . +.It Fn if_sendq_empty +.It Fn if_setsendqready +.It Fn if_setsendqlen +.It Fn if_sethwtsomax Fn if_gethwtsomax +.It Fn if_sethwtsomaxsegcount Fn if_gethwtsomaxsegcount +.It Fn if_sethwtsomaxsegsize Fn if_gethwtsomaxsegsize +.It Fn if_setnetmapadapter Fn if_getnetmapadapter +.It Fn if_setifheaderlen +.It Fn if_setrcvif +.It Fn if_setvtag Fn if_getvtag +.It Fn if_vlantrunkinuse +.It Fn if_getlladdr +.It Fn if_getvnet +.Pq Vt "struct vnet *" +A pointer to the virtual network stack instance. +This is initialized by +.Fn if_attach . +.It Fn if_gethandle +.It Fn if_vlancap +.It Fn if_getcounter +.It Fn if_getmaclabel Fn if_setmaclabel +.It Fn if_getbpf +.Pq Ft "struct bpf_if *" +Opaque per-interface data for the packet filter, +.Xr bpf 4 . +This is initialized by +.Fn bpf_attach . +.It Fn if_getpcp +.It Fn if_getl2com +A pointer to the common data for the interface's layer 2 protocol. +This is initialized by +.Fn if_alloc . +.Fn if_getvlantrunk "if_t ifp" +.Pq Ft struct ifvlantrunk * +A pointer to 802.1Q trunk structure, +.Xr vlan 4 . +This is initialized by the driver-specific +.Fn if_ioctl +routine. +.It Fn if_getdrvflags Fn if_setdrvflags Fn if_setdrvflagbits +.Pq Ft int +Flags describing operational status of this interface (see below). +These flags are manipulated by driver. +.It Fn if_addmulti Fn if_delmulti Fn if_findmulti +Add, remove, and find multicast addresses assigned to this interface. +.It Fn if_getifaddr +.Pq Vt "struct ifaddr *" +Get a pointer to the interface's link-level address. +.It Fn if_getbroadcastaddr Fn if_setbroadcastaddr +.Pq Ft "const u_int8_t *" +A link-level broadcast bytestring for protocols with variable address +length. +.It Fn if_getafdata +.Pq Ft "void *" +An address family dependent data region. +.It Fn if_addgroup Fn if_delgroup +Add and delete groups from the interface. .El .Pp References to @@ -611,7 +721,7 @@ This interface is in all-multicasts mode (used by multicast routers). .It Dv IFF_PALLMULTI .Aq D This interface is in the permanently all-multicasts mode (implies -.Dv IFF_ALLMULTI) . +.Dv IFF_ALLMULTI ) . .It Dv IFF_DRV_OACTIVE .Aq D* The interface's hardware output queue (if any) is full; output packets @@ -891,18 +1001,6 @@ link-layer overhead. .It Va ifi_metric .Pq Vt u_long A dimensionless metric interpreted by a user-mode routing process. -.It Va ifi_baudrate -.Pq Vt u_long -The line rate of the interface, in bits per second. -.It Va ifi_hwassist -.Pq Vt u_long -A detailed interpretation of the capabilities -to offload computational tasks for -.Em outgoing -packets. -The interface driver must keep this field in accord with -the current value of -.Va if_capenable . .It Va ifi_epoch .Pq Vt time_t The system uptime when interface was attached or the statistics @@ -961,8 +1059,7 @@ Number of packets received for unknown network-layer protocol. .It Va ifi_lastchange .Pq Vt "struct timeval" The time of the last administrative change to the interface (as required -for -.Tn SNMP ) . +for SNMP ) . .El .Ss Interface Types The header file @@ -997,7 +1094,7 @@ interface Serial Line IP .It Dv IFT_PARA Parallel-port IP -.Pq Dq Tn PLIP +.Pq Dq PLIP .It Dv IFT_ATM Asynchronous Transfer Mode .It Dv IFT_USB @@ -1062,7 +1159,7 @@ is a macro for The network mask for multi-access interfaces, and the confusion generator for point-to-point interfaces. .It Va ifa_ifp -.Pq Vt "struct ifnet *" +.Pq Vt "if_t" A link back to the interface structure. .It Va ifa_link .Pq Fn TAILQ_ENTRY ifaddr @@ -1324,7 +1421,7 @@ and appropriately. .Pp .It Dv SIOCGIFCAPNV -.Xr NV 9 +.Xr nv 9 version of the .Dv SIOCGIFCAP ioctl. @@ -1368,7 +1465,7 @@ non-modifiable capability bit in .Dv if_capabilities . .Pp .It Dv SIOCSIFCAPNV -.Xr NV 9 +.Xr nv 9 version of the .Dv SIOCSIFCAP ioctl. From nobody Sat Mar 1 22:58:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z50qV3hjzz59KR9; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z50qV33Ljz3M7S; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740869910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRUGcI3xG3zmLBRT6H7aDBLIAYdTeQa6LlrTREa+PP0=; b=lHAdowUiTVlliyQDafuLQ0oOvg6lBQIZ5HCeWtfU+uYFiFyxg1XSeFuUjiWIreewSLpwR3 xzn5qHAnp4aRNJ1NoZoT4Jyr/7j3CmdH8U8nl1w5BpKd0UbtV5+9pDSK53FYxVQvrnWl3N O7IB/RPZ1vALk8ls0acyuMxOU0B7yuifOvQYTOqZ3OXHl6shXnc9A7UiMvfluR1DY08HEP AYLXn9+z6sjtXw6tqx5DhYcDLnzNj+Ioni/FgU4OhPAuxz0jGCIBSNsPZ0DYDraXKdF7aL vbxpKLw1+BotU0qaSa/A1MTaSz0InRzmF4KiFu+tLw7tSNGU4GW/mC+oAFY3Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740869910; a=rsa-sha256; cv=none; b=a4AxahP5DeeciOS2/w86ZNVky6yXtya3qkvLld8Bcos6uVQ2EpsWh9d99AlA1gy67QBhD6 bgHgt8mZeDqubtKX8+SJXwh4DNOIzuZ5kZjwJY+VkXPXOiQyuEE9DLf8XqzAGKeAM84wGX +BvlBANUTGtIv7Wgal8nL1C+WNcUVguQrB7xThiOYKdwT/e5NjlAAOLGoeKuADFYpWJUUZ zF8tw39iHc24gfx1+NRRIPf0pMuIhX5qDOVuzc2KS1qiHNvKaCRJeYPPGsbCVRroLSbZ81 QmfXGe1hyJ+CSvY2qARvFsrNxnrftT5Vfn5eo4/vMrglRgJD7NJmmUhX8NLhdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740869910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRUGcI3xG3zmLBRT6H7aDBLIAYdTeQa6LlrTREa+PP0=; b=HQWV5Hf/3xb8k8Hb1lWlFDJ1O8WDEvJk34m7BRi/Azi5qG9w+qauVrL77dYuEW5isNhnFA g/FBMV+4QalfzKvSKr6nHWOh2jQhmup2N8az0VRZodzM1prk0Ud7xOruhjXzhZSRWRAVNf hz5j1mc92x0iCFw+Vh8+4STHTNeqmwj4KIkhdLRez81owYcmeHF6ZGo4t0fuw8lorYjmLV m4OJr822iIM9Y76zuovVvHwsC3SZNCeP+Itv0ATI8eCkghOBtoJEevqJjOtCkxiluLZFyp RC3/c3BlERHIJ7Y1zFuhWkveDDkaa2WkrZpOyTmChOsB+XDL8gxjxaVAlcv78Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z50qV1VDczc9w; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521MwTJi079343; Sat, 1 Mar 2025 22:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521MwTvP079340; Sat, 1 Mar 2025 22:58:29 GMT (envelope-from git) Date: Sat, 1 Mar 2025 22:58:29 GMT Message-Id: <202503012258.521MwTvP079340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: c564603e6449 - stable/14 - netinet6 tests: Add Scapy as a required program List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c564603e6449dc94835c0a73e0a9b50bc43b0e00 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=c564603e6449dc94835c0a73e0a9b50bc43b0e00 commit c564603e6449dc94835c0a73e0a9b50bc43b0e00 Author: Jose Luis Duran AuthorDate: 2025-02-17 19:50:24 +0000 Commit: Jose Luis Duran CommitDate: 2025-03-01 22:53:06 +0000 netinet6 tests: Add Scapy as a required program The ra.py script requires Scapy. Invoke it using the python3 symlink. While technically, at the moment, python points to python3, and python3 points to the current version of python, it is recommended to use python3. No functional change intended. Add the Scapy requirement in the header of each test that makes use of it. Reviewed by: kp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49005 (cherry picked from commit ec60176e7d29d1e9f11121146603ce5b6b5f40b8) --- tests/sys/netinet6/ndp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh index 038a640f331e..378759eb9ba4 100755 --- a/tests/sys/netinet6/ndp.sh +++ b/tests/sys/netinet6/ndp.sh @@ -134,7 +134,7 @@ atf_test_case "ndp_slaac_default_route" "cleanup" ndp_slaac_default_route_head() { atf_set descr 'Test default route installation via SLAAC' atf_set require.user root - atf_set require.progs "python" + atf_set require.progs scapy } ndp_slaac_default_route_body() { @@ -153,7 +153,7 @@ ndp_slaac_default_route_body() { atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv # Send an RA advertising a prefix. - atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ --sendif ${epair0}b \ --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ --src $(ndp_if_lladdr ${epair0}b) \ @@ -172,7 +172,7 @@ ndp_slaac_default_route_body() { jexec ${jname} netstat -rn -6 # Send another RA, make sure that the default route is installed again. - atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ --sendif ${epair0}b \ --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ --src $(ndp_if_lladdr ${epair0}b) \ From nobody Sat Mar 1 22:58:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z50qW2bZsz59KFc; Sat, 01 Mar 2025 22:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z50qV75XZz3M14; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740869911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3YbnMW3fOBeAxFsELBm9zmBm3XCs2dt4hMyDJASTAMI=; b=vM7Pyh+rzi9IjLgK9oRj43CcKlKsz54Ustj6N0MZmHO/c/5/e2WwbszKyRBOqB+/BqAiw+ t8q626R0F3Jg0aBcGUOzcFeDPQrGqb3h/hlxjwdb/WzrwhUk3phFPopaOKD/q6O+5SSNhI fbSBFjKq0mspfEY1Tsp70/lKQ8MM2wKiPwcQXZyBeua+O4q83ZTmt7hRsAG5pgAu5Q8Eob 5Ziw+oFc/xkhlh/nNbeNI5LfWnjf5ixN/zuWo2IZy8lFFtiH25y0JhXYs9qKivhX/yJsOd Q8BvNN4nwDREuExFS0U4PKy5OFQ0dX1xfe0lE18NGZzzJ1vqzj2Lc+a0UItO+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740869911; a=rsa-sha256; cv=none; b=bw3QoCwWB0kQmw4MZjAy8J0ui+dtXQOzKhTla/OBqTZS8tMxQpkshP9acua1SytBS0UNEc g+TsloH+quet3KB4g8A7Io1dkBRKRhswBs6f0qp6vRqri5jBpFecsJ7Y1HJegP3iYTxJig Zh76v7ZKvYrYiurTq/IW95Z7VWEna6rzI9pF4u48A5xZN5RafRJ3Y6Pl6LUzQzTvlH0rvL pgcr4MYhF9RojrwVtGJtKg67h8xvzQfisi4hUSy1JBFBEeVNImau7wQdwvB0MniZMyxY/p INom8swNLpUhzXGZ8zy2hLHCPbH/RiXFpxvaElSmr1SPftCj5jFu+C9/res3Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740869911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3YbnMW3fOBeAxFsELBm9zmBm3XCs2dt4hMyDJASTAMI=; b=rFPeACZjRKdKltYb4AIuVS9ve97KyE1AtM5c9oEIYxpJR4U78h9Io/KojIOE3Bc4gSzMNN 0bORZrOLiHZpWKx1BV365ism1XC7F0q+N29X0SK+xF5tAvUHqyP2IWK24aglD5jmYdStOR od2/XtVoyelcvOMiKc8H72STL5btuuo/KOBdtWJY16K9wzCaEmpslDyECJlmLl78+vB7tV BqwxTh+l9t35nOb8cDT2WFlmPa97Geug77p6S0imbDSHlJ0Av8tR6HMmcbLZ59HQhHLEFi YxbQbqlrxHs9H3Tf3a2sGY4NuhSN/tf0JSXVkfQ6tR21O0WGVlXISX8rorIujQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z50qV6ZlBzc9x; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521MwU21079379; Sat, 1 Mar 2025 22:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521MwUiF079376; Sat, 1 Mar 2025 22:58:30 GMT (envelope-from git) Date: Sat, 1 Mar 2025 22:58:30 GMT Message-Id: <202503012258.521MwUiF079376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 1dd41c75b5ac - stable/14 - pf tests: Remove Scapy as a required program List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1dd41c75b5ac0ffca55aafb1095bb70dc1700847 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=1dd41c75b5ac0ffca55aafb1095bb70dc1700847 commit 1dd41c75b5ac0ffca55aafb1095bb70dc1700847 Author: Jose Luis Duran AuthorDate: 2025-02-17 19:52:46 +0000 Commit: Jose Luis Duran CommitDate: 2025-03-01 22:53:59 +0000 pf tests: Remove Scapy as a required program Scapy is not needed to run this test. Remove it from the required programs list. Reviewed by: kp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49006 (cherry picked from commit 1f1963bd32d669f89ea3b044636de0cb7a33134b) --- tests/sys/netpfil/pf/rdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index 07aca78cc650..74d12371379d 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -32,7 +32,7 @@ tcp_v6_head() { atf_set descr 'TCP rdr with IPv6' atf_set require.user root - atf_set require.progs scapy python3 + atf_set require.progs python3 } # From nobody Sat Mar 1 23:33:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z51bX6HGyz59N7w; Sat, 01 Mar 2025 23:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z51bX5P7zz3mTl; Sat, 01 Mar 2025 23:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740871992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3WNoBHyPYKOkCkyDhGninHUEk2zM+QZ2EvNL94phqq4=; b=C/UyF5LsQZx2rTLTfNaI2aEHwMSakULWL7m1NpO2g41OO4z++9WJxqbHB5h2nZ2Z2w3XlJ bgA3V3dYfFlA9BPQGTI25sZkHdg1MfWOf3CUUi7Yd0i5Sg9mNlhsRwvYY1EObNsRUoBAtI sv1Nl1tWvxB8cRYdTKB4OK3EsFZoy7pLLoX5F5iGswf4wxvGmvpNY43JPFCKwVEhh2PU43 eBbfa1wnMQG/RkablV4QLyNuToSC8uYR3jMfC7SKLDK7ou42G5+98K+ivBH+AKd2wSzn8y UYAUK1PTX7SgH1JI25P3u5fvEPeS36WRMsd8SXNmOFXUSAj8YxYSIZ2YOTw6iQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740871992; a=rsa-sha256; cv=none; b=uWPwzJ9mx1hsneQ5taxR3OqkEIgCLTaYry+Dbqts5B7lXpFKX3f+jHJkDrDbUflR0T7fTu cjUB4PUI2N5RUOotFrYwz9gpfy/cpAOeqRGE3wsjZrHOgmiG1wsyOMpvJzyJnmBS8rEjO4 iN8Me7vY54iytFKY/fXymtZo4iSUFzGIwd0UdJ3s0o/0U01aryyLTQYkOFMij3olEAbNoL LG+97o1nj2XAgf3FCFTfC1txCe3j3GYwqL5cUiy2flXd+Gxbx6LBdUx50ioyYZtzCcJtnO 6vQvFjRWVI9GjHlv0welh3QioIqeyK2EOJhllxKpYwgUCNfQy1lGEVW3wLKGpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740871992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3WNoBHyPYKOkCkyDhGninHUEk2zM+QZ2EvNL94phqq4=; b=aUU+xeCdm2O3AGT/X1RXEO1+OKlae+anFk6+4ar8wj4ZB2HiRf7Fy65K6R3LAVCQ08BdMY o6QX/H0zirIG/9tLijhycd+vroAIwBb2W4Ljq5h3EhhnIj7CSQqnZIfmHSA+dICSDzFwQx UzUsFa4A9wOsRaskMxBE3ry64bEzlISAJLRbGg/+7bHjw3/hr4kY3GeAS5b3RjLx7rfrH6 vJ/BLUMZ2aLwwZLBE+0mXTv8V9xgLVswooOc/YrAQp1I9I0Aj255T1KGO57YbVjHloAdKS /OSCZt/XFKbyi+MYcfzWy62jD+ipgIXEyOklAroi1Y/GlbSpX8lBXbiHRySY0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z51bX4mnYzcyK; Sat, 01 Mar 2025 23:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521NXCgD052816; Sat, 1 Mar 2025 23:33:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521NXC2W052813; Sat, 1 Mar 2025 23:33:12 GMT (envelope-from git) Date: Sat, 1 Mar 2025 23:33:12 GMT Message-Id: <202503012333.521NXC2W052813@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 50ec1e7af002 - main - ath: fix 20MHz HT short-gi logic. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50ec1e7af002d710eaefa5dd5f581efc20159122 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=50ec1e7af002d710eaefa5dd5f581efc20159122 commit 50ec1e7af002d710eaefa5dd5f581efc20159122 Author: Adrian Chadd AuthorDate: 2025-03-01 22:35:26 +0000 Commit: Adrian Chadd CommitDate: 2025-03-01 23:32:04 +0000 ath: fix 20MHz HT short-gi logic. This was broken in an earlier commit (ca389486a9599768e0ba69dca13c208020623083). PR: kern/285096 Differential Revision: https://reviews.freebsd.org/D49196 Fixes: ca389486a9599768e0ba69dca13c208020623083 Reviewed by: bz --- sys/dev/ath/if_ath_tx_ht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index ac61c7b4cf54..e7ee029fecf0 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -301,7 +301,7 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf) rc[i].flags |= ATH_RC_SGI_FLAG; } - if (ni->ni_chw == IEEE80211_STA_RX_BW_40 && + if (ni->ni_chw == IEEE80211_STA_RX_BW_20 && ieee80211_ht_check_tx_shortgi_20(ni) && (bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) { rc[i].flags |= ATH_RC_SGI_FLAG; From nobody Sat Mar 1 23:33:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z51bZ30VMz59N3y; Sat, 01 Mar 2025 23:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z51bZ0CKVz3mP9; Sat, 01 Mar 2025 23:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740871994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMLLCKuGteYfLPcbL/bGMY4vfsC0namrxaNGcl2MfCI=; b=X5pBpiFO1v0iBrcndy5P7SzKg1x66sclGVq3qjiLhRwMfTLz82fcltafXfI0AZsPSoEoub mA3HXgO/sxqCfJU1Q/SbOiexiNWNY9KDEWj+uiyWzDULRSh8VLTdhutliuDDAGmJdizcdq mozzedxYJiGbk0wO3CJ9DXwTNZnDlh9WtiugO1HEP9JQssNijb/L6ees6OO4phOysLpIgg wIjQZ8RB5s+jbmpxKzOBccvGyLI6m733VNu+o5JXbQXSCX3HcmsYOzOXFWQlUSbkKV70DT qqi78Bq+eA/16CqM4ELBgIjC9MeeFsw520RCoKvBjPdOXN71CZswWIKkQVP4Zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740871994; a=rsa-sha256; cv=none; b=dsalzDRACkP9H9aAQDkdJ9ufHQFO+4pxXqbh4C1qKIXA+FLppPafsJl3HUTDjSese0zVxm qqYybXniMcD8c2TIsUAcDHvAqZteA9aYz7PNGknH687ZO2xsrj7RpnlsCgpYO5U449ef1j ihWbxw9F+t5ioLoy6XR+nNMSlUI+t/Z4fxNhAx56cB/cUJIrR84XvuML4fCHKdbUie5Nh+ 99TJ2KRWKRnUgoBPRDYAZpCABAhEZTa5N+sJDYevE/PNKP2YWw7GWA0rWZcjm7bfH1wbGu NcywMf176P3VMK39G5/w3n5W/qjogSje0sD4D0OhmQ5PiqsVXcOxKUyRY1qcIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740871994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMLLCKuGteYfLPcbL/bGMY4vfsC0namrxaNGcl2MfCI=; b=R3RTtDa9dddW0ZWCAFqLZbh0zD8vu4YLF8TKQsjmA82Et1IgOGJvn32wX2Iwuf4alyMVxm 2nVL6EoBB15EkgTzDonKLCLWc2kDi71Cv5tEe6/b7MO08pnPmHQESPZfbHyHkzThu9ZDSU s8U35BXUIYfHidKo608h4dv82Yql5xohMRpQdkZ4YTY/X3Y2axk0hausEQLAqTjeYtlYVB /liTq0E1O7psdxeMrhWVxuWI4sXOdwGdBbLgK5wYXH3DKOmQ9p7BQ7ft64HbbS+pF11Ccj TVVAkHGOCF8Z4T60AZ6Us0xd4EUjU9ey6A8W13s2KHRmRN9ik8p03jqBCoEq1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z51bY6M2Szd1j; Sat, 01 Mar 2025 23:33:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521NXDlK052852; Sat, 1 Mar 2025 23:33:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521NXDtY052849; Sat, 1 Mar 2025 23:33:13 GMT (envelope-from git) Date: Sat, 1 Mar 2025 23:33:13 GMT Message-Id: <202503012333.521NXDtY052849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 10c633ab1204 - main - ath_rate_sample: fix setting HT rates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10c633ab1204e13d6fbad9f0f474229eed5fd280 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=10c633ab1204e13d6fbad9f0f474229eed5fd280 commit 10c633ab1204e13d6fbad9f0f474229eed5fd280 Author: Adrian Chadd AuthorDate: 2025-03-01 22:38:53 +0000 Commit: Adrian Chadd CommitDate: 2025-03-01 23:32:56 +0000 ath_rate_sample: fix setting HT rates ieee80211_node_set_txrate_ht_mcsrate() takes an MCS rate from 0..76, the high bit (IEEE80211_RATE_MCS) must not be set. This is definitely my fault - I likely didn't get to testing this diff when I changed it from ieee80211_node_set_txrate_dot11rate() just before landing. Differential Revision: https://reviews.freebsd.org/D49197 Reviewed by: bz --- sys/dev/ath/ath_rate/sample/sample.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c index 8fba3c68099f..291d1ec64ed7 100644 --- a/sys/dev/ath/ath_rate/sample/sample.c +++ b/sys/dev/ath/ath_rate/sample/sample.c @@ -857,7 +857,8 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, */ if (rt->info[best_rix].phy == IEEE80211_T_HT) ieee80211_node_set_txrate_ht_mcsrate( - &an->an_node, MCS(best_rix)); + &an->an_node, + MCS(best_rix) & IEEE80211_RATE_VAL); else ieee80211_node_set_txrate_dot11rate( &an->an_node, From nobody Sun Mar 2 00:36:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z530X4QLGz59TBJ; Sun, 02 Mar 2025 00:36:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z530X3Mszz3R7p; Sun, 02 Mar 2025 00:36:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740875788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cF63oif1UFNUVwVGxGBY+Bo+P3p2b+rI9NnAfai32Co=; b=MNmaO8YYuqUfC9setQQ0MlJJHfeS1U8HfW6hN8aRWyBFfCSSFYGqwND+HXSeQHE6qC1/qH C8zuSmfBtdi5oiSgMMwRqKL9SFyNvgu5uJZhI1sKKkacQ2sAUD1JqWauLmlO+R+Ofm+U+e HvByuxpsDcNldGzJ5kH7l26EPk06zzjwX9p27yVhGp/ueOIVyMvPORJU4SfYYdWWjjc0/Z axNkyNcIHJTnm5ycuHHXRWP4y/MLb0AqEqcslP1JPVhmrq3k/F39cZXRMzk8tM2MjFYykx 9kp4VDNAuO3LAHbSvZfesKfOfMHBx14dk3aVLkaWzkeW10SoC/GVYz5uPrEAIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740875788; a=rsa-sha256; cv=none; b=xdaKq/ZmNnBwUPW7dawD00nbUUlEo3CgLIr7qlnszKXjKmkAHAYTp9HtzSLIftHyBsGB/r 5iXfKTdWiVBOoJlu/kaUudOLsPpClx5bkdZKxb7JXLqAYXxLa0u1nxytooguO5pQ8p4FaW BmSC4fGDP3NmGqTbUE9J3EVfe4C6Nlyh4vOl51ZeenpKT/P6C/B2TFMGWKC5EynbOHdWjH SA7bKOXusgZs/R8D4O+KInt0fVPdoPsZfzqNP5A2fwiFuRFxX5QxDDYDKO8kk0N8w1lg3C JVIYa+LV3un3xOcrVkfZWn53cPsnSrfz0AuUKRJWkLpkbr3kQvgnKpX0ba7yIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740875788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cF63oif1UFNUVwVGxGBY+Bo+P3p2b+rI9NnAfai32Co=; b=GCUd5Zl1sXKNV4aXKFUCFhmphG5l54gFCJc3fKKDre48GgPDvK9mOeqp6fkNiQoRy1m6OH cFUn5JnSFgYFLe5+5KWtqh3Lta5BwQTx4O2IYxMxRczKqrMZ0fD7IXbVWUaVLEGSUWjZEF CJnOgrsQjNDvt6iHU/6ZIDzy2UB2p/zJs3krUDpIK0h0JkBV9G4px8YXWid2CFc+pZ8ak+ ZJghGFHt0GkCB0RHPSA1mAtGNEh2t+pKrfKdi/z2g+GicNpzEB9uNhQzgmOU+uBOEALQ6o zIh467SNstA6kTRiAEzCNDjSOxgDlMfZXiiyVuFx0jubaLowEGXZlxaaFr1fGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z530X2D49zfGP; Sun, 02 Mar 2025 00:36:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5220aSkF065990; Sun, 2 Mar 2025 00:36:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5220aSru065987; Sun, 2 Mar 2025 00:36:28 GMT (envelope-from git) Date: Sun, 2 Mar 2025 00:36:28 GMT Message-Id: <202503020036.5220aSru065987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 970d9b5d304c - stable/14 - wifi manuals: Mlink + document description consistency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 970d9b5d304cfdeabc9b2de074fd84205b3ba972 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=970d9b5d304cfdeabc9b2de074fd84205b3ba972 commit 970d9b5d304cfdeabc9b2de074fd84205b3ba972 Author: Alexander Ziaee AuthorDate: 2025-02-19 15:54:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-02 00:35:45 +0000 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 (cherry picked from commit 4262dbc57982383eb61a8b7806de6dd4b7802da8) --- 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 979dc37d7db4..5b8b0fa54630 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -742,7 +742,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 MLINKS+=rue.4 if_rue.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ diff --git a/share/man/man4/uath.4 b/share/man/man4/uath.4 index 7d9632fe8e0f..865f04b84232 100644 --- a/share/man/man4/uath.4 +++ b/share/man/man4/uath.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: ISC +.\" .\" Copyright (c) 2006 .\" Damien Bergamini .\" @@ -19,7 +21,7 @@ .Os .Sh NAME .Nm uath -.Nd Atheros USB IEEE 802.11a/b/g wireless network device +.Nd Atheros USB IEEE 802.11a/b/g wireless network driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 508c87c6a925..5d4ada1d1a1f 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -54,7 +54,7 @@ .Sh NAME .Nm upgt .Nd Conexant/Intersil PrismGT SoftMAC USB IEEE 802.11b/g wireless network -device +driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your From nobody Sun Mar 2 01:25:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z544w1m3Kz5Vbh6; Sun, 02 Mar 2025 01:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z544w0styz3wHl; Sun, 02 Mar 2025 01:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740878720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Jsfaqz63nq2A3EjL/6lx0EJd07IZpE33KQ13XEBedY=; b=J5AhZZ4lD3mVlZ2g5IHifFgHWasbSfUaiM/icaGi+cMtqcc+iKna2rj/Bjz6FOt0oAk7YK Oj9XnGHLxye1HFtLJDEr4s7+lh741kIju3eW/vZ3HbFj4pX/KKK2v3V5Vnud0CdFxlNnRf r3KSXje7CHtbM9uJcq1uSwGSksMfAkHfXo1oqpQHTFg17Ngm8/h5wgVtRPYMUgU/7o02xe iM/YbpV1VoDK5n6PjGTa2x9BsRB4IahJo5/6NCuC9sU1WLbZiK+nvbBsonQsEXsGkGWqf2 NCKXHZLh6o+HwM3wyqJJE7K58QrJ6oismPILtBcurpAnCgVIUqOYL2uVMvR/yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740878720; a=rsa-sha256; cv=none; b=GngDNcIl70ovQoPipj5l1Pg3UMLnfFjUc0jTyeVlR/yDLo6kpj8Qmzuhyuo6SLI51qJ5vf 29lDbgI2H2D+eMf9n/g/rUrgEJWmBeByvwiYKXPTD4nVldwugaz71qhjm0R55RCuj4ulaL fDPHJHVVikHQQikNdkAvqRbm6bwlWWuLvx/glCmzaI2lqzdOfdNHjwh6SMeqQl4Pjds5uY uWV639icVyTpyQpv3kJg0VJd8ylVp9o0QaxB9MJz6JmjSMgc+KPTTa49yFIyQG1rt6fn/1 7BOd/dMXKr+L4iGwGms2JV07VH0EbFaQLG5KOydws3yyIQdSk2KGkzpShfeG9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740878720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Jsfaqz63nq2A3EjL/6lx0EJd07IZpE33KQ13XEBedY=; b=d+PGNl3Sw0yKB/kDjJFZgegc0H47uEJt4m7ecZlcuhLBRdrrb9eROSXzwxFd6iVJBubQx+ aybbxyTt4OpUVeIK2KqiSKyVXabt4mQU1jcDGNi0DggHc8OoF6yLM0CO0YosE/0h0VTbKl A2E4JeacTpSw5Xtj91nhx7PAPXNyblD7KL18onQBflqtE0khWyCeXwdnANBG8ryDPHmUQ4 HJndr4jLq1vKd1SrnKijxm7XNhrRV+9X1u7EDreA7OPuRLLDCPK8Yp3SAcL8neC97vNrvm f/r8kczZ9dP6GayHU0E6xf574IffWnKMS/IPPwNW8S4uaypaSvTl13ZWSqFCVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z544w0Shlzgt1; Sun, 02 Mar 2025 01:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5221PJqJ059149; Sun, 2 Mar 2025 01:25:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5221PJk0059144; Sun, 2 Mar 2025 01:25:19 GMT (envelope-from git) Date: Sun, 2 Mar 2025 01:25:19 GMT Message-Id: <202503020125.5221PJk0059144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 43fa7b907e9c - main - amdiommu: add register definitions from IOMMU spec 48882 rev. 3.10 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43fa7b907e9cc5ce365afd05775349d199fc2eb4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43fa7b907e9cc5ce365afd05775349d199fc2eb4 commit 43fa7b907e9cc5ce365afd05775349d199fc2eb4 Author: Konstantin Belousov AuthorDate: 2025-03-02 01:23:41 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-02 01:23:41 +0000 amdiommu: add register definitions from IOMMU spec 48882 rev. 3.10 Most important for us is the max interrupt remapping count report in the EFR2 register. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/amd_reg.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/x86/iommu/amd_reg.h b/sys/x86/iommu/amd_reg.h index 37375b3fa7b5..53b8b0cb42fc 100644 --- a/sys/x86/iommu/amd_reg.h +++ b/sys/x86/iommu/amd_reg.h @@ -186,6 +186,9 @@ #define AMDIOMMU_CTRL_MARC_EN 0x0000010000000000ull /* Memory Addr Routing En */ #define AMDIOMMU_CTRL_BLKSTOPMRK_EN 0x0000020000000000ull /* Block StopMark En */ #define AMDIOMMU_CTRL_PPRAUTORESPA_EN 0x0000040000000000ull /* PPR Auto Resp Always En */ +#define AMDIOMMU_CTRL_NUMINTRREMAP_MASK 0x0000180000000000ull /* Remapping MSI mode */ +#define AMDIOMMU_CTRL_NUMINTRREMAP_512 0x0000000000000000ull /* 512 max */ +#define AMDIOMMU_CTRL_NUMINTRREMAP_2048 0x0000080000000000ull /* 2048 max */ #define AMDIOMMU_CTRL_EPH_EN 0x0000200000000000ull /* Enh PPR Handling En */ #define AMDIOMMU_CTRL_HADUP_MASK 0x0000c00000000000ull /* Access and Dirty in host PT */ #define AMDIOMMU_CTRL_GDUP_DIS 0x0001000000000000ull /* Dis Dirty in guest PT */ @@ -256,6 +259,21 @@ #define AMDIOMMU_CMDEVS_PPROVRFLWEB 0x00020000 #define AMDIOMMU_CMDEVS_PPROVRFLWE 0x00040000 +/* + * IOMMU Extended Feature2 register fields. + * All currently defined bits are RO. + */ +#define AMDIOMMU_EFR2_TMPMSUP 0x0000000000000004ull /* Tired Mem Migration */ +#define AMDIOMMU_EFR2_GCR3TRPM 0x0000000000000008ull /* GPA based GCR3 pointer in DTE */ +#define AMDIOMMU_EFR2_GAPPID 0x0000000000000010ull /* masking of GAPIC PPI */ +#define AMDIOMMU_EFR2_SNPAVIC_MASK 0x00000000000000e0ull /* SNP-enabled Adv intr features */ +#define AMDIOMMU_EFR2_SNPAVIC_NO 0x0000000000000000ull /* No features supported */ +#define AMDIOMMU_EFR2_SNPAVIC_REMAPV 0x0000000000000020ull /* Intr remapping with GVAPIC */ +#define AMDIOMMU_EFR2_NUMINTRREMAP_MASK 0x0000000000000300ull /* Number of remapped intr per dev */ +#define AMDIOMMU_EFR2_NUMINTRREMAP_512 0x0000000000000000ull /* 512 */ +#define AMDIOMMU_EFR2_NUMINTRREMAP_2048 0x0000000000000100ull /* 2048 */ +#define AMDIOMMU_EFR2_HTRANGEIGN 0x0000000000000800ull /* HT range is regular GPA */ + /* * Device Table Entry (DTE) */ From nobody Sun Mar 2 01:35:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z54Jn0xxXz5VcJv; Sun, 02 Mar 2025 01:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z54Jm6lkWz43Jw; Sun, 02 Mar 2025 01:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740879337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tlL9r14rsSDD/D9MhPwmN00XzlSN3VHhkhAt/aUmzg4=; b=FsIuwvLNRk82DqKIHWoVtpLxVCDBaf+Ps133kUrScv85KarcWrd3fRrkDljHTEKmJgho7E DF8Q6poRs8BEH5u7you2zkAQpQjTZDoXxnex3+AycAPB2JMqArIxtCICu5znCXyYf1ZNMW NOH0uVXkXVocaoSzuB/RugP2tMfXwJUsQf+H3QGbKyhJPxE4yEd0N0cOArGE3/Tj4zX5Gx Y57binGoXjvPy16gztSkufw1Rveeap1cvI08+eiTKkKgy5f0Tl0fCRNpOzMpHJG0IrM9mr 9k71+d+ExTyaefFsSCKkkLQtBd4w2bDVQxNtY1Y2UyM4PFmqNrel1r6elzCoVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740879337; a=rsa-sha256; cv=none; b=JF4xq7HoZ0IoVGP0Y3JCQ79XOpUVgGnxhWz3lLglwQW9tND8fY+XOZrN54D+vDOVTg+I54 Q23vpGLtwvbONZPla3nvFE+qD3XbIl8v5x23JDMbFbtABttS2SeWnKq3r8C+rqTBL6emKW NlCjTcxX0ZNnjSCISE44hbYPGRJvc8lyhq33YXIFrz1vSrYVFBiF3tc2mgKe4fEu5tuHl/ 1iJAAvBd1jIX4NrwFl5xuZo1qhDhYAULKrFtce2vTtbc3QxVqPWY5SttxOi5N5pB64i8qj MqPOVjYfSCXcVIH9y7+Ly/c4z8selYOizbas7/iOoPBPXoOfhm9CqYL7W2dvGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740879337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tlL9r14rsSDD/D9MhPwmN00XzlSN3VHhkhAt/aUmzg4=; b=GoJJjDBWWzWMJg9qCwCKQBcihF/4qAZjvnKjcfka8nU1xHBTCItZpWQa6sl8erUua7Z6O4 EMKynRN1xdEbq2TfwfH6DY2y6zUIDTr0I7+ZQWOb8Bbaq5ZEFKdtAVNwLDSOBJSr+dbS4i FGsxLgp6LMdNJep1BgGt9I8jAfYVo7rCpAquM5HH3iMLRoEi1MGp9avAlQ5PnhAqFL2Z36 Ou0JL2TjZ1MK1ZpvSwgDypISn+ouXKBFu0nCF4j/yxA3M59oRxgWE8iZuob1vRIY+zmQb1 nvXBYmc2ehPrYVWxQ+dqRzaNV72wgeWopB2h/ADnMXorExgnIImEJfdbwIjStQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z54Jm5n8xzh4F; Sun, 02 Mar 2025 01:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5221ZaTi077444; Sun, 2 Mar 2025 01:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5221ZaKC077441; Sun, 2 Mar 2025 01:35:36 GMT (envelope-from git) Date: Sun, 2 Mar 2025 01:35:36 GMT Message-Id: <202503020135.5221ZaKC077441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 4b86550923cf - main - ifconfig: add AES-GCMP RSN OUI decoding List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b86550923cfb226a65b7d48c661654bd0a240cc Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=4b86550923cfb226a65b7d48c661654bd0a240cc commit 4b86550923cfb226a65b7d48c661654bd0a240cc Author: Adrian Chadd AuthorDate: 2025-03-01 01:18:40 +0000 Commit: Adrian Chadd CommitDate: 2025-03-02 01:35:08 +0000 ifconfig: add AES-GCMP RSN OUI decoding This decodes the AES-GCMP OUI in ifconfig, ifconfig list sta, ifconfig list scan, etc. Differential Revision: https://reviews.freebsd.org/D49187 Reviewed by: bz --- sbin/ifconfig/ifieee80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 9f66281931c0..656e71e325cd 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -3136,6 +3136,8 @@ rsn_cipher(const u_int8_t *sel) return "AES-CCMP"; case RSN_SEL(RSN_CSE_WRAP): return "AES-OCB"; + case RSN_SEL(RSN_CSE_GCMP_128): + return "AES-GCMP"; } return "?"; #undef WPA_SEL From nobody Sun Mar 2 01:35:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z54Jq39W2z5VcND; Sun, 02 Mar 2025 01:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z54Jp0cnqz43Gb; Sun, 02 Mar 2025 01:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740879338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HI/ZIVKo63gxjDxU+u61ccwNnSNdmeWR+O9XSvTgtDU=; b=lpxBMqbRB0NgvzPGil+QQExEF4C3zEPlBtSncY5aQakEG9oMLLn99zKgkhgoUI+12Z2Ez1 kzSoffqRwhMg0VMvrRw5Xo3RVQZ5YK5TzDoaz+iBj6GQuBZeGsCh7ZtT4N6Sek0D7Xued9 3YYJHubDGdg7CZzTAonu5599eOEQxi1wgQtosTreYKSw5md31Onls0VORvmAd9WlRcg/FH aJj5VPIRTf6AJkePza12b2aZYR54JLsKWDPPxVI4tqdeP+pUR2hP5cmnZDQiivxYyrJ7Ra q+n+XGcdcRmMKAs9ZC5d/kWWI6ilCS7q76iUhaFGbo/vaSrm8jos8bOK4u9rPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740879338; a=rsa-sha256; cv=none; b=RlsI17o/Iu/Dw/VyxL7ZgYfsQ4pPsE06NCk1etuPfdzZrrNv+VLvDsTlVa92DXtN+Oa93w IICGcFDZmdpaPefnuyb+0QZQ6k6g1XbXMqlmFFz716WN0NA8r3UmPdHedKv8mlTXrrI9hL O1Vgo4h6qlaPUvEF7HnQc+QqxaR+RKo42OO7U9qN7+2tGrkCMMocelvyzliRfOw/4kUoY8 B4UYNLIrcQMzNC2YbT8UdH5kUSNZbkssjvbN97iumaYtEUlmw/02rj2PKxvO7pzrmyfjei VQL1rIESkk8s/ookC02uTr90OknmwRShQJ43qa7RG8dMzf7u3xJatXb3Gw9RsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740879338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HI/ZIVKo63gxjDxU+u61ccwNnSNdmeWR+O9XSvTgtDU=; b=O7aTU5EVy7vVaQBPDBnpEBUt96YXCtP28WZX2z+aerrGlCFjwuXZgTQUiXdtsfH/4JB/zp 1p0EYpo1f7Cz84TfOttawVOtpRj0y9r9JcCoeqBfmp7GyUPwg/zUOEIAzLmDnM2ia3+3XD gdYuZ05mDWziX+9yKPK5Wq7WQgPTOQhGLNE/1rqLu5UZEl1iR/rbLSw9/uS4JOSE9WCgZf N8UhF88kub5BHPcYMA8ebfqC2ysvU5s9+pxa7Kvuw0sT0hAeLfa8v0hdu/pdxhMd/vkv+9 Tc+zfwrJ9YqDEZQsLvh5QkW9s++CEIrbGH5rq/67esMz8WEDSgxA1vX4UwtBSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z54Jn6zxvzhLq; Sun, 02 Mar 2025 01:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5221ZbUJ077485; Sun, 2 Mar 2025 01:35:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5221ZblP077482; Sun, 2 Mar 2025 01:35:37 GMT (envelope-from git) Date: Sun, 2 Mar 2025 01:35:37 GMT Message-Id: <202503020135.5221ZblP077482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: e74a3c75855f - main - net80211: add AES-GCM in ddb output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e74a3c75855ffae028bd1991c73dee474aafce05 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=e74a3c75855ffae028bd1991c73dee474aafce05 commit e74a3c75855ffae028bd1991c73dee474aafce05 Author: Adrian Chadd AuthorDate: 2025-03-01 04:20:30 +0000 Commit: Adrian Chadd CommitDate: 2025-03-02 01:35:23 +0000 net80211: add AES-GCM in ddb output Add the AES-GCM crypto cipher field decode in ddb. Differential Revision: https://reviews.freebsd.org/D49188 Reviewed by: bz --- sys/net80211/ieee80211_ddb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index 3c57b03ddc65..d96d7988a864 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -942,6 +942,9 @@ _db_show_key(const char *tag, int ix, const struct ieee80211_key *wk) case IEEE80211_CIPHER_CKIP: db_printf(" CKIP %u:%u-bit", wk->wk_keyix, 8*keylen); break; + case IEEE80211_CIPHER_AES_GCM_128: + db_printf(" AES-GCM %u:%u-bit", wk->wk_keyix, 8*keylen); + break; case IEEE80211_CIPHER_NONE: db_printf(" NULL %u:%u-bit", wk->wk_keyix, 8*keylen); break; From nobody Sun Mar 2 05:19:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z59H33XWPz5hsRH; Sun, 02 Mar 2025 05:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z59H32R2nz46RR; Sun, 02 Mar 2025 05:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740892767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/ztPTBCAIdWKiqb+rD+s6UFAZndYSBETYtW62u5pFU=; b=KpjXPCEg2ZrgBOXOe+YxFEC0jyukzk7h8FBsEBe/vgIAf1fR+zg5dh+b652cBs+aI0JDEN +QFj9VycsRk37/En2t8QGtXxxDFPdKIN75X8cl6qsGxSG7PFBao0IEOoie07nL1LoRqvCF f1zdHmv18Nu9ZedjybpVa6BJeNcRKfP7G2KMqvihs+YE2+zF40PZ9Jc2fnoYp1Q4aFsbCE d/LzNvnygoiww2R0ZsX2jBS9O8PLEaaYAlEXMrJubS3hBdREfe0rwe9vxCaazDVVY/f3Wi wq5G3eJxYacilsbLtPGR1NgjVGhk7e5fWsnIssezf0aAQZXXu3Tgz4VI+UtU9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740892767; a=rsa-sha256; cv=none; b=NbnwPp571vTkwiPtanHqj5/vjMvYOhlp7iRUwwUSAHosountkty25vqZDHxIqpjepGqQmV vCODI/VOetFJLhHLq4NHODt/mtJNr5fUg3nhRftT+Fgy+U2lCOZJR7Sw+w7EmTCmb2VTJR hxY3l/vDBWUCVgbLEG8ZauP8i7iJ8sMXVzGKcC+PxtsK2y17gC8xMqNixNzxGodqJg34zG FmSV5eIvqwRy8V3Gcd4ZZS6wSlVtq+OJiTqOJcKU8svNgh1WKtf5MOGsqEAH4aUGOGn+3H P+mjI7Fx0qyZ2GFTunQjTIajqRsTsjy+5zWhm7L0NjeksIs1mREFOXtaQHeGxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740892767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/ztPTBCAIdWKiqb+rD+s6UFAZndYSBETYtW62u5pFU=; b=UFuRLT4VGwMWkpXT0tKmGwgzwnasXbOk5VptMXG/L3XhdgW4cz4QmJvwJzYGfT1AiCm0tE bsz3oxa54yNan+xQi31Zk7rJuQo0SkV/qb7LRN2qYgjvk8shOLmJQEatkaR+SgVraGwx94 VKxV3bOFTvtFD9PYjrfzRXq1L+QzBZkqR0H7UsqhhtHKTo/8i6xDV6UJ5x6Se8pjoC5M1C 2KehQCTsg/12w8mxjA6/hLSPClVnL9PzEKAnMzUsYBQ10oXhmzrePVvoc0YaDBh8aKu2h1 oZ8IiAzpgIS5JAviv/UcWm2l15v9dcZzCOZ+yQQ1GyLvwoKBSHyYXVP2Y9U+bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z59H31Nk6zngc; Sun, 02 Mar 2025 05:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5225JQgr091656; Sun, 2 Mar 2025 05:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5225JQYl091653; Sun, 2 Mar 2025 05:19:26 GMT (envelope-from git) Date: Sun, 2 Mar 2025 05:19:26 GMT Message-Id: <202503020519.5225JQYl091653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 23da585dd465 - main - pci(4): Give UEFI wiring example List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23da585dd4650bd17d605049779baceb466cf59b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=23da585dd4650bd17d605049779baceb466cf59b commit 23da585dd4650bd17d605049779baceb466cf59b Author: Warner Losh AuthorDate: 2025-03-02 05:19:11 +0000 Commit: Warner Losh CommitDate: 2025-03-02 05:19:11 +0000 pci(4): Give UEFI wiring example Sponsored by: Netflix Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D49195 --- share/man/man4/pci.4 | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/share/man/man4/pci.4 b/share/man/man4/pci.4 index e9b587dac12c..8623eaf3c3b5 100644 --- a/share/man/man4/pci.4 +++ b/share/man/man4/pci.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 4, 2022 +.Dd March 1, 2025 .Dt PCI 4 .Os .Sh NAME @@ -624,7 +624,12 @@ pin identified by the tunable name. Mapping of IRQ values to platform interrupt sources is machine dependent. .El .Sh DEVICE WIRING -You can wire the device unit at a given location with device.hints. +You can wire the device unit at a given location with +.Xr device.hints 5 . +.Ss BSF Based Wiring +Devices may be wired to a Bus / Slot / Function (BSF) address. +This is the form reported by +.Xr pciconf 8 Entries of the form .Va hints...at="pci::" or @@ -639,7 +644,7 @@ for any PCI device found to match the specification, where: The domain .Pq or segment of the PCI device in decimal. -Defaults to 0 if unspecified +Defaults to 0 if unspecified. .It The bus address of the PCI device in decimal. .It @@ -660,15 +665,18 @@ produces undefined results. .Ss Examples Given the following lines in .Pa /boot/device.hints : -.Cd hint.nvme.3.at="pci6:0:0" -.Cd hint.igb.8.at="pci14:0:0" +.Bd -literal +hint.nvme.3.at="pci6:0:0" +hint.igb.8.at="pci14:0:0" +.Ed +.Pp If there is a device that supports .Xr igb 4 at PCI bus 14 slot 0 function 0, then it will be assigned igb8 for probe and attach. Likewise, if there is an .Xr nvme 4 -card at PCI bus 6 slot 0 function 0, +device at PCI bus 6 slot 0 function 0, then it will be assigned nvme3 for probe and attach. If another type of card is in either of these locations, the name and unit of that card will be the default names and will be unaffected by @@ -676,6 +684,33 @@ these hints. If other igb or nvme cards are located elsewhere, they will be assigned their unit numbers sequentially, skipping the unit numbers that have 'at' hints. +.Ss Location Based Wiring +While simple to locate where to place a device for BSF wiring, the +bus number of that is not invariant. +Any number of changes to the devices within the system can cause +this value to vary from boot to boot. +The UEFI Standard defines a device path that's based only on the invariant parts +of the address: The root complex (domain), the slot number and the function. +These paths are hard to construct by hand, please see +.Xr devctl 8 +.Sq Cm getpath +command with a +.Sq Ar UEFI +locator. +The above example could also be expressed as +.Bd -literal +hint.nvme.3.at="PciRoot(0x2)/Pci(0x1,0x3)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)" +hint.nvme.8.at="PciRoot(0x1)/Pci(0x2,0x2)/Pci(0x0,0x0)/Pci(0x0,0x0)" +.Ed +.Pp +The advantage of this notation is that you can specify the exact location a +device will be at. +For deployments of multiple systems with the same configuration, this can be +helpful in managing the devices. +However, even slight variation in motherboards can cause the path to change +substantially. +It is also less natural to think of the UEFI Device Paths since little else +will report it. .Sh FILES .Bl -tag -width /dev/pci -compact .It Pa /dev/pci @@ -684,6 +719,7 @@ Character device for the driver. .El .Sh SEE ALSO +.Xr device.hints 5 .Xr pciconf 8 .Sh HISTORY The From nobody Sun Mar 2 05:22:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z59Lx2CPlz5hsVR; Sun, 02 Mar 2025 05:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z59Lx1bwFz49lm; Sun, 02 Mar 2025 05:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740892969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzzTRQZAyV9foGr+87IuchY5HdS93FidPyDe+u99Yao=; b=yxUW9MhYlVBdWnIRzUVCxqMLVkjgwNj+ddTx5p/h9qZHeuNHXkuFblCyf1Rcx2KwFH/9IU sm/UTrzdYJXtAFX8KpYHIwPzrn5vZ4ZN+swQIJ0q/Fp3dZxKwYwDFt5ZzdR6FFGntJRAn+ /dKy/FHm7bZxVUMLhqvX04s22C/HRPLWh3funp+Zc4SLOyj0TLC5WBy3gaJiMQR2HnQKXZ pArmoD9pXeAwThlw6pBgZ8KwvPOB7udvAerGZWyq0lDCKWxeXKFQ/4TOz6LzCGe2XfYRri 2+129EiQs0ZytluTNO9SP9rdL3YEtI82Uwp04J4v/5zqTzE86Mf42zeD9R81bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740892969; a=rsa-sha256; cv=none; b=Dnc/nLOVDS3zWh77iunWIEPtTJ1gWjFq7hGZxH1LzOIWfyU60R6/HTXfVMD5ELU+ha78ZK vk6W0dPWgSUBE98Vs3ERE5dQfPolHkouVBfLp8Q+LmkGUclUmN5nfCZdHLoscqsgOvluza 2haQqgnQZSrvXO747YnuHBycrxrNGRnb+cCLDwwR5Y35S+yj+IMxvBTEYJFKwkOXtG/VcG xWVr9dTIBLt0IxtS0ozDiftPWucU5xjDqZ1pg8XlufpJ9Ussvz+4HhD0N4ry/SsbyfuQ0H 0csAOYqIUDmoFVsr9RVLBgHPnHJCUOLlqI9tAZ+lyjIxfbcGxFYGQBtGMmwQEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740892969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzzTRQZAyV9foGr+87IuchY5HdS93FidPyDe+u99Yao=; b=TJqXeJJtCECG1oZJAGlDk2/7VWTNhLI1WfnHEtWIOiy5OQzV/r4arVSQqS9y4NhgCvKLJx EhdYPsYGZDo04dBuSqpRyZbCnQu7tqXtaKFxKTBGA8u2aP0+pXfN1LaOAAIAaZsITeI5c9 IccfXwWmfVOM7ptoGTRD+TB5XbDxmFh4Us8NsCmjXi28Ee5SgdaBaQCsdsZTxzaAYgwfYO A0tbdvjFJCqgX4LvW7wWNqozmt3WkC0DP89pFb5OUuUKO4vcsvvNu55gQH98IwAk+ZDhUe 1InEl7wNj9tLDVdz+4vjYZUuTHJ1mJrbcdwNVYnrdVzypSnuOlkXn8dRClRWpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z59Lx140Czp83; Sun, 02 Mar 2025 05:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5225MnqV008223; Sun, 2 Mar 2025 05:22:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5225MnbP008221; Sun, 2 Mar 2025 05:22:49 GMT (envelope-from git) Date: Sun, 2 Mar 2025 05:22:49 GMT Message-Id: <202503020522.5225MnbP008221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 7c5d816006cd - stable/14 - man4: Fix duplicate if_rtw89.4 MLINK List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7c5d816006cd0370149028f0a1fbedeaf634848a Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7c5d816006cd0370149028f0a1fbedeaf634848a commit 7c5d816006cd0370149028f0a1fbedeaf634848a Author: Ed Maste AuthorDate: 2025-02-28 13:31:02 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-02 05:21:41 +0000 man4: Fix duplicate if_rtw89.4 MLINK Fixes: 4262dbc57982 ("wifi manuals: Mlink + document description consistency") Sponsored by: The FreeBSD Foundation (cherry picked from commit ae2b84d9ab9cb01abb035ad6e938382d1f7c1e3e) --- share/man/man4/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5b8b0fa54630..41fd7d36a74d 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -742,7 +742,7 @@ 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+=rtw88.4 if_rtw89.4 +MLINKS+=rtw88.4 if_rtw88.4 MLINKS+=rtw89.4 if_rtw89.4 MLINKS+=rtwn.4 if_rtwn.4 MLINKS+=rue.4 if_rue.4 From nobody Sun Mar 2 08:14:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5F8t5M4sz5nqwC; Sun, 02 Mar 2025 08:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5F8t4cGdz3Vjv; Sun, 02 Mar 2025 08:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740903262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWXZ8hOaO/Yo9+pl1meEjzQ+nJda972lHecDcNFQlTk=; b=IwohgO1CvvHzoAv73fHvnm9DWlUb/glMfZbyl4K5cqckMHgEUDwuDeX4KJHFTsVqvU0Tix sie1vvW9NVZQATlL0PwoHe90noRh7DlLxUGwdZZI6ErXefI52v29aEQkyPfnAxjhejo+Wg UkBtP031QWvsa9plTSDLcdg/OHRkkAbGjLC9juby9aosrqtEeUfMRW0mIKtnopDATKeHkp b9Xagaa7/ce103b19469oGNHnZ2EirW+fqZ5UKKzs/joFJ4ZcZkNmOFgkIbANSmNgonloo EnGznNCCG37d2K59ea1s/1dzVqoVhC55kp4ZvkfzrWbhdwIyZ/c+hTo5vErHCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740903262; a=rsa-sha256; cv=none; b=E2+dqNEqRobZ2DaUtfj4NDRN540IA9bOEaRuMiJUzPL1aht+ccFBXREg765Xlg4MFaQZ/e Mbc0jrjDDkQX3/fbX7kHcQMTX0TNnuKmg8X0+dwIyGN1Y/TrXQ163WmYA80b6Yw5XH/Ec1 jtz1WwuZoJiXXSXL3uKvaj1FY2GVqtnX5cvAYPjodpF6++T4Fe23IgDYAeLBVudZ5socHU PGYLbr7COLny2JWrTX63igQgMsAgdUj2mXov/H1+Trt59ckTONHs8dKkrJY0VfNn7dGZjX nfxK50BZRf8mAwlHXixwtBZRJGUcyVkcdYYHzb+PE6mAuyFwouCuKZ2Q9s7cIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740903262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWXZ8hOaO/Yo9+pl1meEjzQ+nJda972lHecDcNFQlTk=; b=iS7qw93cX5P3UivOqK8Sqg4Lr1YtuCJDniQQeJJtFMUp9BJXG0DdRT9tEsnhZh/rUyfAVt Ufn55SXw19qX2jxFpfGOMmeSbBTAgFPXi6+srpXWEOkcOt3fpHqaa1b4c8a3LnEhF1mz12 ami3PZJlqaMr+yA7f94dP3yLMn+nmtHErxuNC5x3caa4qpW2AVwXkLLqzVIENDcHoqfEh7 p5qekKk7+U6R/1LsDIhGSbPWgGeZv7SXpzOfXCQi1pJ/NM+ZDOA1vLME6OjJduqTGGOa7+ 7d13zYujIcuj4E0IhNJ9B55GzDZMCIYyQX/jq6Duot/KRThR/K7t+RgCyE1GxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5F8t49W4zt4g; Sun, 02 Mar 2025 08:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5228EMC2025349; Sun, 2 Mar 2025 08:14:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5228EMPi025346; Sun, 2 Mar 2025 08:14:22 GMT (envelope-from git) Date: Sun, 2 Mar 2025 08:14:22 GMT Message-Id: <202503020814.5228EMPi025346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 420e2f8a74df - main - vnode_pager: simplify loop, avoid overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 420e2f8a74df4be1237244a4ef222d2ceae6823d Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=420e2f8a74df4be1237244a4ef222d2ceae6823d commit 420e2f8a74df4be1237244a4ef222d2ceae6823d Author: Doug Moore AuthorDate: 2025-03-02 08:13:24 +0000 Commit: Doug Moore CommitDate: 2025-03-02 08:13:24 +0000 vnode_pager: simplify loop, avoid overflow Filling in read-behind pages in vnode_pager_generic_getpages() is made very slightly simpler here, by avoiding overflowing the startpindex variable and then avoiding an extra test in the allocation loop that handles the overflow case. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49200 --- sys/vm/vnode_pager.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index d5d312b3cf71..69509fe8948a 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -1045,18 +1045,13 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count, vm_page_t mpred, p; VM_OBJECT_WLOCK(object); - startpindex = m[0]->pindex - rbehind; - if ((mpred = TAILQ_PREV(m[0], pglist, listq)) != NULL && - mpred->pindex >= startpindex) - startpindex = mpred->pindex + 1; + tpindex = m[0]->pindex; + startpindex = MAX(tpindex, rbehind) - rbehind; + if ((mpred = TAILQ_PREV(m[0], pglist, listq)) != NULL) + startpindex = MAX(startpindex, mpred->pindex + 1); - /* - * tpindex is unsigned; beware of numeric underflow. - * Stepping backward from pindex, mpred doesn't change. - */ - for (tpindex = m[0]->pindex - 1; - tpindex >= startpindex && tpindex < m[0]->pindex; - tpindex--, i++) { + /* Stepping backward from pindex, mpred doesn't change. */ + for (; tpindex-- > startpindex; i++) { p = vm_page_alloc_after(object, tpindex, VM_ALLOC_NORMAL, mpred); if (p == NULL) { From nobody Sun Mar 2 10:57:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5Jmz5207z5p5h5; Sun, 02 Mar 2025 10:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5Jmz20MFz3krm; Sun, 02 Mar 2025 10:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740913043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/TCuP9YhHrOMFZyAOW5DNNQc8hl9dZ4+o2F5L+Vo/3o=; b=Dr5bapUFYgygHnqYfkL7NJAFzzUkhsseCNup7YsNeTJRcoWgK6wJE4yv+U6I+GM0pcNDur XpbgPpdLMyuXwn2DHFF3EEVdORZQZ0LU+o3j2qXQTDjbCPeO/d4QT2zANwAzrxhdbsJoSv LtXODo4VNCaxxHDCK7gu1Ez6JrRBRGREzEvST6cN18MeFt7iW/eCWyzLooMpTaXzzTvHjM XJHUQW4IsRKV7GLqNSUSIi7A8j/Ss6HSUbXkstjMp7PZ0buli0Eo1jE6xnxUjXFOkiDcIW c7FzRAFHIlpbvrJBXoPf/E/c02zKLtEPBi3wDUxyWieX5/wTMI27aaIJRtGSBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740913043; a=rsa-sha256; cv=none; b=DA8LInrXk/P5cECJ45Os1YtWAEDJmRTH0b+s2QXFKJApyFPQdb1g64FHJDMrenAmqR7Oji K1k8Mrn5szHXv0WlQkjieTZDVjK+lIcQaxq0KsG28WtHa5PpLYT56SnD+7u8DHfZoWNiBM ElivFu4w8FbevGy4sIxTHVbBOwp9GzXpe7gM/q+G12os6Q9VQFlkFVdiIiZY1cTyJnpwvV ICYukJsbzZu9SkFX6vCRmdOILQydeUyTK8j7SWHBpLgsYm6GAhfeD8NCUOqp6n31tVcqPI LAG3qnU++cPuueGZPxPh5Qf0hSnVsLuNLUQQFNUoXcOHkyBZBzys8kiJGUJJyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740913043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/TCuP9YhHrOMFZyAOW5DNNQc8hl9dZ4+o2F5L+Vo/3o=; b=G3KQVvD1YH5BoIPXM93lgT7v8rY0cOIcP2737FlgaYbI9B5VhmGMEqVpTyPqSQicK4oSZv xo68WeGHaAAFDaL+LwVLnD3bXegsgwThnfnEN8iYGeuZlj5RKpEoxq8CaUdVqOt0CvNmim U5tnqTqMTi1IzzpCh2LU84AoqtONF6H4VW8R00WvaBIHyr2YeGGjEjbWiJ2gig6g586o0l oinGTcXPXTNGslfixdLQJAx67n+bNqiWT9cwg0FzzHQ6wzVKADoQKvoibUlrEORANhIYV4 +aNIbaiG3OHELH1Flb3pvNXnzVrgOx7pizL6HzqBT3Q6huskA9OEYa3VGlBpXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5Jmz1bClzxZG; Sun, 02 Mar 2025 10:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522AvN1a023028; Sun, 2 Mar 2025 10:57:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522AvNpL023025; Sun, 2 Mar 2025 10:57:23 GMT (envelope-from git) Date: Sun, 2 Mar 2025 10:57:23 GMT Message-Id: <202503021057.522AvNpL023025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 361a8395f0b0 - main - routing: do not allow PINNED routes to be overriden List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 361a8395f0b0e6f254fd138798232529679d99f6 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=361a8395f0b0e6f254fd138798232529679d99f6 commit 361a8395f0b0e6f254fd138798232529679d99f6 Author: Andrey V. Elsukov AuthorDate: 2025-03-02 10:53:49 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-03-02 10:53:49 +0000 routing: do not allow PINNED routes to be overriden First configured PINNED routes should have higher priority. Fixes: 1da4954c92ea MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48650 --- sys/net/route/route_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index e5ddd7782e1e..5a04e9dcf6e7 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -821,7 +821,7 @@ add_route_flags(struct rib_head *rnh, struct rtentry *rt, struct route_nhop_data /* Now either append or replace */ if (op_flags & RTM_F_REPLACE) { - if (nhop_get_prio(rnd_orig.rnd_nhop) > nhop_get_prio(rnd_add->rnd_nhop)) { + if (nhop_get_prio(rnd_orig.rnd_nhop) == NH_PRIORITY_HIGH) { /* Old path is "better" (e.g. has PINNED flag set) */ RIB_WUNLOCK(rnh); error = EEXIST; From nobody Sun Mar 2 15:02:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5QD32xL7z5pTvL; Sun, 02 Mar 2025 15:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5QD31hNwz3TTC; Sun, 02 Mar 2025 15:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740927763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sdlodn3S9br/PEzssoJF+S7EvmvHwmu5590QGHwh00g=; b=yQNy4BqWaeM7+jVsg1zsTz0FMaaGZT+y7KYrd0dE0AScjAAfiOETKL9o8OzMbtxWFyjcg5 VPCl/9EJzYXz98gDqOKwH3PS/ATNvIBwLx8goVxlJ/jyTm2Q2J4JHRmqIyK7N4VI1KEx9b vIwOoi5eA8akoJNMB5YV5lTJhI4kzGn46ieBapb6MRCxxAns0yHGQ0242fG0ov/REHENsy 2J5A5rmRAtul/TP8YsEc0WAdNCm1CoNEahfWgxd6dCyBB1eP+sTC+9Bk05I/wuN+sKaDfP 2u/7EYIaIU6wS8VPTHsUHqciBtZdGnFQcO+r9Kj0FhsM+I2Tyq5KQPdQZkOz0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740927763; a=rsa-sha256; cv=none; b=WF3gnZbcnYKfUJDTlh4EhlGMOB54gE79thgHM3FV8zrZu+hPF84qbRr9o+JlfCBo1HHox/ bPQ/P4DdDnDoWlPgGWat0DgwZDAZvA41xSRsGCKkCOMysEfWRh5/3arhsWnQ96MutnjICf rUsWVn5G8jMRspMJMjBSy9Kp3IPYibqZ0lDGjF+jkwADYqjM0N+IiX7sZriAqQVfHf59iz UKNm/8dvUqSnSsdN5/4Al9icRrGKxcBRy+1Z3IaDPq7KJD1iaczWFGRkvYt0aP3Ul0pyWd r2KBdqSUc1TzXhuWsypIh4MKKa6z3SJd5EcJbBhcoHINFxgICWzZWcO1T9z4ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740927763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sdlodn3S9br/PEzssoJF+S7EvmvHwmu5590QGHwh00g=; b=BA5ql0UXCKgiAB0RwLhoLTqrIz1qrPp92AqmhIXu4sqOjx59yxea5VgebO3PN/q4B0EPqu aNrsxRPE+jaDgvDhpj/yhtQSQhg/VPWqixKInLStqO9UC7iEdcqxPPzH5W/WKqV3TlQcUD z3DJbj2yFwH5KbJ3Jz1niRB5YKX8Nk7WBnpx2tA8/rTG39rPzUzdNawxyKxbgoMy6aTtGJ Nh/Zabnf7fRRN0EDNJOHIZSbE7gEvF1kbC1So2xVLs2pjQStwX6HoOODSHrQgsAE1AN3HP mlej2UgWDyZmbx6LWYoJarCH6GqzF1FAKo199V1BTWguXNYsal7MrdkjWP8Ujw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5QD31HZ9z1644; Sun, 02 Mar 2025 15:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522F2hLQ089753; Sun, 2 Mar 2025 15:02:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522F2hCi089750; Sun, 2 Mar 2025 15:02:43 GMT (envelope-from git) Date: Sun, 2 Mar 2025 15:02:43 GMT Message-Id: <202503021502.522F2hCi089750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f7174eb2b4c4 - main - netinet: Do not forward or ICMP response to INADDR_ANY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7174eb2b4c45573bb9e836edad2b179a445a88f Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f7174eb2b4c45573bb9e836edad2b179a445a88f commit f7174eb2b4c45573bb9e836edad2b179a445a88f Author: Zhenlei Huang AuthorDate: 2025-03-02 15:00:42 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-02 15:00:42 +0000 netinet: Do not forward or ICMP response to INADDR_ANY The section 4 in the draft proposal [1] explicitly states that 0.0.0.0, aka INADDR_ANY, retains its existing special meanings. [1] https://datatracker.ietf.org/doc/draft-schoen-intarea-unicast-0 Reviewed by: glebius Fixes: efe58855f3ea IPv4: experimental changes to allow net 0/8, 240/4, part of 127/8 MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D49157 --- sys/netinet/in.c | 3 ++- sys/netinet/ip_icmp.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 9a644c60e541..22adc8277b93 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -276,7 +276,8 @@ in_canforward(struct in_addr in) { u_long i = ntohl(in.s_addr); - if (IN_MULTICAST(i) || IN_LINKLOCAL(i) || IN_LOOPBACK(i)) + if (IN_MULTICAST(i) || IN_LINKLOCAL(i) || IN_LOOPBACK(i) || + in_nullhost(in)) return (0); if (IN_EXPERIMENTAL(i) && !V_ip_allow_net240) return (0); diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 936f76e7fbe3..17d15d7d9629 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -783,10 +783,11 @@ icmp_reflect(struct mbuf *m) if (IN_MULTICAST(ntohl(ip->ip_src.s_addr)) || (IN_EXPERIMENTAL(ntohl(ip->ip_src.s_addr)) && !V_ip_allow_net240) || - (IN_ZERONET(ntohl(ip->ip_src.s_addr)) && !V_ip_allow_net0) ) { + (IN_ZERONET(ntohl(ip->ip_src.s_addr)) && !V_ip_allow_net0) || + in_nullhost(ip->ip_src) ) { m_freem(m); /* Bad return address */ ICMPSTAT_INC(icps_badaddr); - goto done; /* Ip_output() will check for broadcast */ + goto done; /* ip_output() will check for broadcast */ } t = ip->ip_dst; From nobody Sun Mar 2 15:02:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5QD44h5rz5pV6v; Sun, 02 Mar 2025 15:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5QD42fbMz3TTD; Sun, 02 Mar 2025 15:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740927764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S23VVF8kFwUWLxPIlcjX3r1rM/PCkilV1r2dxVDcnh8=; b=nxbNsdNa1kM1dMAqErKsS5D7PLNfPd7utVNRzpVK0wsUPbLf3/Uc/99FysL61P8bYzKc8w lw1jKdTyT0ufcZD4gRdNDU4HWAICXQ92AcyjDF6VWWt5R2DWgWkEAu6NV3PA0/Q49A5zEy 9R9e7/v0L2tdKgUN5BmFYda77pZ1GroaXIeiuFa2q0CkF1Op31FQWJFCEK0oTlmd1Scm0m GPWCTpVmWPX45dgJOQ04hwL0AixJ8bTY19ypqvHpgQLQqprgym9vMQ4B+oZALtyvrNv9Jc lKCsKvc8IGO2s0tdVgUwn6n5R6PL7JvrHu6Cd2NdGoI6p8xecOTZOnufRMqzlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740927764; a=rsa-sha256; cv=none; b=Hdnir07tFhjZZ7lZNG77JA2XkXWDHs2BSLd0Qnyzi1WlbxqQ/WYbZQlVPmmukDlqKXkjo2 ClcjNLrGLYpg2cJbOtP4oRshPAb4byCmi/WdCgf4auH9KKoTgSZP7D5lyYhFk6ttIHTQbt 6rFoJVGtLT/htOIOh/gEdLFdJAmmyr5UW1yphhXRPkRkfEeWXg90T7bV5uiWoAES1SLVwp 0cSu8R5SfLawIhFw7oHh/oVPHQS7rIxrmikqoMQV683V20wO0sEKaU8duL6kSwydG4OI3c KigUX6N8rHoV84g+/Cw5bdhw0QsDeylS9f0hnXcKnnVYiX9L25CNx2ZmRr+VOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740927764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S23VVF8kFwUWLxPIlcjX3r1rM/PCkilV1r2dxVDcnh8=; b=PhHsTmvFvw9LccM6mOznZ2/razHr/iUKszukQVDMyd7vs+7RDq+q840dWcxc+VMK83lsR0 a6RlWxOWWXkO/ZqBopnXCuDijubTQ43r8sqlokBWreg7Rj4JB56fcldw6OcMpt/E5fC6gJ fJjLi6/wm87VZN8Cpz3yw1F89tuW3c5k4nm/x76HX0HnFK5wsVd8CpxTskyW9R4zrPLC+x iTEIxFywjCdx3hS0vgnYn+nUAwh+/xTI5w3ruqlYSNg6otj/0I1kGcwuMP2mvvY/cVP9dO p7DpqPXch7uGDKpQm51raDw/aXluX1LMaSGFnRYs6tGwglDkjRyOmI8s+QPflg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5QD42GK4z15wq; Sun, 02 Mar 2025 15:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522F2iNA089790; Sun, 2 Mar 2025 15:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522F2i5x089787; Sun, 2 Mar 2025 15:02:44 GMT (envelope-from git) Date: Sun, 2 Mar 2025 15:02:44 GMT Message-Id: <202503021502.522F2i5x089787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3ae7c763540a - main - netinet: Make in_canforward() return bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ae7c763540afc0bc5320eb45f2661d315370eb8 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3ae7c763540afc0bc5320eb45f2661d315370eb8 commit 3ae7c763540afc0bc5320eb45f2661d315370eb8 Author: Zhenlei Huang AuthorDate: 2025-03-02 15:00:42 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-02 15:00:42 +0000 netinet: Make in_canforward() return bool No functional change intended. MFC after: 5 days --- sys/netinet/in.c | 10 +++++----- sys/netinet/in.h | 2 +- sys/netinet/ip_input.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 22adc8277b93..2fcbff8611ff 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -271,19 +271,19 @@ in_findlocal(uint32_t fibnum, bool loopback_ok) * that may not be forwarded, or whether datagrams to that destination * may be forwarded. */ -int +bool in_canforward(struct in_addr in) { u_long i = ntohl(in.s_addr); if (IN_MULTICAST(i) || IN_LINKLOCAL(i) || IN_LOOPBACK(i) || in_nullhost(in)) - return (0); + return (false); if (IN_EXPERIMENTAL(i) && !V_ip_allow_net240) - return (0); + return (false); if (IN_ZERONET(i) && !V_ip_allow_net0) - return (0); - return (1); + return (false); + return (true); } /* diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 3d087e5b06d5..3f2c388548ec 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -674,7 +674,7 @@ struct in_ifaddr; bool in_ifnet_broadcast(struct in_addr, struct ifnet *); bool in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); -int in_canforward(struct in_addr); +bool in_canforward(struct in_addr); bool in_localaddr(struct in_addr); bool in_localip(struct in_addr); bool in_localip_fib(struct in_addr, uint16_t); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 08c48996a798..4d614dfeb0a2 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -924,7 +924,7 @@ ip_forward(struct mbuf *m, int srcrt) NET_EPOCH_ASSERT(); - if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) { + if (m->m_flags & (M_BCAST|M_MCAST) || !in_canforward(ip->ip_dst)) { IPSTAT_INC(ips_cantforward); m_freem(m); return; From nobody Sun Mar 2 15:17:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5QYV2XHsz5pWCr; Sun, 02 Mar 2025 15:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5QYV1gp1z3ZSy; Sun, 02 Mar 2025 15:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740928670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jzGWHNPwbMHu1gicJwBvcgIdbuZG4krjYfglW9/K870=; b=AOIWMkvFOanHx/CtLvkLYoHkTNXkYOyGGIKyZg3lRNRdTSIBry1YKna/SCbb0uXk99LU6J T4o6B05LzScS785r3O+AaZ03iHByJjWf1+0yTOqpMNHt3KtiQgIAdmjhOvvETVAnnh7l7L pWWAFlEk8BnGb6s0+q5basujMBNeKln/Bnv2nlBcZ2LP8P8UtR3lDzB50WxqdmvbQZkeGl eNEN3oxwS9Zzip1fp/J7K1vAedCzBmWNNnjDm9XTErpSDhuu8BXiCjBwp8oWZiI4EUmiXa S9uo9JMVYP+tmctFj9r+Sbh0m81SUGHBaKIT6EDqQFA8X4SyQLEtK8ks/6n33w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740928670; a=rsa-sha256; cv=none; b=ADIVeSv/zM7YcgfuJfwSfrodXpnJbU6uGZ+1SXRY+j2VkGhU4hs/9AO+yYy0ZOLK0ADHla /CdIpXzmVG3eAk3jXHtSMSrRxdJ6WuTHl6jnWsvzwKsovzfvaXvidiLfaTWFV7vDE42pq2 d0P9yA52RkU5jl6BNSVjhgoWLtwtx3lQq76NCoWqUxkedhll9qte50S3pG5V9Eh7JpcNQe 6hdWyZh61pEyuS43uDgenrN4DxTvXjkgg88kPFEpvEYsngh05wT+Jue+mmn+jfUgBAf695 rBm06yRgTJ9NWqgUiiMVMgl4dOx+HnTnjmXW14DOgmF/P1EpgHtUu/jT6K0eaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740928670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jzGWHNPwbMHu1gicJwBvcgIdbuZG4krjYfglW9/K870=; b=nIRmvCZ75SY99yDfTBVLzdhhe849RvqLXnLH8igJFFt//5KnD+y7qW25bUKok4GJaxdXPz sX0OvLIAf3shhJrumrOI6+rVZAgW0oW9HxwjluIYJH6mjlttQZcJE7XQYf3zNnQJZ93fUE dGklabE6YkytSamaE/B00SmogmAFu865QDuPG1/sDJuM4gs4MP9/wybqQk525xUVTtmt+o BsGJIfYQMdvpg6C62+N3IXPA75fY+m8+oMuw/Otbr4jRe84c+HdtCuKpAWwU41BjeNt9Hh gucsq49cmSQ+FmNj/sD4scmLCO0ld5csNAsqeQgUVgzK5pOfwkUkabFglSQ8TA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5QYV0zHKz15xW; Sun, 02 Mar 2025 15:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522FHnpG009619; Sun, 2 Mar 2025 15:17:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522FHnWk009616; Sun, 2 Mar 2025 15:17:49 GMT (envelope-from git) Date: Sun, 2 Mar 2025 15:17:49 GMT Message-Id: <202503021517.522FHnWk009616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Rabson Subject: git: e8a5b9fd73f4 - main - release: build OCI images with shell scripts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8a5b9fd73f4f437a03c85e7644daa55652e224b Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=e8a5b9fd73f4f437a03c85e7644daa55652e224b commit e8a5b9fd73f4f437a03c85e7644daa55652e224b Author: Doug Rabson AuthorDate: 2024-12-12 16:42:00 +0000 Commit: Doug Rabson CommitDate: 2025-03-02 15:17:13 +0000 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 --- 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-image.sh index 6180ed9d53b4..0fd64602b403 100644 --- a/release/scripts/make-oci-image.sh +++ b/release/scripts/make-oci-image.sh @@ -7,21 +7,23 @@ rev=$1; shift branch=$1; shift arch=$1; shift image=$1; shift +output=$1; shift major=${rev%.*} minor=${rev#*.} abi=FreeBSD:${major}:${arch} +ver=${rev}-${branch}-${arch} echo "Building OCI freebsd${major}-${image} image for ${abi}" . ${curdir}/tools/oci-image-${image}.conf -init_workdir() { +init_repo() { + local workdir=$1; shift local abi=$1; shift - local workdir=$(mktemp -d -t oci-images) - mkdir ${workdir}/repos + mkdir -p ${workdir}/repos cat > ${workdir}/repos/base.conf < ${workdir}/config.json + local config_hash=$(sha256 -q < ${workdir}/config.json) + local config_size=$(stat -f %z ${workdir}/config.json) + + echo "{\"schemaVersion\":2,\"mediaType\":\"application/vnd.oci.image.manifest.v1+json\",\"config\":{\"mediaType\":\"application/vnd.oci.image.config.v1+json\",\"digest\":\"sha256:${config_hash}\",\"size\":${config_size}},\"layers\":[{\"mediaType\":\"application/vnd.oci.image.layer.v1.tar+gzip\",\"digest\":\"sha256:${root_hash}\",\"size\":${root_size}}],\"annotations\":{}}" > ${workdir}/manifest.json + local manifest_hash=$(sha256 -q < ${workdir}/manifest.json) + local manifest_size=$(stat -f %z ${workdir}/manifest.json) + + mkdir -p ${workdir}/oci/blobs/sha256 + echo "{\"imageLayoutVersion\": \"1.0.0\"}" > ${workdir}/oci/oci-layout + echo "{\"schemaVersion\":2,\"manifests\":[{\"mediaType\":\"application/vnd.oci.image.manifest.v1+json\",\"digest\":\"sha256:${manifest_hash}\",\"size\":${manifest_size},\"annotations\":{\"org.opencontainers.image.ref.name\":\"freebsd-${image}:${ver}\"}}]}" > ${workdir}/oci/index.json + ln ${workdir}/rootfs.tar.gz ${workdir}/oci/blobs/sha256/${root_hash} + ln ${workdir}/config.json ${workdir}/oci/blobs/sha256/${config_hash} + ln ${workdir}/manifest.json ${workdir}/oci/blobs/sha256/${manifest_hash} + + tar -C ${workdir}/oci --xz --strip-components 1 --no-read-sparse -a -cf ${output} . +} + +# Prefix with "container-image-" so that we can create a unique work area under +# ${.OBJDIR}. We can assume that make has set our working directory to +# ${.OBJDIR}. +workdir=${PWD}/container-image-${image} +init_repo ${workdir} ${abi} + if [ -n "${OCI_BASE_IMAGE}" ]; then - base_image=freebsd${major}-${OCI_BASE_IMAGE} + base_workdir=${PWD}/container-image-${OCI_BASE_IMAGE} else - base_image=scratch + base_workdir= fi -c=$(buildah from --arch ${arch} ${base_image}) -m=$(buildah mount $c) +create_container ${workdir} ${base_workdir} oci_image_build -buildah unmount $c -buildah commit --rm $c freebsd${major}-${image}:latest +commit_container ${workdir} ${image} ${output} diff --git a/release/tools/oci-image-dynamic.conf b/release/tools/oci-image-dynamic.conf index b146ff2cf7c3..61cb90187764 100644 --- a/release/tools/oci-image-dynamic.conf +++ b/release/tools/oci-image-dynamic.conf @@ -7,5 +7,5 @@ OCI_BASE_IMAGE=static oci_image_build() { - install_packages ${abi} ${workdir} $m FreeBSD-clibs FreeBSD-openssl-lib + install_packages ${abi} ${workdir} FreeBSD-clibs FreeBSD-openssl-lib } diff --git a/release/tools/oci-image-minimal.conf b/release/tools/oci-image-minimal.conf index 82e2ce6a1bd3..93aad1e39250 100644 --- a/release/tools/oci-image-minimal.conf +++ b/release/tools/oci-image-minimal.conf @@ -8,7 +8,8 @@ OCI_BASE_IMAGE=dynamic oci_image_build() { - install_packages ${abi} ${workdir} $m \ + set_cmd ${workdir} /bin/sh + install_packages ${abi} ${workdir} \ FreeBSD-runtime \ FreeBSD-certctl \ FreeBSD-kerberos-lib \ diff --git a/release/tools/oci-image-static.conf b/release/tools/oci-image-static.conf index 552328e66f3c..753a03af653b 100644 --- a/release/tools/oci-image-static.conf +++ b/release/tools/oci-image-static.conf @@ -8,12 +8,13 @@ OCI_BASE_IMAGE= oci_image_build() { local srcdir=${curdir}/.. + local m=${workdir}/rootfs mtree -deU -p $m/ -f ${srcdir}/etc/mtree/BSD.root.dist > /dev/null mtree -deU -p $m/var -f ${srcdir}/etc/mtree/BSD.var.dist > /dev/null mtree -deU -p $m/usr -f ${srcdir}/etc/mtree/BSD.usr.dist > /dev/null mtree -deU -p $m/usr/include -f ${srcdir}/etc/mtree/BSD.include.dist > /dev/null mtree -deU -p $m/usr/lib -f ${srcdir}/etc/mtree/BSD.debug.dist > /dev/null - install_packages ${abi} ${workdir} $m FreeBSD-caroot FreeBSD-zoneinfo + install_packages ${abi} ${workdir} FreeBSD-caroot FreeBSD-zoneinfo cp ${srcdir}/etc/master.passwd $m/etc pwd_mkdb -p -d $m/etc $m/etc/master.passwd || return $? cp ${srcdir}/etc/group $m/etc || return $? From nobody Sun Mar 2 20:57:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5Z532mHcz5qGNv; Sun, 02 Mar 2025 20:57:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5Z523w4Sz3C4h; Sun, 02 Mar 2025 20:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740949030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCz0Y/L/LU1Wloh3jMb/p0aviXXmYklxagqqD3Q2sbY=; b=KYJhPxplkSBH4+JpRP1H9b94ob0m/IMg3otneiJftxsACq7cJzVXJr4k+rtLmzB90OuEgX Rb5dRuQ6R5Lnk2q5R7N888FJ26/Zhidx4CVVgtFviWH4Hu6/B4wrWAIYjVGpFtsOC/RMS9 3R5qGI0fQEOLR82oBZlcomJ2G0dt5DO1wzy4+JcSqVkozqUwa7WPFam5iFjlK8l1ILVZFJ VaxI2ejd36FIXhEAb7VObKVUPCOMbZIxjHYiC9Ve7SD8nKxbTtexxQPMPNgCIOAZHUBX8W HNhPn08Ni8rFbaJUQtOnljQMAxlUymrwqky8xvbk31pVlWS4XfWp7X5jUyqnkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740949030; a=rsa-sha256; cv=none; b=wcg3c0k1xD6ZsGPDNltX3hi6aT+3vWR+zAz9K8aMf7I/3vyEPPNAaOpJEcZtjn9HpSYKKL 58ya2bRFTNhlG9t83NeZSjs6UrCiau2OI+CX2mRD9QkBNYVR/+mn3QqxfRipBYnTgYCkLP sTutawlINAs+D40ks2F/QiY8XrlXgC6dEvZhdkYPziv4rU2+wic2du3pQJ8tMMuPhp3jhe x6o6mtk/0j7Acjykyhl0P/Cdrz1JbaifsF18QfHRJAO9xHxST2Twv09ku+CxsRfSXilAY0 LjABLyOJ7R1phPBT8O/YCkxmhNCaYq2HlRK3CzZXvV5T2PAHn4ehd0EUFi58+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740949030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCz0Y/L/LU1Wloh3jMb/p0aviXXmYklxagqqD3Q2sbY=; b=KunHz+npuuO1W+YSik1PjgIfiFohDPzzwkWCTcw8Sbt0dd7C2owOvwRQBfkygRadAiIqLE Bu3Iz9Pp5Fq08OZDF3P0KLs31KgYg3Csi0BudsjRdklTOzVlVRNLGKSvnBeJbw/cg92xb9 qhgosNweS/6qyKhlzzGNcIgO4L2cWt7KsFE+xzTqSES/QMbP9ohCsdUaBYOXWipfjGQ+q0 HAP09muveinXxd177DEc+RHb6GWB3oS4r2F3UKDIuf1uY4nZ4aKHN7Pm2rfJvdELGyH0Uv 61TVqiJIgPqE31S5sQmIaEhgIfDt5HemCtWklr4RaWd2/q4WNAeEK+4UnEl0/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5Z522vMJz2nf; Sun, 02 Mar 2025 20:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522KvATN043055; Sun, 2 Mar 2025 20:57:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522KvAKt043052; Sun, 2 Mar 2025 20:57:10 GMT (envelope-from git) Date: Sun, 2 Mar 2025 20:57:10 GMT Message-Id: <202503022057.522KvAKt043052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 85b69389ce56 - stable/14 - net: if_media for 1000Base-BX BiDi List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 85b69389ce56f091281aa2543dea31950f68a054 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=85b69389ce56f091281aa2543dea31950f68a054 commit 85b69389ce56f091281aa2543dea31950f68a054 Author: Tore Amundsen AuthorDate: 2024-11-13 05:08:06 +0000 Commit: Kevin Bowling CommitDate: 2025-03-02 20:56:38 +0000 net: if_media for 1000Base-BX BiDi 1000Base-BX uses two wavelengths, commonly 1310nm, 1490nm, 1550nm, or 1590nm, in a Coarse Wavelength Division Multiplexing (CWDM) arrangement so that a single fiber strand may carry both upstream and downstream. It is sometimes referred to as BiDi for bi-directional usage of one fiber. Optics must be paired such that the RX and TX wavelengths cross over, with one side often called U(pstream) and the other D(ownstream). This technology is useful for increasing link density or working around construction issues, and is also frequently used as a last mile delivery technology for FTTx. Sponsored by: BBOX.io (review/commits) Pull Request: https://github.com/freebsd/freebsd-src/pull/1518 (cherry picked from commit 78c63ed260fa20b3500aedfe41dc0dcae9593f51) --- sys/net/ieee8023ad_lacp.c | 1 + sys/net/if_media.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index f6a1be8004e0..ba397e9e5d3b 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -1147,6 +1147,7 @@ lacp_compose_key(struct lacp_port *lp) case IFM_1000_KX: case IFM_1000_SGMII: case IFM_1000_CX_SGMII: + case IFM_1000_BX: key = IFM_1000_SX; break; case IFM_10G_LR: diff --git a/sys/net/if_media.h b/sys/net/if_media.h index 534ad36da517..a2cac00550ef 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -445,6 +445,7 @@ struct ifmedia_description { { IFM_1000_SX, "1000baseSX" }, \ { IFM_1000_LX, "1000baseLX" }, \ { IFM_1000_CX, "1000baseCX" }, \ + { IFM_1000_BX, "1000baseBX" }, \ { IFM_1000_T, "1000baseT" }, \ { IFM_HPNA_1, "homePNA" }, \ { IFM_10G_LR, "10Gbase-LR" }, \ @@ -793,6 +794,7 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER | IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_CX, IF_Mbps(1000) }, \ + { IFM_ETHER | IFM_1000_BX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_HPNA_1, IF_Mbps(1) }, \ { IFM_ETHER | IFM_10G_LR, IF_Gbps(10ULL) }, \ From nobody Sun Mar 2 20:58:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5Z6J2d8nz5qGSm; Sun, 02 Mar 2025 20:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5Z6H6v35z3CwT; Sun, 02 Mar 2025 20:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740949096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+v6rko3T6A8deV3oBlBfZO6XuamUdJBsX+9Ra/CVOyM=; b=PxwWjR850kvhh5tZbvtmt5zTyL/tNwCBwEreNiWgkjRWHkafeMGBQ1sQihFwEFIH7TpLxi dZk/ZTiiKxo+6ycIfF6bObN4UbpKYR1M9QnBzxR/JyonJdEqgYlfNx6hbKuvPehduaLjBo 81tGGfD4Q4SZZV8dgmdJ1WXw71WTJdqxs0GYtRWKRbSG0CX5ZIDoL0rjxFb19fSZEJQGE1 S/XuVrhxoXhha43y/Z/7/vHpGf4zKDFFmSI7GV1fgiVvj/7YtOwCU2QkFEYU3W0aLsMqR8 CbDw4C40UIk1cSo1Fnx5Vwk8r5LFyvXJFyggZCwfp/8qo4aZEgcIetShV9jR9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740949096; a=rsa-sha256; cv=none; b=ebJsDaP20Vhep2COiBSTVSqIpzjakoO1mLgcAGHNG41w3n9WPMpnY5n2kg/gghnOORgzJ5 4MNy9VzNoEYm3ap7xwU2JjBeJEm7hq2/H/4WccuV27D0MJirBePgkhygXVoGYWxr8HUi5n F6gUFLaeYtEJpY/7nIvh6MTdtYoQCiCW3y/oE1OcG1HqW/Zok3n+5x+boCND6vDIpzSSjS S2y1cfrkltkU31lF5Ek1i6KgGwusePd/+x+fo5bNBAjpnMsX8ENCgZATkU134BCQ0chEpY 2gCQ+Ysj16RpxL/tLooSKQDTAfB963zygfYFvZsPTr72ZeEMU7AvlwTYQHSjag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740949096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+v6rko3T6A8deV3oBlBfZO6XuamUdJBsX+9Ra/CVOyM=; b=HzjaOu4ZrpCe/dkWl2PXLGAvUDr5Ud/nGPIfijihNZPtEn2M+PQC1o1dc+Iiykz2hgONVb Fs5a8VfWqr+mjPyxNJqojBfbSQsFy66l8FDugKA6U4azPLOxdXpwhnXhozkohD7wBJmJkb 23y8rtTAu590VoiDMqGyNDqyo3qsv0ooenSP/TNDO+s6j5xUP0bcfhrgduAcFs52UbMWLt a8ijinwN9VbNlaHq35Lrrc9ffXH1O0FoivKkF+H+phL5PcBALnwNhzrkmwmqoVb3XS6R5S 2l3OByiMZlDMrTGM3C5OziujdYRwrRmvaF/sWFj1Bhhcwu+JdhR4YCXVapJEag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5Z6H6PzLz2ZY; Sun, 02 Mar 2025 20:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522KwFSO043467; Sun, 2 Mar 2025 20:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522KwFBW043464; Sun, 2 Mar 2025 20:58:15 GMT (envelope-from git) Date: Sun, 2 Mar 2025 20:58:15 GMT Message-Id: <202503022058.522KwFBW043464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e94246e0a2f3 - stable/13 - net: if_media for 1000Base-BX BiDi List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e94246e0a2f36f955f481eb9b6f1faf9bd0d5cfd Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e94246e0a2f36f955f481eb9b6f1faf9bd0d5cfd commit e94246e0a2f36f955f481eb9b6f1faf9bd0d5cfd Author: Tore Amundsen AuthorDate: 2024-11-13 05:08:06 +0000 Commit: Kevin Bowling CommitDate: 2025-03-02 20:57:59 +0000 net: if_media for 1000Base-BX BiDi 1000Base-BX uses two wavelengths, commonly 1310nm, 1490nm, 1550nm, or 1590nm, in a Coarse Wavelength Division Multiplexing (CWDM) arrangement so that a single fiber strand may carry both upstream and downstream. It is sometimes referred to as BiDi for bi-directional usage of one fiber. Optics must be paired such that the RX and TX wavelengths cross over, with one side often called U(pstream) and the other D(ownstream). This technology is useful for increasing link density or working around construction issues, and is also frequently used as a last mile delivery technology for FTTx. Sponsored by: BBOX.io (review/commits) Pull Request: https://github.com/freebsd/freebsd-src/pull/1518 (cherry picked from commit 78c63ed260fa20b3500aedfe41dc0dcae9593f51) --- sys/net/ieee8023ad_lacp.c | 1 + sys/net/if_media.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index 746f8dc08746..3cac86a8f14b 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -1149,6 +1149,7 @@ lacp_compose_key(struct lacp_port *lp) case IFM_1000_KX: case IFM_1000_SGMII: case IFM_1000_CX_SGMII: + case IFM_1000_BX: key = IFM_1000_SX; break; case IFM_10G_LR: diff --git a/sys/net/if_media.h b/sys/net/if_media.h index 534ad36da517..a2cac00550ef 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -445,6 +445,7 @@ struct ifmedia_description { { IFM_1000_SX, "1000baseSX" }, \ { IFM_1000_LX, "1000baseLX" }, \ { IFM_1000_CX, "1000baseCX" }, \ + { IFM_1000_BX, "1000baseBX" }, \ { IFM_1000_T, "1000baseT" }, \ { IFM_HPNA_1, "homePNA" }, \ { IFM_10G_LR, "10Gbase-LR" }, \ @@ -793,6 +794,7 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER | IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_CX, IF_Mbps(1000) }, \ + { IFM_ETHER | IFM_1000_BX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_HPNA_1, IF_Mbps(1) }, \ { IFM_ETHER | IFM_10G_LR, IF_Gbps(10ULL) }, \