From nobody Mon Aug 26 05:16:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsf5w0rFjz5VFBN; Mon, 26 Aug 2024 05:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsf5w0J02z56P8; Mon, 26 Aug 2024 05:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724649364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3TIDybSH8Qc/pktVSjn2PvLKhyUVQi9L4vojNUqtddg=; b=n90FrkmCY6WMEuRekTb6BoFpUssnHyuHTp9J0Wju+t/PA8t9lmJk2GRJ7Ib/jQYzK2pRlO eK8i2APgUv1IOEHoEPVOf0p2IrUqPc2bSSKaAO0yOApKI8fdPb2kkM34gXo9CIm82812gh iPYhPE5tA+wEf6uBMZ870ywosgQsc1N/xtpWOInFiqUuLG4KmBwI2mvE7uLtShdot0+mWh OpRzmFJfYAztxVML7YnCIRTekGV5fJelWlc4HkjB1vjnf5Ea/jqeckSIjKMK8o1tUGa8VJ wAw33zPT+It7CGJYDS3kSoc+AD4PCCxi/TzdEPdNNK2KI4505XSDTVtiLeEeQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724649364; a=rsa-sha256; cv=none; b=ZOHTpH2mrWxNlOPJ5F8lvjY0d6wszKjEzzpXGp1xD3b2MdHN3P1PQ3N4GzNKTf4BxC9dlf BHX261gmW7+4IhhZxAzFCeS5XlJizSys0dj7AGKnn+v5Px64WmTFuNhHra3c8ToCvVPRUW YcSv80GHERvU7dp5BemrERPOESuNIto6drzUTQCMNDetJ/v7l9S2qKT/IDftDn5UtYB75D 1Kt0NYM9BbQt3Rc9SlZsOxFivA7+xULE8lLODHdHv+I1CoFQBd04kzT8AznzKsXXyg6h3V fftzyOGhB6O/eksJ0WZS/h2MJBmSRS+6wU145jphjf791hd3eUnWa9GpRX1Vbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724649364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3TIDybSH8Qc/pktVSjn2PvLKhyUVQi9L4vojNUqtddg=; b=dzvoghCpv45Nauc/PXQoLvtnCKbkGY9jU8GJx5KwQoxWO5ODU0geQbG+QVxG5/IisrCYx1 UwknPCHRpsU5T9CBteg6jMDRCMYbIVdxHP+x7t6P0jIFV0dqgExMkZgZDJXzjAPq0/FrHH 6LIQcYgI4kOxUquReYHxSU9Fw1vZTmyvrPy4JyC1lJy0cBxkCJIuGAql0daw272BBRwdu8 BTZ3aFirMH+n4CryFFTFnHZ6xFC8t55TLtrtU1JcXbq+po2vgQ9yYT9NEWKz/tjqEpO37b 8UXvZkKb6jJtrrSRB7+GncRU2Vk6n+KzLiXkRUR3PrSmGcDpyE0Qew2jmYXU9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsf5v70dpztXw; Mon, 26 Aug 2024 05:16: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 47Q5G37O035346; Mon, 26 Aug 2024 05:16:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47Q5G32f035343; Mon, 26 Aug 2024 05:16:03 GMT (envelope-from git) Date: Mon, 26 Aug 2024 05:16:03 GMT Message-Id: <202408260516.47Q5G32f035343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: c7d5163a1335 - stable/14 - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7d5163a1335a1ff41bee28a6d49c87cdbd36411 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=c7d5163a1335a1ff41bee28a6d49c87cdbd36411 commit c7d5163a1335a1ff41bee28a6d49c87cdbd36411 Author: Oliver Fromme AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI CommitDate: 2024-08-26 05:15:43 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 5af8d9aca7bd..a0a7b9db60f8 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,6 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; struct amdsmn_softc { @@ -116,6 +117,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M70H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 73a4ba86bb84..583ff80cac69 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,6 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -142,6 +143,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M70H_ROOT, false }, }; /* @@ -874,6 +876,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) _Static_assert((int)NUM_CCDS >= 12, ""); break; case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */ sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); From nobody Mon Aug 26 05:17:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsf7d2f13z5VFW5; Mon, 26 Aug 2024 05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsf7d1zJhz56NT; Mon, 26 Aug 2024 05: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=1724649453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jaGIcmLgdmDpJcl+t2ET1RtIecdsHrknE1EeN/LVdg=; b=iiNgi/4U2F/rQLUNQyjnVkBC62ejNKi9tlZk0rquB3KLhxw0jTYabTRSTp51zZ9k3rVH29 YjvqMCZ6jcnFjcdkPH6sFZDBpaMCQISRo2uwm3piGKFEbLYxB+/rCKC5a/NIz7/+iO2G3p pXGdk1B01HDgmFx2HaYifpSBHLyG6y3m5Pw5HNSGPTAeYVTGFcUp6iHIT/Hurmwp1pCxeN C7XOhSqnK4RRcMTFib1Tqsw7rl5Vl2XUQLeonryeeecgoBum8+e7mujdLQtXqR6yRndGqh Zi1R442qjk1lQm+EEjSRKCaVHUf2AmPTELxqP2f9mr3y+T+MC8OqnZr/VWehqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724649453; a=rsa-sha256; cv=none; b=R1a3kq7dweb+fZReTQbs1P2MRn33QpoVb1+UNdo1nZ6RRjZonib+PqZkUtktrA8gKqAGJr QuIA7N+QOOHZ2eq51pyikI0oYgARc1cw83K0RsN9gRoGphPuofFg4qeZr8k0fmES7pKuCm m8pLCGBBQZla+A9WIZIXnfUBRNeYHQe7I+yMIe6j4ttuhFyzn/2DOYZghQUiOahX5v4txM 3g9/HdY02BxSHRnge5GXn9+L5S1PudiosebFxBsNjCaMTCkGAxnchygSHCIRVQf9/A3WPl jn1Hr43uC7iVRXxr/d4pqnn5YQY88XAkd/6vSPO0QZXOG9z7/ECFkcWurb1Mdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724649453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jaGIcmLgdmDpJcl+t2ET1RtIecdsHrknE1EeN/LVdg=; b=WKFjZJ8XRAJgGOBOEs2Q5LH9B73/q/0Tgx+tOnjpoIWBHJXBYOo+4tRZ5TpAOMA9SM5iwC o6rAgbrBrGRpIUrR2EADSu1p2GR2ZkXgTsE2gmXZlAz5P3DriNKarJsHPaOlKzi4zmssPO lAulHeuuML/HF3QkxO4REAJ2IQ6r2XbltT9Vs0tE36ez2VdJepmnUy/g8T+XTj4csKP3Hz wmXOUxmgwvpE651lt6uJ2lsOmi5ukcOnQTUQiKTzxqzTujPvmU/anlNToojajIfUISkwc/ Feu64KCRsXZPK2j/g78C+iZgMz4WeGoWwLdU2RbfOzEGa6CUrt2Lde3nZ30boA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsf7d1YDYztGs; Mon, 26 Aug 2024 05: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 47Q5HX9K035707; Mon, 26 Aug 2024 05:17:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47Q5HXaj035704; Mon, 26 Aug 2024 05:17:33 GMT (envelope-from git) Date: Mon, 26 Aug 2024 05:17:33 GMT Message-Id: <202408260517.47Q5HXaj035704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: cb8f15aeede6 - stable/13 - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb8f15aeede63627e220c40fe4911df79f35fb69 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=cb8f15aeede63627e220c40fe4911df79f35fb69 commit cb8f15aeede63627e220c40fe4911df79f35fb69 Author: Oliver Fromme AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI CommitDate: 2024-08-26 05:17:17 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index decb2c1249ed..fbef358f4957 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,6 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; struct amdsmn_softc { @@ -116,6 +117,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M70H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index b38f92131c77..0e7f805b40fd 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,6 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -142,6 +143,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M70H_ROOT, false }, }; /* @@ -875,6 +877,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) _Static_assert((int)NUM_CCDS >= 12, ""); break; case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */ sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); From nobody Mon Aug 26 13:22:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsrv91C7bz5SvnB; Mon, 26 Aug 2024 13:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsrv90p10z4Y9g; Mon, 26 Aug 2024 13:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wsl/PkGcruWNJJuXztIXt4qUwe859OyC4m+DRDsCEOg=; b=hK7yJOBoT2VyJhxx79Emd8B/vMb9qKCp4QUS0UqoPZZs0psP6h8ZWK4W0ULii7PvqMJEQV es7ubhrBcEFbXnCfAHJ2AwD2Avpo87kV3pr0hrBR2pFjwk/Wjz6jIyWJcfXkQhP0ytU94y 43QwVdjwURtBfvdEq+NDG9QC/EtEh7R3nKAKs7lZWXhCa9kmKOIIyM5MkKcZb9MY+GS8hc MJqG9P7vSoLV/oJNG7dm5ThWgH+VGKFYWbFBkw82dOKnhwvVwsH7YD7dpju0SH/wc9XoXh PMwxbrLL0eNxhIl8GL3iFcwXDHDRQIHB2ST87ErBnHWFD8GY1as4jk1wL1jQig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678549; a=rsa-sha256; cv=none; b=H4PkL0a9MKswUDNyITrEhcO6d83P2ysheyh5Y/PIJmkSHk+sva7hbCqz5638BYVsUVOruK 9b24im7UuaXokuBlpko98dbN6YrG02uQEMrwgjSgrbOfdAKb9VL1Isj2HZvFEnEaWXXIcX Fs+D0IPYjnDZBUEBK6DmsIhRcBT1ibYkGMmgL8rXZjw/HRScZu3E3xUmg8AAWeuMI2BBNX CEbVM1YOLrLVbq/0O4Jdp07+er+cUy6KrL4OUA1JS6mdOg6xnndfXnMJG+fiAZY1ha6y9N tYjYxa5+0MFD+IvKeckBpkMGuCtSJHzl4A+fpCb9LRbH7AynCtpn4zvqmrUFjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wsl/PkGcruWNJJuXztIXt4qUwe859OyC4m+DRDsCEOg=; b=RJEDLrur+ACwh8VyOSo4sdhLL4V8srwunLcfQOfa5RiexE9AsXrtV/NHIfG8K8ZR5gsQoK 4MTyJX2aGJm2BAdgPG3QawBmYJYQBVqUYOh5N6QxadCVGXDm/PyUb3rCqUJbLDGVIjp76m p8MTE+eYHayQOufe+z1cCw0KRsjwtQ9T01DsEojp38guYNA17Fya2Dncw5XQlM5O39jYBT 6hlkgojPWgLUXI7DHADCXpUKyLq8aQuI93qqlYDAtiMqi8JJUqyiTRk/nx7RCa/Eu9BNej NmHBrg8NvA5n0G6GkDOPCyN+r6d5tjLhDJZwGH9ha31bEPNzDOGIMS2iCld0ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsrv90PX1z17cH; Mon, 26 Aug 2024 13:22: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 47QDMSPp066026; Mon, 26 Aug 2024 13:22:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDMS3N066023; Mon, 26 Aug 2024 13:22:28 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:22:28 GMT Message-Id: <202408261322.47QDMS3N066023@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: 226c73373738 - stable/14 - linux.4: clarify path translation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 226c733737383478f3c1d3f8c119207136c05de0 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=226c733737383478f3c1d3f8c119207136c05de0 commit 226c733737383478f3c1d3f8c119207136c05de0 Author: Ed Maste AuthorDate: 2024-08-19 13:43:37 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:22:03 +0000 linux.4: clarify path translation Try to be a little more explicit about the path translation mechanism accessing /compat/linux/ then falling back to /. As suggested by martin@lispworks.com, refer to the compat path explicitly, and correct an existing grammaro. PR: 277804 Reviewed by: fernape Sponsored by: The FreeBSD Foundation (cherry picked from commit f66e71fa78e16164339f7fd4791306fb30165581) (cherry picked from commit d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1) --- share/man/man4/linux.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 0efc469985f9..0659651d6596 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -61,11 +61,13 @@ under .Pa /compat/linux ) before .Pa / . -For example, when Linux process attempts to open +For example, when a Linux process attempts to open .Pa /etc/passwd , -it will really access +it will first access .Pa /compat/linux/etc/passwd , -unless the latter does not exist. +falling back to +.Pa /etc/passwd +if the compat path does not exist. This is used to make sure Linux processes load Linux shared libraries instead of their similarly-named FreeBSD counterparts, and also to provide alternative versions of certain other files and virtual From nobody Mon Aug 26 13:23:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsrvv0Q0gz5SvGx; Mon, 26 Aug 2024 13:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsrvt71Dfz4Ybk; Mon, 26 Aug 2024 13:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6WJ6pxRMKN4KJvt/XOMG57TMBgGvqJaZFEOKjNqDdJY=; b=JkKZXMG8hOlMoyzMnwm3WtDha3/vMIU9kY1w22AvarL2oinQwpUv/g22JjoOWitF2SiDbD KlS47e054eeIHVvE5HM7383loeapIL+9xIoIwPYMBUpIKRZyk4jCnKpQjUHDzKrdtSH+RU bkLGs8usmY2+/0ceeYB/t+lEWejt1mnI0jvkGkWAgCHbsGYGrWut02xxDXjDkHVbQJTH1w aWq0eM7Y23L7uBcs2mkNzCygUBvAchqUVe5HVsQR8NvK2tLXZSXc4R/9ORaTfYgaVgeMI3 T1051aPnkJ1e4N1wUojHXxZqpmoCVLD2+/GrTxJwQ5QTB6fCbPxhKLmaBVhLeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678587; a=rsa-sha256; cv=none; b=cKlO7VgCe/CxGR0wa8wTgrh5thwZee+WCEgXkazFHOAc658Q8SW3GR0DmNN2zK7qGKR2p/ o1plhKJ7AU1OxcSzximLRSpFhWDyDrKGYsRyrd9PMSldTAfUKCst/nR5w4Fy4gWmZdP89y rVVHTqVQvbiXhZCQQSCK8/gi1uvmF3RHnxHmNYWiENIrDZWyJXpMZFtD79EDJjA9T0Rf1g UX8vsGKwNtnlSKlu5oVLKEDze4jyhEdVKD8+mOm0ZdLX02TfTwjzYP83DJPXw61YkfCVAu Ue6eQWfUxjK0YdRzdZf93fFDtg0BNA10ikwZhE8VH7sr1rzk3uEgQs4LrOHAiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6WJ6pxRMKN4KJvt/XOMG57TMBgGvqJaZFEOKjNqDdJY=; b=xHLaxe8Np0J/vbjLUMRXiAHgLX4k79/HGK86D/Ev4lJ3zlDqL0fb6jeirFRoEfd91K1NwB em+cwLYDpDm4PSYDKDJpEfPx8gLoXSjVXO5kbeehff8+qRfGTEHUKEQJIiPMOXufUVv9SH GZHmrxmEfMQDh6UOOvP/4BJNOIlc1e+kjpcuRKQb/vxGSHSbDMShvEKP62zosB/+hTSNQP Ryj+UiP87ZDfkxNPMu4z8EOopCP1apC4Jk2TnHQVsD9mJQd0+mV/cbGxPqgOsBHkOXmUXB omfxiEBvTMS+BFv6Gb0Dh7ei8iDBYIS/itjfesAfKBhsRxrUlA7ICCjTiz9eFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsrvt6dF3z17cK; Mon, 26 Aug 2024 13:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QDN6Dt066232; Mon, 26 Aug 2024 13:23:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDN64r066229; Mon, 26 Aug 2024 13:23:06 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:23:06 GMT Message-Id: <202408261323.47QDN64r066229@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: 6a847b6d1ee8 - stable/13 - linux.4: clarify path translation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a847b6d1ee8ccf7e109d13bece2ad634672e6ff Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6a847b6d1ee8ccf7e109d13bece2ad634672e6ff commit 6a847b6d1ee8ccf7e109d13bece2ad634672e6ff Author: Ed Maste AuthorDate: 2024-08-19 13:43:37 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:22:58 +0000 linux.4: clarify path translation Try to be a little more explicit about the path translation mechanism accessing /compat/linux/ then falling back to /. As suggested by martin@lispworks.com, refer to the compat path explicitly, and correct an existing grammaro. PR: 277804 Reviewed by: fernape Sponsored by: The FreeBSD Foundation (cherry picked from commit f66e71fa78e16164339f7fd4791306fb30165581) (cherry picked from commit d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1) (cherry picked from commit 226c733737383478f3c1d3f8c119207136c05de0) --- share/man/man4/linux.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 0efc469985f9..0659651d6596 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -61,11 +61,13 @@ under .Pa /compat/linux ) before .Pa / . -For example, when Linux process attempts to open +For example, when a Linux process attempts to open .Pa /etc/passwd , -it will really access +it will first access .Pa /compat/linux/etc/passwd , -unless the latter does not exist. +falling back to +.Pa /etc/passwd +if the compat path does not exist. This is used to make sure Linux processes load Linux shared libraries instead of their similarly-named FreeBSD counterparts, and also to provide alternative versions of certain other files and virtual From nobody Mon Aug 26 13:27:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wss134pDgz5Sw2v; Mon, 26 Aug 2024 13:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wss134FGhz4YwK; Mon, 26 Aug 2024 13:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jlNoG4+h0srj+0Hcz/GnISzNWFRybTYMgtq2NkQdH9s=; b=X21cUnkzhwGQAtnka9bCmcRqsCqEuCTjt49vhL5j9ye86nkcEQ6cO4NFtePrv+QgvdT0aa /t3LBYrAlkZ3GFzErsxhoFjvX1Qobn98l4mmKEkqLlp1KJIrXdILtEU90YC9JaAX+3rt3v 1Sbm8K7wYa1PIjybKzNzE6EGQ0hmR0zoD3OHaDDuCNtZzHoKThEbVcvbdzN0mHP/o+zuH4 Xcz4agdjD/iB99rKr7gWGt5NNN4hdKf3Fps0bD+//64ssPEkvHRXm+e1b23dDsEPDNh3Iq y04nevBOpJ6fWQg21Z5yza3i3/hNk1OZfiN5p9O7JQ1tTCilxs0eEcxIr/pz0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678855; a=rsa-sha256; cv=none; b=Dqmy2AWNEGvB14nxrPeuX7Eht1m1WUQepoPQEzcaN9NKb6AY2qBD+utr8y3OAOtgFhc5Hi 36Kx2eupFJp1+tsDl5YnFMNO9Pl4SHuqOudM0sx1AlRNbYIPxLpEqbJwvriFeMhv3aUpwl T2tgmXB5DmD0Neek1QHiqux9WCfMsYdFizt29VvTcXZqpLioeTQslRUr96MucXLcT2+x5F xg0+e1jDJ14hPwVYOjl5r8Tm5GcQlCxXrIn6crDuD1H334J0iYK7+wmLTjLKD6gBJS33A6 i2dU73jbD+IwG4HUtjKsBo03PTYb6ZtfIX86+pnweY5FPpui0lnBw+q3Bx5NcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jlNoG4+h0srj+0Hcz/GnISzNWFRybTYMgtq2NkQdH9s=; b=L3lKcyIZzaRFI6Snpj91+RRkWaZjf3U9vs5WQXWEjEI5G/kdvSXF03AMr52dHilcGTr7mp LK0i9kiyZNn2Nxbm3s1t6jmr4MkbavzE/TCvRjxaX74q7G9Y7paXy6VG8P2U5iMqcvoLNX dOdkknmXH/KGhPRkT56sxrAvr2s8iqnSUR1HyRz/MGfbCzd1Vi/E2xbRTUjo1tnvc0o+2C KwP8Q5mvpijHijvXnlx7htVYmR/o7Q8AFiRuU83VvAcTPRTunPcwTPXlMSz5q+Y++5Qm93 abVYadTON7p4aK4vxOT+sl0iYRoRhs+/+7MPSOZa7pux3wqqA71feancs8HumQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wss133dPgz17fN; Mon, 26 Aug 2024 13:27: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 47QDRZuD066958; Mon, 26 Aug 2024 13:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDRZXH066955; Mon, 26 Aug 2024 13:27:35 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:27:35 GMT Message-Id: <202408261327.47QDRZXH066955@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: 131b7dcb2fbf - stable/14 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 131b7dcb2fbf8f15815387f60536d9cc16585b0d Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=131b7dcb2fbf8f15815387f60536d9cc16585b0d commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:23:37 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a315c5ef7df3..1d5e13ad4671 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9340,14 +9340,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Mon Aug 26 13:28:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wss2F5GSDz5SvvP; Mon, 26 Aug 2024 13:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wss2F4n1Jz4ZLs; Mon, 26 Aug 2024 13:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9ph4z1Ms+IaXWfrAPPa2WJIWtUR2GcUc4VDNy7M0SI=; b=FQSchJK3BKMsN2d1EuEAeJ1zN90uGbaOu6AsTCL267dcHA6cBPBcxhp/rMHiOI08jM6DEW 1CTCRE7jXGM/SNSg1Q64yaGTeza9k/oBTQ+YQM8wFJ1qs07OcuVAX9RKf4yO/bJoMH7i3h 9QpobDNpFHZkSgPXP2SNa6mN3a+iiCMiz1LzDmxD1yoarMTpmJqtgb/7H7tSMLBGjEIgn0 1QmiJVMbjt6q64nvfAvuzuwzZlkI8YqDkWTH6MybzYfMn3Z3Di1/sHQr7LJjFn91M0ZYMa H94dKVYatyMEmNMW+KwneeiyQB/yR71jfH8q2WRNujH8ffOUhCBU0DKdZGqCcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678917; a=rsa-sha256; cv=none; b=ya6sFZ4nDjLMB7Od8eZE2b30hV21/ERoPmo02M6cow5WhE/SUimE9xETLBzus+Ty0g0xlp EY4vEnbMi4DnKtZK2YhuWbCdiRXXDa7MumvFwnBoLz1lqpnNrfcNpe9A1Bw2BiQleywP2X F3mIOnBQYSrFoQ8k5eKBZYeKtHC/3F5cshLkuMboSWs1TNQb3eW+XV7sOeYLvRDTjzKwTH 12GEx39LEudPODauW/nM+7GD/ikJHLindlAz1vCQ+qlFSVavUo+pS71cbwJx0nWf9hjStz Qr61fh4JhoXsGUlJ1zemJQEvXJGwX4pGjAd67M2D6HFwxlZkmU5gbS557LIUOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9ph4z1Ms+IaXWfrAPPa2WJIWtUR2GcUc4VDNy7M0SI=; b=kKzM2oqvlsRpL0r1YZYEnWHP01kMbbZLiP7gEzRUlUZRzCiZqgcGxCvMSpZYFCeqV6GyjU O2MqJCNwat2DpYKJgGHApt0ZCCZ9UdHS3eeslHSsR/WO5COSAQ0mXAg6R7KefmI6voDI6k 40aGJ/YVJrsKOowkfhkOs1mLJP9LCF3Wt12gY1kg2OpRwZXzfRLW54PCDiPrfB6mRl8GRM oVBmMKnbThaGoON24xTt6STKO+IO1/8rox+vRvkDWtgDvHWPhjKXhngx6KrTJ2MDScPHC2 428Bg1eUDcMT3dy7HJEixkPlxykIAP0W0uPByaAKUa9CzmfUEGA2XM4QEyYRrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wss2F4L40z17Q9; Mon, 26 Aug 2024 13:28: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 47QDSbZw067216; Mon, 26 Aug 2024 13:28:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDSbvx067213; Mon, 26 Aug 2024 13:28:37 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:28:37 GMT Message-Id: <202408261328.47QDSbvx067213@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: 51768dc31df6 - stable/13 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51768dc31df6379aa4a1447a15f054508d16b4b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=51768dc31df6379aa4a1447a15f054508d16b4b1 commit 51768dc31df6379aa4a1447a15f054508d16b4b1 Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:28:17 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) (cherry picked from commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d) --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a31bbd3c8342..7a04a668e823 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9339,14 +9339,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Mon Aug 26 13:54:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscP25DKz5SxhR; Mon, 26 Aug 2024 13:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscP1QN6z4f9H; Mon, 26 Aug 2024 13:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KV91/PtwZ58S8NZU/hVMe7BIEvl0A2XKw9s7XTzZ7Og=; b=iaK1t3HtbjU83gule8XRbrGQKaXUYOodLRN5edhrxZOMarNdeJF6KZYl+wr2RVg4XZANwS j86lOJUe27a+bE81tT8zvH9bqFq3zY/zXd6WkDFFcgncBWsZwWQiJBQn5pPUXTO2ix4rfi +rS64QLMkGBDoox067qJmjyxrhCr2j695TR3eH4j+rhCXdBjGVPGc+ZCrn0DIEMZfj9Mey XHVilzsJvwXIO3XMpfsw2N0RF7aPsuKFP2aRcFxnw9KjvXLhY6hYv36lSvVzVH36WdvUeJ /Bv+9knwZiggq70pAXYF8Kiomfdm2OpYlHC1jZSq4SHYgquKF1woUga6gnzq3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680485; a=rsa-sha256; cv=none; b=Pe1TRZOM/jqTALr4AEaqX7j2zRbO7TNWwtx6cj/7jzT7woVlhJZA5VBCs1m8v54hJF4Mp9 rZfFb08Jprj3FIWfgJ4SQjx0Bh65DCgT8VS+h5AGE2NO97JfAn51IMW4dw82+5stSPrIcF m+6BgE0RptDkJ+nay7q9LgOijMsfScUtytspXJc2+v7X7LNu0F3oQgZNP4jVVWCVpTjmfQ uMyHKDfVs7V8jZEZLHlno7iWsd1GVR35QoeQNPGSG7UXIL+zh0H0pt4wVvx27yrMDe4GeC ybcEDZaSFeRsOmpXS3T1Wkh0zFEGKsB9cJ1RMi7IKOCbOSRLHrLpCm+VHRdrZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KV91/PtwZ58S8NZU/hVMe7BIEvl0A2XKw9s7XTzZ7Og=; b=fQRXVZ/Zn2iVn9hFG2WqEaMk27E0zDffpSYVyBNRtEQ+sktkv/pzMXaZ8AbBdOiUSUsuVG FHSqDPUAjSPQR1axhucsk1T04mnIdUFY8KDaXSaSQqZaem857ig8u6bpuSl6QrRz6FNdFy JFdIOaWfyI1o/nGn3AVTpQ51JVV+C4OUx6PABqgDiSj46KcwfLFBWRIrhDK0CCbA76yUD6 Nij7/jC6QvG5tqkjFuovdfUdiOSAlX5bh5xPWAuPnX+Ehsf3hpPK5FLIxXA1iuQ35/EOmn 1Eu8oPBVKhKUIr3L7szI/PDq5Uzc+6sBIt12AL9oKdgdrTofIW3hv6rVEeYvuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscP0tLQz188n; Mon, 26 Aug 2024 13:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QDsjRT017285; Mon, 26 Aug 2024 13:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsj0c017282; Mon, 26 Aug 2024 13:54:45 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:45 GMT Message-Id: <202408261354.47QDsj0c017282@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: 6ab8b418dc10 - stable/14 - sound tests: Add SNDSTIOC_ADD_USER_DEVS test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ab8b418dc101aaac692c874bbe8d83c071f83de Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6ab8b418dc101aaac692c874bbe8d83c071f83de commit 6ab8b418dc101aaac692c874bbe8d83c071f83de Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:29 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:52:02 +0000 sound tests: Add SNDSTIOC_ADD_USER_DEVS test Test whether the SNDSTIOC_ADD_USER_DEVS IOCTL (registers a userland device to /dev/sndstat) works properly. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46228 (cherry picked from commit 2668e76d6e764c5c361156ffa3d39eb02ce8e5d9) --- tests/sys/sound/sndstat.c | 187 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 183 insertions(+), 4 deletions(-) diff --git a/tests/sys/sound/sndstat.c b/tests/sys/sound/sndstat.c index 7c030dfa8b58..553c745ec950 100644 --- a/tests/sys/sound/sndstat.c +++ b/tests/sys/sound/sndstat.c @@ -30,8 +30,9 @@ #include #include -#include #include +#include +#include #include #include @@ -59,8 +60,7 @@ ATF_TC_BODY(sndstat_nv, tc) const nvlist_t * const *cdi; struct sndstioc_nv_arg arg; size_t nitems, nchans, i, j; - int fd, rc; - int pchan, rchan; + int fd, rc, pchan, rchan; load_dummy(); @@ -135,7 +135,6 @@ ATF_TC_BODY(sndstat_nv, tc) } #undef NV - /* XXX Do we need to skip the TC? userdevs won't have this list */ if (!nvlist_exists(di[i], SNDST_DSPS_PROVIDER_INFO)) continue; @@ -206,9 +205,189 @@ ATF_TC_BODY(sndstat_nv, tc) close(fd); } +#define UDEV_PROVIDER "sndstat_udev" +#define UDEV_NAMEUNIT "sndstat_udev" +#define UDEV_DEVNODE "sndstat_udev" +#define UDEV_DESC "Test Device" +#define UDEV_PCHAN 1 +#define UDEV_RCHAN 1 +#define UDEV_MIN_RATE 8000 +#define UDEV_MAX_RATE 96000 +#define UDEV_FORMATS (AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) +#define UDEV_MIN_CHN 1 +#define UDEV_MAX_CHN 2 + +ATF_TC(sndstat_udev); +ATF_TC_HEAD(sndstat_udev, tc) +{ + atf_tc_set_md_var(tc, "descr", "/dev/sndstat userdev interface test"); +} + +ATF_TC_BODY(sndstat_udev, tc) +{ + nvlist_t *nvl, *di, *dichild; + const nvlist_t * const *rdi; + struct sndstioc_nv_arg arg; + const char *str; + size_t nitems, i; + int fd, rc, pchan, rchan, n; + + load_dummy(); + + if ((fd = open("/dev/sndstat", O_RDWR)) < 0) + atf_tc_skip("/dev/sndstat not found, load sound(4)"); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + di = nvlist_create(0); + ATF_REQUIRE(di != NULL); + + dichild = nvlist_create(0); + ATF_REQUIRE(dichild != NULL); + + nvlist_add_string(di, SNDST_DSPS_PROVIDER, UDEV_PROVIDER); + nvlist_add_string(di, SNDST_DSPS_NAMEUNIT, UDEV_NAMEUNIT); + nvlist_add_string(di, SNDST_DSPS_DESC, UDEV_DESC); + nvlist_add_string(di, SNDST_DSPS_DEVNODE, UDEV_DEVNODE); + nvlist_add_number(di, SNDST_DSPS_PCHAN, UDEV_PCHAN); + nvlist_add_number(di, SNDST_DSPS_RCHAN, UDEV_RCHAN); + + nvlist_add_number(dichild, SNDST_DSPS_INFO_MIN_RATE, UDEV_MIN_RATE); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MAX_RATE, UDEV_MAX_RATE); + nvlist_add_number(dichild, SNDST_DSPS_INFO_FORMATS, UDEV_FORMATS); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MIN_CHN, UDEV_MIN_CHN); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MAX_CHN, UDEV_MAX_CHN); + + nvlist_add_nvlist(di, SNDST_DSPS_INFO_PLAY, dichild); + nvlist_add_nvlist(di, SNDST_DSPS_INFO_REC, dichild); + + nvlist_append_nvlist_array(nvl, SNDST_DSPS, di); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + + arg.buf = nvlist_pack(nvl, &arg.nbytes); + ATF_REQUIRE_MSG(arg.buf != NULL, "failed to pack nvlist"); + + rc = ioctl(fd, SNDSTIOC_ADD_USER_DEVS, &arg); + free(arg.buf); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_ADD_USER_DEVS) failed"); + + nvlist_destroy(di); + nvlist_destroy(dichild); + nvlist_destroy(nvl); + + /* Read back registered values. */ + rc = ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL); + ATF_REQUIRE_EQ(rc, 0); + + arg.nbytes = 0; + arg.buf = NULL; + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#1) failed"); + + arg.buf = malloc(arg.nbytes); + ATF_REQUIRE(arg.buf != NULL); + + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#2) failed"); + + nvl = nvlist_unpack(arg.buf, arg.nbytes, 0); + ATF_REQUIRE(nvl != NULL); + + if (nvlist_empty(nvl) || !nvlist_exists(nvl, SNDST_DSPS)) + atf_tc_skip("no soundcards attached"); + + rdi = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); + for (i = 0; i < nitems; i++) { +#define NV(type, item, var) do { \ + ATF_REQUIRE_MSG(nvlist_exists(rdi[i], SNDST_DSPS_ ## item), \ + "SNDST_DSPS_" #item " does not exist"); \ + var = nvlist_get_ ## type (rdi[i], SNDST_DSPS_ ## item); \ +} while (0) + /* Search for our device. */ + NV(string, NAMEUNIT, str); + if (strcmp(str, UDEV_NAMEUNIT) == 0) + break; + } + if (i == nitems) + atf_tc_fail("userland device %s not found", UDEV_NAMEUNIT); + + NV(string, NAMEUNIT, str); + ATF_CHECK(strcmp(str, UDEV_NAMEUNIT) == 0); + + NV(bool, FROM_USER, n); + ATF_CHECK(n); + + NV(string, DEVNODE, str); + ATF_CHECK(strcmp(str, UDEV_DEVNODE) == 0); + + NV(string, DESC, str); + ATF_CHECK(strcmp(str, UDEV_DESC) == 0); + + NV(string, PROVIDER, str); + ATF_CHECK(strcmp(str, UDEV_PROVIDER) == 0); + + NV(number, PCHAN, pchan); + ATF_CHECK(pchan == UDEV_PCHAN); + if (pchan && !nvlist_exists(rdi[i], SNDST_DSPS_INFO_PLAY)) + atf_tc_fail("playback channel list empty"); + + NV(number, RCHAN, rchan); + ATF_CHECK(rchan == UDEV_RCHAN); + if (rchan && !nvlist_exists(rdi[i], SNDST_DSPS_INFO_REC)) + atf_tc_fail("recording channel list empty"); +#undef NV + +#define NV(type, mode, item, var) do { \ + ATF_REQUIRE_MSG(nvlist_exists(nvlist_get_nvlist(rdi[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item), \ + "SNDST_DSPS_INFO_" #item " does not exist"); \ + var = nvlist_get_ ## type (nvlist_get_nvlist(rdi[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item); \ +} while (0) + if (pchan) { + NV(number, PLAY, MIN_RATE, n); + ATF_CHECK(n == UDEV_MIN_RATE); + + NV(number, PLAY, MAX_RATE, n); + ATF_CHECK(n == UDEV_MAX_RATE); + + NV(number, PLAY, FORMATS, n); + ATF_CHECK(n == UDEV_FORMATS); + + NV(number, PLAY, MIN_CHN, n); + ATF_CHECK(n == UDEV_MIN_CHN); + + NV(number, PLAY, MAX_CHN, n); + ATF_CHECK(n == UDEV_MAX_CHN); + } + if (rchan) { + NV(number, REC, MIN_RATE, n); + ATF_CHECK(n == UDEV_MIN_RATE); + + NV(number, REC, MAX_RATE, n); + ATF_CHECK(n == UDEV_MAX_RATE); + + NV(number, REC, FORMATS, n); + ATF_CHECK(n == UDEV_FORMATS); + + NV(number, REC, MIN_CHN, n); + ATF_CHECK(n == UDEV_MIN_CHN); + + NV(number, REC, MAX_CHN, n); + ATF_CHECK(n == UDEV_MAX_CHN); + } +#undef NV + + free(arg.buf); + nvlist_destroy(nvl); + close(fd); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, sndstat_nv); + ATF_TP_ADD_TC(tp, sndstat_udev); return (atf_no_error()); } From nobody Mon Aug 26 13:54:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscQ2kSqz5SxwM; Mon, 26 Aug 2024 13:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscQ2D7wz4dvj; Mon, 26 Aug 2024 13:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ddatbgwQXdQm+8Cprut7OB3yRbmncR6uBsF5OMS9eI=; b=R6HUDuRRkmtmDx2OGwwK1pw8JAM+k6bJXGMNvnBjYCjneAGAiax7SHPxbJxpiRvUkg/WRy BC6ZoN5nbqMkW/3mLay8UTVbRcacN1wVMgCt5NsJuL8H7f9lo2ICgg/E+XjXfkd4BAztQy znJqTn+y+GginC9oSYqq9jj/jrLC4gYUuJ21egGMLI3nOq4/oHvADUi5P118pD+sSNndiY h9hLS94IkzUgUcNAht5WZd1J2gOoV14C9op0ozI35IU9w9Ws0l2CfTUuR/SrJyeOnlBzNY wLxD5upFPiyroADprBz/URTEjtodYZEhND0yhN2SQ1V/UlcquWQVjYT4/1iBUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680486; a=rsa-sha256; cv=none; b=MOZOEvCY8k9sVdr+iqZL3aHTUieOK4bu6rfNcgrBQnDtzxieVtrVE6pAeGLnQx8xbWfpWR eHyB21krApE+88Hk9pGdXh07A6h8oO4dqq3Wtp+qD60sRI6JEJ7Lm4JP4aCOpKh67GMPcb JDWQqN7rOBHhvs4yQ7hAIGVNnAOEE4JeOhcE3QNV/XlGAFJ+ttoHLaHCtBV9OROVGSqwUL yrK2azZuYMOK2XSb5MGmv0R9u50U4GWuGfQDw45kiPhtPEL8feWhs9xj6W7Q3g5wpFr2Az wy5KzEZw/KkWr4MkWDYLbF8KxitoTwi6ie67czhY/PNaCG+BbwEOATltmyxuLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ddatbgwQXdQm+8Cprut7OB3yRbmncR6uBsF5OMS9eI=; b=OFY0cWv3SvUvCSD6S51edxTLPo+gIOSKot1ZY5nQGEDDyFMf7egJYgFzcldg1LOdkbrM7v BNsYnCkUz5gcBaXNeEs4SqWWwdL9EM91oB5yX0BQkQFDU1Fnu8DUTC6QOfXZBhmGLuT5KZ uscZPmKNrFYKEjYsX4Szsp0PgQUWCWSra18cREBR3W3kk+COg1fQ0MTrLAXiQfhceycNG9 SNLwCERFn944m5DTUB8N/CQKvACL9pM1Phh8L/llJw6/bs3Waz8ZBc2x1VMbwn3gHbPu7o CLpRfPCYR5TCbeC2O1IfJP4TSBqVCFvTNuJr5Ancm5WSj38UyvJ9IFRLQUKtdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscQ1rPfz17kd; Mon, 26 Aug 2024 13:54: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 47QDskQe017322; Mon, 26 Aug 2024 13:54:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsk8O017319; Mon, 26 Aug 2024 13:54:46 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:46 GMT Message-Id: <202408261354.47QDsk8O017319@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: cf9d2fb18433 - stable/14 - mixer(8): Implement hot-swapping List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf9d2fb184338b73c362b98bb8fadd2de9d94634 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cf9d2fb184338b73c362b98bb8fadd2de9d94634 commit cf9d2fb184338b73c362b98bb8fadd2de9d94634 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:35 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:52:02 +0000 mixer(8): Implement hot-swapping Introduce a -V option, which can be used alongside -d (default unit change), in order to hot-swap devices (i.e switch to them on the fly without needing to restart the track), in case virtual_oss(8) exists and is running. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46253 (cherry picked from commit 9aac27599acaffa21ff69c5be8a2d71d29cc3d6b) --- usr.sbin/mixer/mixer.8 | 75 +++++++++++++++++++++++++++++++++++++++++++--- usr.sbin/mixer/mixer.c | 81 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 145 insertions(+), 11 deletions(-) diff --git a/usr.sbin/mixer/mixer.8 b/usr.sbin/mixer/mixer.8 index 75c6a81e3a55..819d8ae73ab1 100644 --- a/usr.sbin/mixer/mixer.8 +++ b/usr.sbin/mixer/mixer.8 @@ -19,7 +19,7 @@ .\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN .\" THE SOFTWARE. .\" -.Dd February 8, 2024 +.Dd August 14, 2024 .Dt MIXER 8 .Os .Sh NAME @@ -28,7 +28,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar device -.Op Fl d Ar pcmN | N +.Op Fl d Ar pcmN | N Op Fl V Ar voss_device:mode .Op Fl os .Op Ar dev Ns Op Cm \&. Ns Ar control Ns Op Cm \&= Ns Ar value .Ar ... @@ -43,7 +43,7 @@ The utility is used to set and display soundcard mixer device controls. .Pp The options are as follows: -.Bl -tag -width "-d pcmN | N" +.Bl -tag -width "-V voss_device:mode" .It Fl a Print the values for all mixer devices available in the system .Pq see Sx FILES . @@ -54,6 +54,30 @@ where N is the unit number (e.g for pcm0, the unit number is 0). See .Sx EXAMPLES on how to list all available audio devices in the system. +.Pp +There is also the possibility of hot-swapping to the new default device if +.Xr virtual_oss 8 +exists in the system and is running, in which case the +.Fl V +option needs to be specified as well. +.Pp +Hot-swapping generally cannot happen with plain +.Xr sound 4 , +so the user has to restart the track in order to get sound coming out of the +new default device. +This is because applications usually open a device at the start of the track +and do not check for default device changes, in order to open the new device +mid-track. +.Xr virtual_oss 8 , +on the other hand, can do hot-swapping, because it creates a virtual device for +applications to open, and then does all the necessary routing and conversions +to the appropriate device(s). +.Pp +Note that hot-swapping will work only for applications that are using +.Xr virtual_oss 8 +devices, and not plain +.Xr sound 4 +ones. .It Fl f Ar device Open .Ar device @@ -66,6 +90,33 @@ Print mixer values in a format suitable for use inside scripts. The mixer's header (name, audio card name, ...) will not be printed. .It Fl s Print only the recording source(s) of the mixer device. +.It Fl V Ar voss_device:mode +Specify a +.Xr virtual_oss 8 +control device, as well as a mode (see below), in order to hot-swap devices. +This option is meant to only be used in combination with the +.Fl d +option. +.Pp +The available modes are as follows: +.Bl -column play +.It Sy Mode Ta Sy Action +.It all Ta Playback and recording +.It play Ta Playback +.It rec Ta Recording +.El +.Pp +The +.Pa mode +part is needed, so that +.Nm +will not accidentally hot-swap both the recording and playback device in +.Xr virtual_oss 8 , +if only one direction is to be hot-swapped. +.Pp +See +.Sx EXAMPLES +on how to use this option. .El .Pp The list of mixer devices that may be modified are: @@ -273,10 +324,26 @@ $ mixer -f /dev/mixer0 -o > info \&... $ mixer -f /dev/mixer0 `cat info` .Ed +.Pp +Suppose +.Xr virtual_oss 8 +is running with +.Pa /dev/vdsp.ctl +as its control device, and +.Pa pcm0 +as the playback device. +Change the default device to +.Pa pcm1 , +and hot-swap to it for both recording and playback in +.Xr virtual_oss 8 : +.Bd -literal -offset indent +$ mixer -d pcm1 -V /dev/vdsp.ctl:all +.Ed .Sh SEE ALSO .Xr mixer 3 , .Xr sound 4 , -.Xr sysctl 8 +.Xr sysctl 8 , +.Xr virtual_oss 8 .Sh HISTORY The .Nm diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 109d3ad09bc5..468130ddaa88 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -20,6 +20,9 @@ * THE SOFTWARE. */ +#include +#include + #include #include #include @@ -40,7 +43,7 @@ static void printall(struct mixer *, int); static void printminfo(struct mixer *, int); static void printdev(struct mixer *, int); static void printrecsrc(struct mixer *, int); /* XXX: change name */ -static int set_dunit(struct mixer *, int); +static int set_dunit(struct mixer *, int, char *); /* Control handlers */ static int mod_volume(struct mix_dev *, void *); static int mod_mute(struct mix_dev *, void *); @@ -54,13 +57,13 @@ main(int argc, char *argv[]) { struct mixer *m; mix_ctl_t *cp; - char *name = NULL, buf[NAME_MAX]; + char *name = NULL, buf[NAME_MAX], *vctl = NULL; char *p, *q, *devstr, *ctlstr, *valstr = NULL; int dunit, i, n, pall = 1, shorthand; int aflag = 0, dflag = 0, oflag = 0, sflag = 0; int ch; - while ((ch = getopt(argc, argv, "ad:f:hos")) != -1) { + while ((ch = getopt(argc, argv, "ad:f:hosV:")) != -1) { switch (ch) { case 'a': aflag = 1; @@ -83,6 +86,9 @@ main(int argc, char *argv[]) case 's': sflag = 1; break; + case 'V': + vctl = optarg; + break; case 'h': /* FALLTHROUGH */ case '?': default: @@ -119,7 +125,7 @@ main(int argc, char *argv[]) initctls(m); if (dflag) { - if (set_dunit(m, dunit) < 0) + if (set_dunit(m, dunit, vctl) < 0) goto parse; else { /* @@ -209,7 +215,8 @@ next: static void __dead2 usage(void) { - fprintf(stderr, "usage: %1$s [-f device] [-d pcmN | N] [-os] [dev[.control[=value]]] ...\n" + fprintf(stderr, "usage: %1$s [-f device] [-d pcmN | N " + "[-V voss_device:mode]] [-os] [dev[.control[=value]]] ...\n" " %1$s [-os] -a\n" " %1$s -h\n", getprogname()); exit(1); @@ -322,9 +329,32 @@ printrecsrc(struct mixer *m, int oflag) } static int -set_dunit(struct mixer *m, int dunit) +set_dunit(struct mixer *m, int dunit, char *vctl) { - int n; + const char *opt; + char *dev, *mode; + char buf[32]; + size_t size; + int n, rc; + + /* + * Issue warning in case of hw.snd.basename_clone being unset. Omit the + * check and warning if the -V flag is used, since the user is most + * likely to be aware of this, and the warning might be confusing. + */ + if (vctl == NULL) { + size = sizeof(int); + if (sysctlbyname("hw.snd.basename_clone", &n, &size, + NULL, 0) < 0) { + warn("hw.snd.basename_clone failed"); + return (-1); + } + if (n == 0) { + warnx("warning: hw.snd.basename_clone not set. " + "/dev/dsp is managed externally and does not " + "change with the default unit change here."); + } + } if ((n = mixer_get_dunit()) < 0) { warn("cannot get default unit"); @@ -336,6 +366,43 @@ set_dunit(struct mixer *m, int dunit) } printf("default_unit: %d -> %d\n", n, dunit); + /* Hot-swap in case virtual_oss exists and is running. */ + if (vctl != NULL) { + dev = strsep(&vctl, ":"); + mode = vctl; + if (dev == NULL || mode == NULL) { + warnx("voss_device:mode tuple incomplete"); + return (-1); + } + if (strcmp(mode, "all") == 0) + opt = "-f"; + else if (strcmp(mode, "play") == 0) + opt = "-P"; + else if (strcmp(mode, "rec") == 0) + opt = "-R"; + else { + warnx("please use one of the following modes: " + "all, play, rec"); + return (-1); + } + snprintf(buf, sizeof(buf), "/dev/dsp%d", dunit); + switch (fork()) { + case -1: + warn("fork"); + break; + case 0: + rc = execl("/usr/local/sbin/virtual_oss_cmd", + "virtual_oss_cmd", dev, opt, buf, NULL); + if (rc < 0) + warn("virtual_oss_cmd"); + _exit(0); + default: + if (wait(NULL) < 0) + warn("wait"); + break; + } + } + return (0); } From nobody Mon Aug 26 13:54:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscR51Pmz5Sy2p; Mon, 26 Aug 2024 13:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscR3c01z4fMB; Mon, 26 Aug 2024 13:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YK/1o6TpLuAbgxMqWSu22W943yNZb11tvAW99vCn0JM=; b=Tz6pngQ86OD6EcABgM1RfNv8K6oHyN3eJsIiuM/zC1mmiHqIZXl0BxNJHF6rVdVIyrMay5 a4xe9Faks1QIPJA+Vu38MMoiXXspKJ4bHcIKYuqJjQ6DXY0NWnY8/1lg/2/DiWmxDjECbN pWBFKbJIyENcdguEMIy9L8j/pOdweq97Rt4C/2kqs24jF19/5bB099ugJvMFXHvm9HJUXg 0cZlURmOxgLpYPgAi5FI/QVfZckEuB/7OE/LZoeGg0F6EQDaMXl2ijRTE6aHs/6mW0ZhN8 YCviJoiecdbcC5EhXF5di8mU4LHPs37ElPM9o1XqKKzm9oMl4mqwRwYD2YYc9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680487; a=rsa-sha256; cv=none; b=U248Cne8HcjbsEqtGkSN+KJzi93GkobB6mH1movEoSail2nCYrQshQg/WfviexIPD3C7wj pxGI1wi/BnA8nqswrrRnN3IJFKI6Yhblv0jq9da2psk86eX4OXvJiS58CHiu4ZFDWsR048 uK2esalINhuC1lL8xCrzb3LezMTUpqkReR8xtBHyKsMMwY1VvVdv18cFtybJB6n8GFDhq1 5oy4BFLf2aZG5tSt/bWMUO9TpwGTKbK+iQmV8ShQHimFaAab8flQI9psnk0MpIQ/to3+nz N/sHS/CPG8wumgQtvntxGJ7jab98BFf7C2gkeBqm3gS9LGu9VDr2fZZBRKor3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YK/1o6TpLuAbgxMqWSu22W943yNZb11tvAW99vCn0JM=; b=Z6bUeBsAeZHsOC5A8t1DtDv1tCSyCEmpJq7nDzR5VNPFSH1b9AA6waoV9Bn0gsUBQJtY5b oLzK0oIiLATA+2Oyv2EcqNNCyLNGx/3/dX0KJm85cXZCrZSwxzDJe2bkSZxJ/eq2QENFr2 5+fiiWcN/+Aa1ym+dq+sFxH5s6butK2Q0Z9zgyn9AyYK69mXAG+tt0pBt/B9qFxZkKwsYO aQpPbglKi9QBXDnAFoFxDATNIQbIbSH4aT++yETxgLmQcEKpTXnXpDXcgiOhNe4MhXOgLR aMIs2f+c3hd3f9+LQLbTy+ThiXbaxUaYTX71xGbpYwJotkTMLQYxQpJv06sAwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscR2r5Pz17RW; Mon, 26 Aug 2024 13:54: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 47QDsliT017364; Mon, 26 Aug 2024 13:54:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDslRj017361; Mon, 26 Aug 2024 13:54:47 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:47 GMT Message-Id: <202408261354.47QDslRj017361@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: 276d76adf984 - stable/14 - sound examples: Simplify MIDI example List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 276d76adf984909876dc72970244ea43049217ce Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=276d76adf984909876dc72970244ea43049217ce commit 276d76adf984909876dc72970244ea43049217ce Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:40 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:52:59 +0000 sound examples: Simplify MIDI example Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D46306 (cherry picked from commit 0ca4d5d8209cf4d2d0bb37d7f20d95ac3457026d) --- share/examples/Makefile | 3 +- share/examples/sound/oss/midi.c | 77 ++++++++++++++++++++++---------------- share/examples/sound/oss/ossmidi.h | 63 ------------------------------- 3 files changed, 46 insertions(+), 97 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 1fbc74f51083..04117719aa95 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -318,8 +318,7 @@ SE_SOUND_OSS= \ README \ basic.c \ midi.c \ - ossinit.h \ - ossmidi.h + ossinit.h SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/midi.c b/share/examples/sound/oss/midi.c index 7149bcb31c82..5b001ba537e5 100644 --- a/share/examples/sound/oss/midi.c +++ b/share/examples/sound/oss/midi.c @@ -2,6 +2,10 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2022 Goran Mekić + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,52 +29,61 @@ * SUCH DAMAGE. */ +#include +#include +#include +#include #include -#include "ossmidi.h" +#define CMD_MASK 0xF0 +#define CHANNEL_MASK 0x0F +#define NOTE_ON 0x90 +#define NOTE_OFF 0x80 +#define CTL_CHANGE 0xB0 int -main() +main(int argc, char *argv[]) { - midi_event_t event; - midi_config_t midi_config; - int l = -1; - unsigned char raw; + int fd; + unsigned char raw, type, channel, b1, b2; - midi_config.device = "/dev/umidi1.0"; - oss_midi_init(&midi_config); + if ((fd = open("/dev/umidi0.0", O_RDWR)) < 0) + err(1, "Error opening MIDI device"); - while ((l = read(midi_config.fd, &raw, sizeof(raw))) != -1) { - if (!(raw & 0x80)) { + for (;;) { + if (read(fd, &raw, sizeof(raw)) < sizeof(raw)) + err(1, "Error reading command byte"); + if (!(raw & 0x80)) continue; - } - event.type = raw & CMD_MASK; - event.channel = raw & CHANNEL_MASK; - switch (event.type) { + + type = raw & CMD_MASK; + channel = raw & CHANNEL_MASK; + + if (read(fd, &b1, sizeof(b1)) < sizeof(b1)) + err(1, "Error reading byte 1"); + if (read(fd, &b2, sizeof(b2)) < sizeof(b2)) + err(1, "Error reading byte 2"); + + switch (type) { case NOTE_ON: - case NOTE_OFF: - case CONTROLER_ON: - if ((l = read(midi_config.fd, &(event.note), sizeof(event.note))) == -1) { - perror("Error reading MIDI note"); - exit(1); - } - if ((l = read(midi_config.fd, &(event.velocity), sizeof(event.velocity))) == -1) { - perror("Error reading MIDI velocity"); - exit(1); - } + printf("Channel %d, note on %d, velocity %d\n", + channel, b1, b2); break; - } - switch (event.type) { - case NOTE_ON: case NOTE_OFF: - printf("Channel %d, note %d, velocity %d\n", event.channel, event.note, event.velocity); + printf("Channel %d, note off %d, velocity %d\n", + channel, b1, b2); break; - case CONTROLER_ON: - printf("Channel %d, controller %d, value %d\n", event.channel, event.controller, event.value); + case CTL_CHANGE: + printf("Channel %d, controller change %d, value %d\n", + channel, b1, b2); break; default: - printf("Unknown event type %d\n", event.type); + printf("Unknown event type %d\n", type); + break; } } - return 0; + + close(fd); + + return (0); } diff --git a/share/examples/sound/oss/ossmidi.h b/share/examples/sound/oss/ossmidi.h deleted file mode 100644 index 60bf5e41173e..000000000000 --- a/share/examples/sound/oss/ossmidi.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2022 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include - -#define CMD_MASK 0xF0 -#define NOTE_ON 0x90 -#define NOTE_OFF 0x80 -#define CHANNEL_MASK 0xF -#define CONTROLER_ON 0xB0 - -typedef struct midi_event { - unsigned char type; - unsigned char channel; - union { - unsigned char note; - unsigned controller; - }; - union { - unsigned char velocity; - unsigned char value; - }; -} midi_event_t; - -typedef struct midi_config { - char *device; - int fd; -} midi_config_t; - -void -oss_midi_init(midi_config_t *config) -{ - if ((config->fd = open(config->device, O_RDWR)) == -1) { - perror("Error opening MIDI device"); - exit(1); - } -} From nobody Mon Aug 26 13:54:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscS5NBnz5SxnT; Mon, 26 Aug 2024 13:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscS53pCz4fZ1; Mon, 26 Aug 2024 13:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJrqC9iBeASB6Te6ok4bYah3nll4itZOQgTJdPK0J6w=; b=WkQdBejKsLf7R+R9sZRsqvwJqJGPiydOOZKjPLGPpubmbPR4A74FYwEPuMDxkMwbegfEeL EuL9i66WNRVEvSqCm5TUl1nrWDIeCLm/8ZTpPS4zGjyJnVyBTqPiybU8CPdWdTmdph9hKs VkyE568yKl/XaX5Gyluk/a5rO6GDADpCWfmfvdIUZdvWQYqpbUmzwrft1H9g2LOzTAHgw7 UdTtJ98ZQOO1w8gL5mJ1xOXxk4NA+li2fBGeqHh63DDQjW10rC0jnl81nbt59A4vsCnZlB MDvu9FqZODxKyW+2IAgOLbeYGFyLdixbn/N6w2tN8iNN4QKYB+i2u3YRS1OBxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680488; a=rsa-sha256; cv=none; b=aGJ4iYrZxVDVAyQwA5yCo6Dh8I2Y+HTYL/mG70HHODX9Yd07MdzDtPiXc1V1Sw9E18HVRa t13YskvWdoBp82PGqqCStwvv+8b4d0bV4lUb6aA02/E+Q0oi/6QZU/Zk/NBZt/xvkFeaU+ eXeC6fDliRz4y5sDiy//TEad2YVsoeSjVBnibDkrsXcWPi+bH3o5DxEOh58s5n8H2T8e4r azKJHp5dFhhYaHVnlBbEgt2ZVCYZuaMw3wGIl2tXp1eLFqKdyBK+sQhR7nnqTzyJlw2CTq 5Ynda+SR/9aM2qayqgCuA7sA8e2wLxA7THbKXkZtfuH1gfeDMgZ3Rhs6mlofFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJrqC9iBeASB6Te6ok4bYah3nll4itZOQgTJdPK0J6w=; b=x57zEH9a7LABSV2A6P3oZ0Ce4UUrq5mol3gYrYSh8wCaImxLLXHyiHiC+vJ0npCy8Q+y7B V1sCbpVOkUnRoeQpHMq0R5vSDSkJ3ShBMz0MHwu81PMqOBXiI66DDNHrYgVC754Tnb00zY 8XL7LxFA7Ucmh611zDudnH77Vm1Y+OQYJ7+lui6kiFKbOIO1/juxJlgQf++QJOvZoKRw/z aY7UYvWBnhfIdJ3r8b/AhHkmZL5MHA14RriRaMHml6Mkex71rFwY5DjKQu9aO8DZHXx3Ns QDJKwFA4y9a+fup+4QWV5wgn+G7fe6S9xme/zQTXQu7gBBDwvi9iU84vy0c8AQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscS3tC4z17RX; Mon, 26 Aug 2024 13:54: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 47QDsm0h017413; Mon, 26 Aug 2024 13: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 47QDsmjT017410; Mon, 26 Aug 2024 13:54:48 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:48 GMT Message-Id: <202408261354.47QDsmjT017410@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: a59e4c405572 - stable/14 - sound examples: Simplify audio example List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a59e4c40557203112438d4f6fbfac69346e4d0f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a59e4c40557203112438d4f6fbfac69346e4d0f4 commit a59e4c40557203112438d4f6fbfac69346e4d0f4 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:45 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:00 +0000 sound examples: Simplify audio example - Merge ossinit.h and basic.c. - Rename basic.c to audio.c. - Use err(3) instead of fprintf(3) + exit(3). - Some style(9) improvements. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46307 (cherry picked from commit 3decd659a7887e83c2c8af35053301dc7d6f7be2) --- share/examples/Makefile | 5 +- share/examples/sound/oss/audio.c | 310 +++++++++++++++++++++++++++++++++++++++ share/examples/sound/oss/basic.c | 99 ------------- 3 files changed, 312 insertions(+), 102 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 04117719aa95..8e2d4a6ad2dd 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -316,9 +316,8 @@ SE_SOUND= \ SE_DIRS+= sound/oss SE_SOUND_OSS= \ README \ - basic.c \ - midi.c \ - ossinit.h + audio.c \ + midi.c SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/audio.c b/share/examples/sound/oss/audio.c new file mode 100644 index 000000000000..4dd3c8b82575 --- /dev/null +++ b/share/examples/sound/oss/audio.c @@ -0,0 +1,310 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Goran Mekić + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifndef SAMPLE_SIZE +#define SAMPLE_SIZE 16 +#endif + +/* Format can be unsigned, in which case replace S with U */ +#if SAMPLE_SIZE == 32 +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Signed 32bit native endian format */ +#elif SAMPLE_SIZE == 16 +typedef int16_t sample_t; +int format = AFMT_S16_NE; /* Signed 16bit native endian format */ +#elif SAMPLE_SIZE == 8 +typedef int8_t sample_t; +int format = AFMT_S8_NE; /* Signed 8bit native endian format */ +#else +#error Unsupported sample format! +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Not a real value, just silencing + * compiler errors */ +#endif + +/* + * Minimal configuration for OSS + * For real world applications, this structure will probably contain many + * more fields + */ +typedef struct config { + char *device; + int channels; + int fd; + int format; + int frag; + int sample_count; + int sample_rate; + int sample_size; + int chsamples; + int mmap; + oss_audioinfo audio_info; + audio_buf_info buffer_info; +} config_t; + +/* + * Error state is indicated by value=-1 in which case application exits with + * error + */ +static inline void +check_error(const int value, const char *message) +{ + if (value == -1) + err(1, "OSS error: %s\n", message); +} + + +/* Calculate frag by giving it minimal size of buffer */ +static inline int +size2frag(int x) +{ + int frag = 0; + + while ((1 << frag) < x) + ++frag; + + return (frag); +} + +/* + * Split input buffer into channels. Input buffer is in interleaved format + * which means if we have 2 channels (L and R), this is what the buffer of 8 + * samples would contain: L,R,L,R,L,R,L,R. The result are two channels + * containing: L,L,L,L and R,R,R,R. + */ +static void +oss_split(config_t *config, sample_t *input, sample_t *output) +{ + int channel, index, i; + + for (i = 0; i < config->sample_count; ++i) { + channel = i % config->channels; + index = i / config->channels; + output[channel * index] = input[i]; + } +} + +/* + * Convert channels into interleaved format and place it in output + * buffer + */ +static void +oss_merge(config_t *config, sample_t *input, sample_t *output) +{ + int channel, index; + + for (channel = 0; channel < config->channels; ++channel) { + for (index = 0; index < config->chsamples; ++index) { + output[index * config->channels + channel] = + input[channel * index]; + } + } +} + +static void +oss_init(config_t *config) +{ + int error, tmp, min_frag; + + /* Open the device for read and write */ + config->fd = open(config->device, O_RDWR); + check_error(config->fd, "open"); + + /* Get device information */ + config->audio_info.dev = -1; + error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info)); + check_error(error, "SNDCTL_ENGINEINFO"); + printf("min_channels: %d\n", config->audio_info.min_channels); + printf("max_channels: %d\n", config->audio_info.max_channels); + printf("latency: %d\n", config->audio_info.latency); + printf("handle: %s\n", config->audio_info.handle); + if (config->audio_info.min_rate > config->sample_rate || + config->sample_rate > config->audio_info.max_rate) { + errx(1, "%s doesn't support chosen samplerate of %dHz!\n", + config->device, config->sample_rate); + } + if (config->channels < 1) + config->channels = config->audio_info.max_channels; + + /* + * If device is going to be used in mmap mode, disable all format + * conversions. Official OSS documentation states error code should not + * be checked. + * http://manuals.opensound.com/developer/mmap_test.c.html#LOC10 + */ + if (config->mmap) { + tmp = 0; + ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp); + } + + /* + * Set number of channels. If number of channels is chosen to the value + * near the one wanted, save it in config + */ + tmp = config->channels; + error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp); + check_error(error, "SNDCTL_DSP_CHANNELS"); + /* Or check if tmp is close enough? */ + if (tmp != config->channels) { + errx(1, "%s doesn't support chosen channel count of %d set " + "to %d!\n", config->device, config->channels, tmp); + } + config->channels = tmp; + + /* Set format, or bit size: 8, 16, 24 or 32 bit sample */ + tmp = config->format; + error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp); + check_error(error, "SNDCTL_DSP_SETFMT"); + if (tmp != config->format) { + errx(1, "%s doesn't support chosen sample format!\n", + config->device); + } + + /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */ + tmp = config->sample_rate; + error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp); + check_error(error, "SNDCTL_DSP_SPEED"); + + /* Get and check device capabilities */ + error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps)); + check_error(error, "SNDCTL_DSP_GETCAPS"); + if (!(config->audio_info.caps & PCM_CAP_DUPLEX)) + errx(1, "Device doesn't support full duplex!\n"); + + if (config->mmap) { + if (!(config->audio_info.caps & PCM_CAP_TRIGGER)) + errx(1, "Device doesn't support triggering!\n"); + if (!(config->audio_info.caps & PCM_CAP_MMAP)) + errx(1, "Device doesn't support mmap mode!\n"); + } + + /* + * If desired frag is smaller than minimum, based on number of channels + * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer + * size is 2^frag, but the real size of the buffer will be read when + * the configuration of the device is successful + */ + min_frag = size2frag(config->sample_size * config->channels); + + if (config->frag < min_frag) + config->frag = min_frag; + + /* + * Allocate buffer in fragments. Total buffer will be split in number + * of fragments (2 by default) + */ + if (config->buffer_info.fragments < 0) + config->buffer_info.fragments = 2; + tmp = ((config->buffer_info.fragments) << 16) | config->frag; + error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp); + check_error(error, "SNDCTL_DSP_SETFRAGMENT"); + + /* When all is set and ready to go, get the size of buffer */ + error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info)); + check_error(error, "SNDCTL_DSP_GETOSPACE"); + if (config->buffer_info.bytes < 1) { + errx(1, "OSS buffer error: buffer size can not be %d\n", + config->buffer_info.bytes); + } + config->sample_count = config->buffer_info.bytes / config->sample_size; + config->chsamples = config->sample_count / config->channels; +} + +int +main(int argc, char *argv[]) +{ + int ret, bytes; + int8_t *ibuf, *obuf; + config_t config = { + .device = "/dev/dsp", + .channels = -1, + .format = format, + .frag = -1, + .sample_rate = 48000, + .sample_size = sizeof(sample_t), + .buffer_info.fragments = -1, + .mmap = 0, + }; + + /* Initialize device */ + oss_init(&config); + + /* + * Allocate input and output buffers so that their size match frag_size + */ + bytes = config.buffer_info.bytes; + ibuf = malloc(bytes); + obuf = malloc(bytes); + sample_t *channels = malloc(bytes); + + printf("bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, " + "samples: %d\n", + bytes, config.buffer_info.fragments, + config.buffer_info.fragsize, config.buffer_info.fragstotal, + config.sample_count); + + /* Minimal engine: read input and copy it to the output */ + for (;;) { + ret = read(config.fd, ibuf, bytes); + if (ret < bytes) { + fprintf(stderr, "Requested %d bytes, but read %d!\n", + bytes, ret); + break; + } + oss_split(&config, (sample_t *)ibuf, channels); + /* All processing will happen here */ + oss_merge(&config, channels, (sample_t *)obuf); + ret = write(config.fd, obuf, bytes); + if (ret < bytes) { + fprintf(stderr, "Requested %d bytes, but wrote %d!\n", + bytes, ret); + break; + } + } + + /* Cleanup */ + free(channels); + free(obuf); + free(ibuf); + close(config.fd); + + return (0); +} diff --git a/share/examples/sound/oss/basic.c b/share/examples/sound/oss/basic.c deleted file mode 100644 index 83ecbe6ea9a7..000000000000 --- a/share/examples/sound/oss/basic.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2021 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "ossinit.h" - -int -main() -{ - config_t config = { - .device = "/dev/dsp", - .channels = -1, - .format = format, - .frag = -1, - .sample_rate = 48000, - .sample_size = sizeof(sample_t), - .buffer_info.fragments = -1, - .mmap = 0, - }; - - /* Initialize device */ - oss_init(&config); - - /* - * Allocate input and output buffers so that their size match - * frag_size - */ - int ret; - int bytes = config.buffer_info.bytes; - int8_t *ibuf = malloc(bytes); - int8_t *obuf = malloc(bytes); - sample_t *channels = malloc(bytes); - - printf( - "bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, samples: %d\n", - bytes, - config.buffer_info.fragments, - config.buffer_info.fragsize, - config.buffer_info.fragstotal, - config.sample_count - ); - - /* Minimal engine: read input and copy it to the output */ - for (;;) { - ret = read(config.fd, ibuf, bytes); - if (ret < bytes) { - fprintf( - stderr, - "Requested %d bytes, but read %d!\n", - bytes, - ret - ); - break; - } - oss_split(&config, (sample_t *)ibuf, channels); - /* All processing will happen here */ - oss_merge(&config, channels, (sample_t *)obuf); - ret = write(config.fd, obuf, bytes); - if (ret < bytes) { - fprintf( - stderr, - "Requested %d bytes, but wrote %d!\n", - bytes, - ret - ); - break; - } - } - - /* Cleanup */ - free(channels); - free(obuf); - free(ibuf); - close(config.fd); - return (0); -} From nobody Mon Aug 26 13:54:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscV11z8z5Sy9n; Mon, 26 Aug 2024 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscT5nPvz4fRP; Mon, 26 Aug 2024 13: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=1724680489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAxOfEK3BDmTCvzDaMd38R9T3yRqz2qYwRgV+FCovbo=; b=xi1ynirnVKXaHaDQpI3ho52JK8ZzDwWq1f9Ev79mcCzscRhvq65APZOcyyHUYZN4lKp5r9 ObAs+Tdg95nha+nLpC4Rk2XVFmVORrkaV7+u+LDVSmLODNlHK+e0UFxKLmof1eadHuUcuw 9XtxXRZYYKhTM89Q+H8Un2etioReg5wDtQrboF7oH19bv1gzOVEONYlgKC8RtaFy3ZwZ9v 98wDc2tXrnQJf0ytLg2AjcD1pGk3JaehEvvY8B+6UYCHXbm/lX5XZvlLWTRLV+CHqSmsLg h3qzrB6pgjgEuCPZrmIl4qWZSWqOG4x7CRveMs9NBfyG/6pU9aSYLm51wtLf+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680489; a=rsa-sha256; cv=none; b=hS60JNoKvtsMmPr1IxeKfMy7B/lal3NkAf54Iwgh94FVmDvyLnjDhCohabA+V0HfRsVCo/ I0RNM5j2gEJYmxyOm3U23g2vQxJHfGxExdzb1IPnGfLCl4dqS0SJ8ZpqyxDrjol1RWHb+W lYduSx6n9jlS8mvm+CwyTTQP9VACJxHZeQXKw3njvLuFdLXlVQUQqLFyN/26NXluWROSYw DIPV6JN+Ngxmg+9uk/+65j2FjQToWw5JQk71GDoVXwinAfWC12Hp9nzjhzw30vAqtYwpwH hlBW4/md7yRR2NdMuxfRBjlMA19cUG8Y/JwcFkF65whBpUTvpxM0n+E9KbS8TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAxOfEK3BDmTCvzDaMd38R9T3yRqz2qYwRgV+FCovbo=; b=Hbyeq21FnSOKblDzCuMoi8etNFFyAkcWd0rFFFxaflSVbpg6WjnBuBQMwhHYqQ3VhJET7Y f1cRqIh24jDJL3xHq3x72/V55jHbsKf0F4zB/qldP/SZtVOGtUJHPQmNP/jaaCizMjp/w1 oFXr81Yi7tF/XUyefggw5uI4r/X7e91CSjzRxya2V6cyVkmJYfXmpp+8+RdZ8xc04GrAPB bfuXOsUxz9gBnMCTOc1pXajyWi0LE0o5mObhqMsfIB/1of40l7Ax5yo82CazQA2UgQmBMO MdlOfDaM5kfzzlVou693HrjA3swMJBUQJeURM4jvvzpZBF5cyK8BaoVfN1iv9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscT4x29z187G; Mon, 26 Aug 2024 13: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 47QDsn0d017468; Mon, 26 Aug 2024 13:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsnx5017465; Mon, 26 Aug 2024 13:54:49 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:49 GMT Message-Id: <202408261354.47QDsnx5017465@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: f060ed39805d - stable/14 - sound examples: Move MIDI example out of OSS directory List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f060ed39805ddbe8c2977834967a452ebb2bc858 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f060ed39805ddbe8c2977834967a452ebb2bc858 commit f060ed39805ddbe8c2977834967a452ebb2bc858 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:49 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:00 +0000 sound examples: Move MIDI example out of OSS directory This example is not related to OSS. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, meka_tilda.center Differential Revision: https://reviews.freebsd.org/D46308 (cherry picked from commit 6747b1a8218f229c7593cdb02e4b41e2b1186e26) --- share/examples/Makefile | 6 +++--- share/examples/sound/{oss => }/midi.c | 0 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 8e2d4a6ad2dd..cf0f113cd496 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -311,13 +311,13 @@ SE_SCSI_TARGET= \ SE_DIRS+= sound SE_SOUND= \ - sndstat_nv.c + sndstat_nv.c \ + midi.c SE_DIRS+= sound/oss SE_SOUND_OSS= \ README \ - audio.c \ - midi.c + audio.c SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/midi.c b/share/examples/sound/midi.c similarity index 100% rename from share/examples/sound/oss/midi.c rename to share/examples/sound/midi.c From nobody Mon Aug 26 13:54:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscW1Y99z5SxwP; Mon, 26 Aug 2024 13:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscV6Jdlz4fjR; Mon, 26 Aug 2024 13: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=1724680490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq89ZYbGW+yrlqcrVlz5oGoyDoXd1kblV9qmY8tUo0k=; b=KYgS9+sqR+lLKOP0L81Ho83Lmk445WxME9dd8zMM/XmLJwwCfi7bL/EuZKkl/Ccf6/ylvY m9LJqy3EduUNiVkEXEv8yX/7WPrQBMiat8d0Y0h+vgJZ8DAC6aJIVW3RU5JKZah77tWH76 p/ZOqhPQFB9CF3Rp5CBBV5UYFRcHtzs7k+Ti1JK71bLJGA6iFHJyswCQtk1jFdqbD/ojDD RE3aaOxhsCkOTSCu/SPAxI5LdL4kqNa9uKizaUrJeN+WJZZUxKUeFN/pvSt+MqmCBK8oXs PUGbHpWv7Pv8jvsz0AzfXpMRnZtYI3MwKk1HP0IatBv0akT1zOsF55vDUuuTIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680490; a=rsa-sha256; cv=none; b=jNVMFzJu09PMHr3dC1bEnRTyvukhKxjvglm1QxfYfycvU2NAciOt/SJbkTlXyodsXsUhJZ Mu1E0dTyTs/6rB71H5ZOumtmNlpVVgLMCGhkWFHUGBOvcgL9EcU/x1a80+vDIgvwR/2zej lBKbsdElGjHKn8ktPOEX5Lgd60oKtNi/t70IG/h6R9d3r37RplsnaBTsQijZI5RY3UtVE2 OU1eOziIhUNdjRXglPPNRhBCn6I6XVaTkDYFiDag0LnashzSxvOiOdZrvShxqVGx8hsU/B 5dRhHW5I6hd2zX6aPKGCzzsE57Ld48X0hQONgA9g53eZBo7UHeGhW4FE3xC1tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq89ZYbGW+yrlqcrVlz5oGoyDoXd1kblV9qmY8tUo0k=; b=kDXvolMEO6YYFaEzinl0XseSPuCJbrQ4x7IJ30/lV5B55/DtxJzYrvm4SZ2ckOq1wOzVP9 gNchABlRcBdtXN8wMmG8B5AD5K3/zwgefC0e5LsjtNl+tsPIFgBmUjwZL2K1eAqd2XwnKg 11wCYXo1RSBiM3NZB0zdPKfEDs3dbLISPMJO6nEKMaYzSGiX+EXmczpsZXBZfAhHvyKfw2 1BNLofWag2jVj+OghNydvG8Z1/yvD31dxqxhYVKJMPMcDO98kbT5g/ttcjg0PgqQsQf8VD Pozz1ou+vm8rcLeyMYOxPaOO1fsf1+A7iO/6jE/AWMCgMPdK+IACnWCHe3IxEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscV5gVtz187H; Mon, 26 Aug 2024 13: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 47QDso2v017513; Mon, 26 Aug 2024 13: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 47QDsoU3017510; Mon, 26 Aug 2024 13:54:50 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:50 GMT Message-Id: <202408261354.47QDsoU3017510@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: 8156d8598f59 - stable/14 - sound: Improve sndstat nvlist feederchain format List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8156d8598f5926a8fa996b65b742a295599b131c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8156d8598f5926a8fa996b65b742a295599b131c commit 8156d8598f5926a8fa996b65b742a295599b131c Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:54 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:01 +0000 sound: Improve sndstat nvlist feederchain format - Use snd_afmt2str() to display format conversions in feeder_format, instead of the plain hex value. - Simplify feeder_rate contents. - Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix. - Use snd_afmt2str() instead of a plain hex for the the rest of the feeder classes. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46309 (cherry picked from commit 0864dfe6299b75e424b845c0d0e1a593da905ae3) --- sys/dev/sound/pcm/sndstat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 4fac6a97a3f0..4c5efb72cc0a 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -388,6 +388,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) uint32_t maxrate, minrate, fmts, minchn, maxchn, caps; nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL, *cdi = NULL; int err, nchan; + char buf[AFMTSTR_LEN]; di = nvlist_create(0); if (di == NULL) { @@ -531,10 +532,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) while (f != NULL) { sbuf_printf(&sb, "%s", f->class->name); if (f->desc->type == FEEDER_FORMAT) { - sbuf_printf(&sb, "(0x%08x -> 0x%08x)", - f->desc->in, f->desc->out); + snd_afmt2str(f->desc->in, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s -> ", buf); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "%s)", buf); } else if (f->desc->type == FEEDER_MATRIX) { - sbuf_printf(&sb, "(%d.%d -> %d.%d)", + sbuf_printf(&sb, "(%d.%dch -> %d.%dch)", AFMT_CHANNEL(f->desc->in) - AFMT_EXTCHANNEL(f->desc->in), AFMT_EXTCHANNEL(f->desc->in), @@ -542,15 +545,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) AFMT_EXTCHANNEL(f->desc->out), AFMT_EXTCHANNEL(f->desc->out)); } else if (f->desc->type == FEEDER_RATE) { - sbuf_printf(&sb, - "(0x%08x q:%d %d -> %d)", - f->desc->out, - FEEDER_GET(f, FEEDRATE_QUALITY), + sbuf_printf(&sb, "(%d -> %d)", FEEDER_GET(f, FEEDRATE_SRC), FEEDER_GET(f, FEEDRATE_DST)); } else { - sbuf_printf(&sb, "(0x%08x)", - f->desc->out); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s)", buf); } sbuf_printf(&sb, " -> "); f = f->parent; From nobody Mon Aug 26 13:54:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscX1Vknz5Sy30; Mon, 26 Aug 2024 13:54:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscW6tVQz4fZv; Mon, 26 Aug 2024 13:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOSLUqt8gKaW/1xyrr/QJsFGl2ZBviltAl0aeclSZlw=; b=ADCGp4gmTHthWKa47XeTERUWo2VMLwIz+e8CkpqZm75/DRDSGOoeCaki6Y+fwo8lmtW7WZ 47d7e+cKpMw8z7k79fCadaVjektyXqBolSvjEAq8WUvaCgHg+nH0R7/MH8IgY0sICJGZgW vMoN6KZXKm8WluHdc77Eun6En/i9S5ZEGXCepxZgsnspgtZbNZ10MXcNQchRGf8k4QBTxT D/piJRC3u9g7/gfuRvQDJJfil6e7KJonG/YfRv0SD0v+pZNqHg40TTa8dP0ZwpOsh56Bxv dQJQAvio5+DTl/YiUyV3xrAqy3K/f6n3h67PaMR5SvzLZzp+SSczQFtPxYBEbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680492; a=rsa-sha256; cv=none; b=DQILmbZejQUReKFsx2BVBS6+blreTk7RCv1r/eI8xhbuf5dz05ruTLhwbtBHbYXSNllnz6 hvE8ejizjQaHVN/L9JBGr5ZI/AvLB9SrUnqnVblhXHU/MqgFL5pIBwPhyvuRC58dA7JriB 1Gqvb+FyED+5jvCpVgvwK2xcV+o069bo4duoV8x3Epe4b1a8AoQ6jTE4zeGjqsucXeDlvW q2OQUP5T/zsgQVOtjHSTfCDrpM6jMjxWP6C/H9OovXbVrQHjKvsEBv/lZa6i/wlnLcU1av w97AyrJ+SxAgPKI19qqyD6EeWcAiTwgC1mBf42AVXa376tOBNXNwPWcGKntNBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOSLUqt8gKaW/1xyrr/QJsFGl2ZBviltAl0aeclSZlw=; b=KvKUJTonI7N4VdPTdBFwfmw3PwxFp71aYr1zxzswc3dJl/D0Q1mV+j2jTbhCso3ae8OIeL UhGrQ4kYPKXgVjFzWFwLIRecKs03yU5JzxABcMlXgzghjVnxOAC6Rb6PBLPlbrMym37x/I NGujp1PBSusy4/O4k/Q1TCAsFOFG2yUdZanSKc8I1gxVMwvJWS1AxVNZaFzwXmOVDNUivE /hAFk08n+NvJYd6WY3Jd+ETky3C2/npA2MpT19WN7YRwBqFj/xOfNLD9ZjShj1SQol4S+H MM7rr+CD/H2GoUd4xgcISKVzTfBNbvAcnpY37FOypG7uCHL1+jwBaP+JIkSEsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscW6TwGz17wd; Mon, 26 Aug 2024 13:54: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 47QDspU3017555; Mon, 26 Aug 2024 13:54:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsps2017552; Mon, 26 Aug 2024 13:54:51 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:51 GMT Message-Id: <202408261354.47QDsps2017552@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: f63d0c39d9d7 - stable/14 - ObsoleteFiles.inc: Update after sound changes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f63d0c39d9d748bbb2cecaf4c7799059b2dd5939 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f63d0c39d9d748bbb2cecaf4c7799059b2dd5939 commit f63d0c39d9d748bbb2cecaf4c7799059b2dd5939 Author: Christos Margiolis AuthorDate: 2024-08-24 12:08:15 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:43 +0000 ObsoleteFiles.inc: Update after sound changes Sponsored by: The FreeBSD Foundation (cherry picked from commit c3516c6533a17dbd980b5a2a8f566ada99c4b72d) --- ObsoleteFiles.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 4ae15082cdfd..788edc0eac38 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,16 @@ # xargs -n1 | sort | uniq -d; # done +# 20240824: sound examples: midi.c moved out of oss/ +OLD_FILES+=share/examples/sound/oss/midi.c + +# 20240824: sound examples: Remove ossinit.h and rename basic.c to audio.c +OLD_FILES+=share/examples/sound/oss/ossinit.h +OLD_FILES+=share/examples/sound/oss/basic.c + +# 20240824: sound examples: Remove ossmidi.h +OLD_FILES+=share/examples/sound/oss/ossmidi.h + # 20240801: retire ifaddr_byindex OLD_FILES+=usr/share/man/man9/ifaddr_byindex.9.gz From nobody Mon Aug 26 13:54:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscY4wtwz5SyFC; Mon, 26 Aug 2024 13:54:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscY3ZX8z4fbD; Mon, 26 Aug 2024 13:54:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Od9ExCjs5KW0uJt++jfW/RWazoPsArEuH7PLs4jfwg=; b=rVs0WCUeBH1jH/83RVqS+i+qFTQZy6SpwrGk26VAl4/6TrrdwhEm5VUPJxh8QNZ7rLC1sx gNn5bWC4i4QStOu9VK8HDXXW87/z2pW1YfLQda8WvZa6FD5xI84iQcDQ7W3O3iZkg2rtIH dobwFqKIaVDsPAgKHWUi2aZgdjkwQJaoK/gnLmUH8tPJ/84rsfs1yN+mmy34BOOw2Jarhb 6VUImx+MEqiV7rF+isBo8vb5bYPRYe+gpPpUXZp00xEr3j41DrfE8O0NwxA9hYopMzkpOR HckkwYmCVtqgL46bk6Kb1nYcMfGf/Y1FCjeQZZZV8LnQcvxl9/rPb8+SHVd08w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680493; a=rsa-sha256; cv=none; b=k58GF1UQdTTUhXdJdLbMIFbH+niWxzYDeqTcwH6uLnDosPWjiYCW5Nw0h/xG3K0Fid8sqL 8wIbaVh0YEI9CoY922PxCT2J+q0IjR5i4J+94cspvnaVi8KgyX48BfqW+UOqBnaelU6UNN ZH4a2UDLSk/5Vdj/MWYiBmXjfJCyMPyRFyphPNb/yZMo4mtkgyB7Ie9ym9RblT21u1pJOp P1Wt8gvNOG9KlriOUFPWZwopJ8q8Pj2Hu1dc8bOK6mPQyreTTRBP+lu7ZbvpnWmJ1c+q0i XUK+bwLWMGt00a9KS4Dr3+J3ubV2M9KMCFvDalUwzOnAU7vCy87jC3nUis6nNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Od9ExCjs5KW0uJt++jfW/RWazoPsArEuH7PLs4jfwg=; b=ee8pXR53JacXhXdqyhKmJx0seEtc0UC4YOCmHJK2aAPm0rmtem2mwCChgS+51sOvgzbKJ2 yeXRpaUZNQtqezLxIObRWHrrLoOqHTuzq7KewPcEV+3OyrbUjR1SYfQTdRruOCDOy3yJUc inDCq4q8M5Ko0VEyrfhDk5ZzL24z5BlMoAAB1ZNm1Kix9XGVH4RcnwByr4LFhJ/nPwf2YK AtofYDhAEUjFWKwCqYrNhzZPf1s+RSsgp3p+a5xBwoUIHt1LXah6Yh6B2ZWWLD/ia7q8tC VFJcUahoE+y9nKdC9roS8C1kiOI67Kmv/ls+tR4Iqn8plLpIPph4G6jnAsgpfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscY0ksDz17wf; Mon, 26 Aug 2024 13:54: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 47QDsrfZ017603; Mon, 26 Aug 2024 13:54:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsq3I017600; Mon, 26 Aug 2024 13:54:52 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:52 GMT Message-Id: <202408261354.47QDsq3I017600@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: 91b1e2a4a84b - stable/14 - sound examples: Delete stale ossinit.h file List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 91b1e2a4a84ba90c40eed9378a5be4cfbd623037 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=91b1e2a4a84ba90c40eed9378a5be4cfbd623037 commit 91b1e2a4a84ba90c40eed9378a5be4cfbd623037 Author: Christos Margiolis AuthorDate: 2024-08-24 12:16:21 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:54:00 +0000 sound examples: Delete stale ossinit.h file Fixes: 3decd659a788("sound examples: Simplify audio example") Sponsored by: The FreeBSD Foundation MFC after: 2 days (cherry picked from commit 7ae4868a9a1ad255e03529f5872c78f14f215f25) --- share/examples/sound/oss/ossinit.h | 262 ------------------------------------- 1 file changed, 262 deletions(-) diff --git a/share/examples/sound/oss/ossinit.h b/share/examples/sound/oss/ossinit.h deleted file mode 100644 index 5fd614ecb4fb..000000000000 --- a/share/examples/sound/oss/ossinit.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2021 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include - - -#ifndef SAMPLE_SIZE -#define SAMPLE_SIZE 16 -#endif - -/* Format can be unsigned, in which case replace S with U */ -#if SAMPLE_SIZE == 32 -typedef int32_t sample_t; -int format = AFMT_S32_NE; /* Signed 32bit native endian format */ -#elif SAMPLE_SIZE == 16 -typedef int16_t sample_t; -int format = AFMT_S16_NE; /* Signed 16bit native endian format */ -#elif SAMPLE_SIZE == 8 -typedef int8_t sample_t; -int format = AFMT_S8_NE; /* Signed 8bit native endian format */ -#else -#error Unsupported sample format! -typedef int32_t sample_t; -int format = AFMT_S32_NE; /* Not a real value, just silencing - * compiler errors */ -#endif - - - -/* - * Minimal configuration for OSS - * For real world applications, this structure will probably contain many - * more fields - */ -typedef struct config { - char *device; - int channels; - int fd; - int format; - int frag; - int sample_count; - int sample_rate; - int sample_size; - int chsamples; - int mmap; - oss_audioinfo audio_info; - audio_buf_info buffer_info; -} config_t; - - -/* - * Error state is indicated by value=-1 in which case application exits - * with error - */ -static inline void -check_error(const int value, const char *message) -{ - if (value == -1) { - fprintf(stderr, "OSS error: %s %s\n", message, strerror(errno)); - exit(1); - } -} - - - -/* Calculate frag by giving it minimal size of buffer */ -static inline int -size2frag(int x) -{ - int frag = 0; - - while ((1 << frag) < x) { - ++frag; - } - return frag; -} - - -/* - * Split input buffer into channels. Input buffer is in interleaved format - * which means if we have 2 channels (L and R), this is what the buffer of - * 8 samples would contain: L,R,L,R,L,R,L,R. The result are two channels - * containing: L,L,L,L and R,R,R,R. - */ -void -oss_split(config_t *config, sample_t *input, sample_t *output) -{ - int channel; - int index; - - for (int i = 0; i < config->sample_count; ++i) { - channel = i % config->channels; - index = i / config->channels; - output[channel * index] = input[i]; - } -} - - -/* - * Convert channels into interleaved format and place it in output - * buffer - */ -void -oss_merge(config_t *config, sample_t *input, sample_t *output) -{ - for (int channel = 0; channel < config->channels; ++channel) { - for (int index = 0; index < config->chsamples; ++index) { - output[index * config->channels + channel] = input[channel * index]; - } - } -} - -void -oss_init(config_t *config) -{ - int error; - int tmp; - - /* Open the device for read and write */ - config->fd = open(config->device, O_RDWR); - check_error(config->fd, "open"); - - /* Get device information */ - config->audio_info.dev = -1; - error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info)); - check_error(error, "SNDCTL_ENGINEINFO"); - printf("min_channels: %d\n", config->audio_info.min_channels); - printf("max_channels: %d\n", config->audio_info.max_channels); - printf("latency: %d\n", config->audio_info.latency); - printf("handle: %s\n", config->audio_info.handle); - if (config->audio_info.min_rate > config->sample_rate || config->sample_rate > config->audio_info.max_rate) { - fprintf(stderr, "%s doesn't support chosen ", config->device); - fprintf(stderr, "samplerate of %dHz!\n", config->sample_rate); - exit(1); - } - if (config->channels < 1) { - config->channels = config->audio_info.max_channels; - } - - /* - * If device is going to be used in mmap mode, disable all format - * conversions. Official OSS documentation states error code should not be - * checked. http://manuals.opensound.com/developer/mmap_test.c.html#LOC10 - */ - if (config->mmap) { - tmp = 0; - ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp); - } - - /* - * Set number of channels. If number of channels is chosen to the value - * near the one wanted, save it in config - */ - tmp = config->channels; - error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp); - check_error(error, "SNDCTL_DSP_CHANNELS"); - if (tmp != config->channels) { /* or check if tmp is close enough? */ - fprintf(stderr, "%s doesn't support chosen ", config->device); - fprintf(stderr, "channel count of %d", config->channels); - fprintf(stderr, ", set to %d!\n", tmp); - } - config->channels = tmp; - - /* Set format, or bit size: 8, 16, 24 or 32 bit sample */ - tmp = config->format; - error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp); - check_error(error, "SNDCTL_DSP_SETFMT"); - if (tmp != config->format) { - fprintf(stderr, "%s doesn't support chosen sample format!\n", config->device); - exit(1); - } - - /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */ - tmp = config->sample_rate; - error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp); - check_error(error, "SNDCTL_DSP_SPEED"); - - /* Get and check device capabilities */ - error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps)); - check_error(error, "SNDCTL_DSP_GETCAPS"); - if (!(config->audio_info.caps & PCM_CAP_DUPLEX)) { - fprintf(stderr, "Device doesn't support full duplex!\n"); - exit(1); - } - if (config->mmap) { - if (!(config->audio_info.caps & PCM_CAP_TRIGGER)) { - fprintf(stderr, "Device doesn't support triggering!\n"); - exit(1); - } - if (!(config->audio_info.caps & PCM_CAP_MMAP)) { - fprintf(stderr, "Device doesn't support mmap mode!\n"); - exit(1); - } - } - - /* - * If desired frag is smaller than minimum, based on number of channels - * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer size - * is 2^frag, but the real size of the buffer will be read when the - * configuration of the device is successfull - */ - int min_frag = size2frag(config->sample_size * config->channels); - - if (config->frag < min_frag) { - config->frag = min_frag; - } - - /* - * Allocate buffer in fragments. Total buffer will be split in number - * of fragments (2 by default) - */ - if (config->buffer_info.fragments < 0) { - config->buffer_info.fragments = 2; - } - tmp = ((config->buffer_info.fragments) << 16) | config->frag; - error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp); - check_error(error, "SNDCTL_DSP_SETFRAGMENT"); - - /* When all is set and ready to go, get the size of buffer */ - error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info)); - check_error(error, "SNDCTL_DSP_GETOSPACE"); - if (config->buffer_info.bytes < 1) { - fprintf( - stderr, - "OSS buffer error: buffer size can not be %d\n", - config->buffer_info.bytes - ); - exit(1); - } - config->sample_count = config->buffer_info.bytes / config->sample_size; - config->chsamples = config->sample_count / config->channels; -} From nobody Mon Aug 26 15:21:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsvXx303mz5T5y1; Mon, 26 Aug 2024 15:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsvXx2QFZz4nyX; Mon, 26 Aug 2024 15:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724685713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W/WwTFTi7wqhtE63a4F5LwGuuy7D30doaqwtPSs7y6c=; b=oL+4dRorwK9gl5fnpL+AkL0gVUV42KF9FTDk96J3Bw3gddVDP2l1jYqjyrpOi/jdqPp+2o vTke4UdgNrrKT5JV6wmpDwVULFxAVgWH8i+XvPbzogdKiEgJYkAk9H9JjX878AUYx2eps2 JttkU60gRMH4Wa6YhRMEnobNT7yAJXMU5g5M5KRlrduZ9+QwqKsXk0OPiGPa65OjwuRfG/ 8q8nX4L7eZqZR5NJsGtk955L+KBoouQAkGgn1I3f3sJptm2+1leYTr6UtE84iavAUnIoTX Djh8ADqDiA2EJ+MWQ4Tvvm91svbPLdH5UA4lZOwq7fesiuahwUDS6W7GDIDjjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724685713; a=rsa-sha256; cv=none; b=ntv2y+6LEBV8ubVfublUEBjnC8eZA2976WwO23X37O9SwdFej+Q98Dn+BD9EAi9bY/OgjP JCJjRFjXayfdlxAop5RV55O9+uzB4M03lhy+z0vhIaRJaxu9diaTr0iGDsKC7s8B2AkCol Mtet3s+quXPHlTL7EZYfFE5b+8HK1fpwCAj4HlWllWBDPAwwu6hx5/WbPcqnBJXXxQP8FR DwNhuDyHeYHvTFUmaV5qCJI75GtWjsTHBpjWLqhcN/gA1i+dBt/r4hJUpLMPCTD2sZDs5e D18a2GM4uW+vOR2QhSdCuUfLLrgD9/g3JEWi2zSd0ZfgebYLTd8VBWUHNqkugg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724685713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W/WwTFTi7wqhtE63a4F5LwGuuy7D30doaqwtPSs7y6c=; b=yO5cbczfQubILDZJBrAK6yjCRbtH272iY+qgzMXJSt7ojK+6Xw8B63/AyWvYYk6yrQq7ni fl3IGaYFinz3YlFum7+5bSCdwxDZ/Tp9Pnt3bh25tpcj/U4JIpV7OO0vTrZnQlzjqYlPQ8 reKy7zlWirj3LlMTYLC9O2cTezHblZ/mBXLytfYeZ521lpftN8eYGSc8RCXbW6GDLACobL pdUGWk8/RWYYtzhQehZvNAslXrw1BbD+oxOz/06RFv7nzC4P8k+bQZbJHrF9AKZvMwUYTa +h1G6AJrbO5uWEvU99mjR88pjnLHnQ2ncG7Bfm6m4SERHZku6KDviR645Hsuwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsvXx21gGz1BnR; Mon, 26 Aug 2024 15:21: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 47QFLrBh068201; Mon, 26 Aug 2024 15:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QFLrK6068198; Mon, 26 Aug 2024 15:21:53 GMT (envelope-from git) Date: Mon, 26 Aug 2024 15:21:53 GMT Message-Id: <202408261521.47QFLrK6068198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: e3819923655c - releng/13.4 - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: e3819923655c544b5494293d48d19067c67eb832 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=e3819923655c544b5494293d48d19067c67eb832 commit e3819923655c544b5494293d48d19067c67eb832 Author: Oliver Fromme AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI CommitDate: 2024-08-26 15:21:13 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes Approved by: re (cperciva) (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) (cherry picked from commit cb8f15aeede63627e220c40fe4911df79f35fb69) --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index decb2c1249ed..fbef358f4957 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,6 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; struct amdsmn_softc { @@ -116,6 +117,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M70H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index b38f92131c77..0e7f805b40fd 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,6 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -142,6 +143,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M70H_ROOT, false }, }; /* @@ -875,6 +877,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) _Static_assert((int)NUM_CCDS >= 12, ""); break; case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */ sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); From nobody Mon Aug 26 15:51:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WswCY4YWzz5T7Tj; Mon, 26 Aug 2024 15:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WswCY464yz4s1D; Mon, 26 Aug 2024 15:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZEYv/unH5+0QmDenqvD9xeQJxOGSmXNfS9qXmlC0X9w=; b=A7KTiclbXQDjdCPYljgI6EJ3PNtR/rklJWh0dL52JVsdQ/CwjAteNqFCyCJD2WJQz22+vn m5b4o00rN8HkbeRST3nAl7Nf4IGjfOA4ns+0z3DbUVDjxaTvGz/RTZ+nBzkliD979EoMWz j0sb+TQ8dDozqQMnIuQsod8IGOhp6csAvcAW6qFSzi+SqMI0j5iBuFM/BaSMulrHBMRhR+ Z3RfqgW6ekyQlI+j086L+kYgtx7sUjCwQgnJS6vKWF+Zstx6qtV0RKXYowSsnLp+yZzuNQ YzECU6mMxzviJeSKGZ52Du09Zem4rbBEBqkNcpNmPg9pGQbQ/8412fQcGAw3Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724687513; a=rsa-sha256; cv=none; b=bnC4jWBwtWqlnotzjWZQxXXGBsVKoVdWFDkOKnmJf1AqIpAbD2vhP0lLa9vakCx3DkgVFP mggZTtqFJvd3U3FxKNqB4XLsB2ZbftwA3WWf9kvBiTD/UcZvdWouSKDJWaGDRohkHAdEFI i4Eqlyfg60J6E3yqU59wjNDeoSy94rPYGrj9ZBFiy+syo2a86tOqgLhSvQdXcxCc3z8aBI lgNmL5lwa7J1zu/9UgE+4cX8Xnh6fCMW/rRaQ4WxomR+imk9CdiOT5W44VwvxKGpBKQJtJ u867idtx1qlzA50UM6OjwOWDpzgjZBTUn9qguY3HeKwzYmWbcX5M+o7nBOeyZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZEYv/unH5+0QmDenqvD9xeQJxOGSmXNfS9qXmlC0X9w=; b=JPy+fQ38PYt3osV4NhsHJ2SclGGjKJwLJBJRot9RTsjnDWZU4sSoao/iVW/w8RT9OZc9rg ljlSUqFOTJpzHyrKJo4Hk9KTAMB4QBB8OYD/Hbj20ofGbNPLcwGquSsnZtwSyVJP2pjbb0 jMVMYt9W2engYdw4/G7YUr+19ril1pTV1QVaZjDo8g44JXogpVrUZlrS0SAhesUdhgfIG9 8+UmSt4e7zxpRo/YNSKq1LK0rN35KlMzCR3cbUfA434TsYsN880gNMVcBDwD52PJQuYSw5 A8zX7p5KBNjw0T+vX2udYRqZuOSrNGo0xiPBohwSS73yOdkhGjRjvU/SUOabzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WswCY3jgFz1CTy; Mon, 26 Aug 2024 15:51: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 47QFpr2a015384; Mon, 26 Aug 2024 15:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QFprrl015381; Mon, 26 Aug 2024 15:51:53 GMT (envelope-from git) Date: Mon, 26 Aug 2024 15:51:53 GMT Message-Id: <202408261551.47QFprrl015381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 31ad232d8565 - stable/14 - Revert "mcast: fix memory leak in imf_purge()" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 31ad232d85656af77726626decce6c2b7fd824f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=31ad232d85656af77726626decce6c2b7fd824f6 commit 31ad232d85656af77726626decce6c2b7fd824f6 Author: Kristof Provost AuthorDate: 2023-12-12 18:20:03 +0000 Commit: Warner Losh CommitDate: 2024-08-26 15:45:58 +0000 Revert "mcast: fix memory leak in imf_purge()" This reverts commit fa03d37432caf17d56a931a9e6f5d9b06f102c5b. This commit caused us to not send IGMP leave messages if the inpcb went away. In other words: we freed pending packets whenever the socket closed rather than when the interface (or address) goes away. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43032 (cherry picked from commit c196e43243b83840cc9f3d1dadc7dacb3b0f556f) --- sys/netinet/in_mcast.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 94fc807ccea7..f93c4b0dac8c 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -915,8 +915,6 @@ imf_purge(struct in_mfilter *imf) imf->imf_st[0] = imf->imf_st[1] = MCAST_UNDEFINED; KASSERT(RB_EMPTY(&imf->imf_sources), ("%s: imf_sources not empty", __func__)); - if (imf->imf_inm != NULL) - mbufq_drain(&imf->imf_inm->inm_scq); } /* From nobody Mon Aug 26 15:51:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WswCZ6g0hz5T8Gg; Mon, 26 Aug 2024 15:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WswCZ5Mkhz4sFs; Mon, 26 Aug 2024 15:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M9M6Eq3JFMA6qXZpD45gQxgLHXammxIsjqAkDAWRtMo=; b=yjl/cCvQV5CusTwUwUcQnyKuqk/+eI4vgvCOzTaqaLRat5zL1ohXot/XQ1mZk7isvH6a38 3+YSBIdw015jtmUoJYOdKxHSULimAHWIHHiUgbSgEa8blq9/CXi2z/s+71AJSCc/o70Xss A1v5DFdNlknsfu2gR51/2ElnP3OXJMKfOEnqmCM0+zhd8TxbVIwBde1OaCUDm2hvlfOA/6 sJhPdNNAm3FFucFdlsNnpxgt3499NfTQqNwT1fZlecbqK6sTkGABY4KJEKTYBYBY8UyDxM BIYs1ZF9GSZTEwysKvNdEdZBybZqj80mUrExjmBjwOU5d+xcWUgGynZceNQbcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724687514; a=rsa-sha256; cv=none; b=ZdxNO7nBI7GTWObgu/gjec96U3hnxCXz2j9VvkHPfVsdEwSo9qrQTfolzBnNEj7Yglrqmg T4dZH4pMFLRTI65FTl4U7mM8YIn5cuTm2XFnfJmou5x3ImZy6kNgepA3MljAjZTV4Wsd8C dhpAPGlxjsAk5T4VfsBen2Wuz95GFtck00HAYrKMwqCqqqMXPqzg45+qsxJ5rdWdhj0sVE 7IS3cRFuorr0pYDQ/d1wdv6ff7y45vwhah1oK68QvqEr5pI1OpY4RjEsPaq4c+zDdet9zO icHhsCakl9YhTxCJuhPNLsXz0gTmXTywJR4WMYW+w05/xQjWcVgcL5ghWysQ1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M9M6Eq3JFMA6qXZpD45gQxgLHXammxIsjqAkDAWRtMo=; b=p2GfPSoNE9I/JMPF2EwFFSDFFCPNMWU+6J4SnX/Q+zPXC3dV4PCxtw91VC3C284gD4ZxBO E5lzHuZTpBdrKOcWfnQI5hD3esRbjdVEcG5iXEBkAn3Kw3gKEUwJ4C1VEKcQoCcnPvUKqu MNwPs9RKUUjo6Ps+qX/SKp55OROSKdN4iFCB1vpcuFXZeDwbCK2z82z68pJueZ6F2OnLG/ AGVjQeCn8j4FNqsli8r7qxRTd1p+05MHiFCSbXkw/JQRLQrLuFjaxEhCOWwdmi/SmeiYC5 Af2zgcLfJjue42KwbT8GEfDGOx8xDyXYk0NtQAw5sV9t+5OIVtsWFHtP2k1Hng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WswCZ50Krz1CX4; Mon, 26 Aug 2024 15:51: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 47QFpsJX015437; Mon, 26 Aug 2024 15:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QFpseU015434; Mon, 26 Aug 2024 15:51:54 GMT (envelope-from git) Date: Mon, 26 Aug 2024 15:51:54 GMT Message-Id: <202408261551.47QFpseU015434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 88e1bc06692a - stable/14 - mcast: fix leaked igmp packets on multicast cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88e1bc06692ae4552462945c53b5047e8dad5929 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=88e1bc06692ae4552462945c53b5047e8dad5929 commit 88e1bc06692ae4552462945c53b5047e8dad5929 Author: Kristof Provost AuthorDate: 2023-12-13 12:32:08 +0000 Commit: Warner Losh CommitDate: 2024-08-26 15:46:21 +0000 mcast: fix leaked igmp packets on multicast cleanup When we release a multicast address (e.g. on interface shutdown) we may still have packets queued in inm_scq. We have to free those, or we'll leak memory. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43033 (cherry picked from commit c2e340452c147b551180f2a1600ae76491342b0e) --- sys/netinet/in_mcast.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index f93c4b0dac8c..3dc4fa271683 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1181,6 +1181,7 @@ inm_purge(struct in_multi *inm) free(ims, M_IPMSOURCE); inm->inm_nsrc--; } + mbufq_drain(&inm->inm_scq); } /* From nobody Mon Aug 26 18:03:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz724SQ5z5TLZ6; Mon, 26 Aug 2024 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz723rlcz44l5; Mon, 26 Aug 2024 18: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=1724695390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0dP/uAhp0ol8VL3Pno3Ua2XnbA8R/84dziPKGrpu0V0=; b=OCp97IOq51KGG/rNRS/TW3/m4tvqrUs56h87LXBlbCuJIM1l9nUYhEusXVipnnpPurn3l1 rKOtcncI7EaQCmScbfjEcGmjPEfPe3tOWpsf9zuAz2bOJA5K98ZLkx5ZlgZcDD+KIYHbR2 tjXeI+i9/7bO8/YVqAMLVANzDc3XYCj8RhJWF0q+7lJGd+Ac0fBuesrcFqS/3pFThHr5CI i1pShPilmPOEFKjNz+c+Di3VcBNCCSWJMV6oDrhixVMON3iGTNrhc6oOUaDA+4sw7CQ9mT Cm4RYaovGEyNuyj9+HUEtt3EkMxIi3kpGBwIdfHBgyxjK3p4SRONfnkjaKZQyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695390; a=rsa-sha256; cv=none; b=MT7XtaPptnpwjiVK6x8AARKEKbDhwdVELkC5Jtu7x4znYJjTXLxcUL4yUEnCjaHUVweNVd Ei3Dexa8k/OzfZlswrEVThyxtRuHnAF6/Lo/Wr6zK155CFq/BHJVkvUgZ0xOimjmK06UnM gMe+BIq3CXaEVNbv6JCvrMYhH965bVtiaFDLErJGJu7AFkr1Z2pZ8VgBuYaIyoJnmDQbvq ik0Dwdh9vLwTm+hTq07wvMSlxrkGcfYavLd1onQNZTBZ1LFV74zirGrcJOLQ2w9ozpVaSc ctxGr/hMKR3bDEAm1Gl6tnV3ML5glFdS4ptjzOiwSD4RFY7hJPLDBtIwnEHKcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0dP/uAhp0ol8VL3Pno3Ua2XnbA8R/84dziPKGrpu0V0=; b=Q1MrYl8AUQSLIQBqM24leCNNqJ0efkGj/BQ4bmkuD5TeFnO/pr4om7A1AkXD0Hbk2+nm33 OfWaieWLAJkX9Z09OODpwLmpOrOBLjyITbmmIP8SkfHuGYGUvd34W35b0JsDXDC3WbxcQS /X7dxIEM9uwEQXxEzQiU3DUIyKcDlXjJnFF9sCw3RzfzC+nAQ5a5H1KGV9CMD04G7y11tN uxMmZLxc9N9CDffqNX9ySMYGcGXEsy8svjStLuTHIndtJB0MNqZDq2Cx8R90DPvRS84eCo WiZ6vgQ1z417nEbrG5+uugY0pFV5g4EuiYzp8cx+at7r6DWWCrXwt3eMOSR0nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz723RnBzHKJ; Mon, 26 Aug 2024 18: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 47QI3AOZ042282; Mon, 26 Aug 2024 18: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 47QI3AYx042279; Mon, 26 Aug 2024 18:03:10 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:10 GMT Message-Id: <202408261803.47QI3AYx042279@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: 215c3766945a - stable/14 - nvme: Use the NVMEV macro instead of expanded versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 215c3766945abf085c580b73bb409fd4afe5ff09 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=215c3766945abf085c580b73bb409fd4afe5ff09 commit 215c3766945abf085c580b73bb409fd4afe5ff09 Author: John Baldwin AuthorDate: 2024-01-29 18:30:54 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:25:49 +0000 nvme: Use the NVMEV macro instead of expanded versions Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43595 (cherry picked from commit 479680f235dd89cdabe0503312b3d23f322f4000) --- sys/dev/nvme/nvme.h | 72 +++++++++++++++++++++++++---------------------- sys/dev/nvme/nvme_ctrlr.c | 11 ++++---- sys/dev/nvme/nvme_ns.c | 16 ++++------- sys/dev/nvme/nvme_qpair.c | 2 +- 4 files changed, 51 insertions(+), 50 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 315dbdd5a3c8..cb5e1a5f1118 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -73,13 +73,13 @@ #define NVME_CAP_LO_REG_TO_SHIFT (24) #define NVME_CAP_LO_REG_TO_MASK (0xFF) #define NVME_CAP_LO_MQES(x) \ - (((x) >> NVME_CAP_LO_REG_MQES_SHIFT) & NVME_CAP_LO_REG_MQES_MASK) + NVMEV(NVME_CAP_LO_REG_MQES, x) #define NVME_CAP_LO_CQR(x) \ - (((x) >> NVME_CAP_LO_REG_CQR_SHIFT) & NVME_CAP_LO_REG_CQR_MASK) + NVMEV(NVME_CAP_LO_REG_CQR, x) #define NVME_CAP_LO_AMS(x) \ - (((x) >> NVME_CAP_LO_REG_AMS_SHIFT) & NVME_CAP_LO_REG_AMS_MASK) + NVMEV(NVME_CAP_LO_REG_AMS, x) #define NVME_CAP_LO_TO(x) \ - (((x) >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK) + NVMEV(NVME_CAP_LO_REG_TO, x) #define NVME_CAP_HI_REG_DSTRD_SHIFT (0) #define NVME_CAP_HI_REG_DSTRD_MASK (0xF) @@ -108,31 +108,31 @@ #define NVME_CAP_HI_REG_CRIMS_SHIFT (28) #define NVME_CAP_HI_REG_CRIMS_MASK (0x1) #define NVME_CAP_HI_DSTRD(x) \ - (((x) >> NVME_CAP_HI_REG_DSTRD_SHIFT) & NVME_CAP_HI_REG_DSTRD_MASK) + NVMEV(NVME_CAP_HI_REG_DSTRD, x) #define NVME_CAP_HI_NSSRS(x) \ - (((x) >> NVME_CAP_HI_REG_NSSRS_SHIFT) & NVME_CAP_HI_REG_NSSRS_MASK) + NVMEV(NVME_CAP_HI_REG_NSSRS, x) #define NVME_CAP_HI_CSS(x) \ - (((x) >> NVME_CAP_HI_REG_CSS_SHIFT) & NVME_CAP_HI_REG_CSS_MASK) + NVMEV(NVME_CAP_HI_REG_CSS, x) #define NVME_CAP_HI_CSS_NVM(x) \ - (((x) >> NVME_CAP_HI_REG_CSS_NVM_SHIFT) & NVME_CAP_HI_REG_CSS_NVM_MASK) + NVMEV(NVME_CAP_HI_REG_CSS_NVM, x) #define NVME_CAP_HI_BPS(x) \ - (((x) >> NVME_CAP_HI_REG_BPS_SHIFT) & NVME_CAP_HI_REG_BPS_MASK) + NVMEV(NVME_CAP_HI_REG_BPS, x) #define NVME_CAP_HI_CPS(x) \ - (((x) >> NVME_CAP_HI_REG_CPS_SHIFT) & NVME_CAP_HI_REG_CPS_MASK) + NVMEV(NVME_CAP_HI_REG_CPS, x) #define NVME_CAP_HI_MPSMIN(x) \ - (((x) >> NVME_CAP_HI_REG_MPSMIN_SHIFT) & NVME_CAP_HI_REG_MPSMIN_MASK) + NVMEV(NVME_CAP_HI_REG_MPSMIN, x) #define NVME_CAP_HI_MPSMAX(x) \ - (((x) >> NVME_CAP_HI_REG_MPSMAX_SHIFT) & NVME_CAP_HI_REG_MPSMAX_MASK) + NVMEV(NVME_CAP_HI_REG_MPSMAX, x) #define NVME_CAP_HI_PMRS(x) \ - (((x) >> NVME_CAP_HI_REG_PMRS_SHIFT) & NVME_CAP_HI_REG_PMRS_MASK) + NVMEV(NVME_CAP_HI_REG_PMRS, x) #define NVME_CAP_HI_CMBS(x) \ - (((x) >> NVME_CAP_HI_REG_CMBS_SHIFT) & NVME_CAP_HI_REG_CMBS_MASK) + NVMEV(NVME_CAP_HI_REG_CMBS, x) #define NVME_CAP_HI_NSSS(x) \ - (((x) >> NVME_CAP_HI_REG_NSSS_SHIFT) & NVME_CAP_HI_REG_NSSS_MASK) + NVMEV(NVME_CAP_HI_REG_NSSS, x) #define NVME_CAP_HI_CRWMS(x) \ - (((x) >> NVME_CAP_HI_REG_CRWMS_SHIFT) & NVME_CAP_HI_REG_CRWMS_MASK) + NVMEV(NVME_CAP_HI_REG_CRWMS, x) #define NVME_CAP_HI_CRIMS(x) \ - (((x) >> NVME_CAP_HI_REG_CRIMS_SHIFT) & NVME_CAP_HI_REG_CRIMS_MASK) + NVMEV(NVME_CAP_HI_REG_CRIMS, x) #define NVME_CC_REG_EN_SHIFT (0) #define NVME_CC_REG_EN_MASK (0x1) @@ -164,7 +164,8 @@ #define NVME_CSTS_REG_ST_SHIFT (6) #define NVME_CSTS_REG_ST_MASK (0x1) -#define NVME_CSTS_GET_SHST(csts) (((csts) >> NVME_CSTS_REG_SHST_SHIFT) & NVME_CSTS_REG_SHST_MASK) +#define NVME_CSTS_GET_SHST(csts) \ + NVMEV(NVME_CSTS_REG_SHST, csts) #define NVME_AQA_REG_ASQS_SHIFT (0) #define NVME_AQA_REG_ASQS_MASK (0xFFF) @@ -187,19 +188,19 @@ #define NVME_PMRCAP_REG_CMSS_MASK (0x1) #define NVME_PMRCAP_RDS(x) \ - (((x) >> NVME_PMRCAP_REG_RDS_SHIFT) & NVME_PMRCAP_REG_RDS_MASK) + NVMEV(NVME_PMRCAP_REG_RDS, x) #define NVME_PMRCAP_WDS(x) \ - (((x) >> NVME_PMRCAP_REG_WDS_SHIFT) & NVME_PMRCAP_REG_WDS_MASK) + NVMEV(NVME_PMRCAP_REG_WDS, x) #define NVME_PMRCAP_BIR(x) \ - (((x) >> NVME_PMRCAP_REG_BIR_SHIFT) & NVME_PMRCAP_REG_BIR_MASK) + NVMEV(NVME_PMRCAP_REG_BIR, x) #define NVME_PMRCAP_PMRTU(x) \ - (((x) >> NVME_PMRCAP_REG_PMRTU_SHIFT) & NVME_PMRCAP_REG_PMRTU_MASK) + NVMEV(NVME_PMRCAP_REG_PMRTU, x) #define NVME_PMRCAP_PMRWBM(x) \ - (((x) >> NVME_PMRCAP_REG_PMRWBM_SHIFT) & NVME_PMRCAP_REG_PMRWBM_MASK) + NVMEV(NVME_PMRCAP_REG_PMRWBM, x) #define NVME_PMRCAP_PMRTO(x) \ - (((x) >> NVME_PMRCAP_REG_PMRTO_SHIFT) & NVME_PMRCAP_REG_PMRTO_MASK) + NVMEV(NVME_PMRCAP_REG_PMRTO, x) #define NVME_PMRCAP_CMSS(x) \ - (((x) >> NVME_PMRCAP_REG_CMSS_SHIFT) & NVME_PMRCAP_REG_CMSS_MASK) + NVMEV(NVME_PMRCAP_REG_CMSS, x) /* Command field definitions */ @@ -219,12 +220,18 @@ #define NVME_STATUS_DNR_SHIFT (15) #define NVME_STATUS_DNR_MASK (0x1) -#define NVME_STATUS_GET_P(st) (((st) >> NVME_STATUS_P_SHIFT) & NVME_STATUS_P_MASK) -#define NVME_STATUS_GET_SC(st) (((st) >> NVME_STATUS_SC_SHIFT) & NVME_STATUS_SC_MASK) -#define NVME_STATUS_GET_SCT(st) (((st) >> NVME_STATUS_SCT_SHIFT) & NVME_STATUS_SCT_MASK) -#define NVME_STATUS_GET_CRD(st) (((st) >> NVME_STATUS_CRD_SHIFT) & NVME_STATUS_CRD_MASK) -#define NVME_STATUS_GET_M(st) (((st) >> NVME_STATUS_M_SHIFT) & NVME_STATUS_M_MASK) -#define NVME_STATUS_GET_DNR(st) (((st) >> NVME_STATUS_DNR_SHIFT) & NVME_STATUS_DNR_MASK) +#define NVME_STATUS_GET_P(st) \ + NVMEV(NVME_STATUS_P, st) +#define NVME_STATUS_GET_SC(st) \ + NVMEV(NVME_STATUS_SC, st) +#define NVME_STATUS_GET_SCT(st) \ + NVMEV(NVME_STATUS_SCT, st) +#define NVME_STATUS_GET_CRD(st) \ + NVMEV(NVME_STATUS_CRD, st) +#define NVME_STATUS_GET_M(st) \ + NVMEV(NVME_STATUS_M, st) +#define NVME_STATUS_GET_DNR(st) \ + NVMEV(NVME_STATUS_DNR, st) #define NVME_PWR_ST_MPS_SHIFT (0) #define NVME_PWR_ST_MPS_MASK (0x1) @@ -1752,8 +1759,7 @@ static inline bool nvme_ctrlr_has_dataset_mgmt(const struct nvme_controller_data *cd) { /* Assumes cd was byte swapped by nvme_controller_data_swapbytes() */ - return ((cd->oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) & - NVME_CTRLR_DATA_ONCS_DSM_MASK); + return (NVMEV(NVME_CTRLR_DATA_ONCS_DSM, cd->oncs) != 0); } /* Namespace helper functions */ diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index e659a3776957..7096f0443f1d 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -278,8 +278,7 @@ nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) csts = nvme_mmio_read_4(ctrlr, csts); if (csts == NVME_GONE) /* Hot unplug. */ return (ENXIO); - if (((csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK) - == desired_val) + if (NVMEV(NVME_CSTS_REG_RDY, csts) == desired_val) break; if (timeout - ticks < 0) { nvme_printf(ctrlr, "controller ready did not become %d " @@ -305,8 +304,8 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) cc = nvme_mmio_read_4(ctrlr, cc); csts = nvme_mmio_read_4(ctrlr, csts); - en = (cc >> NVME_CC_REG_EN_SHIFT) & NVME_CC_REG_EN_MASK; - rdy = (csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK; + en = NVMEV(NVME_CC_REG_EN, cc); + rdy = NVMEV(NVME_CSTS_REG_RDY, csts); /* * Per 3.1.5 in NVME 1.3 spec, transitioning CC.EN from 0 to 1 @@ -352,8 +351,8 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) cc = nvme_mmio_read_4(ctrlr, cc); csts = nvme_mmio_read_4(ctrlr, csts); - en = (cc >> NVME_CC_REG_EN_SHIFT) & NVME_CC_REG_EN_MASK; - rdy = (csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK; + en = NVMEV(NVME_CC_REG_EN, cc); + rdy = NVMEV(NVME_CSTS_REG_RDY, csts); /* * See note in nvme_ctrlr_disable. Short circuit if we're already enabled. diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 55f607c96e59..329b8d583898 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -181,10 +181,8 @@ nvme_ns_get_sector_size(struct nvme_namespace *ns) { uint8_t flbas_fmt, lbads; - flbas_fmt = (ns->data.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (ns->data.lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, ns->data.flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, ns->data.lbaf[flbas_fmt]); return (1 << lbads); } @@ -231,8 +229,7 @@ nvme_ns_get_stripesize(struct nvme_namespace *ns) { uint32_t ss; - if (((ns->data.nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & - NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0) { + if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, ns->data.nsfeat) != 0) { ss = nvme_ns_get_sector_size(ns); if (ns->data.npwa != 0) return ((ns->data.npwa + 1) * ss); @@ -552,8 +549,8 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, if (ns->data.nsze == 0) return (ENXIO); - flbas_fmt = (ns->data.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, ns->data.flbas); + /* * Note: format is a 0-based value, so > is appropriate here, * not >=. @@ -585,8 +582,7 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, if (nvme_ctrlr_has_dataset_mgmt(&ctrlr->cdata)) ns->flags |= NVME_NS_DEALLOCATE_SUPPORTED; - vwc_present = (ctrlr->cdata.vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK; + vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, ctrlr->cdata.vwc); if (vwc_present) ns->flags |= NVME_NS_FLUSH_SUPPORTED; diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 2e9af4310a15..e087abcb2654 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1041,7 +1041,7 @@ nvme_qpair_timeout(void *arg) * usually doesn't). */ csts = nvme_mmio_read_4(ctrlr, csts); - cfs = (csts >> NVME_CSTS_REG_CFS_SHIFT) & NVME_CSTS_REG_CFS_MASK; + cfs = NVMEV(NVME_CSTS_REG_CFS, csts); if (csts == NVME_GONE || cfs == 1) goto do_reset; From nobody Mon Aug 26 18:03:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz735kkhz5TLnS; Mon, 26 Aug 2024 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz734q53z44l6; Mon, 26 Aug 2024 18: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=1724695391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgm+0gLO6b1UaTWLW+JwCCsU8LWSO9ROqyJ79su0oCE=; b=e7KvA0SCeDJ7js0xIJae2CRO2uoksjtq7Tg5Sy9h1udtr7R+zH/OdTMIQC2weUbvD41Plq 7VvI4fMs7Miw44f1eiUsm5xoCbhEVlYkTjxxNz3AxC+bLRN1Hdbl25vg5zYdg2IWfBk1wK bjGlH+S9kAlAOSxtBz8eB1J+Pl2eOiEKIPrTvBkJZrjJNbkR3nqyRMYO1xpaDBoSvdqL2u W4RE6RP2x37qNn0FAWAd9jwtHvl32xWhRZE93BNh82/1zWLUz+inmtaMD7C7Hutp5v4Mo6 NFb79JgakyNg/RLFmNovu01+YvvqJ9DjwZjXhMhE7SdFwAI481D9n7OTGcnzRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695391; a=rsa-sha256; cv=none; b=nq+SzU3P402CXGx0G+kL+F1Y2zq1mh1MCFLxHzOkROUMRM5bJDyJs4gvVXk21pqN9Arv6s r0ARbCLw5B7dJbKoxNTzPouAykjqajaf27Zz9vL5Kx3Vt05jITveTo3Ctf9UDx6hh0uXak PYumeTwe7RxPmF8SPgRdOMv3shJwnvGMIoXSa4/9Tsr/farMnMY2b4oDZqRWNvEuvHvuOh jchLbPAe9dnjYdo4e4XNxwZxSgSJjqx5HaAlrTMNAGS4BZW4Kcwg8hwLYFUUD783QwIclj Tf77Cqp13Bg+VtxBIzwBTFGQAAdYPokfc50+pWJh8u7YHM4cd8QUuAmcCeYedg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgm+0gLO6b1UaTWLW+JwCCsU8LWSO9ROqyJ79su0oCE=; b=xsc5zL+DxgN7zk860k9t2sBI3O2pG30I/CNFnsHXkFAmqZfj6FbhTnGosGxfN+jLXyrobw rdNF007nWIm0Mf8UbOnXZIHmmi8GIE1HsSARtbW0RXGfl6ccGNVMbKD8ElJj5DrFz1P06h +rAxUOXz5VXu8K4pETQ+gvSA/bg77EOrBQzkD08iw61RTkt446h8bIvd0FNIwn2h+R00l7 VLrWq4Z4M4CMFEKMHt5R3sDXLd95r21x2wXLuqvj4Pu23SG1B6SBwMp4zBTPuO+CaRJbtl dwRORyHHi8OjT7qUiQ+kzmZ4Xl3LF4XUsnvZya60MzBseECkzR2jv3xRbS7G9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz734QmmzH6K; Mon, 26 Aug 2024 18: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 47QI3B8p042336; Mon, 26 Aug 2024 18: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 47QI3BpQ042333; Mon, 26 Aug 2024 18:03:11 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:11 GMT Message-Id: <202408261803.47QI3BpQ042333@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: e8edea1b4cc5 - stable/14 - nda: Use the NVMEV macro instead of expanded versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e8edea1b4cc5aae7897439821a611257a32a879c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e8edea1b4cc5aae7897439821a611257a32a879c commit e8edea1b4cc5aae7897439821a611257a32a879c Author: John Baldwin AuthorDate: 2024-01-29 18:33:39 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:00 +0000 nda: Use the NVMEV macro instead of expanded versions Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43596 (cherry picked from commit 2cb78e71503ec9a73054a6f70908c5f20c2ceb73) --- sys/cam/nvme/nvme_da.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 9901ecccf21c..33efbc66773c 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -912,18 +912,15 @@ ndaregister(struct cam_periph *periph, void *arg) else if (maxio > maxphys) maxio = maxphys; /* for safety */ disk->d_maxsize = maxio; - flbas_fmt = (nsd->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (nsd->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsd->flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsd->lbaf[flbas_fmt]); disk->d_sectorsize = 1 << lbads; disk->d_mediasize = (off_t)(disk->d_sectorsize * nsd->nsze); disk->d_delmaxsize = disk->d_mediasize; disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if (nvme_ctrlr_has_dataset_mgmt(cd)) disk->d_flags |= DISKFLAG_CANDELETE; - vwc_present = (cd->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK; + vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc); if (vwc_present) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { @@ -946,8 +943,8 @@ ndaregister(struct cam_periph *periph, void *arg) disk->d_hba_subdevice = cpi.hba_subdevice; snprintf(disk->d_attachment, sizeof(disk->d_attachment), "%s%d", cpi.dev_name, cpi.unit_number); - if (((nsd->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & - NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0 && nsd->npwg != 0) + if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, nsd->nsfeat) != 0 && + nsd->npwg != 0) disk->d_stripesize = ((nsd->npwg + 1) * disk->d_sectorsize); else disk->d_stripesize = nsd->noiob * disk->d_sectorsize; From nobody Mon Aug 26 18:03:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz750ZLYz5TLnW; Mon, 26 Aug 2024 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz745xGXz44QS; Mon, 26 Aug 2024 18: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=1724695392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8kZ+0viOhSrNF5DAtpFY+2Ebw5LVg2XAHa1EXu026wY=; b=G9MgbcogPT1UvCL3ji0iKQ9GeyuFOQX2MLCyepW4G3BNXnKXhAIV5Sb1zKmk/jp2PxO+NP sll2zbyoZ5BL7GIHKZ0Of4wPwi4MgURMTraDY2l/HGT3Xw8WZ3TQXaxGuU+KVMoL7mrVJy cMSn7HHkM0QtY4wE+RzdfprDg8ba5quSNNO9ueRXdkr99gAX3T3Tcu6sm6uxFhRwi1tYhd yapVn2N0tZ2XwNGo7Lq15YlpKvEokQHPOM6B+K1E2SPh02Eb462sMKU8IFAMkpby2q/+lF vaaO00o0q1DdN/nuk9zpqVIKT50sXw/tWIPaVylCXmce0cPNSCvniy9j8vFuUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695392; a=rsa-sha256; cv=none; b=l0fFLMGydZnDmxBlKZhihenpJ8J/n4M6Q9kEksIdtOIuilCDxLu8g6eK05rqzvE0cUx0jc wPq6uBr405PR23N/vyWPnxgCgTha/Jeab1rHzzaZK28BQCi2udL4NYoM7NPxro5jLWm6U0 oJmJovAT0y3muME7JcLTWyRWbaRDQ4CZd50JlcDOPGxGD4xbGPk1LLXjdrH58zi8CwFzb0 e0BbVSClb/60KAxgocDKLocTrC2Rsxp2aaQpxpvtcEMPzYMDYjoIhTnv8W52kPZkYOZt7u qaLZ7XPYkWinyLAk7BbT7LOt+r68oDliHE7AxylvCzzpSg1HileyFVr1pwHR7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8kZ+0viOhSrNF5DAtpFY+2Ebw5LVg2XAHa1EXu026wY=; b=vyZEukCHMcXrpBFZX8epg2g4iSR4O2p8Pog2OP3RWw6FFT+s4cY2gC6PjiDOEurOOrUDzj Wlytk7fbCjAxL2vwKsOefZhHMsGdlhf37Uk3/knjJ+GBt7gALBHLMmEMC6R+xCZzfq/mwm 52kMFKIUQso4iLzblq6ZeAOtqM/M43cqgol8i852CPw7AiS8rmZnepM9/mZZBaZtMQIi2V aimdaSeqZZ7PJuMgT4rp42Ri94co0Cc0r3XdLW/szNmlR6HnSvzavDfMfegDaRBdTHYr+i DbT4Fjp7wT0OiGgBkWe9Zw0FBdm8GQ3//CXmaVRlit/J/ymgfIqtVv5TY57EWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz745DqlzH9F; Mon, 26 Aug 2024 18: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 47QI3CCe042396; Mon, 26 Aug 2024 18: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 47QI3CBF042393; Mon, 26 Aug 2024 18:03:12 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:12 GMT Message-Id: <202408261803.47QI3CBF042393@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: 112d3053486c - stable/14 - nvmecontrol: Use the NVMEV macro instead of expanded versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 112d3053486c949fff6bc02394c88b2b04018961 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=112d3053486c949fff6bc02394c88b2b04018961 commit 112d3053486c949fff6bc02394c88b2b04018961 Author: John Baldwin AuthorDate: 2024-01-29 18:34:02 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:08 +0000 nvmecontrol: Use the NVMEV macro instead of expanded versions Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43597 (cherry picked from commit fba73a408314d8e32056d4a812c9a2eb5f618b5d) --- sbin/nvmecontrol/devlist.c | 6 +- sbin/nvmecontrol/firmware.c | 9 +-- sbin/nvmecontrol/format.c | 27 +++----- sbin/nvmecontrol/identify.c | 109 +++++++++++++---------------- sbin/nvmecontrol/identify_ext.c | 149 ++++++++++++++++------------------------ sbin/nvmecontrol/logpage.c | 63 ++++++----------- sbin/nvmecontrol/ns.c | 39 ++++------- sbin/nvmecontrol/power.c | 12 ++-- sbin/nvmecontrol/sanitize.c | 12 ++-- sbin/nvmecontrol/selftest.c | 3 +- 10 files changed, 167 insertions(+), 262 deletions(-) diff --git a/sbin/nvmecontrol/devlist.c b/sbin/nvmecontrol/devlist.c index 7e3dfe60fff4..b5e95b38937e 100644 --- a/sbin/nvmecontrol/devlist.c +++ b/sbin/nvmecontrol/devlist.c @@ -83,10 +83,8 @@ ns_get_sector_size(struct nvme_namespace_data *nsdata) { uint8_t flbas_fmt, lbads; - flbas_fmt = (nsdata->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (nsdata->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsdata->flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsdata->lbaf[flbas_fmt]); return (1 << lbads); } diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index 80bbff032cf2..8fcc4ba4f46e 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -278,21 +278,18 @@ firmware(const struct cmd *f, int argc, char *argv[]) if (read_controller_data(fd, &cdata)) errx(EX_IOERR, "Identify request failed"); - oacs_fw = (cdata.oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & - NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; + oacs_fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, cdata.oacs); if (oacs_fw == 0) errx(EX_UNAVAILABLE, "controller does not support firmware activate/download"); - fw_slot1_ro = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & - NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; + fw_slot1_ro = NVMEV(NVME_CTRLR_DATA_FRMW_SLOT1_RO, cdata.frmw); if (opt.fw_img && opt.slot == 1 && fw_slot1_ro) errx(EX_UNAVAILABLE, "slot %d is marked as read only", opt.slot); - fw_num_slots = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & - NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; + fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata.frmw); if (opt.slot > fw_num_slots) errx(EX_UNAVAILABLE, diff --git a/sbin/nvmecontrol/format.c b/sbin/nvmecontrol/format.c index 541b207b373f..a56027089ff5 100644 --- a/sbin/nvmecontrol/format.c +++ b/sbin/nvmecontrol/format.c @@ -160,38 +160,33 @@ format(const struct cmd *f, int argc, char *argv[]) /* Check that controller can execute this command. */ if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_FORMAT_SHIFT) & - NVME_CTRLR_DATA_OACS_FORMAT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_FORMAT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support format"); - if (((cd.fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & - NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) == 0 && ses == SES_CRYPTO) + if (NVMEV(NVME_CTRLR_DATA_FNA_CRYPTO_ERASE, cd.fna) == 0 && + ses == SES_CRYPTO) errx(EX_UNAVAILABLE, "controller does not support cryptographic erase"); if (nsid != NVME_GLOBAL_NAMESPACE_TAG) { - if (((cd.fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == SES_NONE) + if (NVMEV(NVME_CTRLR_DATA_FNA_FORMAT_ALL, cd.fna) && + ses == SES_NONE) errx(EX_UNAVAILABLE, "controller does not support per-NS format"); - if (((cd.fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != SES_NONE) + if (NVMEV(NVME_CTRLR_DATA_FNA_ERASE_ALL, cd.fna) && + ses != SES_NONE) errx(EX_UNAVAILABLE, "controller does not support per-NS erase"); /* Try to keep previous namespace parameters. */ if (read_namespace_data(fd, nsid, &nsd)) errx(EX_IOERR, "Identify request failed"); if (lbaf < 0) - lbaf = (nsd.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) - & NVME_NS_DATA_FLBAS_FORMAT_MASK; + lbaf = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsd.flbas); if (lbaf > nsd.nlbaf) errx(EX_USAGE, "LBA format is out of range"); if (ms < 0) - ms = (nsd.flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT) - & NVME_NS_DATA_FLBAS_EXTENDED_MASK; + ms = NVMEV(NVME_NS_DATA_FLBAS_EXTENDED, nsd.flbas); if (pi < 0) - pi = (nsd.dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) - & NVME_NS_DATA_DPS_MD_START_MASK; + pi = NVMEV(NVME_NS_DATA_DPS_MD_START, nsd.dps); if (pil < 0) - pil = (nsd.dps >> NVME_NS_DATA_DPS_PIT_SHIFT) - & NVME_NS_DATA_DPS_PIT_MASK; + pil = NVMEV(NVME_NS_DATA_DPS_PIT, nsd.dps); } else { /* We have no previous parameters, so default to zeroes. */ diff --git a/sbin/nvmecontrol/identify.c b/sbin/nvmecontrol/identify.c index 50698e8bfc70..81aebad0e0d6 100644 --- a/sbin/nvmecontrol/identify.c +++ b/sbin/nvmecontrol/identify.c @@ -67,11 +67,9 @@ print_namespace(struct nvme_namespace_data *nsdata) uint8_t thin_prov, ptype; uint8_t flbas_fmt, t; - thin_prov = (nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT) & - NVME_NS_DATA_NSFEAT_THIN_PROV_MASK; + thin_prov = NVMEV(NVME_NS_DATA_NSFEAT_THIN_PROV, nsdata->nsfeat); - flbas_fmt = (nsdata->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsdata->flbas); printf("Size: %lld blocks\n", (long long)nsdata->nsze); @@ -83,83 +81,77 @@ print_namespace(struct nvme_namespace_data *nsdata) thin_prov ? "Supported" : "Not Supported"); printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); printf("Current LBA Format: LBA Format #%02d", flbas_fmt); - if (nsdata->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_MS_SHIFT & NVME_NS_DATA_LBAF_MS_MASK) - printf(" %s metadata\n", nsdata->flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT & - NVME_NS_DATA_FLBAS_EXTENDED_MASK ? "Extended" : "Separate"); + if (NVMEV(NVME_NS_DATA_LBAF_MS, nsdata->lbaf[flbas_fmt]) != 0) + printf(" %s metadata\n", + NVMEV(NVME_NS_DATA_FLBAS_EXTENDED, nsdata->flbas) != 0 ? + "Extended" : "Separate"); else printf("\n"); printf("Metadata Capabilities\n"); printf(" Extended: %s\n", - nsdata->mc >> NVME_NS_DATA_MC_EXTENDED_SHIFT & NVME_NS_DATA_MC_EXTENDED_MASK ? "Supported" : "Not Supported"); + NVMEV(NVME_NS_DATA_MC_EXTENDED, nsdata->mc) != 0 ? "Supported" : + "Not Supported"); printf(" Separate: %s\n", - nsdata->mc >> NVME_NS_DATA_MC_POINTER_SHIFT & NVME_NS_DATA_MC_POINTER_MASK ? "Supported" : "Not Supported"); + NVMEV(NVME_NS_DATA_MC_POINTER, nsdata->mc) != 0 ? "Supported" : + "Not Supported"); printf("Data Protection Caps: %s%s%s%s%s%s\n", (nsdata->dpc == 0) ? "Not Supported" : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_END_SHIFT) & - NVME_NS_DATA_DPC_MD_END_MASK) ? "Last Bytes, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_START_SHIFT) & - NVME_NS_DATA_DPC_MD_START_MASK) ? "First Bytes, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT3_SHIFT) & - NVME_NS_DATA_DPC_PIT3_MASK) ? "Type 3, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_SHIFT) & - NVME_NS_DATA_DPC_PIT2_MASK) ? "Type 2, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT1_SHIFT) & - NVME_NS_DATA_DPC_PIT1_MASK) ? "Type 1" : ""); + NVMEV(NVME_NS_DATA_DPC_MD_END, nsdata->dpc) != 0 ? "Last Bytes, " : + "", + NVMEV(NVME_NS_DATA_DPC_MD_START, nsdata->dpc) != 0 ? + "First Bytes, " : "", + NVMEV(NVME_NS_DATA_DPC_PIT3, nsdata->dpc) != 0 ? "Type 3, " : "", + NVMEV(NVME_NS_DATA_DPC_PIT2, nsdata->dpc) != 0 ? "Type 2, " : "", + NVMEV(NVME_NS_DATA_DPC_PIT1, nsdata->dpc) != 0 ? "Type 1" : ""); printf("Data Protection Settings: "); - ptype = (nsdata->dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & - NVME_NS_DATA_DPS_PIT_MASK; - if (ptype) { + ptype = NVMEV(NVME_NS_DATA_DPS_PIT, nsdata->dps); + if (ptype != 0) { printf("Type %d, %s Bytes\n", ptype, - ((nsdata->dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) & - NVME_NS_DATA_DPS_MD_START_MASK) ? "First" : "Last"); + NVMEV(NVME_NS_DATA_DPS_MD_START, nsdata->dps) != 0 ? + "First" : "Last"); } else { printf("Not Enabled\n"); } printf("Multi-Path I/O Capabilities: %s%s\n", (nsdata->nmic == 0) ? "Not Supported" : "", - ((nsdata->nmic >> NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) & - NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK) ? "May be shared" : ""); + NVMEV(NVME_NS_DATA_NMIC_MAY_BE_SHARED, nsdata->nmic) != 0 ? + "May be shared" : ""); printf("Reservation Capabilities: %s%s%s%s%s%s%s%s%s\n", (nsdata->rescap == 0) ? "Not Supported" : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_IEKEY13_SHIFT) & - NVME_NS_DATA_RESCAP_IEKEY13_MASK) ? "IEKEY13, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_AR_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_AR_MASK) ? "EX_AC_AR, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_AR_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_AR_MASK) ? "WR_EX_AR, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_RO_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_RO_MASK) ? "EX_AC_RO, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_RO_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_RO_MASK) ? "WR_EX_RO, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_MASK) ? "EX_AC, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_MASK) ? "WR_EX, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_PTPL_SHIFT) & - NVME_NS_DATA_RESCAP_PTPL_MASK) ? "PTPL" : ""); + NVMEV(NVME_NS_DATA_RESCAP_IEKEY13, nsdata->rescap) != 0 ? + "IEKEY13, " : "", + NVMEV(NVME_NS_DATA_RESCAP_EX_AC_AR, nsdata->rescap) != 0 ? + "EX_AC_AR, " : "", + NVMEV(NVME_NS_DATA_RESCAP_WR_EX_AR, nsdata->rescap) != 0 ? + "WR_EX_AR, " : "", + NVMEV(NVME_NS_DATA_RESCAP_EX_AC_RO, nsdata->rescap) != 0 ? + "EX_AC_RO, " : "", + NVMEV(NVME_NS_DATA_RESCAP_WR_EX_RO, nsdata->rescap) != 0 ? + "WR_EX_RO, " : "", + NVMEV(NVME_NS_DATA_RESCAP_EX_AC, nsdata->rescap) != 0 ? + "EX_AC, " : "", + NVMEV(NVME_NS_DATA_RESCAP_WR_EX, nsdata->rescap) != 0 ? + "WR_EX, " : "", + NVMEV(NVME_NS_DATA_RESCAP_PTPL, nsdata->rescap) != 0 ? "PTPL" : ""); printf("Format Progress Indicator: "); - if ((nsdata->fpi >> NVME_NS_DATA_FPI_SUPP_SHIFT) & - NVME_NS_DATA_FPI_SUPP_MASK) { + if (NVMEV(NVME_NS_DATA_FPI_SUPP, nsdata->fpi) != 0) { printf("%u%% remains\n", - (nsdata->fpi >> NVME_NS_DATA_FPI_PERC_SHIFT) & - NVME_NS_DATA_FPI_PERC_MASK); + NVMEV(NVME_NS_DATA_FPI_PERC, nsdata->fpi)); } else printf("Not Supported\n"); - t = (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_READ_SHIFT) & - NVME_NS_DATA_DLFEAT_READ_MASK; + t = NVMEV(NVME_NS_DATA_DLFEAT_READ, nsdata->dlfeat); printf("Deallocate Logical Block: Read %s%s%s\n", (t == NVME_NS_DATA_DLFEAT_READ_NR) ? "Not Reported" : (t == NVME_NS_DATA_DLFEAT_READ_00) ? "00h" : (t == NVME_NS_DATA_DLFEAT_READ_FF) ? "FFh" : "Unknown", - (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_DWZ_SHIFT) & - NVME_NS_DATA_DLFEAT_DWZ_MASK ? ", Write Zero" : "", - (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_GCRC_SHIFT) & - NVME_NS_DATA_DLFEAT_GCRC_MASK ? ", Guard CRC" : ""); + NVMEV(NVME_NS_DATA_DLFEAT_DWZ, nsdata->dlfeat) != 0 ? + ", Write Zero" : "", + NVMEV(NVME_NS_DATA_DLFEAT_GCRC, nsdata->dlfeat) != 0 ? + ", Guard CRC" : ""); printf("Optimal I/O Boundary: %u blocks\n", nsdata->noiob); printf("NVM Capacity: %s bytes\n", uint128_to_str(to128(nsdata->nvmcap), cbuf, sizeof(cbuf))); - if ((nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & - NVME_NS_DATA_NSFEAT_NPVALID_MASK) { + if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, nsdata->nsfeat) != 0) { printf("Preferred Write Granularity: %u blocks\n", nsdata->npwg + 1); printf("Preferred Write Alignment: %u blocks\n", @@ -181,14 +173,11 @@ print_namespace(struct nvme_namespace_data *nsdata) printf("\n"); for (i = 0; i <= nsdata->nlbaf; i++) { lbaf = nsdata->lbaf[i]; - lbads = (lbaf >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, lbaf); if (lbads == 0) continue; - ms = (lbaf >> NVME_NS_DATA_LBAF_MS_SHIFT) & - NVME_NS_DATA_LBAF_MS_MASK; - rp = (lbaf >> NVME_NS_DATA_LBAF_RP_SHIFT) & - NVME_NS_DATA_LBAF_RP_MASK; + ms = NVMEV(NVME_NS_DATA_LBAF_MS, lbaf); + rp = NVMEV(NVME_NS_DATA_LBAF_RP, lbaf); printf("LBA Format #%02d: Data Size: %5d Metadata Size: %5d" " Performance: %s\n", i, 1 << lbads, ms, (rp == 0) ? "Best" : diff --git a/sbin/nvmecontrol/identify_ext.c b/sbin/nvmecontrol/identify_ext.c index 72b1ff5ccd7b..cc30ba0d6349 100644 --- a/sbin/nvmecontrol/identify_ext.c +++ b/sbin/nvmecontrol/identify_ext.c @@ -57,41 +57,27 @@ nvme_print_controller(struct nvme_controller_data *cdata) uint8_t fwug; oncs = cdata->oncs; - compare = (oncs >> NVME_CTRLR_DATA_ONCS_COMPARE_SHIFT) & - NVME_CTRLR_DATA_ONCS_COMPARE_MASK; - write_unc = (oncs >> NVME_CTRLR_DATA_ONCS_WRITE_UNC_SHIFT) & - NVME_CTRLR_DATA_ONCS_WRITE_UNC_MASK; - dsm = (oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) & - NVME_CTRLR_DATA_ONCS_DSM_MASK; + compare = NVMEV(NVME_CTRLR_DATA_ONCS_COMPARE, oncs); + write_unc = NVMEV(NVME_CTRLR_DATA_ONCS_WRITE_UNC, oncs); + dsm = NVMEV(NVME_CTRLR_DATA_ONCS_DSM, oncs); oacs = cdata->oacs; - security = (oacs >> NVME_CTRLR_DATA_OACS_SECURITY_SHIFT) & - NVME_CTRLR_DATA_OACS_SECURITY_MASK; - fmt = (oacs >> NVME_CTRLR_DATA_OACS_FORMAT_SHIFT) & - NVME_CTRLR_DATA_OACS_FORMAT_MASK; - fw = (oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & - NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; - nsmgmt = (oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK; + security = NVMEV(NVME_CTRLR_DATA_OACS_SECURITY, oacs); + fmt = NVMEV(NVME_CTRLR_DATA_OACS_FORMAT, oacs); + fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, oacs); + nsmgmt = NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, oacs); - fw_num_slots = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & - NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; - fw_slot1_ro = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & - NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; + fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata->frmw); + fw_slot1_ro = NVMEV(NVME_CTRLR_DATA_FRMW_SLOT1_RO, cdata->frmw); fwug = cdata->fwug; - ns_smart = (cdata->lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) & - NVME_CTRLR_DATA_LPA_NS_SMART_MASK; + ns_smart = NVMEV(NVME_CTRLR_DATA_LPA_NS_SMART, cdata->lpa); - sqes_min = (cdata->sqes >> NVME_CTRLR_DATA_SQES_MIN_SHIFT) & - NVME_CTRLR_DATA_SQES_MIN_MASK; - sqes_max = (cdata->sqes >> NVME_CTRLR_DATA_SQES_MAX_SHIFT) & - NVME_CTRLR_DATA_SQES_MAX_MASK; + sqes_min = NVMEV(NVME_CTRLR_DATA_SQES_MIN, cdata->sqes); + sqes_max = NVMEV(NVME_CTRLR_DATA_SQES_MAX, cdata->sqes); - cqes_min = (cdata->cqes >> NVME_CTRLR_DATA_CQES_MIN_SHIFT) & - NVME_CTRLR_DATA_CQES_MIN_MASK; - cqes_max = (cdata->cqes >> NVME_CTRLR_DATA_CQES_MAX_SHIFT) & - NVME_CTRLR_DATA_CQES_MAX_MASK; + cqes_min = NVMEV(NVME_CTRLR_DATA_CQES_MIN, cdata->cqes); + cqes_max = NVMEV(NVME_CTRLR_DATA_CQES_MAX, cdata->cqes); printf("Controller Capabilities/Features\n"); printf("================================\n"); @@ -108,14 +94,14 @@ nvme_print_controller(struct nvme_controller_data *cdata) cdata->ieee[2], cdata->ieee[1], cdata->ieee[0]); printf("Multi-Path I/O Capabilities: %s%s%s%s%s\n", (cdata->mic == 0) ? "Not Supported" : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_ANAR_SHIFT) & - NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "Asymmetric, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT) & - NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "SR-IOV VF, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT) & - NVME_CTRLR_DATA_MIC_MCTRLRS_MASK) ? "Multiple controllers, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_MPORTS_SHIFT) & - NVME_CTRLR_DATA_MIC_MPORTS_MASK) ? "Multiple ports" : ""); + NVMEV(NVME_CTRLR_DATA_MIC_ANAR, cdata->mic) != 0 ? + "Asymmetric, " : "", + NVMEV(NVME_CTRLR_DATA_MIC_SRIOVVF, cdata->mic) != 0 ? + "SR-IOV VF, " : "", + NVMEV(NVME_CTRLR_DATA_MIC_MCTRLRS, cdata->mic) != 0 ? + "Multiple controllers, " : "", + NVMEV(NVME_CTRLR_DATA_MIC_MPORTS, cdata->mic) != 0 ? + "Multiple ports" : ""); /* TODO: Use CAP.MPSMIN to determine true memory page size. */ printf("Max Data Transfer Size: "); if (cdata->mdts == 0) @@ -123,24 +109,19 @@ nvme_print_controller(struct nvme_controller_data *cdata) else printf("%ld bytes\n", PAGE_SIZE * (1L << cdata->mdts)); printf("Sanitize Crypto Erase: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_CES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_CES_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize Block Erase: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_BES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_BES_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize Overwrite: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_OWS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_OWS_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize NDI: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_NDI_SHIFT) & - NVME_CTRLR_DATA_SANICAP_NDI_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_NDI, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize NODMMAS: "); - switch (((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_NODMMAS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_NODMMAS_MASK)) { + switch (NVMEV(NVME_CTRLR_DATA_SANICAP_NODMMAS, cdata->sanicap)) { case NVME_CTRLR_DATA_SANICAP_NODMMAS_UNDEF: printf("Undefined\n"); break; @@ -171,32 +152,26 @@ nvme_print_controller(struct nvme_controller_data *cdata) printf("Namespace Management: %s\n", nsmgmt ? "Supported" : "Not Supported"); printf("Device Self-test: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT) & - NVME_CTRLR_DATA_OACS_SELFTEST_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_SELFTEST, oacs) != 0 ? "" : "Not "); printf("Directives: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT) & - NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_DIRECTIVES, oacs) != 0 ? "" : "Not "); printf("NVMe-MI Send/Receive: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT) & - NVME_CTRLR_DATA_OACS_NVMEMI_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_NVMEMI, oacs) != 0 ? "" : "Not "); printf("Virtualization Management: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_VM_SHIFT) & - NVME_CTRLR_DATA_OACS_VM_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_VM, oacs) != 0 ? "" : "Not "); printf("Doorbell Buffer Config: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT) & - NVME_CTRLR_DATA_OACS_DBBUFFER_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_DBBUFFER, oacs) != 0 ? "" : "Not "); printf("Get LBA Status: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_GETLBA_SHIFT) & - NVME_CTRLR_DATA_OACS_GETLBA_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_GETLBA, oacs) != 0 ? "" : "Not "); printf("Sanitize: "); if (cdata->sanicap != 0) { printf("%s%s%s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_CES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_CES_MASK) ? "crypto, " : "", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_BES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_BES_MASK) ? "block, " : "", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_OWS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_OWS_MASK) ? "overwrite" : ""); + NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ? + "crypto, " : "", + NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cdata->sanicap) != 0 ? + "block, " : "", + NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cdata->sanicap) != 0 ? + "overwrite" : ""); } else { printf("Not Supported\n"); } @@ -245,36 +220,30 @@ nvme_print_controller(struct nvme_controller_data *cdata) printf("Dataset Management Command: %s\n", dsm ? "Supported" : "Not Supported"); printf("Write Zeroes Command: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_WRZERO_SHIFT) & - NVME_CTRLR_DATA_ONCS_WRZERO_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_WRZERO, oncs) != 0 ? "" : "Not "); printf("Save Features: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_SAVEFEAT_SHIFT) & - NVME_CTRLR_DATA_ONCS_SAVEFEAT_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_SAVEFEAT, oncs) != 0 ? "" : "Not "); printf("Reservations: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_RESERV_SHIFT) & - NVME_CTRLR_DATA_ONCS_RESERV_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_RESERV, oncs) != 0 ? "" : "Not "); printf("Timestamp feature: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_TIMESTAMP_SHIFT) & - NVME_CTRLR_DATA_ONCS_TIMESTAMP_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_TIMESTAMP, oncs) != 0 ? "" : "Not "); printf("Verify feature: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_VERIFY_SHIFT) & - NVME_CTRLR_DATA_ONCS_VERIFY_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_VERIFY, oncs) != 0 ? "" : "Not "); printf("Fused Operation Support: %s%s\n", (cdata->fuses == 0) ? "Not Supported" : "", - ((cdata->fuses >> NVME_CTRLR_DATA_FUSES_CNW_SHIFT) & - NVME_CTRLR_DATA_FUSES_CNW_MASK) ? "Compare and Write" : ""); + NVMEV(NVME_CTRLR_DATA_FUSES_CNW, cdata->fuses) != 0 ? + "Compare and Write" : ""); printf("Format NVM Attributes: %s%s Erase, %s Format\n", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & - NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) ? "Crypto Erase, " : "", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) ? "All-NVM" : "Per-NS", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) ? "All-NVM" : "Per-NS"); - t = (cdata->vwc >> NVME_CTRLR_DATA_VWC_ALL_SHIFT) & - NVME_CTRLR_DATA_VWC_ALL_MASK; + NVMEV(NVME_CTRLR_DATA_FNA_CRYPTO_ERASE, cdata->fna) != 0 ? + "Crypto Erase, " : "", + NVMEV(NVME_CTRLR_DATA_FNA_ERASE_ALL, cdata->fna) != 0 ? + "All-NVM" : "Per-NS", + NVMEV(NVME_CTRLR_DATA_FNA_FORMAT_ALL, cdata->fna) != 0 ? + "All-NVM" : "Per-NS"); + t = NVMEV(NVME_CTRLR_DATA_VWC_ALL, cdata->vwc); printf("Volatile Write Cache: %s%s\n", - ((cdata->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK) ? "Present" : "Not Present", + NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cdata->vwc) != 0 ? + "Present" : "Not Present", (t == NVME_CTRLR_DATA_VWC_ALL_NO) ? ", no flush all" : (t == NVME_CTRLR_DATA_VWC_ALL_YES) ? ", flush all" : ""); diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 31ec3a443716..8c03aa6fb7f4 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -402,13 +402,10 @@ print_log_firmware(const struct nvme_controller_data *cdata, void *buf, uint32_t uint16_t oacs_fw; uint8_t fw_num_slots; - afi_slot = fw->afi >> NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT; - afi_slot &= NVME_FIRMWARE_PAGE_AFI_SLOT_MASK; + afi_slot = NVMEV(NVME_FIRMWARE_PAGE_AFI_SLOT, fw->afi); - oacs_fw = (cdata->oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & - NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; - fw_num_slots = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & - NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; + oacs_fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, cdata->oacs); + fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata->frmw); printf("Firmware Slot Log\n"); printf("=================\n"); @@ -463,41 +460,27 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused, for (i = 0; i < 255; i++) { s = ce->acs[i]; - if (((s >> NVME_CE_PAGE_CSUP_SHIFT) & - NVME_CE_PAGE_CSUP_MASK) == 0) + if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("Admin\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, - ((s >> NVME_CE_PAGE_LBCC_SHIFT) & - NVME_CE_PAGE_LBCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NCC_SHIFT) & - NVME_CE_PAGE_NCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NIC_SHIFT) & - NVME_CE_PAGE_NIC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CCC_SHIFT) & - NVME_CE_PAGE_CCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CSE_SHIFT) & - NVME_CE_PAGE_CSE_MASK), - ((s >> NVME_CE_PAGE_UUID_SHIFT) & - NVME_CE_PAGE_UUID_MASK) ? "Yes" : "No"); + NVMEV(NVME_CE_PAGE_LBCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NIC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CSE, s), + NVMEV(NVME_CE_PAGE_UUID, s) != 0 ? "Yes" : "No"); } for (i = 0; i < 255; i++) { s = ce->iocs[i]; - if (((s >> NVME_CE_PAGE_CSUP_SHIFT) & - NVME_CE_PAGE_CSUP_MASK) == 0) + if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("I/O\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, - ((s >> NVME_CE_PAGE_LBCC_SHIFT) & - NVME_CE_PAGE_LBCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NCC_SHIFT) & - NVME_CE_PAGE_NCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NIC_SHIFT) & - NVME_CE_PAGE_NIC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CCC_SHIFT) & - NVME_CE_PAGE_CCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CSE_SHIFT) & - NVME_CE_PAGE_CSE_MASK), - ((s >> NVME_CE_PAGE_UUID_SHIFT) & - NVME_CE_PAGE_UUID_MASK) ? "Yes" : "No"); + NVMEV(NVME_CE_PAGE_LBCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NIC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CSE, s), + NVMEV(NVME_CE_PAGE_UUID, s) != 0 ? "Yes" : "No"); } } @@ -548,8 +531,7 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, printf("Sanitize Progress: %u%% (%u/65535)\n", (ss->sprog * 100 + 32768) / 65536, ss->sprog); printf("Sanitize Status: "); - switch ((ss->sstat >> NVME_SS_PAGE_SSTAT_STATUS_SHIFT) & - NVME_SS_PAGE_SSTAT_STATUS_MASK) { + switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss->sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); break; @@ -569,12 +551,10 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, printf("Unknown"); break; } - p = (ss->sstat >> NVME_SS_PAGE_SSTAT_PASSES_SHIFT) & - NVME_SS_PAGE_SSTAT_PASSES_MASK; + p = NVMEV(NVME_SS_PAGE_SSTAT_PASSES, ss->sstat); if (p > 0) printf(", %d passes", p); - if ((ss->sstat >> NVME_SS_PAGE_SSTAT_GDE_SHIFT) & - NVME_SS_PAGE_SSTAT_GDE_MASK) + if (NVMEV(NVME_SS_PAGE_SSTAT_GDE, ss->sstat) != 0) printf(", Global Data Erased"); printf("\n"); printf("Sanitize Command Dword 10: 0x%x\n", ss->scdw10); @@ -796,8 +776,7 @@ logpage(const struct cmd *f, int argc, char *argv[]) if (read_controller_data(fd, &cdata)) errx(EX_IOERR, "Identify request failed"); - ns_smart = (cdata.lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) & - NVME_CTRLR_DATA_LPA_NS_SMART_MASK; + ns_smart = NVMEV(NVME_CTRLR_DATA_LPA_NS_SMART, cdata.lpa); /* * The log page attributes indicate whether or not the controller diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index dd678568d5ca..a77f37e0f468 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -417,8 +417,7 @@ nsactive(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -463,8 +462,7 @@ nsallocated(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -509,8 +507,7 @@ nscontrollers(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -571,8 +568,7 @@ nscreate(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&nsdata, 0, sizeof(nsdata)); @@ -630,8 +626,7 @@ nscreate(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace creation failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d created\n", pt.cpl.cdw0); exit(0); @@ -667,8 +662,7 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -684,8 +678,7 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace deletion failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d deleted\n", nsid); exit(0); @@ -734,8 +727,7 @@ nsattach(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); if (attach_opt.ctrlrid == NONE) { @@ -771,8 +763,7 @@ nsattach(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace attach failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d attached\n", nsid); exit(0); @@ -806,8 +797,7 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); if (detach_opt.ctrlrid == NONE) { @@ -850,8 +840,7 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace detach failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d detached\n", nsid); exit(0); @@ -885,8 +874,7 @@ nsattached(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -939,8 +927,7 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); diff --git a/sbin/nvmecontrol/power.c b/sbin/nvmecontrol/power.c index 78de46dbc277..887010feb782 100644 --- a/sbin/nvmecontrol/power.c +++ b/sbin/nvmecontrol/power.c @@ -63,14 +63,10 @@ power_list_one(int i, struct nvme_power_state *nps) int mpower, apower, ipower; uint8_t mps, nops, aps, apw; - mps = (nps->mps_nops >> NVME_PWR_ST_MPS_SHIFT) & - NVME_PWR_ST_MPS_MASK; - nops = (nps->mps_nops >> NVME_PWR_ST_NOPS_SHIFT) & - NVME_PWR_ST_NOPS_MASK; - apw = (nps->apw_aps >> NVME_PWR_ST_APW_SHIFT) & - NVME_PWR_ST_APW_MASK; - aps = (nps->apw_aps >> NVME_PWR_ST_APS_SHIFT) & - NVME_PWR_ST_APS_MASK; + mps = NVMEV(NVME_PWR_ST_MPS, nps->mps_nops); + nops = NVMEV(NVME_PWR_ST_NOPS, nps->mps_nops); + apw = NVMEV(NVME_PWR_ST_APW, nps->apw_aps); + aps = NVMEV(NVME_PWR_ST_APS, nps->apw_aps); mpower = nps->mp; if (mps == 0) diff --git a/sbin/nvmecontrol/sanitize.c b/sbin/nvmecontrol/sanitize.c index d56a74685651..4611a6964a4d 100644 --- a/sbin/nvmecontrol/sanitize.c +++ b/sbin/nvmecontrol/sanitize.c @@ -155,14 +155,11 @@ sanitize(const struct cmd *f, int argc, char *argv[]) /* Check that controller can execute this command. */ if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); - if (((cd.sanicap >> NVME_CTRLR_DATA_SANICAP_BES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_BES_MASK) == 0 && sanact == 2) + if (NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cd.sanicap) == 0 && sanact == 2) errx(EX_UNAVAILABLE, "controller does not support Block Erase"); - if (((cd.sanicap >> NVME_CTRLR_DATA_SANICAP_OWS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_OWS_MASK) == 0 && sanact == 3) + if (NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cd.sanicap) == 0 && sanact == 3) errx(EX_UNAVAILABLE, "controller does not support Overwrite"); - if (((cd.sanicap >> NVME_CTRLR_DATA_SANICAP_CES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_CES_MASK) == 0 && sanact == 4) + if (NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cd.sanicap) == 0 && sanact == 4) errx(EX_UNAVAILABLE, "controller does not support Crypto Erase"); /* @@ -187,8 +184,7 @@ sanitize(const struct cmd *f, int argc, char *argv[]) wait: read_logpage(fd, NVME_LOG_SANITIZE_STATUS, NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &ss, sizeof(ss)); - switch ((ss.sstat >> NVME_SS_PAGE_SSTAT_STATUS_SHIFT) & - NVME_SS_PAGE_SSTAT_STATUS_MASK) { + switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss.sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); break; diff --git a/sbin/nvmecontrol/selftest.c b/sbin/nvmecontrol/selftest.c index 6139a7902234..0fae3a3062ae 100644 --- a/sbin/nvmecontrol/selftest.c +++ b/sbin/nvmecontrol/selftest.c @@ -100,8 +100,7 @@ selftest(const struct cmd *f, int argc, char *argv[]) if (read_controller_data(fd, &cdata)) errx(EX_IOERR, "Identify request failed"); - if (((cdata.oacs >> NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT) & - NVME_CTRLR_DATA_OACS_SELFTEST_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_SELFTEST, cdata.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support self-test"); selftest_op(fd, nsid, opt.stc); From nobody Mon Aug 26 18:03:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7610y0z5TLm4; Mon, 26 Aug 2024 18:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz756M47z44HY; Mon, 26 Aug 2024 18: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=1724695393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dw4gzY3PzFgovS0cQsGOx+4Q0IGMZqCjSE4C1Zr15tI=; b=MKLpvaCe2mOJUILS2Ia+++OcWy9ooAe6LYgI7ubU8bWcJDFfCxk+/pQhmwHnuwpKACCI8j lyy054CSaBMLrf4CgY3TN+e1dviTmPg+K8g1Y453das4fdMlI74wRX7cmgau2heyqykmfd v3ZmaKhXSNYinGB2dXxEYGjuUN7zkNwXuh43m3Pd0kjyKJYkd+E+BCE+6/AOGD3OTUsl5W oijcUeFTIf9ZGR4o0tX1xFJAAIeQF2A0kFzicT8vRZqY1xQ0oLrLoo6pYXaAxs8b/l89FJ ZoATBZ+4cz2i0X4wBN+Og5PnV0uBUBBe8kvodsEOkNSuVx2GrQLMdGVz+hOWLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695393; a=rsa-sha256; cv=none; b=i8dtmJ2P8J2rnjpTdk6xc+g91C5GLc2K3BwicXKCIp5PjRw3a8ua6lLrJQUegeqSLIEHBJ afNIUJbJi/DVsu70/cHJ/9lFQDuazX1gCyRb7AvwQckjki9YUllABjCdUseqL4wc2Ure2J T2pvS5D8aVLDy+SdirzK11n4bn5Kb48Vp3BVH+BnAjaZI3dgxlw6h8t699A+YEPkmhEh+e KSqWBuzNZHP0DVU5X2EMfuwkzo2tRpjYXLfQelRmdARRBNZ2CzqvB5WYrVFcd5gHWMfzT6 SRARMZcTXPpeeW3T2jLmFOnfemC6WYZdfdsvfFaht3+mOpIVGuqCYEDVnBp6aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dw4gzY3PzFgovS0cQsGOx+4Q0IGMZqCjSE4C1Zr15tI=; b=bEEVix+0g1diXRrxWiG/1L0CesvH8Ya4ni19uVjm+gp3wFTX1Hl6/zltP9bOKra4FNZxCX owf6c37cOtMLYEHhaO4JrYdwWYYrtQiVetopwz8X/qZjV8Od6IXST0/P2rlNPD/FgO7riQ ICoDzFdofK2yHowDNdm9/GJ7/hYZh7/0fgQu1gD6H9dIRStr+vc+km3VN5xwI7XtfuqLcU EijJV4rhP2UhFhix9RuehHdtm3tOLzluLA2A7De8SUxLSWlFTd7W1WvGp7SmFcl25OW0cW OK2WpwTBvL07AZTKNrIymgM17iakS4ew3vIfd2pjg43gKKMy5E9WklbPsP+BKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz755xw1zGs9; Mon, 26 Aug 2024 18:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QI3DUd042451; Mon, 26 Aug 2024 18:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3DDr042448; Mon, 26 Aug 2024 18:03:13 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:13 GMT Message-Id: <202408261803.47QI3DDr042448@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: 8ed711ddcd02 - stable/14 - bhyve: Use the NVMEV macro instead of expanded versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ed711ddcd0277f4b0101e7bb641130ee8d1dfab Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed711ddcd0277f4b0101e7bb641130ee8d1dfab commit 8ed711ddcd0277f4b0101e7bb641130ee8d1dfab Author: John Baldwin AuthorDate: 2024-01-29 18:49:49 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:17 +0000 bhyve: Use the NVMEV macro instead of expanded versions Reviewed by: corvink, chuck (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43598 (cherry picked from commit 94962f5a72ae7a5190f38cbe54a0ad4426329a06) --- usr.sbin/bhyve/pci_nvme.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 2fd49a84c768..4084f9b007ba 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -369,15 +369,15 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Controller Configuration utils */ #define NVME_CC_GET_EN(cc) \ - ((cc) >> NVME_CC_REG_EN_SHIFT & NVME_CC_REG_EN_MASK) + NVMEV(NVME_CC_REG_EN, cc) #define NVME_CC_GET_CSS(cc) \ - ((cc) >> NVME_CC_REG_CSS_SHIFT & NVME_CC_REG_CSS_MASK) + NVMEV(NVME_CC_REG_CSS, cc) #define NVME_CC_GET_SHN(cc) \ - ((cc) >> NVME_CC_REG_SHN_SHIFT & NVME_CC_REG_SHN_MASK) + NVMEV(NVME_CC_REG_SHN, cc) #define NVME_CC_GET_IOSQES(cc) \ - ((cc) >> NVME_CC_REG_IOSQES_SHIFT & NVME_CC_REG_IOSQES_MASK) + NVMEV(NVME_CC_REG_IOSQES, cc) #define NVME_CC_GET_IOCQES(cc) \ - ((cc) >> NVME_CC_REG_IOCQES_SHIFT & NVME_CC_REG_IOCQES_MASK) + NVMEV(NVME_CC_REG_IOCQES, cc) #define NVME_CC_WRITE_MASK \ ((NVME_CC_REG_EN_MASK << NVME_CC_REG_EN_SHIFT) | \ @@ -391,7 +391,7 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Controller Status utils */ #define NVME_CSTS_GET_RDY(sts) \ - ((sts) >> NVME_CSTS_REG_RDY_SHIFT & NVME_CSTS_REG_RDY_MASK) + NVMEV(NVME_CSTS_REG_RDY, sts) #define NVME_CSTS_RDY (1 << NVME_CSTS_REG_RDY_SHIFT) #define NVME_CSTS_CFS (1 << NVME_CSTS_REG_CFS_SHIFT) @@ -1085,8 +1085,7 @@ pci_nvme_init_controller(struct pci_nvme_softc *sc) DPRINTF("%s mapping Admin-SQ guest 0x%lx, host: %p", __func__, sc->regs.asq, sc->submit_queues[0].qbase); - acqs = ONE_BASED((sc->regs.aqa >> NVME_AQA_REG_ACQS_SHIFT) & - NVME_AQA_REG_ACQS_MASK); + acqs = ONE_BASED(NVMEV(NVME_AQA_REG_ACQS, sc->regs.aqa)); if (acqs < 2) { EPRINTLN("%s: illegal ACQS value %#x (aqa=%#x)", __func__, acqs - 1, sc->regs.aqa); @@ -2083,8 +2082,8 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, uint64_t value) break; case NVME_OPC_FORMAT_NVM: DPRINTF("%s command FORMAT_NVM", __func__); - if ((sc->ctrldata.oacs & - (1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT)) == 0) { + if (NVMEV(NVME_CTRLR_DATA_OACS_FORMAT, + sc->ctrldata.oacs) == 0) { pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); break; } From nobody Mon Aug 26 18:03:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz771rq4z5TLZ8; Mon, 26 Aug 2024 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7709y4z44cR; Mon, 26 Aug 2024 18: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=1724695395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JbXUaGW4UgbN92vgWHVNS9rMUqNzCXdRJLZVTmlTLx4=; b=iLRhkpATrosQA0zewduQB/3iHrhgOJjmE8ceFhaHVTcX9Y6Eoy9Hrs/vISgUNgqARI9NO4 Yk+otb2J44UzTa9WtAy+HkSbMZ8aZG6W2Sc/pjlPqpRwl9Jtc/S8y1vhcMXY/Okcn+RNNA 1fvNaF/xhhhZmJROV7sZX6YpNWUdPzZYMRfKaVWFePHllI+UPkTO4og2iEEYWkiZFroWUM 286eDvjT6BXrd4FKGRm0op40/cIQTESywcYlk1dkCniCAaOMFgiUJwRwfnKCHOla9P7eIQ RVZzalWuce/9korBz7/tNIwIC/v6rgNLA8SwaUgXDeBI821Hf3FCqMXDdGmHMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695395; a=rsa-sha256; cv=none; b=s0ZrLRnHWGzF8tHkqQEkW4HfWz066Adny2jZzrcbf964qandN9WtUAC8C2aHtJAWMd/zrm R8QoO46PKo2NOyNaIIkCxGvv5e7NHfUP/v8xjZM4YVx9yuiRd2HSYYHQUcpW+Jrd7882e9 o567KjBTZmNium0x9i+8GN5KOWfLZPq7QPr37rtXwCVPICed27n8/V8qxPlbp0PetFgFjx l5THhChxucGIDh8/dWXHS4xZw46vod1Zjjux2wxlac2+GgW+lOW/aB4KriLETmk3dxa3nX cTLgWcD8WMstEzYEkqGyAFa4LImnR+X/G7FetgLDx0u6Vk6uL65/t6F1Tm8GXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JbXUaGW4UgbN92vgWHVNS9rMUqNzCXdRJLZVTmlTLx4=; b=fyWk4eUzIuIQYtcAwph2sVW6Br/xZnCchVyvUn5Wt2/OO5AUXKgGWoxSDNGr7ge3//CZ0O +XzuTmrNmY/kjJMLkW7SPDlDbmwa4XQp7PjFOckDDWT83V0VrWl49GZhuFgInlPPnYEUGn UvgwoecbrC0viGYJ4n3VXfpXq9FprQa7BbWQgii/lsf0BOA3s7Ynlc04XQga9TNsKoDIVf /K/hMnmc2Q7GbocX0w2uZl34HW+Ix/Zkzr+HmtdvGRc4Qi/thP7Zc+TMvDBpzCxCweHpa+ SpBn3cfwvdfF/myLg4/T3Op1nffsWzHdby91QI6xLHLZ6mtIF3/fFA6ScB635w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz766pGszHKK; Mon, 26 Aug 2024 18: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 47QI3ExR042505; Mon, 26 Aug 2024 18: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 47QI3EVj042502; Mon, 26 Aug 2024 18:03:14 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:14 GMT Message-Id: <202408261803.47QI3EVj042502@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: 4846d72432a8 - stable/14 - camdd: Use the NVMEV macro instead of expanded versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4846d72432a89614d7ceb3522cf7b5ac0185c775 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4846d72432a89614d7ceb3522cf7b5ac0185c775 commit 4846d72432a89614d7ceb3522cf7b5ac0185c775 Author: John Baldwin AuthorDate: 2024-01-29 18:50:41 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:24 +0000 camdd: Use the NVMEV macro instead of expanded versions Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43599 (cherry picked from commit c9d9315b74017b0637bcbcc2e7a5c01d7bc58bf1) --- usr.sbin/camdd/camdd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/camdd/camdd.c b/usr.sbin/camdd/camdd.c index 4f15aa8eedcf..1f067113c562 100644 --- a/usr.sbin/camdd/camdd.c +++ b/usr.sbin/camdd/camdd.c @@ -1430,9 +1430,8 @@ camdd_probe_pass_nvme(struct cam_device *cam_dev, union ccb *ccb, *maxsector = nsdata.nsze; /* The LBA Data Size (LBADS) is reported as a power of 2 */ - format = nsdata.flbas & NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (nsdata.lbaf[format] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + format = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsdata.flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsdata.lbaf[format]); *block_len = 1 << lbads; retval = 0; From nobody Mon Aug 26 18:03:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz783qNtz5TLnd; Mon, 26 Aug 2024 18:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz781BNvz44t8; Mon, 26 Aug 2024 18:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lylXJh9hdcV1zeMVQD+IMQE+SenVc5RuYhkZpssTHEo=; b=FplfaWT2KA7LxbW6ndeou/gpOv0D4jZaxW8r7w0oH5H++AfI0hy8tveoM2rv5AT+3XbYBm U4UxaIZ1aw41hsI8wQ32XxO28aokV2C0GopOx9ZexZaVosfo6IZZDmzz3Gmh0lPJjRO1p4 maj2C5luoYmVm9gYM4qV7JFAj/b3/ymiFg5QjdfKXK2XlmFc0NcgM4bE+1+0bVdE/LtiKv NusHEealr9Zv3LRBhYMwhvO5MlAQ8CivoUT4tYl7qHEUVljT7tXegcA5EBymenZaIhSpyS 3w0OsLun1jusdUWdR/yat0cFg5WaZJTEYewRId0M0Y639y6KR6op3SZ1GlPKvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695396; a=rsa-sha256; cv=none; b=V6JmcTM9/w0fkKHcNSOfFteIPZR9s6WUfjHXnF3K17iApcRiVawocTOrCwKw5L4m+ThLcJ t8vAiC+qIc6DbojoQkb/8d84VsNyY7qp6mz3wAfrxOQmvikl5O07hJx2+HPTXZWNFu7z2D PZDGF3IG7eIc6YeiDyzAunpfGTquSeN/RG7gS2V8EnPngDbnhNlkmEFTEh4GUFDDFjQ9Sl B5t5bc9bB+K/gfn3b2YpqqCiZCyS8mGrIJS99WF0QpK3DRDkO7lndlX3HUGWVzqBsiQSp0 kSNML41jGfvZCfmrtxEwHUU1Guw0StQQ+OQGl8m1cZa8s099Zu8D6/aTGbGZHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lylXJh9hdcV1zeMVQD+IMQE+SenVc5RuYhkZpssTHEo=; b=Muqv9jAuoHVHaGfDaXfdwceUMkqpriSmNBQXApn3tzRfknWziyEDbI//iqR2vjZuKYI1Uf FM+xdezkq4B8c3Jebe6c4o6yCw3edlw7ffvZzGDECWN5ZqNbGcBIE/GwvxRkXy4pTKN5Gd T9dsba6BuAYrAnTpvGpiQz1XiWQHlSfKTn78JCT0dwS69m+ToURIYbbvwI8GM2MOSQrUXy iVI3pf5cSMxOV3WDqRSBlD75bKz5i18J7wpgosNeqxlw9hSNeR6L3xNqSu7CLv4Myc+nLm 15hWkJ9HlqNwaitoHvTdusFWJhEnexZBR8gVF9hJCOYPHNVnPrOXnG2mofOlMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz780mSrzHHL; Mon, 26 Aug 2024 18:03: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 47QI3GHl042566; Mon, 26 Aug 2024 18:03:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3Fcv042563; Mon, 26 Aug 2024 18:03:15 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:15 GMT Message-Id: <202408261803.47QI3Fcv042563@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: a918e5e9f88c - stable/14 - bhyve: Use NVMEV to read the ASQS field of AQA List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a918e5e9f88c82a2e47e4675ff92bf7735e98f77 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a918e5e9f88c82a2e47e4675ff92bf7735e98f77 commit a918e5e9f88c82a2e47e4675ff92bf7735e98f77 Author: John Baldwin AuthorDate: 2024-01-29 18:51:07 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:32 +0000 bhyve: Use NVMEV to read the ASQS field of AQA This is not a functional change, but just being consistent instead of omitting a shift by 0. Reviewed by: corvink, chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43600 (cherry picked from commit c42692360611c8afce6ee7bb937a858d64a133f4) --- usr.sbin/bhyve/pci_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 4084f9b007ba..dd6c9a41d17f 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1065,7 +1065,7 @@ pci_nvme_init_controller(struct pci_nvme_softc *sc) * cleared to 0h produces undefined results" for both ACQS and * ASQS. If zero, set CFS and do not become ready. */ - asqs = ONE_BASED(sc->regs.aqa & NVME_AQA_REG_ASQS_MASK); + asqs = ONE_BASED(NVMEV(NVME_AQA_REG_ASQS, sc->regs.aqa)); if (asqs < 2) { EPRINTLN("%s: illegal ASQS value %#x (aqa=%#x)", __func__, asqs - 1, sc->regs.aqa); From nobody Mon Aug 26 18:03:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz794Bzgz5TM4s; Mon, 26 Aug 2024 18:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz792DYTz44RH; Mon, 26 Aug 2024 18:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ltXwUkh2TLLC4ady714CCKLExZgz5iNRG2Be8NLrxuI=; b=XZfGMrn7X2iLCQEL48l3xyG2lPUFLrN2WVeS8UTR0eXH0FO8GU8lUZwNbPd4Jdkdqur3Og fXVxQipv+ilWvwFUBHUwy0/SCm8bPBxb2b5xSAhQWdU2oWcGzsvXKJ967QAAK1b/7K44g2 5FB45c47G5gVsQiV4yF3c0jqSyiDR9xn0ZEZWeJ5rV4/2nKAzJYyAwoDmYUXEzEzpncAla PnYBHw+V4vNCVJ/ML/feorvuqq6wGwq8KU1fnhl2s9DX9odN+AD8SvsThrPynnq4AdJsjN Xm1KXOs+j8/pQYuUOpSvbXyCuFb3c+1dLinfE5PEKavZURKyHqTPVakdrDGxng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695397; a=rsa-sha256; cv=none; b=y4kuZLbxRQg5UUYnj+44KApyCID9Vslkt/x9jgUYaHyf5itfCD3VI31AOVoKdFiq3J5KuM fPS8zlD8ol73BjI5vGRj0o27FeYZ02Wasj3LPNItBZ2L5xk6OK56RLxONqJ8CFAARiBjLM PbvFJd3CLNj/2UoZq2QHQzlO/AaHO8TuYP3imly5IVo0GcxPM52P2eXCBEmK09a3qbRVTQ gv1uIPmop/86OA4lPqlVrjPF65QM5gfqTZUDnRDMyyRuJetXA5xcGwdKTq22qzMySkk6V6 2tnhDP2//BA8gCeaPMPXhStMOeSQRU5gVjh1E1tBHz9rC2cJcnXUejrMzbw5OA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ltXwUkh2TLLC4ady714CCKLExZgz5iNRG2Be8NLrxuI=; b=H44F7hJHnH3yzGr8vLT8qQewjL6kvJ5bboffE3xrhQnFA/bwg4fe3/pwtjHzixKIKIWnf6 FMRuKNTti/k2agL+3WKpoD6ev/xd6pfdr359OKPYp0gdNDkcZcpV2CTSV7iCvxJF2nlRFR sJKHJrvJ8B9c3V55XLdXOacwFhcSOpXurpe9VUMI2/KBTDG471AIYve5k5BhaS7YhJsGsT rvrsbDEaikTnnGf6xUpAcx0C/wxfQKp0dVPMphUBxpLWruXWOOA4RVOHHITSTqaI4A6b88 XDtCqWYnRYsrHSos46ACy8R9HfGZuKPNZ8rWCt5R5bW1q53cHWXpdtN0LWinJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz791pFFzH9G; Mon, 26 Aug 2024 18:03: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 47QI3Ho3042614; Mon, 26 Aug 2024 18:03:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3HUn042611; Mon, 26 Aug 2024 18:03:17 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:17 GMT Message-Id: <202408261803.47QI3HUn042611@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: 80a92f1b91ed - stable/14 - nvme: Rename NVMEB helper macro to NVMEM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 80a92f1b91ed90a5245651507b1af8c4fb616136 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=80a92f1b91ed90a5245651507b1af8c4fb616136 commit 80a92f1b91ed90a5245651507b1af8c4fb616136 Author: John Baldwin AuthorDate: 2024-01-29 18:58:28 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:38 +0000 nvme: Rename NVMEB helper macro to NVMEM The current macro always builds a full mask for a named field, so use the M suffix for mask. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43601 (cherry picked from commit 1dade1f255ee535ad357211395b46188bece52dc) --- sys/dev/nvme/nvme.h | 2 +- usr.sbin/bhyve/pci_nvme.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index cb5e1a5f1118..7b3cdd89f146 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -605,7 +605,7 @@ enum nvme_critical_warning_state { #define NVME_FEAT_SET_FID_MASK (0xff) /* Helper macro to combine *_MASK and *_SHIFT defines */ -#define NVMEB(name) (name##_MASK << name##_SHIFT) +#define NVMEM(name) (name##_MASK << name##_SHIFT) /* Helper macro to extract value from x */ #define NVMEV(name, x) (((x) >> name##_SHIFT) & name##_MASK) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index dd6c9a41d17f..2d426fb19096 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -538,12 +538,12 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->cntrltype = NVME_CNTRLTYPE_IO; cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; - cd->oaes = NVMEB(NVME_CTRLR_DATA_OAES_NS_ATTR); + cd->oaes = NVMEM(NVME_CTRLR_DATA_OAES_NS_ATTR); cd->acl = 2; cd->aerl = 4; /* Advertise 1, Read-only firmware slot */ - cd->frmw = NVMEB(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | + cd->frmw = NVMEM(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | (1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT); cd->lpa = 0; /* TODO: support some simple things like SMART */ cd->elpe = 0; /* max error log page entries */ From nobody Mon Aug 26 18:03:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7C6Ndyz5TMDK; Mon, 26 Aug 2024 18:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7C40JQz450B; Mon, 26 Aug 2024 18:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tqa53fkhFHOXEsJDVf3d9d2j3nYimfvdF4WbvwAl3yk=; b=OlUfXhtjdz56OB9dSRMdYUMiaE3pBFIs1aP2wGOoBCo1vdzUdF8kme14YYlcft0UJysZlD plzzH8zKBysreV6jTsk38DAEuMRovlTpmD1SXs/3pjBCoeUiVb6zsA/Av1q69PysQV986A LHC1x1dnFEAb5IkpOPA69RLTfVMor8Virvoje5ZYDdpUvsuNNsWSYE4PxCAenbi5fsEBZy UqGtkSWakOWDLCFQQd75Ynwh/VQ/Se6GN0yO/5BAHiG6MmK4DfHR9NwFIQ2FULtp6Qzz7P n0PBqI0t0oQOLc79Z/nb9c8OSoVDgEB7T5qvh43kqAyJxf+X+upvt/yPpkqezw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695399; a=rsa-sha256; cv=none; b=N/jolT0GMJLFtZUD3rsRb+TUByOE9AMVQ3Xou9ysyfxGT61jte5ohWAOEP85Y+jeWRoGTl FRro/5A5Vl18qubSByMyCCYEUAL3xXJVdOEK36l6li74JhImvFNH/c7HWMYeRBdw3XhK6j VweZHNJ0vwG1GVN1FtVR8cQ8JPzGI0XPFuQVcdXSYGIxfdLbXQD4Bbw0p5nrcKqsyxqhrZ eTpAFeqFmmAN2L64lC4/uhNgX2MfhysLqYdM39Ouc10QB1Ojzenibi+2CdwIDt2Pn2PFY9 QUvBKz75l7Y2uKIymFsXSw2E+EdeM66Cg5B+6UKRLmLs64EJ1ogiLW8GF5ggNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tqa53fkhFHOXEsJDVf3d9d2j3nYimfvdF4WbvwAl3yk=; b=UHOxpVZf9LjPI7VE28QLRvrrDtFWL0qSOzdeztsVmycpVDqIKQ/XOdpsLvOFEmJMZH7l1S 0D3qRyXPnqanhGALXM2HhZqJHXV/B/m4r/vG7LNiV/8g9UtSNcAjTEThBoMsYNzmTyMHg+ OpVxhphF7M8YIDAv/DUh3UZXTVOliKk+LjOEkRHu+uFx/uI9Yjxi8ZOlR+00s0CWGc2bAG OyuYy+rwx/LhBlE/gUO5p4lp4qp2lA69Z/4DapBykCFHGq6YWjXJnOX2TVDJuLJflB+ri/ Ihqygd+K5DJYisTfilRTtnFiX25j4zdw//uwWE6JYwg467o1K/FLaMg90zNPLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7C3cR4zGsB; Mon, 26 Aug 2024 18:03: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 47QI3JxP042729; Mon, 26 Aug 2024 18:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3JpU042726; Mon, 26 Aug 2024 18:03:19 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:19 GMT Message-Id: <202408261803.47QI3JpU042726@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: 8029ffc9c0b8 - stable/14 - bhyve: Use the NVMEM macro instead of expanded versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8029ffc9c0b895b783da8ba366ffdcc9e4862e64 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8029ffc9c0b895b783da8ba366ffdcc9e4862e64 commit 8029ffc9c0b895b783da8ba366ffdcc9e4862e64 Author: John Baldwin AuthorDate: 2024-01-29 19:00:09 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:54 +0000 bhyve: Use the NVMEM macro instead of expanded versions Reviewed by: corvink, chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43603 (cherry picked from commit c85b3903d1b1cf93f1fba10cd1cffed31ce84418) --- usr.sbin/bhyve/pci_nvme.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 2d426fb19096..cd81767d950b 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -380,14 +380,14 @@ static void pci_nvme_io_done(struct blockif_req *, int); NVMEV(NVME_CC_REG_IOCQES, cc) #define NVME_CC_WRITE_MASK \ - ((NVME_CC_REG_EN_MASK << NVME_CC_REG_EN_SHIFT) | \ - (NVME_CC_REG_IOSQES_MASK << NVME_CC_REG_IOSQES_SHIFT) | \ - (NVME_CC_REG_IOCQES_MASK << NVME_CC_REG_IOCQES_SHIFT)) + (NVMEM(NVME_CC_REG_EN) | \ + NVMEM(NVME_CC_REG_IOSQES) | \ + NVMEM(NVME_CC_REG_IOCQES)) #define NVME_CC_NEN_WRITE_MASK \ - ((NVME_CC_REG_CSS_MASK << NVME_CC_REG_CSS_SHIFT) | \ - (NVME_CC_REG_MPS_MASK << NVME_CC_REG_MPS_SHIFT) | \ - (NVME_CC_REG_AMS_MASK << NVME_CC_REG_AMS_SHIFT)) + (NVMEM(NVME_CC_REG_CSS) | \ + NVMEM(NVME_CC_REG_MPS) | \ + NVMEM(NVME_CC_REG_AMS)) /* Controller Status utils */ #define NVME_CSTS_GET_RDY(sts) \ @@ -399,11 +399,10 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Completion Queue status word utils */ #define NVME_STATUS_P (1 << NVME_STATUS_P_SHIFT) #define NVME_STATUS_MASK \ - ((NVME_STATUS_SCT_MASK << NVME_STATUS_SCT_SHIFT) |\ - (NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT)) + (NVMEM(NVME_STATUS_SCT) | \ + NVMEM(NVME_STATUS_SC)) -#define NVME_ONCS_DSM (NVME_CTRLR_DATA_ONCS_DSM_MASK << \ - NVME_CTRLR_DATA_ONCS_DSM_SHIFT) +#define NVME_ONCS_DSM NVMEM(NVME_CTRLR_DATA_ONCS_DSM) static void nvme_feature_invalid_cb(struct pci_nvme_softc *, struct nvme_feature_obj *, @@ -580,8 +579,7 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) break; } - cd->fna = NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK << - NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT; + cd->fna = NVMEM(NVME_CTRLR_DATA_FNA_FORMAT_ALL); cd->vwc = NVME_CTRLR_DATA_VWC_ALL_NO << NVME_CTRLR_DATA_VWC_ALL_SHIFT; @@ -2732,8 +2730,7 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint16_t idx) if ((nsid == 0) || (nsid > sc->ctrldata.nn)) { pci_nvme_status_genc(&status, NVME_SC_INVALID_NAMESPACE_OR_FORMAT); - status |= - NVME_STATUS_DNR_MASK << NVME_STATUS_DNR_SHIFT; + status |= NVMEM(NVME_STATUS_DNR); goto complete; } @@ -2957,8 +2954,7 @@ pci_nvme_write_bar_0(struct pci_nvme_softc *sc, uint64_t offset, int size, if (NVME_CC_GET_SHN(ccreg)) { /* perform shutdown - flush out data to backend */ - sc->regs.csts &= ~(NVME_CSTS_REG_SHST_MASK << - NVME_CSTS_REG_SHST_SHIFT); + sc->regs.csts &= ~NVMEM(NVME_CSTS_REG_SHST); sc->regs.csts |= NVME_SHST_COMPLETE << NVME_CSTS_REG_SHST_SHIFT; } From nobody Mon Aug 26 18:03:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7B4g6kz5TLZW; Mon, 26 Aug 2024 18:03:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7B3F2yz44mQ; Mon, 26 Aug 2024 18:03:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILtue+TKeRppPhMQCbXQCBlIa7kOPuGe2y5ov4xkZTg=; b=NlZkxUqN6UNV9m+DZoswG0kFnY////0lZYv2a5Gnjw9I1PaA3jit4UpN3L9rY+bdS7GhhC BUzn9SgXyyVZuNg2pfmuwYehRIpruNBvVZCaHms8tg6IG3sQRHJRNoSp6h/VUDeiABysTm kKM+b1iYrsUulQcjBeskrsoOvQOA7nKKTH0WVuyznZUPCJNWqHs3eshXmimBzP+Gz18NXP XYD2cdQd4nyim+Oy0dibrXEqJ1X8HDE8PSyqcUQwIk0iWcRSwQHxKhLc5qQihPTCDbRiAy mgXV+0Q4m++YIQKuacK8IeESLFhIkrPVN5UV9l9yoIW4fi++gow7Jr8OAyD4RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695398; a=rsa-sha256; cv=none; b=R1zOqZsmArspOw0XfxslO4pAEyNyxa2VATcXeIgwxCJcKc03aOVlW2aDzI8DcB+/c7Z3pg qmBXAGJD1f/PiKkr/QO8GcaOChavMwILNopwueIkuKQOtEhfk3FjZ3sxGTYQwYWLhDud+a YCDiqz1fKVVrk5JAGLsy+SR3SaXDPdlE758Jl0H3v8HdJmpz2QfPEpQSnzzibVURD5QtIk vT0j1ZwExtMr8U9Bar8wbsCJt/VYFqBz3KQnBYoALJh0qK93ll6gQcLb5WUfZmfudaGEk9 SwGJs5PHSJyyFVO3XJ0wHlA13X/7ryAv+LHSvzmTZcDMzqACAsawNygBO0GLyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILtue+TKeRppPhMQCbXQCBlIa7kOPuGe2y5ov4xkZTg=; b=oQZAkWI7NC/wN0o82G8bXwI/Ab+qcX5mJWJWO89fWXVCk0dCOTaprANWWPuZ9ANl2G9ORn zAMhcepX8CbiurGmoBN18T5BOMRCUSfVXEHPCmg93FlNB/s231Too3i8QWcruMTiNyqvxe I0Roj159P1IJfyORv8FsWKBiutHHNg8IDPTqJAo2gz0Wpi9KYiEWrUNp7qHOV5JMJhAubG GMvNZ+BzOg2teUQxcdl78cSqEqQICKXB8WH8uAxHsf9jzWQMgoda1JlZnOmWYgLb50vWsY pvPFBFNWru7mfS258+YYKbRCjPVAQmKIj6RtIbwV1FQM2UdDVglbiAha9fMOoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7B2qkBzH4L; Mon, 26 Aug 2024 18:03: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 47QI3IMJ042671; Mon, 26 Aug 2024 18:03:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3IRS042668; Mon, 26 Aug 2024 18:03:18 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:18 GMT Message-Id: <202408261803.47QI3IRS042668@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: 2208f2c15688 - stable/14 - nvme: Use the NVMEM macro instead of expanded versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2208f2c15688e6b517680535053bfba39b67c0a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2208f2c15688e6b517680535053bfba39b67c0a4 commit 2208f2c15688e6b517680535053bfba39b67c0a4 Author: John Baldwin AuthorDate: 2024-01-29 18:59:37 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:47 +0000 nvme: Use the NVMEM macro instead of expanded versions A few of these omitted a shift of 0, but this is more consistent. Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43602 (cherry picked from commit 8488fc417fc24af37fa6f1e880f09a5023670950) --- sys/dev/nvme/nvme_ctrlr.c | 6 +++--- sys/dev/nvme/nvme_ns.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 7096f0443f1d..3ef5a2b51544 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -326,7 +326,7 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) return (err); } - cc &= ~NVME_CC_REG_EN_MASK; + cc &= ~NVMEM(NVME_CC_REG_EN); nvme_mmio_write_4(ctrlr, cc, cc); /* @@ -1258,7 +1258,7 @@ nvme_pt_done(void *arg, const struct nvme_completion *cpl) pt->cpl.cdw0 = cpl->cdw0; status = cpl->status; - status &= ~NVME_STATUS_P_MASK; + status &= ~NVMEM(NVME_STATUS_P); pt->cpl.status = status; mtx_lock(mtx); @@ -1600,7 +1600,7 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) int timeout; cc = nvme_mmio_read_4(ctrlr, cc); - cc &= ~(NVME_CC_REG_SHN_MASK << NVME_CC_REG_SHN_SHIFT); + cc &= ~NVMEM(NVME_CC_REG_SHN); cc |= NVME_SHN_NORMAL << NVME_CC_REG_SHN_SHIFT; nvme_mmio_write_4(ctrlr, cc, cc); diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 329b8d583898..c172663f75a3 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -286,7 +286,7 @@ nvme_bio_child_inbed(struct bio *parent, int bio_error) if (inbed == children) { bzero(&parent_cpl, sizeof(parent_cpl)); if (parent->bio_flags & BIO_ERROR) { - parent_cpl.status &= ~(NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT); + parent_cpl.status &= ~NVMEM(NVME_STATUS_SC); parent_cpl.status |= (NVME_SC_DATA_TRANSFER_ERROR) << NVME_STATUS_SC_SHIFT; } nvme_ns_bio_done(parent, &parent_cpl); From nobody Mon Aug 26 18:03:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7G0r8Lz5TMDn; Mon, 26 Aug 2024 18:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7F5yrqz44tp; Mon, 26 Aug 2024 18:03:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DTUYXGnk/9SRG8Fd5isU8sgIUB377xvxld4dhCCM+o=; b=lTS/7v8SRtqzPhvhI6qVghzHIkIKxkWSZXlpj3H+v2lG9BX/IQgsoDm/zL+dUOHjlsL0zP 4k2RMyRDt2GwZeML2YcVhinKuvN0oqfmqlt1c2CjJm3LEA09T4BWjMlaqWNodHrb+Sqv// 1rVSvVrdIwfWJiID63gHj/h1sLjc9tZvvqq//2a5y6BFTG3D1KF1gSH2gIb0qG3pnjEwUF a7W99CRyEnDtu2UIP0Lqu42QQP7IvODRCChPX1kJQgWnI4nenrZ5aStGbyQEtFJev4YIFE DsvQjTGiIcq4ZzfrZjidLYflcinoB6isr3c5ba5d+wA5FLpHI0Pyvn2xQtXX/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695401; a=rsa-sha256; cv=none; b=EfmmVcyICLxmVAi2uCihjHFUDKAJXF/ldSMTECXvxt404/Dx67O1ppLdbAl9NYcbgXkfZV J2Auv2P7I7b6cl1tO6QeJACrcElmrsnOpZZXirarYF/U7B6y2e+g7aZt6QVj099niO3LBA cG+b/rE5T7nLsTqMTBqbYoK/xNiQMjVpcwF8qcDoPHh/lF/GkhJ2XNqReHdIGgzvtZn5Fm pWeBkjjh8Qu5lOgKwhlDfQIdZ86DFdXVmuwct3IjDab7rURH8cuzx8P2vVFkeYUSgPYwrk tR7r0wyn0rquPYHnQ6EPiAAC9JLVt0UxvfOl1xkujoGgLkwF4K5gymn46uCf8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DTUYXGnk/9SRG8Fd5isU8sgIUB377xvxld4dhCCM+o=; b=rX/w8OWU89ctJ9xL/tJX/E0I5kiOgeNAdmmZPhbMQpxRY/pmENvM+g/BaEVo5fq5Sr1GvY ft1v3JS8kPVVjHsHT0/Kwxwa+R0JhhEeyynrNNfv1Yj9OITgXVGSTlg7bd5lN99fTRLlIW aX3rN++eWVrOfI7DOuJ8hYrfbf3wYOQHOnkjpCHYIbTn/xDQjIbB12HyZcj13/3xnJDqP5 5crryAB9Oxoi1f5pRzBZrVhtxH5JJmPjYMnHVQnbwTyW4EZ50kX6nNVc27DOfBHaB12svV F1yhX9XiNipdw3FoEsG54qlBtkC6BmO4OZtSk4zefhE5WiGk4GOEoX3ZcWeRww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7F5WmMzGCH; Mon, 26 Aug 2024 18:03: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 47QI3L6s042842; Mon, 26 Aug 2024 18:03:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3L6j042839; Mon, 26 Aug 2024 18:03:21 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:21 GMT Message-Id: <202408261803.47QI3L6j042839@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: 4d2e2e1b440e - stable/14 - nvme: Use the NVMEF macro to construct fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d2e2e1b440e339d679f2fa9e146767d98f8aea8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2e2e1b440e339d679f2fa9e146767d98f8aea8 commit 4d2e2e1b440e339d679f2fa9e146767d98f8aea8 Author: John Baldwin AuthorDate: 2024-01-29 19:01:13 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:08 +0000 nvme: Use the NVMEF macro to construct fields Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43605 (cherry picked from commit 5650bd3fe8eff1043ef3df33b5bdd7b24b5f2bc0) --- sys/dev/nvme/nvme_ctrlr.c | 20 ++++++++++---------- sys/dev/nvme/nvme_ns.c | 3 ++- sys/dev/nvme/nvme_qpair.c | 10 +++++----- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 3ef5a2b51544..0004895d6691 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -375,25 +375,25 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) qsize = ctrlr->adminq.num_entries - 1; aqa = 0; - aqa = (qsize & NVME_AQA_REG_ACQS_MASK) << NVME_AQA_REG_ACQS_SHIFT; - aqa |= (qsize & NVME_AQA_REG_ASQS_MASK) << NVME_AQA_REG_ASQS_SHIFT; + aqa |= NVMEF(NVME_AQA_REG_ACQS, qsize); + aqa |= NVMEF(NVME_AQA_REG_ASQS, qsize); nvme_mmio_write_4(ctrlr, aqa, aqa); /* Initialization values for CC */ cc = 0; - cc |= 1 << NVME_CC_REG_EN_SHIFT; - cc |= 0 << NVME_CC_REG_CSS_SHIFT; - cc |= 0 << NVME_CC_REG_AMS_SHIFT; - cc |= 0 << NVME_CC_REG_SHN_SHIFT; - cc |= 6 << NVME_CC_REG_IOSQES_SHIFT; /* SQ entry size == 64 == 2^6 */ - cc |= 4 << NVME_CC_REG_IOCQES_SHIFT; /* CQ entry size == 16 == 2^4 */ + cc |= NVMEF(NVME_CC_REG_EN, 1); + cc |= NVMEF(NVME_CC_REG_CSS, 0); + cc |= NVMEF(NVME_CC_REG_AMS, 0); + cc |= NVMEF(NVME_CC_REG_SHN, 0); + cc |= NVMEF(NVME_CC_REG_IOSQES, 6); /* SQ entry size == 64 == 2^6 */ + cc |= NVMEF(NVME_CC_REG_IOCQES, 4); /* CQ entry size == 16 == 2^4 */ /* * Use the Memory Page Size selected during device initialization. Note * that value stored in mps is suitable to use here without adjusting by * NVME_MPS_SHIFT. */ - cc |= ctrlr->mps << NVME_CC_REG_MPS_SHIFT; + cc |= NVMEF(NVME_CC_REG_MPS, ctrlr->mps); nvme_ctrlr_barrier(ctrlr, BUS_SPACE_BARRIER_WRITE); nvme_mmio_write_4(ctrlr, cc, cc); @@ -1601,7 +1601,7 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) cc = nvme_mmio_read_4(ctrlr, cc); cc &= ~NVMEM(NVME_CC_REG_SHN); - cc |= NVME_SHN_NORMAL << NVME_CC_REG_SHN_SHIFT; + cc |= NVMEF(NVME_CC_REG_SHN, NVME_SHN_NORMAL); nvme_mmio_write_4(ctrlr, cc, cc); timeout = ticks + (ctrlr->cdata.rtd3e == 0 ? 5 * hz : diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index c172663f75a3..9eb808f81a48 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -287,7 +287,8 @@ nvme_bio_child_inbed(struct bio *parent, int bio_error) bzero(&parent_cpl, sizeof(parent_cpl)); if (parent->bio_flags & BIO_ERROR) { parent_cpl.status &= ~NVMEM(NVME_STATUS_SC); - parent_cpl.status |= (NVME_SC_DATA_TRANSFER_ERROR) << NVME_STATUS_SC_SHIFT; + parent_cpl.status |= NVMEF(NVME_STATUS_SC, + NVME_SC_DATA_TRANSFER_ERROR); } nvme_ns_bio_done(parent, &parent_cpl); } diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index e087abcb2654..ce2f30aaa5ba 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -494,9 +494,9 @@ nvme_qpair_manual_complete_tracker( cpl.sqid = qpair->id; cpl.cid = tr->cid; - cpl.status |= (sct & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT; - cpl.status |= (sc & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; - cpl.status |= (dnr & NVME_STATUS_DNR_MASK) << NVME_STATUS_DNR_SHIFT; + cpl.status |= NVMEF(NVME_STATUS_SCT, sct); + cpl.status |= NVMEF(NVME_STATUS_SC, sc); + cpl.status |= NVMEF(NVME_STATUS_DNR, dnr); /* M=0 : this is artificial so no data in error log page */ /* CRD=0 : this is artificial and no delayed retry support anyway */ /* P=0 : phase not checked */ @@ -512,8 +512,8 @@ nvme_qpair_manual_complete_request(struct nvme_qpair *qpair, memset(&cpl, 0, sizeof(cpl)); cpl.sqid = qpair->id; - cpl.status |= (sct & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT; - cpl.status |= (sc & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; + cpl.status |= NVMEF(NVME_STATUS_SCT, sct); + cpl.status |= NVMEF(NVME_STATUS_SC, sc); error = nvme_completion_is_error(&cpl); From nobody Mon Aug 26 18:03:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7F1qWpz5TMGn; Mon, 26 Aug 2024 18:03:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7D4gjsz44b0; Mon, 26 Aug 2024 18:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DEf2brWfOq9fpHWr9Q76WzMsAJPV/rht+bimMtncrg=; b=jllJNugLOCkiL3VzvErxW8oqVKud16HBiF5kxXk3GvR/CdvgEHJYctmGKsaaFYkiP8jdw6 dGWc3Sid8IGk39m2XS/zRDJayxNVv7tBRULDgDX8OA6YsABBR/qyyVyNHqdQ4seRjmoqhz qdM5/kOn9mrOxKE2tHL/PLg7zF4J4z99jp5BNO/czd03mEAxAfmh/fqV0qU6NuivM8H+nJ nk6MGFpJekc9SRihTA8kSxbFi0w2Pvhv3xS3AwY3c4QDaiNuTZBEeauErlOny3Pw4vbyPy xtfbzJ5xxV9nhFuBG3DT4oPUY1q785w+VUtUc+fAHY/90JEqjxkpScuWbMBQHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695400; a=rsa-sha256; cv=none; b=RcKJtY5RkpbtSkhrVlNWi1F3T+UWE2TWY6gwQDIilG/Ebzc4tY+n1HI+yUgDjJgQ0E4L9b f5anyK3+EU5LRsb74La2AicePzUiOexvH3Fvpe9OlzRKM2Krgwyl7fqltfyad6/fDwFXrB KYbsBn/FhBAEDGGg1P7jERARp9yf2C708FBDEuCHbh6bCz74cXB2GFveywjSVkF0ikp2ig rUABPl+WZcydvoob4+C2AuSdKFAPNB+ij+uO1lMc5mj2GHunMLGC6jNPlcUF5qVh2kB5HA joJLGVWn94UY/Qc6zBfeCqX/QJnaRXHS7GwtxS6R1p7eXJHhMsa0oZmxDYWDlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DEf2brWfOq9fpHWr9Q76WzMsAJPV/rht+bimMtncrg=; b=m7qZvXtwUt/gK9+cAdN4h61ZzlsHYGNs8m9JPM1qxAHxZAMIoSbPpCX1xdLkBhwEbRdOKN 1NkFhzZCYy7M+Ipfb6jf0oST8Xjh98AiyKJBIoiOHAkK2/7DRfZvOD+jnPLjtel3ph9vAs XdpsbjtDAwmnZZBz1X3U3DegAdLa3jzK0kztb7bRahLen21P7jfTFcWPBRYD3NQGK4m1Xx wk9swRw6zEynHhiFpvtmMTYBauQ8Z5EzW/tRElqVpGH/jZNuSo/8aHgIPDqgVKJYjHZ5+P DF/LMBMdaBmRsTXm6aVBREeDR3YREDelsp1uZAjgyz0CemvPITaSy1vqH0zvlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7D49SwzHHM; Mon, 26 Aug 2024 18:03: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 47QI3Keo042786; Mon, 26 Aug 2024 18:03:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3KrM042783; Mon, 26 Aug 2024 18:03:20 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:20 GMT Message-Id: <202408261803.47QI3KrM042783@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: 7566b99458a3 - stable/14 - nvme: Add NVMEF helper macro as the inverse of NVMEV List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7566b99458a31ad9ac2ef289c401fa008fd01386 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7566b99458a31ad9ac2ef289c401fa008fd01386 commit 7566b99458a31ad9ac2ef289c401fa008fd01386 Author: John Baldwin AuthorDate: 2024-01-29 19:00:57 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:01 +0000 nvme: Add NVMEF helper macro as the inverse of NVMEV This macro accepts a field name and a value for the field and constructs the shifted field value. Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43604 (cherry picked from commit 3a477a9b70a34dc0686630599c27f022b1e07bd8) --- sys/dev/nvme/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 7b3cdd89f146..137aff792868 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -610,6 +610,9 @@ enum nvme_critical_warning_state { /* Helper macro to extract value from x */ #define NVMEV(name, x) (((x) >> name##_SHIFT) & name##_MASK) +/* Helper macro to construct a field value */ +#define NVMEF(name, x) (((x) & name##_MASK) << name##_SHIFT) + /* CC register SHN field values */ enum shn_value { NVME_SHN_NORMAL = 0x1, From nobody Mon Aug 26 18:03:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7H4cdHz5TM83; Mon, 26 Aug 2024 18:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7H0RHGz457l; Mon, 26 Aug 2024 18:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0F1mUzaXpcP0vXTJL1ubz5W0VbG+Bh00J8cFyl8mdw=; b=gaoU+A7RD9mAjEDgMEiMwxyjdxmuzesZCWMdenOlNB+pso5ITwJWbu7gPiKN+808H2HkIW zbEJ5RusZDk/pfqNjLgMAF722yx/gvxDqR4+jIXgCcPofrFjBWYBbNQ32vZR7uJBMC/X9H BDadZKCL6QOy//ZdJD6Ar2OTQu3G3947q3nr9KXpqJ/mv/PQ0r1MUZQIuQ7eUe4htgDWez nf1gawImT3hexAAM4H83XPk3VjzSe3snEL61UypFhHn0cdx0ohdDGextpp1kMeMQbU9Jqn mT0N/m4vcuV1tAUZt9NRfiCngRIjAePG0kATt0NREcv0aqyn2mvAcbUoYis65g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695403; a=rsa-sha256; cv=none; b=oxQgWt9R2Ipb1S7HIOTdwC8g3I8fQ2AypCpi3yWEMvolhmz3yqDmnKyMDNlfV+L2lyyUO+ o2FKniepRweJm5s9hMGqszJksjnkdJ46tpcKi/MoyTdoG5CZ1O0cSv+mdOxLqlE+HvfzjU mQ2pW33XwyveV/GVPRra3Q/cmfhAVOBYjLAnRr0Qg003ei5RvjFXUFF7UMop2mDld4v5t2 KIo2YUpdPxzuv3A4GDBTmClKO8RxzraOydZRr+6t38Hn09JMabNqBX14v8Ik0aEV8m8Sz8 0r+EWk/AxxVzFep6x82yRlW/gl6qcaHoeveHv2AbFKVk7kCTkIwQmTEMKQyafQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0F1mUzaXpcP0vXTJL1ubz5W0VbG+Bh00J8cFyl8mdw=; b=IBPXjkS3UjmjL1QEletGUwZf8PpRQwi2tQClcWgWJiN+Z3uIosrJ2Y4AVVO+XZml58NkFp Y1a0A/4XCYSnjFfbYqdy+XGgrZbaX31aPfyW79RVUTYXsnwcF9yNjOEDHIzVP3MeJi3Bbe LgpbHJ5FdbTr1TOoVU0S+j2Zk/6dfOID09odKdkiGmRiGzgCeq60B7/J0xY0Hl8tPuSJXu t2mRvKPuDZv5wexV/AD2gC5g9F3vEqmslO+Jxp3f1cU8coG99M/383lEhnD8rHisQcWULy L37nPXmr7Te8aP/uFRDtgPvdLMw+GNR/4wH2HeqdPX29v2C5jtnMlAFeAcfkBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7G6TWBzH6L; Mon, 26 Aug 2024 18:03: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 47QI3Mcm042894; Mon, 26 Aug 2024 18:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3MBT042891; Mon, 26 Aug 2024 18:03:22 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:22 GMT Message-Id: <202408261803.47QI3MBT042891@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: 5438d2060676 - stable/14 - nvmecontrol: Use NVMEF macro to construct fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5438d20606769c8db690f1a2d92becb7a6b05426 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5438d20606769c8db690f1a2d92becb7a6b05426 commit 5438d20606769c8db690f1a2d92becb7a6b05426 Author: John Baldwin AuthorDate: 2024-01-29 19:01:46 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:14 +0000 nvmecontrol: Use NVMEF macro to construct fields Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43606 (cherry picked from commit c68ec278deb23fd90eb5506c9a6a4f7339784ff3) --- sbin/nvmecontrol/ns.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index a77f37e0f468..24f4b6b3d043 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -580,14 +580,12 @@ nscreate(const struct cmd *f, int argc, char *argv[]) /* Default to the first format, whatever it is. */ nsdata.flbas = 0; if (create_opt.lbaf != NONE) { - nsdata.flbas |= (create_opt.lbaf & - NVME_NS_DATA_FLBAS_FORMAT_MASK) - << NVME_NS_DATA_FLBAS_FORMAT_SHIFT; + nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_FORMAT, + create_opt.lbaf); } if (create_opt.mset != NONE) { - nsdata.flbas |= (create_opt.mset & - NVME_NS_DATA_FLBAS_EXTENDED_MASK) - << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT; + nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_EXTENDED, + create_opt.mset); } } if (create_opt.dps != NONE) { @@ -596,22 +594,19 @@ nscreate(const struct cmd *f, int argc, char *argv[]) /* Default to protection disabled. */ nsdata.dps = 0; if (create_opt.pi != NONE) { - nsdata.dps |= (create_opt.pi & - NVME_NS_DATA_DPS_MD_START_MASK) - << NVME_NS_DATA_DPS_MD_START_SHIFT; + nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_MD_START, + create_opt.pi); } if (create_opt.pil != NONE) { - nsdata.dps |= (create_opt.pil & - NVME_NS_DATA_DPS_PIT_MASK) - << NVME_NS_DATA_DPS_PIT_SHIFT; + nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_PIT, + create_opt.pil); } } if (create_opt.nmic != NONE) { nsdata.nmic = create_opt.nmic; } else { /* Allow namespaces sharing if Multi-Path I/O is supported. */ - nsdata.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK << - NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0; + nsdata.nmic = NVMEF(NVME_NS_DATA_NMIC_MAY_BE_SHARED, !!cd.mic); } nvme_namespace_data_swapbytes(&nsdata); From nobody Mon Aug 26 18:03:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7J5hclz5TM40; Mon, 26 Aug 2024 18:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7J19GWz44xm; Mon, 26 Aug 2024 18:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VxQHz1ECPprZODB7twYzb97FMALRHsfQQtlFmlSLfzQ=; b=o2UTIhnLn+oNUjVdMAhN7cagm6yqvzUOAppCHEIAvYarBNx+nKRF/+MI+HFvoDE6UoPKiO awvRWs5bvQVX4N5klU+rVr29uOhc4LHCr29n78LBD94x1cCA2OZ2/fpFy+qURxUHHUC8ko fn9dUR1fnTJ1ABuYUu26rTv3UR/+gQohcUM6s5RpxwWSrjZA7nodv8FQaGqccI3Ck8sUVB LUs7LMeoeUmq7HfPT/HTjDDoRFb/ZVMEvFYMiMwOotHNICDCqVaqXyCgSHc3LNuPw6xReb LHuf/RM1QXFZIIzMMx9aE5bpLF9ekD89eU60O/GTa+J7eERFy3WMxivvNRpJRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695404; a=rsa-sha256; cv=none; b=xznFxdX8IfkH/nPCQ1+b/MHC3zFKUnfjjKDdeQZIRiGi3WSX3RSU3ljbwQd10TlacigEhJ p57ejZmF/QWk9d6EgaNh1N1Mk/YOQlq9tye+xW9o8KIuhi0MqpVMVD8TKmZf97HRNIA5/m Rqq19smwILll8JPUy+0t++yWZLZhkpjMPNtCX/B2NmP5QvPRMI+Xq2Qd46Ak5HENo6PRNV Vh9BwCzdDZ68pFo6YLFkkHW8khYswc9+mveA6SdkdeiSiag9CC14v/z2Us/ticKU+QXGIM I688OoTURcsiXb5sMfhHt2rQJcnKqReUyQVrgCCx+U/ApzZFEprGNC4mCpzsBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VxQHz1ECPprZODB7twYzb97FMALRHsfQQtlFmlSLfzQ=; b=SVYj1cOuQ8QkhED8q4FwjtHoKEF39fm8crJxlVhQ7StTVXs+2r6lQS2R9aNdMWDt/OI4Bz DxZ7ZRhuQ7goB/gbAcTTnWCNbzqSUwGx1VEtj2ff2MtnVcWR1RU6+SXzCM10MWsxEwuklM EALLX6w/FPnYmDXKQgoNRsopwtt7iqXul6LUipVbzu2RbH54r/hfjNXxft56raH2CVEei5 ChBndG5svTJXvY2Egog5dW0swnn6eHq746PgWYVZRvdG5gM2FHgPYC9jdGJ28HLU2grfm0 BBKZoAvjQL+bR5o9Pv+sP+ZJfgccgljhLlcsbhVb/IgU/ewxM3dGJz/kyyc0Bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7J0RbNzHKL; Mon, 26 Aug 2024 18:03: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 47QI3Nlj042944; Mon, 26 Aug 2024 18:03:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3NhC042941; Mon, 26 Aug 2024 18:03:23 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:23 GMT Message-Id: <202408261803.47QI3NhC042941@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: f314e46271f1 - stable/14 - bhyve: Use NVMEF macro to construct fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f314e46271f1100c258a72aa8c0e072f0f3ef2e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f314e46271f1100c258a72aa8c0e072f0f3ef2e6 commit f314e46271f1100c258a72aa8c0e072f0f3ef2e6 Author: John Baldwin AuthorDate: 2024-01-29 19:02:07 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:53 +0000 bhyve: Use NVMEF macro to construct fields Reviewed by: corvink, chuck (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43607 (cherry picked from commit c46860dbcb2037933575a260028325418b3e9789) --- usr.sbin/bhyve/pci_nvme.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index cd81767d950b..45ab1b11fda4 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -393,11 +393,11 @@ static void pci_nvme_io_done(struct blockif_req *, int); #define NVME_CSTS_GET_RDY(sts) \ NVMEV(NVME_CSTS_REG_RDY, sts) -#define NVME_CSTS_RDY (1 << NVME_CSTS_REG_RDY_SHIFT) -#define NVME_CSTS_CFS (1 << NVME_CSTS_REG_CFS_SHIFT) +#define NVME_CSTS_RDY (NVMEF(NVME_CSTS_REG_RDY, 1)) +#define NVME_CSTS_CFS (NVMEF(NVME_CSTS_REG_CFS, 1)) /* Completion Queue status word utils */ -#define NVME_STATUS_P (1 << NVME_STATUS_P_SHIFT) +#define NVME_STATUS_P (NVMEF(NVME_STATUS_P, 1)) #define NVME_STATUS_MASK \ (NVMEM(NVME_STATUS_SCT) | \ NVMEM(NVME_STATUS_SC)) @@ -442,8 +442,7 @@ pci_nvme_status_tc(uint16_t *status, uint16_t type, uint16_t code) { *status &= ~NVME_STATUS_MASK; - *status |= (type & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT | - (code & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; + *status |= NVMEF(NVME_STATUS_SCT, type) | NVMEF(NVME_STATUS_SC, code); } static __inline void @@ -536,14 +535,14 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->ver = NVME_REV(1,4); cd->cntrltype = NVME_CNTRLTYPE_IO; - cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; + cd->oacs = NVMEF(NVME_CTRLR_DATA_OACS_FORMAT, 1); cd->oaes = NVMEM(NVME_CTRLR_DATA_OAES_NS_ATTR); cd->acl = 2; cd->aerl = 4; /* Advertise 1, Read-only firmware slot */ cd->frmw = NVMEM(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | - (1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT); + NVMEF(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, 1); cd->lpa = 0; /* TODO: support some simple things like SMART */ cd->elpe = 0; /* max error log page entries */ /* @@ -557,13 +556,13 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->cctemp = 0x0157; /* SANICAP must not be 0 for Revision 1.4 and later NVMe Controllers */ - cd->sanicap = (NVME_CTRLR_DATA_SANICAP_NODMMAS_NO << - NVME_CTRLR_DATA_SANICAP_NODMMAS_SHIFT); + cd->sanicap = NVMEF(NVME_CTRLR_DATA_SANICAP_NODMMAS, + NVME_CTRLR_DATA_SANICAP_NODMMAS_NO); - cd->sqes = (6 << NVME_CTRLR_DATA_SQES_MAX_SHIFT) | - (6 << NVME_CTRLR_DATA_SQES_MIN_SHIFT); - cd->cqes = (4 << NVME_CTRLR_DATA_CQES_MAX_SHIFT) | - (4 << NVME_CTRLR_DATA_CQES_MIN_SHIFT); + cd->sqes = NVMEF(NVME_CTRLR_DATA_SQES_MAX, 6) | + NVMEF(NVME_CTRLR_DATA_SQES_MIN, 6); + cd->cqes = NVMEF(NVME_CTRLR_DATA_CQES_MAX, 4) | + NVMEF(NVME_CTRLR_DATA_CQES_MIN, 4); cd->nn = 1; /* number of namespaces */ cd->oncs = 0; @@ -581,7 +580,7 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->fna = NVMEM(NVME_CTRLR_DATA_FNA_FORMAT_ALL); - cd->vwc = NVME_CTRLR_DATA_VWC_ALL_NO << NVME_CTRLR_DATA_VWC_ALL_SHIFT; + cd->vwc = NVMEF(NVME_CTRLR_DATA_VWC_ALL, NVME_CTRLR_DATA_VWC_ALL_NO); ret = snprintf(cd->subnqn, sizeof(cd->subnqn), "nqn.2013-12.org.freebsd:bhyve-%s-%u-%u-%u", @@ -634,7 +633,7 @@ pci_nvme_init_nsdata(struct pci_nvme_softc *sc, be64enc(nd->eui64, nvstore->eui64); /* LBA data-sz = 2^lbads */ - nd->lbaf[0] = nvstore->sectsz_bits << NVME_NS_DATA_LBAF_LBADS_SHIFT; + nd->lbaf[0] = NVMEF(NVME_NS_DATA_LBAF_LBADS, nvstore->sectsz_bits); } static void @@ -657,7 +656,7 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) sc->health_log.available_spare_threshold = 10; /* Set Active Firmware Info to slot 1 */ - sc->fw_log.afi = (1 << NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT); + sc->fw_log.afi = NVMEF(NVME_FIRMWARE_PAGE_AFI_SLOT, 1); memcpy(&sc->fw_log.revision[0], sc->ctrldata.fr, sizeof(sc->fw_log.revision[0])); @@ -1003,10 +1002,10 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) DPRINTF("%s", __func__); sc->regs.cap_lo = (ZERO_BASED(sc->max_qentries) & NVME_CAP_LO_REG_MQES_MASK) | - (1 << NVME_CAP_LO_REG_CQR_SHIFT) | - (60 << NVME_CAP_LO_REG_TO_SHIFT); + NVMEF(NVME_CAP_LO_REG_CQR, 1) | + NVMEF(NVME_CAP_LO_REG_TO, 60); - sc->regs.cap_hi = 1 << NVME_CAP_HI_REG_CSS_NVM_SHIFT; + sc->regs.cap_hi = NVMEF(NVME_CAP_HI_REG_CSS_NVM, 1); sc->regs.vs = NVME_REV(1,4); /* NVMe v1.4 */ @@ -2955,8 +2954,8 @@ pci_nvme_write_bar_0(struct pci_nvme_softc *sc, uint64_t offset, int size, if (NVME_CC_GET_SHN(ccreg)) { /* perform shutdown - flush out data to backend */ sc->regs.csts &= ~NVMEM(NVME_CSTS_REG_SHST); - sc->regs.csts |= NVME_SHST_COMPLETE << - NVME_CSTS_REG_SHST_SHIFT; + sc->regs.csts |= NVMEF(NVME_CSTS_REG_SHST, + NVME_SHST_COMPLETE); } if (NVME_CC_GET_EN(ccreg) != NVME_CC_GET_EN(sc->regs.cc)) { if (NVME_CC_GET_EN(ccreg) == 0) From nobody Mon Aug 26 18:30:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WszkG5kN3z5TP81; Mon, 26 Aug 2024 18:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WszkG55qNz4CMy; Mon, 26 Aug 2024 18:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724697014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha4v50D6O81rn96lpE0sMBBm8rX9r6As2V66eRN7WN4=; b=qdRKodHsX2nFd+I8emyRvPWbavSJa/bSHI6Xqq/+1MoV5qnrr3IFyoSoUPZSJotRyFCWH6 hK73rLzECxFV8QQ/1Lw2Rq4tCozuQnyEJjQeZlo4/cHVcQfp2g0xXbcIqa/gifAEO0pmaA mwcpGZtT3QXzkQjhPo9lnUEg82IaJCpIAzm8Zzh8XbXdVka1pP7BXNfAiFedEPVjZeqqdc yEe61RymxbXJMNUY5BhnGHQhtz23VJK9LyMx4Zw5ESdJFr8gTj/hBYciraqMdaUqPylBLT 8elj6a4Sm6x7P7Iis84DK/SdR1hcCjqJy5d5zmznczbWczf6DZkqNMibAmAAvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724697014; a=rsa-sha256; cv=none; b=udTMz4Z7pbi6pcN5jOFgRMicPIImEQyUFb1gZGedXV4YZBcYG/LZYOTfWeu6+hLg8VWeSV +FL98lm4hnBDtORMSvr3zGkSFRtWonQr0fvOu5li4xKbSTanpuevC7H4McmcfzhYElTN52 YLFoKueJRyUmw1XZyNILPEctpbpCOX1KxBYtaTqXkO74uXARvA5Fij0UGToLSuL68YjTzg N6OswpJOixfrvcikf1qIremXRw7V7ClvtvZPMv6BWulBulYLmjF2Hgx1P/+uG9xlX1qXuW ONKdpiWpWRRmcXrRgeBANRv71PXAcK+/wf1dvMCVJF2999sodNoJCFonnv0rcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724697014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha4v50D6O81rn96lpE0sMBBm8rX9r6As2V66eRN7WN4=; b=vxYzlk5grr4BwAYMJt1DMPhLeXAST6McdTfgVcN1X9lXruzOX4s5iVfMzTlntAgupUr+id qjmEJZiX/60l49QYcwJFtPEZVlch5x1mryi/wcY/jrGY9kzgm8frjEgQbqK+3Ce/k+MoV+ o5IxuTF4axAcjLQ10q/TKBmT/l6UhMZueVz4EXXs9F4N4sI0J8NpgtyWB2sG9vBI5dVpEo gcB7PfWXTdFVyPzg8Yu//eb+a+WZ77RS2mQY8+QTodRijwrk7o8r+B4hY3FrjTkdmcaZ0i BH++H0zG6Z0566Z/IqC1PnclZ7G2AKKivd+RwHmHmDurczLcI8cvFlCrm2Po6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WszkG4jJGzHqG; Mon, 26 Aug 2024 18:30: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 47QIUEep084057; Mon, 26 Aug 2024 18:30:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIUE1e084040; Mon, 26 Aug 2024 18:30:14 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:30:14 GMT Message-Id: <202408261830.47QIUE1e084040@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: 27777283da79 - releng/13.4 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 27777283da79cbfa39ba10b65c748f49884be7fe Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=27777283da79cbfa39ba10b65c748f49884be7fe commit 27777283da79cbfa39ba10b65c748f49884be7fe Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-08-26 18:29:40 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) (cherry picked from commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d) (cherry picked from commit 51768dc31df6379aa4a1447a15f054508d16b4b1) Approved by: re (cperciva) --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a31bbd3c8342..7a04a668e823 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9339,14 +9339,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Tue Aug 27 01:06:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WM4zgJz5Thwf; Tue, 27 Aug 2024 01:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WM4F15z4lgn; Tue, 27 Aug 2024 01:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D68kCSJj0nMU4wDA8utXaVuAFB66BrmWDfZ/kpw0rGo=; b=vOkoof4Mx33/ufbqX4+TE2qHWAM4TlB88JvDqrB+FRS0DUN951JXndDz2MstdUb68KR7rk JDHVJN53TMMmfYx1HfXOcDRqF2Q2VhZE+TBvUF5HvrkTIdu3/hu2+HqnBR79Jx3utDG6l/ s2eMrAl1abt4StMTO2BdFY/gxVV56r709fzQwoXWKk5Kc/CzM4du6Kgdv9VC50DfXDQNk4 NSQDe5Vt/qBHvwm4V4DWHUbmHutp6+qo4hK4jQQH2J2RWCoM8sBFiKcoVBM0kZ6DkVZLqM DudgIJf9ZKHu10Ilmk5eCOZrj0PMsZmza6Bjh7ZsxCCcuPdOJRk5A8TbC1jkAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720783; a=rsa-sha256; cv=none; b=oTCmd6RwU84s4sILjQVVCuRIVg8CCqsY7nTmRGY/lMA+ejKpAEL1oQvnYP2/GHvBagIIdP NnOuWQFypSYSn60EHotfK2VHDK+7frhqIjXVPhashUd6pD1C3zpJnYi0h++jXK8Dt+hbjs UWHIcfrpLpZGu4IHQ0aOWjYHSSkqPJqFoIJvsIgO+DEaKuXz1xT7BWEXqDMc9LTOnTmD3y 3MOzW43EM2Uil/tN8EbjTkfWJVubcUIxdkIkIQqeZF4zcG5BZCADm6vlFeKemYkN6EEjxs 6sApQMYXl3Gr6FmmMGYR7qcOseeWr1d40E17uzhSxAUMLxOHujkRaOWdFdsWCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D68kCSJj0nMU4wDA8utXaVuAFB66BrmWDfZ/kpw0rGo=; b=ISB/yJdHQ4VmetlqQ/Z/YrW2Nwreuq/suKJ4YuRDfI28FzWlbYH2MSN1QNHXTU+WvH+/2i yHhFTrQBliIDhMEP4C8IBvTFyJG0DzdVrYi4vxok7kUTZccHGIvcqlqosKHafMbjbkPL2N +YWS0yuHv3b2jLO14m0zs1BC18TmETu1hxvA23BvIcOuSFUPr5PE4LyvVa16SO+esyA9fP jjrowUYevYcuOFs3KRAwv/503KJD0Vo1GVY++tiwzQYMAIEgMGNjztllutXQAgNeppu/ea g+Kir720NeP8eYVwY9N9otVBNML2AaK4EcSUfUKpiYTUxeu/94btyNAG44flDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WM2NPGzTfc; Tue, 27 Aug 2024 01:06: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 47R16N9c056312; Tue, 27 Aug 2024 01:06:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16NAw056309; Tue, 27 Aug 2024 01:06:23 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:23 GMT Message-Id: <202408270106.47R16NAw056309@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: aaa01ea24d64 - stable/14 - nvmecontrol(8): Fix typo in ns.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aaa01ea24d645e096199b4bc4064acf21324631d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aaa01ea24d645e096199b4bc4064acf21324631d commit aaa01ea24d645e096199b4bc4064acf21324631d Author: Yu-Sheng Ma AuthorDate: 2024-01-05 08:11:48 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:17:26 +0000 nvmecontrol(8): Fix typo in ns.c `Insufficient` was spelled wrongly on line 537. Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/997 (cherry picked from commit 69f9c5a51346b1ada4854cb4131e8a63b7dd8b46) --- sbin/nvmecontrol/ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 24f4b6b3d043..27f622162c7d 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -532,7 +532,7 @@ nscontrollers(const struct cmd *f, int argc, char *argv[]) /* * NS MGMT Command specific status values: * 0xa = Invalid Format - * 0x15 = Namespace Insuffience capacity + * 0x15 = Namespace Insufficient capacity * 0x16 = Namespace ID unavailable (number namespaces exceeded) * 0xb = Thin Provisioning Not supported */ From nobody Tue Aug 27 01:06:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WN5fLFz5TjL6; Tue, 27 Aug 2024 01:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WN3fQfz4lMy; Tue, 27 Aug 2024 01:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHtnu0K9GXwPyZjeMKDVyMcntGniA1884Jh7Y34JJew=; b=M50SSE8RvmxGo+W2Sr7SoDabCuXIdUj4aUIy56UFbvDkh2V/Ab5DhSr4u29wFwBCWeXoky V/Z0FohRyJpIM0oTSiafaHWsdtoS4IrEmb2nvHklvnPEwUXYQmX4kC9ktRFszlJEy/AAdQ IMG+jkNzsgcDJc7dWVWw4EJcCvjW7uAYad4YV6s7cOFW+Q8tzK/e/YgmnlVSnOevO3NVug IqshpHy7g13tJzfEl1IT7vC5puYaU7m7s82a5HCb0ayeuTuIcZESZLkDJKwwS/5YFdt0+h wTYUuOOfRFqk17M3JyE7y4Ip1B9qInwd7zy6xnWvdQyMvBfGn13WpAtUvkajwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720784; a=rsa-sha256; cv=none; b=tj6mJPDmgReOb1QAygR5J8Ofpo3OM4aMAAgaV0LdF9z0hA3PZbbhGBEDuz2z4NHYA4m1w8 18xRZeQawMpDq8DmZpnYLYsH179WUWOfPZ2d2OfdZ+ZdB3JPwsb+w0+nq5eBbDp0hO909A 0mMy4/fms9oyUwU3YDfs71cMFILsyWooiMCDHQyHwzkVLJzajqCvvr//cRKyChJrishk5z LeFE/jfxerBWlClCqL3zqXHkL52rFx7zZV8TTSx03WqPLcRADEL9wMVjvFZ18rcHKZiAB7 iQqHIaFwvYne3oFBj+FI+UsV0C5x/DiIF/94nFeTSUuDLfpJqVIrCmkf5BupxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHtnu0K9GXwPyZjeMKDVyMcntGniA1884Jh7Y34JJew=; b=NDWbvF4IwQdN6FSV66O+BEf6AYqUP/UHoGWeNrCsQkfdU1XMHrLGjXEwvHnR4RYcnhSqRd 3GvpVu6K+H/5eXmN/h2Q4tB4miOivOUzha6KfoXDPzASc4GfdyjpPtRfFcy8LNn+kzAUJo ZqRthla8floK7AWldQTOVt+4g2AbYnhD56BKBnRyD47OvqTR4VVxd1elu9rzMGTRuSnwYH DbmVrGu8uKm4mTVf9PwdMxxXviu6TyM8TSKf7ahUlq5PykjGT5zU7cuYBPMamzbADYZXlT ngdqmU5qPejGT9U+RB7loBLR8KI8AjueReqHonDuvviyo947YJtymZuv+Q9yjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WN32qYzT9S; Tue, 27 Aug 2024 01:06: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 47R16ORZ056366; Tue, 27 Aug 2024 01:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16OiM056363; Tue, 27 Aug 2024 01:06:24 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:24 GMT Message-Id: <202408270106.47R16OiM056363@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: 94feb210599a - stable/14 - nvme: Export constants for min and max queue sizes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 94feb210599a358462ad48ccc792ec4d78e03ee3 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=94feb210599a358462ad48ccc792ec4d78e03ee3 commit 94feb210599a358462ad48ccc792ec4d78e03ee3 Author: John Baldwin AuthorDate: 2024-03-23 00:21:20 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:21 +0000 nvme: Export constants for min and max queue sizes These are useful for NVMe over Fabrics. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44441 (cherry picked from commit 1931b75e004f25cf1d2db809bfd9baba40c04521) --- sys/dev/nvme/nvme.h | 7 +++++++ sys/dev/nvme/nvme_private.h | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 137aff792868..ee387d54985e 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -63,6 +63,13 @@ /* Many items are expressed in terms of power of two times MPS */ #define NVME_MPS_SHIFT 12 +/* Limits on queue sizes: See 4.1.3 Queue Size in NVMe 1.4b. */ +#define NVME_MIN_ADMIN_ENTRIES 2 +#define NVME_MAX_ADMIN_ENTRIES 4096 + +#define NVME_MIN_IO_ENTRIES 2 +#define NVME_MAX_IO_ENTRIES 65536 + /* Register field definitions */ #define NVME_CAP_LO_REG_MQES_SHIFT (0) #define NVME_CAP_LO_REG_MQES_MASK (0xFFFF) diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 72797d30a3bf..26dc75ba4141 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -57,9 +57,6 @@ MALLOC_DECLARE(M_NVME); #define NVME_ADMIN_TRACKERS (16) #define NVME_ADMIN_ENTRIES (128) -/* min and max are defined in admin queue attributes section of spec */ -#define NVME_MIN_ADMIN_ENTRIES (2) -#define NVME_MAX_ADMIN_ENTRIES (4096) /* * NVME_IO_ENTRIES defines the size of an I/O qpair's submission and completion @@ -74,11 +71,6 @@ MALLOC_DECLARE(M_NVME); #define NVME_MIN_IO_TRACKERS (4) #define NVME_MAX_IO_TRACKERS (1024) -/* - * NVME_MAX_IO_ENTRIES is not defined, since it is specified in CC.MQES - * for each controller. - */ - #define NVME_INT_COAL_TIME (0) /* disabled */ #define NVME_INT_COAL_THRESHOLD (0) /* 0-based */ From nobody Tue Aug 27 01:06:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WP5kXLz5TjJJ; Tue, 27 Aug 2024 01:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WP4vt4z4lN0; Tue, 27 Aug 2024 01:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pQDkyTq+ZxrSOk5og2y69r0zY+JLE+tMegRzzG2Qn+w=; b=JwqiPrtnf2YcM50dR+T8ZSSRPV3O93sdKkAsOQ17MyMV3GlCRNjKD+A7gYckTiGUk5cUZy WO+CsQzow7bgblHW05xwFjG1yD+YBSQe2lE4asNCXfmVwwU/9Vx4EgG9FItq5EcRip9s2C sIg1gZob+SE84brycCKGIa832NqhQcSAcbfaSsHomZDOMyKpMQBqcNFLtu1tm7gwO566P3 iCnsUcASuWsnOzzPLFtawd4afnthrM4BPAd9eknapPou8RRXaeixRKBMLsHQyb3hWB+G0b z1cv3VV23ejOp7kLKLX+81ziwp6sbTYf/+R08urQE8lHUSRx5KaDNS8SdM++ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720785; a=rsa-sha256; cv=none; b=rUOoxfPOAyVt0g253rvJcMeKcJ946jVe5zSZuiJlyg6qijvZfu8Q4Ltii556UxDx0TX8Bq NvxTRl4zj11iRomVvhDblI2Vu/w3LlIRzvj4MU2+3j94YHiYvSoWytDZndn7PVxjJ0uI2Y Kurj4LdqzGEPQHXvK6eItO55DjCZCQoKuWWhBRvxS1V//TLt/sEH442Nqng2ZVYnsbJhfN 8rCe5SRTf8CMgjD6ob0JL0YOiZVHH62cxjOK+ANxEsdMSNZpCh8T0l+0eW8IDN3kgh8nIy OjMuGLTM0V+QG7YTynGF9MZrcj3PTPUxcHolHxwgET6PX9U0yzcRU+nP/rEe6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pQDkyTq+ZxrSOk5og2y69r0zY+JLE+tMegRzzG2Qn+w=; b=U9XMkd6XWsNuLSE9zyUp64KLg/p5Ya7FnLEd/hDLMFSps4xU8OwatF+4d9p5WDmmRSrO5w HLzksPWotinLhGx6nwsL6D8phUosKp/lJfLHyMYO4ilgw8f6WETCWL6hi/SXCFDbK+g7RW DUk0xj1nce7jgl8xaVky+iD7VVcLCqYC/qUkyqcm5k9t7giEH8Ar41Gxo5Wh1wwP0X4G6r SeyWV1TAwhSO8ld6kyQOfQt4+Tbannik14XbCoXDHEK5YUlRUDR4QnAyPJ90skSu8zkneU MYoRMEe0xj/dx6Mqkm7RYL2h2aRRdV8isM/DEdY6QyO7/X5Fe1wZKO4zs1HqoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WP4Q5ZzTjY; Tue, 27 Aug 2024 01:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47R16PIh056428; Tue, 27 Aug 2024 01:06:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16PSA056425; Tue, 27 Aug 2024 01:06:25 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:25 GMT Message-Id: <202408270106.47R16PSA056425@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: 1e066e460403 - stable/14 - nvme: Add SGL structure and constants for use in NVMe commands List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e066e46040354f244561894911e0938c9ef4df7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1e066e46040354f244561894911e0938c9ef4df7 commit 1e066e46040354f244561894911e0938c9ef4df7 Author: John Baldwin AuthorDate: 2024-03-23 00:23:09 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:28 +0000 nvme: Add SGL structure and constants for use in NVMe commands Fabrics capsules use an SGL structure instead of prp1/2 addresses to describe the data buffer used for a command. The SGL structure is added to a union with the existing prp1/2 fields. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44442 (cherry picked from commit f21a54d19080510bce279183f4bf07d5315bd179) --- sys/dev/nvme/nvme.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index ee387d54985e..f00090731dff 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -433,6 +433,25 @@ #define NVME_CTRLR_DATA_VWC_ALL_NO (2) #define NVME_CTRLR_DATA_VWC_ALL_YES (3) +/** SGL Support */ +/* NVM command set SGL support */ +#define NVME_CTRLR_DATA_SGLS_NVM_COMMAND_SET_SHIFT (0) +#define NVME_CTRLR_DATA_SGLS_NVM_COMMAND_SET_MASK (0x3) +#define NVME_CTRLR_DATA_SGLS_KEYED_DATA_BLOCK_SHIFT (2) +#define NVME_CTRLR_DATA_SGLS_KEYED_DATA_BLOCK_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_BIT_BUCKET_SHIFT (16) +#define NVME_CTRLR_DATA_SGLS_BIT_BUCKET_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_CONTIG_MPTR_SHIFT (17) +#define NVME_CTRLR_DATA_SGLS_CONTIG_MPTR_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_OVERSIZED_SHIFT (18) +#define NVME_CTRLR_DATA_SGLS_OVERSIZED_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_MPTR_SGL_SHIFT (19) +#define NVME_CTRLR_DATA_SGLS_MPTR_SGL_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_ADDRESS_AS_OFFSET_SHIFT (20) +#define NVME_CTRLR_DATA_SGLS_ADDRESS_AS_OFFSET_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_TRANSPORT_DATA_BLOCK_SHIFT (21) +#define NVME_CTRLR_DATA_SGLS_TRANSPORT_DATA_BLOCK_MASK (0x1) + /** namespace features */ /* thin provisioning */ #define NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT (0) @@ -674,6 +693,38 @@ struct nvme_registers { _Static_assert(sizeof(struct nvme_registers) == 0x1008, "bad size for nvme_registers"); +#define NVME_SGL_SUBTYPE_SHIFT (0) +#define NVME_SGL_SUBTYPE_MASK (0xF) +#define NVME_SGL_TYPE_SHIFT (4) +#define NVME_SGL_TYPE_MASK (0xF) + +#define NVME_SGL_TYPE(type, subtype) \ + ((subtype) << NVME_SGL_SUBTYPE_SHIFT | (type) << NVME_SGL_TYPE_SHIFT) + +enum nvme_sgl_type { + NVME_SGL_TYPE_DATA_BLOCK = 0x0, + NVME_SGL_TYPE_BIT_BUCKET = 0x1, + NVME_SGL_TYPE_SEGMENT = 0x2, + NVME_SGL_TYPE_LAST_SEGMENT = 0x3, + NVME_SGL_TYPE_KEYED_DATA_BLOCK = 0x4, + NVME_SGL_TYPE_TRANSPORT_DATA_BLOCK = 0x5, +}; + +enum nvme_sgl_subtype { + NVME_SGL_SUBTYPE_ADDRESS = 0x0, + NVME_SGL_SUBTYPE_OFFSET = 0x1, + NVME_SGL_SUBTYPE_TRANSPORT = 0xa, +}; + +struct nvme_sgl_descriptor { + uint64_t address; + uint32_t length; + uint8_t reserved[3]; + uint8_t type; +}; + +_Static_assert(sizeof(struct nvme_sgl_descriptor) == 16, "bad size for nvme_sgl_descriptor"); + struct nvme_command { /* dword 0 */ uint8_t opc; /* opcode */ @@ -690,11 +741,14 @@ struct nvme_command { /* dword 4-5 */ uint64_t mptr; /* metadata pointer */ - /* dword 6-7 */ - uint64_t prp1; /* prp entry 1 */ - - /* dword 8-9 */ - uint64_t prp2; /* prp entry 2 */ + /* dword 6-9 */ + union { + struct { + uint64_t prp1; /* prp entry 1 */ + uint64_t prp2; /* prp entry 2 */ + }; + struct nvme_sgl_descriptor sgl; + }; /* dword 10-15 */ uint32_t cdw10; /* command-specific */ From nobody Tue Aug 27 01:06:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WR0T6wz5TjNT; Tue, 27 Aug 2024 01:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WQ5zZlz4lXq; Tue, 27 Aug 2024 01:06:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ourddm0P6v8x53oOjZad8j7YceyPjIqS/uHFOlg5Zfk=; b=rUE+tAzUAGNy2iKzUzK0X5m3NFvGBXuhzYSGyqtFLW99+AdUg6+ILs+Y7a5HuKfHlcWOGR JXM3jzvqG04jMBGKVVNQ/yiGw/8nPsfHa7vAXDoZv+cIb27w6YIMTKnB5U8ZsX0Hggp+un Si7F+HbOGwrlcAlIgxtgs6mGZpHAfn+u+V/7FLnEe3L5MjNrYNXLqAL0WPiFN/fSK68Orc JYhmoyaPM+7EEL/v2aXG3+Y3bfZZYD179jqmDkedhBlkPCkA42Pbs3TI1RwgUDwsp/rRRR r+5oN7ItUx4ww6xH6ZucmrvoSEIzfySE2Rieqj8CWIX8vjQ1+kPwanuiQFmJ3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720786; a=rsa-sha256; cv=none; b=YkeOl5bOaDob6H64qE4Gr8DwOB7PYDyHQs3ImouA+xl5CKJ7bBN4f9c7s+thMvw8YKsboF PX4AZx/GwQ4w3ScKmBPCEPVqkjRsRr4Mokov+h5iokGAA2r98Zevjrtr2JD1FGU03UwjMY IcOo9EuScQdNNMGHI9ioeqouk49KVvC/sbhe/Z+EaOWJ2VmDoddvAiJ7lz4DzYPPgUQ+af +q6f+Mk0aPySxLWNGkWeHw9bDMMQp0C/oW680650QekIP+nOJfHxrzEPHN0VfsXLIx9yx2 O4WT+q6X2NxJWWLKgDW2BcA4YN38gLJyjI9Gnn6BHm3xQuqiis1AUg2fbC0Ddw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ourddm0P6v8x53oOjZad8j7YceyPjIqS/uHFOlg5Zfk=; b=tGgpcs68OUP2pMbfoV5SUpHMl/g/nQZ24TpaKjXWKhNt3wR1MPC0Sbru4+JHwtF6v/TrEj dYNPekL1GtvAYBTk8sZYpB+Qi0TuLqK+ps+rMt8aS5hC3u2cu2NNHJU7C9qnPXDuDSUvPE aXkO3nIlZ846xgEPvc0u7B+QZmCKHhH9mXu3/gfbGi7Ymv4m81AdkA1hPEiOImPuHhzCBb CYb3mUkwbNxvKknQUsBMHDaw9JrA0gjdYLX6pn9VCB4S3YIeoMIWiq/VdERYKzNITJtgqf 4wE3r8N9wv9vI6K+H7UUny/ZrLsXZIIhT5qVGG/uNTv7nINxIae+G8AllkTOsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WQ4hBVzTfd; Tue, 27 Aug 2024 01:06: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 47R16Qib056483; Tue, 27 Aug 2024 01:06:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Q1t056480; Tue, 27 Aug 2024 01:06:26 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:26 GMT Message-Id: <202408270106.47R16Q1t056480@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: da548abbc35c - stable/14 - nvme: Add constants for the PSDT field in cdw0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: da548abbc35c86d4f504c5392ce79ec1c67bd432 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=da548abbc35c86d4f504c5392ce79ec1c67bd432 commit da548abbc35c86d4f504c5392ce79ec1c67bd432 Author: John Baldwin AuthorDate: 2024-03-23 00:23:24 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:36 +0000 nvme: Add constants for the PSDT field in cdw0 This is not used in nvme(4) but is used in NVMe over Fabrics transports which use SGLs to describe buffers instead of PRPs. While here, adjust the shift value for the FUSE field to be relative to the 'fuse' member of 'struct nvme_command'. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44443 (cherry picked from commit b8cb8dd3625d7396ea98152d89e1e64b16e77bc6) --- sys/dev/nvme/nvme.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index f00090731dff..04eec1ff0917 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -211,9 +211,18 @@ /* Command field definitions */ -#define NVME_CMD_FUSE_SHIFT (8) +#define NVME_CMD_FUSE_SHIFT (0) #define NVME_CMD_FUSE_MASK (0x3) +enum nvme_psdt { + NVME_PSDT_PRP = 0x0, + NVME_PSDT_SGL = 0x1, + NVME_PSDT_SGL_MPTR = 0x2 +}; +#define NVME_CMD_PSDT_SHIFT (6) +#define NVME_CMD_PSDT_MASK (0x3) + + #define NVME_STATUS_P_SHIFT (0) #define NVME_STATUS_P_MASK (0x1) #define NVME_STATUS_SC_SHIFT (1) From nobody Tue Aug 27 01:06:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WS0vxMz5ThsX; Tue, 27 Aug 2024 01:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WR6cy4z4lbD; Tue, 27 Aug 2024 01:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVUo2CACrmF+ah+32QCEsRTJHEotcNozZBcZqCZfQh4=; b=YM1AK+ncM8plcfwyAcutLPvEn8XJ99TmU9hTdb6iFAsnm4FTGwrDnJutuKV73JyxUfn/sr xKeLGGzPfKDEAm9fluK7BOtZ//ZuV+RprReOih+LRPINQAZj/l9Gn3yi6TKvr140hS5tV0 loDFmQLk03PEJsmT8iqRfS5NijKGcQMxPE10GvPQvW6XQBZ3tk9PKE+DwB0v4wmpQ/oEnW wXe5YIx8mznjK0H3NzCx7KN1DeJfRoRJyvAobE1SbugRzVflO/ywU9KOHehfLvdfGi4tjE yW7wXb27XE2LUbQa1EYdjZ6N5KuHYbLXlQEM9l9lBMzEI45FWusWt2tZWeDFew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720787; a=rsa-sha256; cv=none; b=sjoNg2nc0Fqi+eZyV6Ja2LVtQAt0DM8utvrOZUKFe19A1zzh2Oi41jsvT+4uLkqCTiCSZB lGPXcJmBrHxZgmKIJPy2bIJRWq0Uc9aDzGY1E2xYGzyAD82gLv37vOaC3Lh9W6i+fwWozQ WmR6ovXCRZaW+yuTdK8hcKl7FWG7YSqLQ01FQicIJd3n01CcnvbsC2iC2iNyoZCDbF6YUg yEOp9jtnGd6HxsPx6c4LOL4837CDHFT+Vbx+dy+wm6yrTQwJgLza07ER1UVA/QyRGv6dMo nwjMSvvTiXlzqsy1D3a3g0EMhRoo2iMtF828/x2jUnqkTxhMiJPL4u8PaKIHyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVUo2CACrmF+ah+32QCEsRTJHEotcNozZBcZqCZfQh4=; b=k9zxbqz+iGmqYqP4/E/AzAO5PPOlBGjnBO4cLaqZIlJrl2TIKuzxK9qtznB/ht4i9Dwu3/ r4KxmiFJoo5hYMSa3raspv6QwHR0zPVB46E4sMuZmDGPItvMg3Al7kNL+hWC2rrg9hBd9v o/BqRadYocZJYsnGbJwGcOgb5UKoy/JUPeQdygevjrYpzkNr2qoe8swc50gNam+QF+igQS IMwcVWOOw+WiJ+mDxQzuAOoP3fSLG1lBubKbDNCXzMuBsTVCv04rcR5ejRFrR4XZpEQBVQ n2jCRyp/jU6j4K8yso7nd0N9oz4xgadX4rmeNeX3r/LrgV+hmm8hfbuRqHo6pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WR5fQJzV3m; Tue, 27 Aug 2024 01:06: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 47R16RTd056550; Tue, 27 Aug 2024 01:06:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16RlT056547; Tue, 27 Aug 2024 01:06:27 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:27 GMT Message-Id: <202408270106.47R16RlT056547@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: ae2a9307b5ea - stable/14 - nvme: Add constants for the extended data for Get Log Page command flag List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ae2a9307b5ea306cb4316f35c9c4d1d9105b56f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ae2a9307b5ea306cb4316f35c9c4d1d9105b56f8 commit ae2a9307b5ea306cb4316f35c9c4d1d9105b56f8 Author: John Baldwin AuthorDate: 2024-03-23 00:23:46 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:42 +0000 nvme: Add constants for the extended data for Get Log Page command flag nvme(4) doesn't check this flag, but Fabrics implementations may need to set this flag in the log page attributes cdata field. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44444 (cherry picked from commit cbda1886ab1cd3ec2847b7da5136d3bb68d56101) --- sys/dev/nvme/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 04eec1ff0917..70d293cf278e 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -358,6 +358,9 @@ enum nvme_psdt { /* per namespace smart/health log page */ #define NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT (0) #define NVME_CTRLR_DATA_LPA_NS_SMART_MASK (0x1) +/* extended data for Get Log Page command */ +#define NVME_CTRLR_DATA_LPA_EXT_DATA_SHIFT (2) +#define NVME_CTRLR_DATA_LPA_EXT_DATA_MASK (0x1) /** AVSCC - admin vendor specific command configuration */ /* admin vendor specific commands use spec format */ From nobody Tue Aug 27 01:06:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WT1tPlz5TjLD; Tue, 27 Aug 2024 01:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WT0QPmz4lSb; Tue, 27 Aug 2024 01:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzsEaML/NTkpEDiR/taIqdnPctgtLDK0DMYmruSl1bk=; b=qo1Lf39tn379kR8UW6mKDwo0btUyegLjQy1J6uX3uDta3ogU9yXsxixYKEn45TxEdfeWDH AxJx+wnW4CeFY+RsqIJ1R7CjvyEIJWc4IhdodaR+V8AbEKedyxLnHVDxztfFp3T6tH3Ej5 RzwOWSQlCpBL7Npofo4vHUMhrmlMLQxEfrV4Zx8mja8dCjZIlw0MOOASHgwCmrzDFx4k8D +o9do9y0qfSMGnhs0I0QutZ3iAhu3Gul5Xc+tZItvEvXGE+sn9buckt2eu2lp/2guKRakM 7tO/Ei9GbYIoQuvYoaTJvsRFjmAa7fPRv+Mlqf6KVa2sARs/gnXJNfTsGVjv0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720789; a=rsa-sha256; cv=none; b=BytW5zgRy4fabCOsQriMYpP4sHaEILn+F8Lnzjr6E+K/5iwailLkDuqJt2AUSaN+GXeVXQ BoIL0TuwWH20DNQTs05zdpXnW7gPq+pm4tSFREfY9Ltju/ywT3/suvV+RA9mz+mClDbhmX hzixB9leD++lwE+NqGL1i/CSAABkLl5YQ+/jTMc8IJUgKBTPNHCH5OSqZzeDq+ZwgO3X+x 8HzvKU4kscSl1qV1iEp7cfzMnWJZ1KxfphH2E54Zsi6jzUwdw+/3m45tjsrF2yJbh6heHS P2WWHfEdH9IwW9x5bzOOzyoKVxi5Rihes1O2cBHg2Xh2Dl6w0A19LYPQ35ucOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzsEaML/NTkpEDiR/taIqdnPctgtLDK0DMYmruSl1bk=; b=P8sUyofEMwixKMwUtQxcnQF52A98voT9CAA9b+/WTA+c4RuF13MPYJxyAIXeMjZJxfmZ0m wfI3nNdhIml4NZ3yAQfN1ClMzPXPNQxvIILKyHvOn2gqBOiUFfGk8cfPBDffzbwj55VRK2 MgnoGU5Jx2TUtvygLNML+DkAFjuJD3bBNXj7zG8oMchzLTpMLRB1HMgyFdmoZVS4rh1GTQ 0sIcDxhRwkg8TxaYt1B2HWxJ8UV7J2y5/PHklnl/L3NCpQsWF4X3mLNk6Ae5V8kTekkDc0 98cw0Cu4ncjLSBp/spMIXN1m9mAvKss4jxwyiNdxQFfCJxSqOd8xUY1uxgV3QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WS6byKzTff; Tue, 27 Aug 2024 01:06: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 47R16SBm056609; Tue, 27 Aug 2024 01:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16SnF056606; Tue, 27 Aug 2024 01:06:28 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:28 GMT Message-Id: <202408270106.47R16SnF056606@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: 41f61bf23024 - stable/14 - nvme: Add constants for fields in AER completion dword 0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 41f61bf230243361b8375ce19d45eb01f139014d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=41f61bf230243361b8375ce19d45eb01f139014d commit 41f61bf230243361b8375ce19d45eb01f139014d Author: John Baldwin AuthorDate: 2024-03-23 00:24:06 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:48 +0000 nvme: Add constants for fields in AER completion dword 0 Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44445 (cherry picked from commit b354bb04cb51f373e997cb8911c32dc93243c1d7) --- sys/dev/nvme/nvme.h | 8 ++++++++ sys/dev/nvme/nvme_ctrlr.c | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 70d293cf278e..b738ab902f89 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -642,6 +642,14 @@ enum nvme_critical_warning_state { #define NVME_FEAT_SET_FID_SHIFT (0) #define NVME_FEAT_SET_FID_MASK (0xff) +/* Async Events */ +#define NVME_ASYNC_EVENT_TYPE_SHIFT (0) +#define NVME_ASYNC_EVENT_TYPE_MASK (0x7) +#define NVME_ASYNC_EVENT_INFO_SHIFT (8) +#define NVME_ASYNC_EVENT_INFO_MASK (0xff) +#define NVME_ASYNC_EVENT_LOG_PAGE_ID_SHIFT (16) +#define NVME_ASYNC_EVENT_LOG_PAGE_ID_MASK (0xff) + /* Helper macro to combine *_MASK and *_SHIFT defines */ #define NVMEM(name) (name##_MASK << name##_SHIFT) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 0004895d6691..52e412c5202a 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -794,10 +794,11 @@ nvme_ctrlr_async_event_cb(void *arg, const struct nvme_completion *cpl) } /* Associated log page is in bits 23:16 of completion entry dw0. */ - aer->log_page_id = (cpl->cdw0 & 0xFF0000) >> 16; + aer->log_page_id = NVMEV(NVME_ASYNC_EVENT_LOG_PAGE_ID, cpl->cdw0); nvme_printf(aer->ctrlr, "async event occurred (type 0x%x, info 0x%02x," - " page 0x%02x)\n", (cpl->cdw0 & 0x07), (cpl->cdw0 & 0xFF00) >> 8, + " page 0x%02x)\n", NVMEV(NVME_ASYNC_EVENT_TYPE, cpl->cdw0), + NVMEV(NVME_ASYNC_EVENT_INFO, cpl->cdw0), aer->log_page_id); if (is_log_page_id_valid(aer->log_page_id)) { From nobody Tue Aug 27 01:06:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WW5bWGz5TjDb; Tue, 27 Aug 2024 01:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WW2jJCz4lc4; Tue, 27 Aug 2024 01:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xhwenZKquX5tXzQ9Xj/v6HytizOhea0sZPPFo2cYT7U=; b=vvMb7lP1u8a1kaRUXXm+2/Ds/Kdtom38nj8btwLRfOTcFQsYEnFGTsLQjwqsUFAjw5r/oq 1FEV0+NOaaiI+U8TzmXwji+HqPtHIjeGztlkc11fPhfR4bM+uMgF+qcipw2inKZUp1nT/C oXfiWIhuD/3JBSPBG+X4EMX/NEXOiSITaOw6+hdGen2T5KAW1YDpMuZv+VyzQtUNSNoCzR spAuxXkRVURcpVahsS0db04K66Y0uC8MCv7bR+oUvCPlD3HdnWrsuT4gIPLodn8P4AWi1H Ju00BQ7uXqGMeLsHBZjClXf3znrshw8RhhplVGMXNLfqOkrfPN9RD7ji5hdi3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720791; a=rsa-sha256; cv=none; b=FemmljynCi+K5uxNPCtYcxJJ91gbTj2gU/VJ7IizqV4m4ZjePJ90EYgAEWrcRrWWR90JBL fv2k+mkRAmphKyjc0ax2OvWHA9Mnwf6XRLCtzxuuVGnaqhAzV6gcAJ+zXPGQCXAFdjKtzB CAfpM65yPSh9q6gcib06K7hdDy4c1lW9psp7FyiHNr6Ezpl9Gzs1HZuZCCqA71iau+7DUy LjKtwS/hZL4dcwK/2ltsW5N0ytjZo9CB+oruLkomCCA+VWezABeyF3qw/2QYLysmYrlX2J nptjVcnjHYVHk+LRhtgIpjImxiuXSdvcnFUgPrIhzzCy38WxWVJ7Ze9tMaxXaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xhwenZKquX5tXzQ9Xj/v6HytizOhea0sZPPFo2cYT7U=; b=KgUSZgj9QInL8oGA7Pijmr43GzB4taK6Zs4QrtFBG5NZlLwMSz5QAQej0Dg1u2AUUtccDJ jnmtdJTxiyS2TY7sdKhrTjms/NcbknP7lOCj1bC+woBIUY9w56AJsVexREoCNuJW3dzBsi CvuTB9T9SYYbWTKR0+JzGpmddCuFd4x1hjv0mm7o/FgFMe7IRzn72UyAGGKTcMO/zicd92 7J1RmZzuQoTxAvKAolh9mCSTt70hJ26QflZbRztipsEQ8Rz7/WiXL4ER1GRedUcNaX3WLt 221x7P+a2Xj4bzwI8csx6glwCw7WHirCDP1VxVtpZt8/ZeN2OnVNmPkq18QSAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WW1q14zT9T; Tue, 27 Aug 2024 01:06: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 47R16VHE056727; Tue, 27 Aug 2024 01:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Vd9056724; Tue, 27 Aug 2024 01:06:31 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:31 GMT Message-Id: <202408270106.47R16Vd9056724@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: 9541862de74e - stable/14 - nvme: Add constants for the Controller Attributes field in cdata List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9541862de74e437e01a2e0f3b978f6fb5f0568d4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9541862de74e437e01a2e0f3b978f6fb5f0568d4 commit 9541862de74e437e01a2e0f3b978f6fb5f0568d4 Author: John Baldwin AuthorDate: 2024-03-23 00:24:31 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:59 +0000 nvme: Add constants for the Controller Attributes field in cdata Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44447 (cherry picked from commit 7fa8adb8c5cd46979b76770794ac1b6584e8baa7) --- sys/dev/nvme/nvme.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 3bbb1c326efd..6317c65ec9cd 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -311,6 +311,38 @@ enum nvme_psdt { #define NVME_CTRLR_DATA_OAES_LOG_PAGE_CHANGE_SHIFT (31) #define NVME_CTRLR_DATA_OAES_LOG_PAGE_CHANGE_MASK (0x1) +/** CTRATT - Controller Attributes */ +/* supports 128-bit Host Identifier */ +#define NVME_CTRLR_DATA_CTRATT_128BIT_HOSTID_SHIFT (0) +#define NVME_CTRLR_DATA_CTRATT_128BIT_HOSTID_MASK (0x1) +/* supports Non-Operational Power State Permissive Mode */ +#define NVME_CTRLR_DATA_CTRATT_NONOP_POWER_STATE_SHIFT (1) +#define NVME_CTRLR_DATA_CTRATT_NONOP_POWER_STATE_MASK (0x1) +/* supports NVM Sets */ +#define NVME_CTRLR_DATA_CTRATT_NVM_SETS_SHIFT (2) +#define NVME_CTRLR_DATA_CTRATT_NVM_SETS_MASK (0x1) +/* supports Read Recovery Levels */ +#define NVME_CTRLR_DATA_CTRATT_READ_RECOVERY_LVLS_SHIFT (3) +#define NVME_CTRLR_DATA_CTRATT_READ_RECOVERY_LVLS_MASK (0x1) +/* supports Endurance Groups */ +#define NVME_CTRLR_DATA_CTRATT_ENDURANCE_GROUPS_SHIFT (4) +#define NVME_CTRLR_DATA_CTRATT_ENDURANCE_GROUPS_MASK (0x1) +/* supports Predictable Latency Mode */ +#define NVME_CTRLR_DATA_CTRATT_PREDICTABLE_LATENCY_SHIFT (5) +#define NVME_CTRLR_DATA_CTRATT_PREDICTABLE_LATENCY_MASK (0x1) +/* supports Traffic Based Keep Alive Support */ +#define NVME_CTRLR_DATA_CTRATT_TBKAS_SHIFT (6) +#define NVME_CTRLR_DATA_CTRATT_TBKAS_MASK (0x1) +/* supports Namespace Granularity */ +#define NVME_CTRLR_DATA_CTRATT_NAMESPACE_GRANULARITY_SHIFT (7) +#define NVME_CTRLR_DATA_CTRATT_NAMESPACE_GRANULARITY_MASK (0x1) +/* supports SQ Associations */ +#define NVME_CTRLR_DATA_CTRATT_SQ_ASSOCIATIONS_SHIFT (8) +#define NVME_CTRLR_DATA_CTRATT_SQ_ASSOCIATIONS_MASK (0x1) +/* supports UUID List */ +#define NVME_CTRLR_DATA_CTRATT_UUID_LIST_SHIFT (9) +#define NVME_CTRLR_DATA_CTRATT_UUID_LIST_MASK (0x1) + /** OACS - optional admin command support */ /* supports security send/receive commands */ #define NVME_CTRLR_DATA_OACS_SECURITY_SHIFT (0) From nobody Tue Aug 27 01:06:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WV4WDhz5TjQt; Tue, 27 Aug 2024 01:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WV1NfDz4lSq; Tue, 27 Aug 2024 01:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c4CwoUaXihNKWnfBf+hSqNRQ3vAWdwJTxopvDGs5eGA=; b=VzvDuZMbVz4YtCpw9v351k2nLZvUgCwZIe3h2qhDkHFO2bH1HFkImtvejvsUgGee3t1FII c6fmt/BA4lTIvUvUkD6kofv/bphO+7SAWv63Or0LpcX7yU1kytjfxYuS8+JHfX/rzLQjkV k1/1daR/rUh7oa9xDHebv97/ezRCCNnXZJEU8PPbFNoYdRDdDXxCTXTuFu+Hpd6oO+1OYh 9dFjxc0kER8NoftiziapORMkkXBR0Zq8kx4dWXCHlFflqAVD7F2YX9tdHhY5Hi6ri4Nbn0 WhgDGSVA+/clh9rmzb+KbelasSBPLpXgJ4pO9Speh+nYF5UZpSq2Ym9oY+b48A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720790; a=rsa-sha256; cv=none; b=f6LfXG6d+Dh4YkHtZ3+UMu3RU8xW7GITCvJ1qvSqNV3I4AZFmfjRf5hkhrF4DCKGnzKrNO tLAPzahaHTpUvfmptKgWp7qLqaCQkDdjF9YXv+KL4ItdxjMWbQXhqSeBEDE2W3QUECDzY3 kEK6bDMFd8cft72CxQYLvnr97nSu7/iYavXzRRKdGOvK7jdzrfymDp4fZa2vMCLPs96J4H UyevdViFrFchltmLdt6r5OiaGb7S5imPDeXkDwBHl80Ntxg0/2M3HYC8zXTkWdyDxAlinS uu43sdZH/0DhZ34GOpaRj2sd0tb5rEtN0E5qyugNCHF7SDMTTfl5/INxfyVSGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c4CwoUaXihNKWnfBf+hSqNRQ3vAWdwJTxopvDGs5eGA=; b=xcaB1p81hJ5JHGbIBHTHzCBWtjvsthGG+wKmdf/91n1ohx33EEaNCRYB+pEFclUyVFaStN oJRo2KlT97UjjLBbHb60RBcmcfchTiunqWdnAj4y+SM2uAkgFRcMyfRW8CXl4W8vDxQa66 ocQLKa5Oc1PW6ISGWDE7j6a9WCqcDIhKC4528Vq04xzI6kxUOsCg+M8LMBAJVhAU0g1qFP 3d9p5lFWIirjRAkIctr45Y8m67rmqrTf7AvrYiSirkJcg+OmIx3eRmKrkpCUypwNoRCVVe R7vOjknOcRoNXAImJVUwXkI+0yKgz5+HzewBgirGsm12Dxu8Idz+OqaX+qSJcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WV0f3QzTjZ; Tue, 27 Aug 2024 01:06: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 47R16Tht056670; Tue, 27 Aug 2024 01:06:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16T11056667; Tue, 27 Aug 2024 01:06:29 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:29 GMT Message-Id: <202408270106.47R16T11056667@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: 759864ad7ad6 - stable/14 - nvme: Add constants and types for the discovery log page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 759864ad7ad6f7ee949f496cc46ff906be9afcea Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=759864ad7ad6f7ee949f496cc46ff906be9afcea commit 759864ad7ad6f7ee949f496cc46ff906be9afcea Author: John Baldwin AuthorDate: 2024-03-23 00:24:18 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:53 +0000 nvme: Add constants and types for the discovery log page This is used in NVMe over Fabrics to enumerate a list of available controllers. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44446 (cherry picked from commit 88ecf154c7c5a2e413a81ae1b0511b0295265b99) --- sys/dev/nvme/nvme.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index b738ab902f89..3bbb1c326efd 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1458,6 +1458,7 @@ enum nvme_log_page { NVME_LOG_PERSISTENT_EVENT_LOG = 0x0d, NVME_LOG_LBA_STATUS_INFORMATION = 0x0e, NVME_LOG_ENDURANCE_GROUP_EVENT_AGGREGATE = 0x0f, + NVME_LOG_DISCOVERY = 0x70, /* 0x06-0x7F - reserved */ /* 0x80-0xBF - I/O command set specific */ NVME_LOG_RES_NOTIFICATION = 0x80, @@ -1590,6 +1591,48 @@ struct nvme_device_self_test_page { _Static_assert(sizeof(struct nvme_device_self_test_page) == 564, "bad size for nvme_device_self_test_page"); +struct nvme_discovery_log_entry { + uint8_t trtype; + uint8_t adrfam; + uint8_t subtype; + uint8_t treq; + uint16_t portid; + uint16_t cntlid; + uint16_t aqsz; + uint8_t reserved1[22]; + uint8_t trsvcid[32]; + uint8_t reserved2[192]; + uint8_t subnqn[256]; + uint8_t traddr[256]; + union { + struct { + uint8_t rdma_qptype; + uint8_t rdma_prtype; + uint8_t rdma_cms; + uint8_t reserved[5]; + uint16_t rdma_pkey; + } rdma; + struct { + uint8_t sectype; + } tcp; + uint8_t reserved[256]; + } tsas; +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_discovery_log_entry) == 1024, + "bad size for nvme_discovery_log_entry"); + +struct nvme_discovery_log { + uint64_t genctr; + uint64_t numrec; + uint16_t recfmt; + uint8_t reserved[1006]; + struct nvme_discovery_log_entry entries[]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_discovery_log) == 1024, + "bad size for nvme_discovery_log"); + struct nvme_res_notification_page { uint64_t log_page_count; uint8_t log_page_type; @@ -2214,4 +2257,27 @@ nvme_device_self_test_swapbytes(struct nvme_device_self_test_page *s __unused) } #endif } + +static inline void +nvme_discovery_log_entry_swapbytes(struct nvme_discovery_log_entry *s __unused) +{ +#if _BYTE_ORDER != _LITTLE_ENDIAN + s->portid = le16toh(s->portid); + s->cntlid = le16toh(s->cntlid); + s->aqsz = le16toh(s->aqsz); + if (s->trtype == 0x01 /* RDMA */) { + s->tsas.rdma.rdma_pkey = le16toh(s->tsas.rdma.rdma_pkey); + } +#endif +} + +static inline void +nvme_discovery_log_swapbytes(struct nvme_discovery_log *s __unused) +{ +#if _BYTE_ORDER != _LITTLE_ENDIAN + s->genctr = le64toh(s->genctr); + s->numrec = le64toh(s->numrec); + s->recfmt = le16toh(s->recfmt); +#endif +} #endif /* __NVME_H__ */ From nobody Tue Aug 27 01:06:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WX62kWz5TjGv; Tue, 27 Aug 2024 01:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WX487lz4lWd; Tue, 27 Aug 2024 01:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Pa08BDywduvMqANJsOShy90z0pfUHGcLNaX+D3CNkU=; b=fpYGoSHGNZ2rFY+/5wNU4hUQw6feSzaqpXtukLVizgtjS5aXvPOovjFs/Z3wkZxuJFNCUB ta8/MR3eT4BIfOuBUdcETy7xCEoisq1N6zrJ1MeqbKvasK3T2fxQF7eiDhKdMjFm1voes2 cNHXTmET4h/uI+Z3DYRDBXZGuz4BAPUX4WSVq0oim3zGKkHXenbJB4AkZX1U9ajEqoVh7K UUbze1dhbxIcwu4x22BXhkAJpuAZ1gJXdvrNPey/6cJH2pP1NAC8wTpw8XwGZkUHA27flr 1uRJpEPDcFhwpi/4MmelNvz5kue4Mxwr10GM+SBSLJsNBvoCVVcEs2q2NLRZdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720792; a=rsa-sha256; cv=none; b=qEzTTfskeht0FPhohaQ7oDUEdJ42iJMcsRkwUXx9Gte5zmACqb/pWFvxbZsSbMV4/QVExn 2ebwU5zjPWDG2O2/EiEFGFyhQAxYWJMpx91hwZnDpGuPt1HQ8HChxFT4oQ/7teyFpOVkfC 9xqwpbX5yg1wgrifmuevKCcZ81YjJ9pCPivnLJzwvhN/Xfpk6n/rPd70UTfHjuaRcZrIHs E9KmV3YWe5JmDyfgtlos+klrReLytKrMH7mZOJPTUkuH3FYWw0hNCnDNyJFdOGaV6a30Ft YmBtPqnlv2KfBGB6PEoOLdsEhR0C2K3j6NL48PYzAMLD79005hq8J1b5Psrgrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Pa08BDywduvMqANJsOShy90z0pfUHGcLNaX+D3CNkU=; b=jpcy5l5qvIjaiULmrXrF5Bkn5P50hQ4ZiBTa1QsZRcrkuMTYLNjUZUUDOd+XBF1YBuNRaP 80pZofrtbsoHBFp78TyA3E3plDx+FlwdTiVIku4JZyhjyZa4nOoREX6CQD1r51YiLPRkda zU/I2iJ6/KrML8haDFI5Xp6bDxEk4JftKUsL/Gnwgc9YnNMEF5yaVRXYfOiJ02WYEBAbkj xHUHmZha9JTAh1/URBiKGptNNVlucWa5I4rIr8YOKE1Pgf3OlZpIujxNlX0HgPQg4CzUm1 XLH0sVM1iOWgw5Qp4vSEEJqlLtfrWn0XAxDS5o6t4OfvNWmFn5ggH9cv10kt2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WX2zS2zT9V; Tue, 27 Aug 2024 01:06: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 47R16Wjs056778; Tue, 27 Aug 2024 01:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16W0G056775; Tue, 27 Aug 2024 01:06:32 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:32 GMT Message-Id: <202408270106.47R16W0G056775@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: 46c77392cbfc - stable/14 - nvme: Add NVMe over Fabrics fields to nvme_controller_data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 46c77392cbfcccad947f6a7945431956f03acb6a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=46c77392cbfcccad947f6a7945431956f03acb6a commit 46c77392cbfcccad947f6a7945431956f03acb6a Author: John Baldwin AuthorDate: 2024-03-23 00:24:52 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:00 +0000 nvme: Add NVMe over Fabrics fields to nvme_controller_data Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44448 (cherry picked from commit 21d3a84db481e84cf240f6802b1a4110854eaec5) --- sys/dev/nvme/nvme.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 6317c65ec9cd..cceafc743519 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1349,7 +1349,13 @@ struct nvme_controller_data { uint8_t reserved8[768]; /* bytes 1792-2047: NVMe over Fabrics specification */ - uint8_t reserved9[256]; + uint32_t ioccsz; + uint32_t iorcsz; + uint16_t icdoff; + uint8_t fcatt; + uint8_t msdbd; + uint16_t ofcs; + uint8_t reserved9[242]; /* bytes 2048-3071: power state descriptors */ struct nvme_power_state power_state[32]; @@ -2066,6 +2072,10 @@ void nvme_controller_data_swapbytes(struct nvme_controller_data *s __unused) s->acwu = le16toh(s->acwu); s->sgls = le32toh(s->sgls); s->mnan = le32toh(s->mnan); + s->ioccsz = le32toh(s->ioccsz); + s->iorcsz = le32toh(s->iorcsz); + s->icdoff = le16toh(s->icdoff); + s->ofcs = le16toh(s->ofcs); for (i = 0; i < 32; i++) nvme_power_state_swapbytes(&s->power_state[i]); #endif From nobody Tue Aug 27 01:06:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WZ01csz5TjLL; Tue, 27 Aug 2024 01:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WY5TVPz4lQt; Tue, 27 Aug 2024 01:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBLaa2ri6t7JtYr9QFwPVzF91q7R4hFRqh35aKCmnos=; b=RfdkaMlGHPV47VFrIuZrMah4zivPVGU9Zyq1tUAh4weeZVeehEnsq7uPO8Mdlwf5Xzu5B+ qlnNZVwiiTNyE7FRZeuQPP8pZYMEr/vEPLcDJp+p/CyFDy4IFmubRZwVpNYkUaC69PmRgr 1oOuf21uMvcmxw9VRvvpzocb9uvobkN5BB10BSX/etzNHnHeqz6Qz3vlnC1wzogYOVt5t2 Sn+mh3+io4VcDVlXGwrWYLha7RmKigE/gkfJeINA8ndr3UqjL5F7EXaCGBFEjKKuO612+k Vfbt54JudzNIxJdJalKgixt8qxraqAu91hCaPorLmJlVejYk11VCPws/46vzqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720793; a=rsa-sha256; cv=none; b=wZknYmhBbF+maNGouk63liwWzN4K7dDFgHxhT8BAdt06yWKReu4E0xUtvaWTExBQ44c4wC M2j/igtwJRCuYQm/MDRATSqRmYaEKx7Yt+hOPVw0DAdYZCBvGgfmMqHd/tkoYrhAJtIHsX jzhPpCB5BY22UVznahtrZNzuX7U3UR1k3lNOwk2CK0Nz2doAwVaorJQocfWpBaHmr3BbE5 Q34LLnVoPLAQGmnxefBzHZYuC6/qFwH+w3n//PAYqvDBaTPJvy4MBcDgVZeTz9iD3BEYS4 EBzJ4beFqPmrcecR7z33wCDwtHc3J1nr1lP7lPsjKkBP56RFTJT4wNKWWkgm8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBLaa2ri6t7JtYr9QFwPVzF91q7R4hFRqh35aKCmnos=; b=t6YP5+F466+wQ5tVQ+b2WHaESYbqgeXYDao9yH+XajWpsVzOj/2nqezH/JNZrh4gVlCeeb l9ZZAlyuEOZRrV43rBlools0/ewhcy9OdcuFmikQpitPvsty70vfXxOtsbPG9BLLVctRuu vYK/zVp6DM0jcbsicPZzv69SD710IPkF7W2kX2U/wJFKi4rFspGHjHACIpq/l4V+cuDa3V AxBUg+zdePS2yeL/OjfOQqe430Gs2/Cd8KXk9Wk/FkI8j8qPena4yJbh1IG/47yjY6ASgC 5SPd6jB7oluCTul3TShl7QIiRPoVfpGM6mqSpQb5iulTNqBmH3r3k6x8RWaUZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WY3tdKzV3n; Tue, 27 Aug 2024 01:06: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 47R16XPl056826; Tue, 27 Aug 2024 01:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Xkh056823; Tue, 27 Aug 2024 01:06:33 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:33 GMT Message-Id: <202408270106.47R16Xkh056823@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: 7e771c225d9c - stable/14 - nvmecontrol: Display additional Fabrics-related fields for cdata List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e771c225d9c34e5d57faad99829c0bba41ee897 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7e771c225d9c34e5d57faad99829c0bba41ee897 commit 7e771c225d9c34e5d57faad99829c0bba41ee897 Author: John Baldwin AuthorDate: 2024-03-23 00:25:07 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Display additional Fabrics-related fields for cdata Some of these fields are specific to Fabrics controllers (such as the size of capsules) while other fields are shared with PCI-e controllers, but are more relevant for Fabrics controllers (such as KeepAlive timer properties). Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44449 (cherry picked from commit acbc176c3dfdfebd047507dc7d843f8cc10984a8) --- sbin/nvmecontrol/identify_ext.c | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/sbin/nvmecontrol/identify_ext.c b/sbin/nvmecontrol/identify_ext.c index cc30ba0d6349..1082433d697e 100644 --- a/sbin/nvmecontrol/identify_ext.c +++ b/sbin/nvmecontrol/identify_ext.c @@ -139,6 +139,36 @@ nvme_print_controller(struct nvme_controller_data *cdata) printf("Version: %d.%d.%d\n", (cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff, cdata->ver & 0xff); + printf("Traffic Based Keep Alive: %sSupported\n", + NVMEV(NVME_CTRLR_DATA_CTRATT_TBKAS, cdata->ctratt) ? "" : "Not "); + printf("Controller Type: "); + switch (cdata->cntrltype) { + case 0: + printf("Not Reported\n"); + break; + case 1: + printf("I/O Controller\n"); + break; + case 2: + printf("Discovery Controller\n"); + break; + case 3: + printf("Administrative Controller\n"); + break; + default: + printf("%d (Reserved)\n", cdata->cntrltype); + break; + } + printf("Keep Alive Timer "); + if (cdata->kas == 0) + printf("Not Supported\n"); + else + printf("%u ms granularity\n", cdata->kas * 100); + printf("Maximum Outstanding Commands "); + if (cdata->maxcmd == 0) + printf("Not Specified\n"); + else + printf("%u\n", cdata->maxcmd); printf("\n"); printf("Admin Command Set Attributes\n"); @@ -249,4 +279,25 @@ nvme_print_controller(struct nvme_controller_data *cdata) if (cdata->ver >= 0x010201) printf("\nNVM Subsystem Name: %.256s\n", cdata->subnqn); + + if (cdata->ioccsz != 0) { + printf("\n"); + printf("Fabrics Attributes\n"); + printf("==================\n"); + printf("I/O Command Capsule Size: %d bytes\n", + cdata->ioccsz * 16); + printf("I/O Response Capsule Size: %d bytes\n", + cdata->iorcsz * 16); + printf("In Capsule Data Offset: %d bytes\n", + cdata->icdoff * 16); + printf("Controller Model: %s\n", + (cdata->fcatt & 1) == 0 ? "Dynamic" : "Static"); + printf("Max SGL Descriptors: "); + if (cdata->msdbd == 0) + printf("Unlimited\n"); + else + printf("%d\n", cdata->msdbd); + printf("Disconnect of I/O Queues: %sSupported\n", + (cdata->ofcs & 1) == 1 ? "" : "Not "); + } } From nobody Tue Aug 27 01:06:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wb3Fk2z5TjJg; Tue, 27 Aug 2024 01:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WZ6FBYz4lw8; Tue, 27 Aug 2024 01:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVR9iMFqrGSUrLk9MdizwsYdeAbqQKaH1U/aNifSW+c=; b=oly5KLK2nQy2sj9Qjy3mCYIG3vQ03/wHsXGEOpXUPdMCduiq+VAOScz2TDfGkBXASsnZxS brMQDt3Hj78y5jNlm2T3tXJ+stgD5hek8yep7auSDb4gr+TXj+iTJoey/yBdHWHja2cApD 9fcr9aYUN/bnRGqAjEJGbB6pmQaqu0GBTmqyW6y6Z6x3aHU5Uxqi5Dv4/+WX8KAtIBzNka 2KqHBVET9Rkw60pBJBpJZBUyw2rWbg3ShugMcXfRUx7Tf4fGb/pK7TjVGOoj91IV7AZfFD FM9sxlwGgBbi/qGeDB+eTcfCoKGhdA1D9m9LkFivCSIK13F9S3VgK1m/QQNt7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720794; a=rsa-sha256; cv=none; b=VCa2TVaT/2GqixC3zr9yHLInLX7LP+ghXs/EmEvDWW8DP46eMkAzjHsNvZeIjPiSENl69+ yk2Vfvd1zW5L5ICnQXKVan2w3UttnBEfEzOlHVb7UuO91h7wl+lE00MX0ZXoa4x+Q77d38 IClD+DOAfpYTxpURmxbB4V9CHnFeu07sASV1QxWsT/1Gwz8nFCJZLchlQbPqqh1POm3JKY 2jzdoduWvwZRz2cIM5gUplEBS9zhhYU8wCt/jvFANUAXpATQ2VzHICm7ROt5bcUDCcmJ9A rEU+JolCW5P978TGZ6fwfpoz5D03notfhrMh+dGlUKjCZmSQSrWCsI6Ay0VVgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVR9iMFqrGSUrLk9MdizwsYdeAbqQKaH1U/aNifSW+c=; b=S5Q18q+kDA2X9V/BCf7Wph9yXDEGdl1M/XaQm3HhcL5R1k4bpBus298Cwo35ijxtcdW9lb It+FqmBDCxfZ4k0Ju+YtPnAKB7fKkdfZHypVi/JAGEUKuPmhdw/wJUfIZ66HWMnZXVkAz7 r29t72QPdZ/+6UuPX+haMhCMQ3k+3frtJFQbNp30dveAqXI6RWo3yTuUHRePGpriZkm3sI MEtDeNCP1OWWNO4DQDXa8uwH6h4TMGuG9zLwCLvcjDZuiCpr4NddROoe9f73Up8l7IQZqy /m/lO64upoPMmGVM043NDVmnL5XqbQb/V4iZZOjI2xpWg5WrAtqhnxmFCmJt9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WZ50jtzTjb; Tue, 27 Aug 2024 01:06: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 47R16Yhj056873; Tue, 27 Aug 2024 01:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16YkK056870; Tue, 27 Aug 2024 01:06:34 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:34 GMT Message-Id: <202408270106.47R16YkK056870@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: 4837e07cd2af - stable/14 - nvme: Add my copyright to logpage.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4837e07cd2af5d2698ed1fdb25ab7f3ece566917 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4837e07cd2af5d2698ed1fdb25ab7f3ece566917 commit 4837e07cd2af5d2698ed1fdb25ab7f3ece566917 Author: Warner Losh AuthorDate: 2024-04-03 18:10:08 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvme: Add my copyright to logpage.c Reflect the command line refactoring I did, and other changes. git blame says I'm to blame for ~1/4 of this file. Sponsored by: Netflix (cherry picked from commit fe83abacd4d097342cabef94b3128cd12c5fdccb) --- sbin/nvmecontrol/logpage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 8c03aa6fb7f4..6bdf83abefea 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -6,6 +6,7 @@ * * Copyright (C) 2012-2013 Intel Corporation * All rights reserved. + * Copyright (C) 2016-2023 Warner Losh * Copyright (C) 2018-2019 Alexander Motin * * Redistribution and use in source and binary forms, with or without From nobody Tue Aug 27 01:06:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wc3lYKz5TjHC; Tue, 27 Aug 2024 01:06:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wb6qv4z4lgT; Tue, 27 Aug 2024 01:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDwXvOgRHPVKjvPw0UVhFXlzdfNFXJE8RuyNc/6WmVE=; b=m3Vu5av7639xD7qiZ0oTOUZB0TyES/+UIZZ0lBuPM/+n1uxiC7TwuoFhUvgYgCkdFDVUqT Q6LIA+PPwWkSWhqyZkfkr9yCkOiMNuGfbLrjdJiSkaRZ/oKvfY0xM+ck2cvBempEQRTzuH 4qv7E9jOgXDyMuuOqsr50yQ0dxJ4ezVIBzf1vdGx4RqcBe/S6rTv8r7mFn/wEc9udQFLYz 5ZuhbgabypYVmdoSrh2NDHeeZASSKXC/sbavmAzJJSO0j7WO7/1PhnTZov09pDwIVQa61w TMwgVy6i0T1G8PXjBojQ+ck/q3ydvXksFYS4It0OBmXy0NkfbtuUhH010+hEnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720796; a=rsa-sha256; cv=none; b=ms5zMP02j6J3zKCNzxgkLiNo3tLlssDYMNffdAxsKI00yCmOfiNhwD1dGAZ7bgup/lSW24 uX2mv1slNX7mVlTtGutmp4XXl2kjsxx2Ya/J6FQaSNTtXvP/B4wS4VldAa8czxVeCEzS6Z JSSxtlHP7DhTnrD6HUMBi3gx/LxD40lRFUBWcfwMtRA1BFJIXJ4utKwGlK/o2BZT2ttpUM DGHnju5gZjLtNCndXK9tlVh/i4odZCTj/FHwHZyMaM5+X8TzxrNLXv21MwtqAFQ91Qz7JR pIkz1Ys/ULIFAgUsZFIZbXQ+ybzYkLmM0zUUOLcfjQftKSE60FpZfhNvueJ35A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDwXvOgRHPVKjvPw0UVhFXlzdfNFXJE8RuyNc/6WmVE=; b=TTOig3pTJmHlHz81BVTBCWgcZ+sfNm9wCEv8igr3eswCYBwHS5M1plssQpvM9RbfQjazYE 2iQAgxMerJXJUnxcV/FsS9KQhSNwmYTZTG2O0A2PrgaVhCNCRE62KKE99dE/b/UPcpGqfF 4OUlAPgf6/jJllVr+o5yLWgUYYa0kZY+8yKFPgm0+mDsgyla8qqX/rjFy6x6A/KRjMmf37 /ifsjUEnbNKAqkrDx1Zu/SV7TxWIokbiS/xMb9rlSsNVu62INi/BAUvWacenjXs18NMZhG 4Qf9LfThKZigA2BnkALDj7p5RDGG3Tcs2uAzJJvtO2vYrJu2CtdrocJP4rvOoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wb6R0mzTdx; Tue, 27 Aug 2024 01:06: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 47R16ZQa056930; Tue, 27 Aug 2024 01:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Z3P056927; Tue, 27 Aug 2024 01:06:35 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:35 GMT Message-Id: <202408270106.47R16Z3P056927@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: 05fe0588432a - stable/14 - nvmecontrol: Create letoh to generically convert to host order List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 05fe0588432aaf74077bc23b0db29889b49a3e40 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=05fe0588432aaf74077bc23b0db29889b49a3e40 commit 05fe0588432aaf74077bc23b0db29889b49a3e40 Author: Warner Losh AuthorDate: 2024-04-16 22:35:33 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Create letoh to generically convert to host order Using _Generic, create letoh which will generically convert uintXX_t types from little endian to host, regardless of the size. This name has been floated as a possible addition to endian.h. Sponsored by: Netflix Discussed with: jhb Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44649 (cherry picked from commit 67163bc485a56d960b72fb26f19685682b92dd6b) --- sbin/nvmecontrol/nvmecontrol.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index ce717e5732c3..a098da4c9c45 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -60,6 +60,17 @@ struct kv_name { const char *name; }; +/* + * Generically convert little endian to host endian, based on the type of the thing + * being converted. Use the proposed name for future changes to endian.h. + */ +#define letoh(x) \ + _Generic(x, \ + uint8_t: (x), \ + uint16_t: le16toh(x), \ + uint32_t: le32toh(x), \ + uint64_t: le64toh(x)) + const char *kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key); void logpage_register(struct logpage_function *p); From nobody Tue Aug 27 01:06:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wd3zrhz5Thsj; Tue, 27 Aug 2024 01:06:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wd1Cv1z4lnG; Tue, 27 Aug 2024 01:06:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1xfbSZAQI84PkblpNl787qSMuMRDysuuufwPD3tFUc=; b=WyyXAGMTHutr9Aru47jnfkf9h/QhsahYi4Ler0Vni5id9pA+Gi+HaayELoyBrvkiePQM0G wUqX2Wmz0ZyqBIMKgqA4YHZk7HdIY/ORIwpmM/Pmljs9iP7y10JOJ0cx0Z70npdY6pLhwT BSDT5v6seEBiU1FbVAkeHPPieDLX4qZlLbF3pqrfqfLa43pRS8hhu35T9+Jm46mBtRMjf7 yv/d1zlkWcNcguypUZNnz7OkF8BrSpByOPm6y5nXf+xEUnngizJXyn1DRi+xtjMPxTkjLt rggaGefL6SdqOyjNoYhgh9Kzs4ZXx1K+MZfJLhpUNyPMGR/RpfwBKyV+7IHjyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720797; a=rsa-sha256; cv=none; b=S23P7JYQEEYliGqJ1v9C6XXjcs3DvHhTNEh1YuaxNAZ9GDYJSm0pA7fhjVTMzJvIQFobo5 I1qkGZtF1TF1F6/DAKlQqZS5Ppbfo9YKgE/UVocdem1vL9J+sS8COkbdMTurkBABuyNd3I hp/zeDBxb8E6qRB3s9ehglMmpC8ih9DxfCKSBwUO9jqqVeIq57LeUCPXZpbhYiu3gmckn5 KVAS9H1e3ss9+md8rbzwk9EDNb4R3+3JA7HtTjTmJ1iodkI3QyoeTY85vruHGLgidpWV51 1JySFJd8g79q1KMSiz8V9sDMi22+/7WbRjJybeWsAUZzCmuNANlMuSbBvDliwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1xfbSZAQI84PkblpNl787qSMuMRDysuuufwPD3tFUc=; b=RJEsC3XEDLS+k0Yv3j8WzWZcyHmpLbBsyA8ArdNCp7oejzLUmxreyM2DKFe/HMkhKjKTtt ZwlLmeowfZO7F87sP4d5qA5W0PIyx/8kdBBwqtgY9NnbDw04pkWVSC/A38yy345vJPy7mr D9WCEh7uH79n7ShuodjyMOyt8NfawgpN2h4W24BxVR9cgT/lp9bwER+vYuINlmYvYTPX4w OUi9XN2rXvklhZrmN4i0Ee3ZO1fx7begMzcAp4y6h7IZfafUebZZ2NzZe1bQzaEmPzeYKV qGrMhtA1H7GAczowR7cA44pAK0Yst3vwKG0DlftpYEndTV1xR7XAunGe+G8o8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wd0S2fzSkH; Tue, 27 Aug 2024 01:06: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 47R16aFD056987; Tue, 27 Aug 2024 01:06:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16aZP056984; Tue, 27 Aug 2024 01:06:36 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:36 GMT Message-Id: <202408270106.47R16aZP056984@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: d20b149786cb - stable/14 - nvmecontrol: Make the error log page work on native format List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d20b149786cbd2c983eeaffce9c51c0a767cadc7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d20b149786cbd2c983eeaffce9c51c0a767cadc7 commit d20b149786cbd2c983eeaffce9c51c0a767cadc7 Author: Warner Losh AuthorDate: 2024-04-16 22:35:46 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Make the error log page work on native format As the number of page types proliferates, it becomes untennable to convert them in read_logpage (especailly since new UUID page types will need to be supported). Convert the error page printing code to operate on little endian data. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44680 (cherry picked from commit 85656a9a015339f3d412e5b1888e798bb3e7d4ba) --- sbin/nvmecontrol/logpage.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 6bdf83abefea..a6242bd4a440 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -194,8 +194,7 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, uint16_t lsi, uint8_t rae, void *payload, uint32_t payload_size) { struct nvme_pt_command pt; - struct nvme_error_information_entry *err_entry; - u_int i, err_pages, numd; + u_int numd; numd = payload_size / sizeof(uint32_t) - 1; memset(&pt, 0, sizeof(pt)); @@ -221,12 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_ERROR: - err_entry = (struct nvme_error_information_entry *)payload; - err_pages = payload_size / sizeof(struct nvme_error_information_entry); - for (i = 0; i < err_pages; i++) - nvme_error_information_entry_swapbytes(err_entry++); - break; case NVME_LOG_HEALTH_INFORMATION: nvme_health_information_page_swapbytes( (struct nvme_health_information_page *)payload); @@ -273,17 +266,17 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Error Information Log\n"); printf("=====================\n"); - if (entry->error_count == 0) { + if (LE2H(entry->error_count) == 0) { printf("No error entries found\n"); return; } - nentries = size/sizeof(struct nvme_error_information_entry); + nentries = size / sizeof(struct nvme_error_information_entry); for (i = 0; i < nentries; i++, entry++) { - if (entry->error_count == 0) + if (LE2H(entry->error_count) == 0) break; - status = entry->status; + status = LE2H(entry->status); p = NVME_STATUS_GET_P(status); sc = NVME_STATUS_GET_SC(status); @@ -293,9 +286,9 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Entry %02d\n", i + 1); printf("=========\n"); - printf(" Error count: %ju\n", entry->error_count); - printf(" Submission queue ID: %u\n", entry->sqid); - printf(" Command ID: %u\n", entry->cid); + printf(" Error count: %ju\n", LE2H(entry->error_count)); + printf(" Submission queue ID: %u\n", LE2H(entry->sqid)); + printf(" Command ID: %u\n", LE2H(entry->cid)); /* TODO: Export nvme_status_string structures from kernel? */ printf(" Status:\n"); printf(" Phase tag: %d\n", p); @@ -303,13 +296,13 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf(" Status code type: %d\n", sct); printf(" More: %d\n", m); printf(" DNR: %d\n", dnr); - printf(" Error location: %u\n", entry->error_location); - printf(" LBA: %ju\n", entry->lba); - printf(" Namespace ID: %u\n", entry->nsid); - printf(" Vendor specific info: %u\n", entry->vendor_specific); - printf(" Transport type: %u\n", entry->trtype); - printf(" Command specific info:%ju\n", entry->csi); - printf(" Transport specific: %u\n", entry->ttsi); + printf(" Error location: %u\n", LE2H(entry->error_location)); + printf(" LBA: %ju\n", LE2H(entry->lba)); + printf(" Namespace ID: %u\n", LE2H(entry->nsid)); + printf(" Vendor specific info: %u\n", LE2H(entry->vendor_specific)); + printf(" Transport type: %u\n", LE2H(entry->trtype)); + printf(" Command specific info:%ju\n", LE2H(entry->csi)); + printf(" Transport specific: %u\n", LE2H(entry->ttsi)); } } From nobody Tue Aug 27 01:06:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wf3WXVz5TjR4; Tue, 27 Aug 2024 01:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wf1sDdz4m4n; Tue, 27 Aug 2024 01:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGBUtphMy2RwXXLc568Og9OdEkk9wNXf9TpWc1cQM8Q=; b=MiK1oPdwW/l6LZS9gT04NTHsTDlx9DrOZZQU7/jD9I/L2FtPhf/frxiW3PKz88x7MWku7l ENzFNpg4WBHJ7e8YAeRDez8McHjOSKpvQRkDfFV5hfiJir6RWkmb+cQ6JKmcpZRKMib2r1 wQOWPicT8fcYpV1lNAQb5rTVVvNF2OCofD3AergJo5RXRMrkjpZLqELqRThmuuK6MPOdf2 /7nRstycyO2PZnb3tT9VGU5caXfS/3MacIFlO4dCi/Id5W4O1JTx+w+PnZgqKQr717OFO7 cHVkPllQzetKMEjKeUDOGb9uZCCD/cvqWbMFR8WIpy0hvAUj6IySIfrTgCTe7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720798; a=rsa-sha256; cv=none; b=Nw5HbZWUUyYyenOIZRYGsKE6rCeJuvqUryGEaEVxWNA2PZA10SDZbbNADS+dLIyU0ifEa2 Bl15cSU8EhC5x/fOaSws1KpwukI6bzLOArKnV0rpNz6/5cRfIYtw4CVjg7P+eM78zsapw/ DqanEu5qz3AoxYn1hWsr5FcLl/vH5MZ5wGhsrTz2us/eE1M3T7tw3rQ0TTvL4xFLf6hUr7 9PVUgQRALyTb4djuV3c1JzIrFZtt1gsgJIq5nvCH9zw1F4LZCG7Lih/wqAqBVNkGfBzGlW 0h3LdFkXuQrax8kVOP8skmgRScp3WsYhMhSvyIpgJEEEsePtaMbpKfrSlaVWow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGBUtphMy2RwXXLc568Og9OdEkk9wNXf9TpWc1cQM8Q=; b=CHVIKV1cef0e4qsYnDpXzPSMfz0puSALWjWPFRSxyBeJhz7dFHGzlNeO7ICiQS9fMoQwjU H8DXsxR4CyKKVMdTKuU8DUQkn2/eq4tHhM3w4MipB3KC8JyDoJUWofsaOAExWgRXHPCgFJ u9r4Q2R3Ih7gynAEqM6x1C6fo6Pu2J8GgmoZZqEV+hJfVZ02j8th/zAPWwXN9umNL/H7au NEPAeRGe5sxmMnMChu7a+g7REJXv7lh1ZYxq2IPkNwFGLacA8zNAW2bNg67w5n2MeDOhHg XSJm4JyjZsFV0yovOvzULRZJJRA2ldgGkUCXfEM4DOoKKau/UpcMccKWXc5cbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wf1NZrzSkJ; Tue, 27 Aug 2024 01:06: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 47R16ciC057046; Tue, 27 Aug 2024 01:06:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16cqr057043; Tue, 27 Aug 2024 01:06:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:38 GMT Message-Id: <202408270106.47R16cqr057043@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: 78e2c1882b2f - stable/14 - nvmecontrol: Have to truncate on all 32-bit architectures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 78e2c1882b2fac00fabe9d362050213b35dd4a78 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=78e2c1882b2fac00fabe9d362050213b35dd4a78 commit 78e2c1882b2fac00fabe9d362050213b35dd4a78 Author: Warner Losh AuthorDate: 2024-04-16 22:35:53 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Have to truncate on all 32-bit architectures armv7, powerpc, powerpcspe and i386 all lack 128-bit integer types. Adjust the comment and #ifdef. I don't think we support nvme on any of these other architectures at the moment, but it won't hurt to be more precise. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44650 (cherry picked from commit e098d24b5290a9f59734587ded783c19d4dc6e31) --- sbin/nvmecontrol/nvmecontrol.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index a098da4c9c45..ed331327ae9e 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -92,12 +92,12 @@ void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, vo /* Utility Routines */ /* * 128-bit integer augments to standard values. On i386 this - * doesn't exist, so we use 64-bit values. So, on 32-bit i386, + * doesn't exist, so we use 64-bit values. So, on 32-bit systems, * you'll get truncated values until someone implement 128bit * ints in software. */ #define UINT128_DIG 39 -#ifdef __i386__ +#ifdef __ILP32__ typedef uint64_t uint128_t; #else typedef __uint128_t uint128_t; From nobody Tue Aug 27 01:06:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wg5PXTz5Thsn; Tue, 27 Aug 2024 01:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wg2wlPz4m0Z; Tue, 27 Aug 2024 01:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4/jgTntAC2T/G55ZVE3COTKzl1RhBLxQufTgClb9bs=; b=ULvTBtR+3cPseaZY0V4nIACL+1bh3mLt+6WR2y31QFuK7jREVEL20mVPBbz6mkwLCrzgla ndrJQ+IHdXySz29R0ad0xNWQn5xlGjEIJrzQ6sgeyEbvW1gFLG/8/wE7CFNV+0jt3hLE8t ZQLtn/Xjuvhatd/G7F91lN8TfgEf1ZuOKTYSss+UPPrZqOPpNlenCYixIfQkyN5jzvcnR2 4DAXH49r8tN2KLvbdccQQBeoxYrUEaUTQFcPR7P07XszR7VWnwhonyh22fV+8O9RoAe0k6 qA579P7rnXrMDEgOkk0q5hA/XD3EdtT/eEEccWDr1crZTOQghqu3giaE4XKN/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720799; a=rsa-sha256; cv=none; b=J0155vAbWh5tdo4//QUUdFs5Re4iSd/FEZ0m8nIFJ4P4jShsAJyddxxF20jukH8waeJ/eK Toj2sSyBv/ZeQZT3/sw2JIyRJnWJlL5PT5al/zlm8aJbKdYe6eBtj5CHjNjkmWgnZJdB2Y hlY8OXp3dy0vgoHpHYidmJoS2lcanNrvhnxqSHtTeaEAYqL6si4/LdF7YuzG3qWbw+P1MQ fm61zhn2u6SOmtZ7bVyDQ737NuWxpvIgR97Q3e6XLlmLicErKTae6p7UQecjEG+Ezjqs+N 1WQC3f55v1Q1iV1d9OSIQmPMl3xdCfTj0RGQpx+P4+2eo/b11zsexp85LUe6qA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4/jgTntAC2T/G55ZVE3COTKzl1RhBLxQufTgClb9bs=; b=YmFJe93zyDajhitnkyxB+JIA14TMNkqTzG+jXXEZPbznmW9EzuBz7bgqK1QK1XGA5B2IUq 038dwAmhQVwhwCuDz/uwaDtre1R1iUdoJ5Sx88l22vV9rvNNhcXPAAa7qLeZ1jS6v4x0zX IGiNVVBksws0Ovif5Nwbpu/aLSWopSpdul7f/0S3hc5byshWukSNEylYwiprLydLnGl4Z2 x8NTkWS0Ws9yHXfpQ1qDGfN+A+jMG9LKHZi2Z57+TPD8P4glETI3Of0/lFkOxVrSv2SRpW EClbBiauAnXTfSBXIB5rBlskYaxq5QwIIXNGbyZJPf+KiAWXWZcvveDTF/AJSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wg257czTfg; Tue, 27 Aug 2024 01:06: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 47R16dII057095; Tue, 27 Aug 2024 01:06:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16dwR057092; Tue, 27 Aug 2024 01:06:39 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:39 GMT Message-Id: <202408270106.47R16dwR057092@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: 650c012e519f - stable/14 - nvmecontrol: Fix to128 for big endian targets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 650c012e519fe027fdab6561d35380dcd0ac8e4b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=650c012e519fe027fdab6561d35380dcd0ac8e4b commit 650c012e519fe027fdab6561d35380dcd0ac8e4b Author: Warner Losh AuthorDate: 2024-04-16 22:35:59 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Fix to128 for big endian targets The source is always 128-bits in little endian format. For big endian hosts, we have to convert, or we print bogus numbers. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44651 (cherry picked from commit 1c4b7effa7f9df64bf72c6291b4719cffb2ffe22) --- sbin/nvmecontrol/Makefile | 1 - sbin/nvmecontrol/nvmecontrol.h | 27 +++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/sbin/nvmecontrol/Makefile b/sbin/nvmecontrol/Makefile index facb5f09835d..e3d363b123ed 100644 --- a/sbin/nvmecontrol/Makefile +++ b/sbin/nvmecontrol/Makefile @@ -1,4 +1,3 @@ - .include PACKAGE=nvme-tools diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index ed331327ae9e..4187c9bee432 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -91,22 +91,33 @@ void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, vo /* Utility Routines */ /* - * 128-bit integer augments to standard values. On i386 this - * doesn't exist, so we use 64-bit values. So, on 32-bit systems, - * you'll get truncated values until someone implement 128bit - * ints in software. + * C23 supports 128-bit integers via _BitInt(128). clang 16 and gcc 13 support + * this. Older compilers will support 128-bit ints on 64-bit + * platforms. Otherwise we truncate this to 64-bit on 32-bit systems with older + * compilers. We also check for > C18 instead of >= C23 because clang 17 was + * released before the the __STDC_VERSION__ was defined. */ #define UINT128_DIG 39 -#ifdef __ILP32__ -typedef uint64_t uint128_t; -#else +#if __STDC_VERSION__ >= 202311L +typedef unsigned _BitInt(128) uint128_t; +#elif defined(__SIZEOF_INT128__) typedef __uint128_t uint128_t; +#else +typedef uint64_t uint128_t; #endif static __inline uint128_t to128(void *p) { - return *(uint128_t *)p; +#if __STDC_VERSION__ >= 202311L || defined(__SIZEOF_INT128__) + uint64_t lo, hi; + + lo = le64dec(p); + hi = le64dec((const char *)p + 8); + return ((uint128_t)hi << 64 | lo); +#else + return (le64dec(p)); +#endif } uint64_t le48dec(const void *pp); From nobody Tue Aug 27 01:06:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wh6W2sz5TjR9; Tue, 27 Aug 2024 01:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wh4Fbgz4ltP; Tue, 27 Aug 2024 01:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZpgxZAWZRKN5eNiep8VR+EvHSqnpZsc1LxSV+rD36sk=; b=Rkul/MD+0oqbZRyW/u5iTfVCYKvzOUqj2scWdAMRfsEY00sC1VtqDmckIfNdsl+Hr1GImn Gles4UdntPOlu4pGJF5qOIKusjqa4VwyVsP7+mmmXsvEohv9z6UUlzjC6msyIpxdwQY9Ks fasLSYEmEM0Apn3NhC0ruEvNs8F8j2BaAXD0B2/lCYxlyjcfHD3mgLPknP6fyp/XkI83K5 GVtQ2jpYlbuu3xEk3cLbM1L3IILh4avqJJeeSvq8bSu3G1YJMp1v51uRErldNfSdZg2Bf4 7QGV4GQGBvrCeOPaTI3N1u79ozgxXRGk7X5zx2kRXroilaJypj+ZMkIueO6FLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720800; a=rsa-sha256; cv=none; b=qnOFP+VGxUkMjJFfCIzA83lfXuQBNqF2g+5Xh5mNTrE3lo1BeZw2NNoE57RyPc32wxraYy LQisg3vw6eicjBgcRFbuvXcD8fsYOJvRLeDXlbjTjM8nbVfZ69bRfWlet4uc6ZKP7l2Wa2 KgiWoBu22KpXJaGeU0ZVC678Uv9HU9Y251u5SWPurUsJjBJx6D7gUxnTAA1886sn40NaMc Fj5p+R36Gt9Y98Ixy9Ry6vJ4k0FDLCsFVURbBNgGxgR0Qfh02e4kkTt6wbmlGrH5RIZAyU 9KZ63J42s+PY5jcpMNpsUOHTtZ5KowVCPsZ3wNfhs7ukpqb6RwG0VkUESc3F5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZpgxZAWZRKN5eNiep8VR+EvHSqnpZsc1LxSV+rD36sk=; b=k0M+DB1m4l5T4KzB+2Neff0WlFjQjwE9Cf/JkJw3vSDX+XpV9e1/pJwEPTdKk9HZrEktmO UhkSv1/Vhq7ayBqQHrF0W8ETSANtD1cOIAUKKnZOR5UEk1Zg7dqwqkrdauE3J3zHm4J/Jx PzQdv3zYrN3pXbmMOFzJ6HuE1BLIwxBo9PS63/xA6cjeQZ6slhRjyrivzxgEHBIT6Ik9DR d6yzHbSoNH8UlhqJvR9F+PgHFSG20HffAS98TNG5qwvDnMnBn6bC64hKavaUkeM19rCwp8 kIDoBa2hjoNC37+Nj0VylJQncr/zgxI0wM/Xof6i3GSrs2Q7SuBE0n1v32bx2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wh36wxzSkK; Tue, 27 Aug 2024 01:06: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 47R16eSu057146; Tue, 27 Aug 2024 01:06:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16e6v057143; Tue, 27 Aug 2024 01:06:40 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:40 GMT Message-Id: <202408270106.47R16e6v057143@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: 4d144d4ceb1c - stable/14 - nvmecontrol: Move smart/health printing to little endian orderinng List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d144d4ceb1c7df824ba66929c396faa83638edf Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4d144d4ceb1c7df824ba66929c396faa83638edf commit 4d144d4ceb1c7df824ba66929c396faa83638edf Author: Warner Losh AuthorDate: 2024-04-16 22:36:05 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Move smart/health printing to little endian orderinng Move health printing to little endian ordering... Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44652 (cherry picked from commit 729ee4c88f2af4560adec39fd709ff89bb597e4a) --- sbin/nvmecontrol/logpage.c | 56 +++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index a6242bd4a440..0ed19222ba1a 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_HEALTH_INFORMATION: - nvme_health_information_page_swapbytes( - (struct nvme_health_information_page *)payload); - break; case NVME_LOG_CHANGED_NAMESPACE: nvme_ns_list_swapbytes((struct nvme_ns_list *)payload); break; @@ -266,17 +262,17 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Error Information Log\n"); printf("=====================\n"); - if (LE2H(entry->error_count) == 0) { + if (letoh(entry->error_count) == 0) { printf("No error entries found\n"); return; } nentries = size / sizeof(struct nvme_error_information_entry); for (i = 0; i < nentries; i++, entry++) { - if (LE2H(entry->error_count) == 0) + if (letoh(entry->error_count) == 0) break; - status = LE2H(entry->status); + status = letoh(entry->status); p = NVME_STATUS_GET_P(status); sc = NVME_STATUS_GET_SC(status); @@ -286,9 +282,9 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Entry %02d\n", i + 1); printf("=========\n"); - printf(" Error count: %ju\n", LE2H(entry->error_count)); - printf(" Submission queue ID: %u\n", LE2H(entry->sqid)); - printf(" Command ID: %u\n", LE2H(entry->cid)); + printf(" Error count: %ju\n", letoh(entry->error_count)); + printf(" Submission queue ID: %u\n", letoh(entry->sqid)); + printf(" Command ID: %u\n", letoh(entry->cid)); /* TODO: Export nvme_status_string structures from kernel? */ printf(" Status:\n"); printf(" Phase tag: %d\n", p); @@ -296,13 +292,13 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf(" Status code type: %d\n", sct); printf(" More: %d\n", m); printf(" DNR: %d\n", dnr); - printf(" Error location: %u\n", LE2H(entry->error_location)); - printf(" LBA: %ju\n", LE2H(entry->lba)); - printf(" Namespace ID: %u\n", LE2H(entry->nsid)); - printf(" Vendor specific info: %u\n", LE2H(entry->vendor_specific)); - printf(" Transport type: %u\n", LE2H(entry->trtype)); - printf(" Command specific info:%ju\n", LE2H(entry->csi)); - printf(" Transport specific: %u\n", LE2H(entry->ttsi)); + printf(" Error location: %u\n", letoh(entry->error_location)); + printf(" LBA: %ju\n", letoh(entry->lba)); + printf(" Namespace ID: %u\n", letoh(entry->nsid)); + printf(" Vendor specific info: %u\n", letoh(entry->vendor_specific)); + printf(" Transport type: %u\n", letoh(entry->trtype)); + printf(" Command specific info:%ju\n", letoh(entry->csi)); + printf(" Transport specific: %u\n", letoh(entry->ttsi)); } } @@ -326,7 +322,7 @@ print_log_health(const struct nvme_controller_data *cdata __unused, void *buf, u uint8_t warning; int i; - warning = health->critical_warning; + warning = letoh(health->critical_warning); printf("SMART/Health Information Log\n"); printf("============================\n"); @@ -343,13 +339,13 @@ print_log_health(const struct nvme_controller_data *cdata __unused, void *buf, u printf(" Volatile memory backup: %d\n", !!(warning & NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP)); printf("Temperature: "); - print_temp_K(health->temperature); + print_temp_K(letoh(health->temperature)); printf("Available spare: %u\n", - health->available_spare); + letoh(health->available_spare)); printf("Available spare threshold: %u\n", - health->available_spare_threshold); + letoh(health->available_spare_threshold)); printf("Percentage used: %u\n", - health->percentage_used); + letoh(health->percentage_used)); printf("Data units (512,000 byte) read: %s\n", uint128_to_str(to128(health->data_units_read), cbuf, sizeof(cbuf))); @@ -372,18 +368,18 @@ print_log_health(const struct nvme_controller_data *cdata __unused, void *buf, u printf("No. error info log entries: %s\n", uint128_to_str(to128(health->num_error_info_log_entries), cbuf, sizeof(cbuf))); - printf("Warning Temp Composite Time: %d\n", health->warning_temp_time); - printf("Error Temp Composite Time: %d\n", health->error_temp_time); + printf("Warning Temp Composite Time: %d\n", letoh(health->warning_temp_time)); + printf("Error Temp Composite Time: %d\n", letoh(health->error_temp_time)); for (i = 0; i < 8; i++) { - if (health->temp_sensor[i] == 0) + if (letoh(health->temp_sensor[i]) == 0) continue; printf("Temperature Sensor %d: ", i + 1); - print_temp_K(health->temp_sensor[i]); + print_temp_K(letoh(health->temp_sensor[i])); } - printf("Temperature 1 Transition Count: %d\n", health->tmt1tc); - printf("Temperature 2 Transition Count: %d\n", health->tmt2tc); - printf("Total Time For Temperature 1: %d\n", health->ttftmt1); - printf("Total Time For Temperature 2: %d\n", health->ttftmt2); + printf("Temperature 1 Transition Count: %d\n", letoh(health->tmt1tc)); + printf("Temperature 2 Transition Count: %d\n", letoh(health->tmt2tc)); + printf("Total Time For Temperature 1: %d\n", letoh(health->ttftmt1)); + printf("Total Time For Temperature 2: %d\n", letoh(health->ttftmt2)); } static void From nobody Tue Aug 27 01:06:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wk07dTz5TjLl; Tue, 27 Aug 2024 01:06:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wj4pjvz4lxG; Tue, 27 Aug 2024 01:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=raq+C25BAIgh528AmjDfXubl3zeoE5nJCub2ILqtZKA=; b=DlC9yh+qY1gBwvDW5SjUNzFJv12nNjie1ODXRSz9uYDK1I18I6FxIIIreajhYrsHga6sc3 aAgbDFFbkWKs59tUH0/fIxzAoM9QoK6I/zsn/EPM27K1kKduuStNP4XkBtEitv4eLD9Uw9 St5lQo5mW2TvsgT/mRj46xoNifNxIdFneeJbhvHKjUfR6Gm0J84KTUwXRXEzwU5bEDeyJN 9UaoxEKMz8C3LvkDf1Vf9UcPqGt2EDul8LZZEurvHEssBUzOL2gtgl6HUXmEztjWVvXRA8 zixwQdf5wpljZNNO0oCRMmCtYUr5DZ0u5Ah3BDitvw9tKZwtKkjki/DQQ5xxjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720801; a=rsa-sha256; cv=none; b=ljzr6mQZ++gZkEoh9+tSiV/gaiBCXhjW1fWkOyCFgy0r0h4wwHs9IulH3IjqK3v5Bgaxf4 jeXA0g7HUPQzAsF+DZhtde4Rtr57A/oWbt9Qb+Lobr8xHWH6K3F0dImhrODP5nRXonc6oe qX00he9SFCNDU28Lm7tpRdBtTugrY2bpS/YZct9KLIMiyB+RGpwwGHtg4sG4fZsZSyEFjH nFv0RVXCYih6/oI+Mw/YQhPsdgJcK8qJIRMD6Xm9AytibcPYrZZxvTj44e4lrhATcr1hwv /LtCaz18zgLwPr/1z+en07uHZkQbfrXHjdo/Efmtz7PfvcaE+41/hHQw+w/usQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=raq+C25BAIgh528AmjDfXubl3zeoE5nJCub2ILqtZKA=; b=O646Wjc+eINE9ehKpsdBworJ3C+dDTe407J8Ih90+kF6iMkjY+cT5VMRNf7VE7XIttgs6Q cODxdAskGvKY20QAXHXpI7qRWfWFHiAykiSM8gOyaMsVZisdYTieg4HwPJyKqHgIr8KtLd fcJIoGm3I+GvZaChnD1/oKIM3XhR01ScXtXYSaLAm0svKY4h/iLF+OUctowsdRkzHVZDVD WibEW+O5FmqBm4lxAvNdKjnl6ya3zv1LMz5GL657V8IkG3rlVtribG/5u1SC/c+dLf8KZe LQKILDUZKXO3wCKfSCQD7jFu0SQRl4aPJcBs2CchchdA5K1olUCNCpmjwhzinQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wj49TbzTf5; Tue, 27 Aug 2024 01:06: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 47R16f9t057205; Tue, 27 Aug 2024 01:06:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16fFp057202; Tue, 27 Aug 2024 01:06:41 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:41 GMT Message-Id: <202408270106.47R16fFp057202@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: 0c66083c035c - stable/14 - nvmecontrol: Move namespace change page printing to little endian orderinng List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0c66083c035c90e6991e18914b1fcdbdc70d8e7d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0c66083c035c90e6991e18914b1fcdbdc70d8e7d commit 0c66083c035c90e6991e18914b1fcdbdc70d8e7d Author: Warner Losh AuthorDate: 2024-04-16 22:36:13 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Move namespace change page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44653 (cherry picked from commit acdf72f7bbe582b8eabf09576dc93eb4fcfbd19b) --- sbin/nvmecontrol/logpage.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 0ed19222ba1a..845dad0cd539 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,9 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_CHANGED_NAMESPACE: - nvme_ns_list_swapbytes((struct nvme_ns_list *)payload); - break; case NVME_LOG_DEVICE_SELF_TEST: nvme_device_self_test_swapbytes( (struct nvme_device_self_test_page *)payload); @@ -430,8 +427,8 @@ print_log_ns(const struct nvme_controller_data *cdata __unused, void *buf, printf("Changed Namespace List\n"); printf("======================\n"); - for (i = 0; i < nitems(nsl->ns) && nsl->ns[i] != 0; i++) { - printf("%08x\n", nsl->ns[i]); + for (i = 0; i < nitems(nsl->ns) && letoh(nsl->ns[i]) != 0; i++) { + printf("%08x\n", letoh(nsl->ns[i])); } } From nobody Tue Aug 27 01:06:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wl1mb5z5TjLs; Tue, 27 Aug 2024 01:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wl063Lz4m7k; Tue, 27 Aug 2024 01:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uIpMSeYUfoAiobLBOZcFfn3712IAiV5jw0KWYT6DNk=; b=vR/eRDM1Khq/YJuRq5CC/RAF8Hpc8Db0Bz7tiVcm42dF8k+2MSofaPnt8Nmi6GJYYdT+0i 3TnwAUitM/vJ5DML65Fb4tKBemYc5b5n6kj2JD7X36aho+i/LiJcTnRdgjeAlmXm8PIO7+ vUQv6FkRQJR3FWmUdOizi6cZiJCUuFH0nOGKf8TPkseKEXVE/nNkS2TjVCn3It2+QXmOyG eubdmJAh99j2eM9BUzD8JFwH8z6RXDilR5SN9lotc3NEXgqKQgzcOM8kgQAVZkDltM9XVV O8THL0VoEgy1rDtPgzZNJwM86dYIyO8b3aPXBjJcLD07zx2Pc+QMdDBCk9czzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720803; a=rsa-sha256; cv=none; b=R/YkDd5wjMrNYI5uNumEY9HEWOo6KQf8fzEtPK5C/oFx3/ji8s0AT3cMGgoq+W1adKYquG OnzkCuKGirE5foXd5W3MFMcGp/tAmRsQtdyR6dppw84+Ql6jqBTzfWMwLO/L+vh12F2qoV YRYz4leFuR3WSeeIWHKIZL4YNq5272xQdYtb6o1e14fz+ApYYj5NOIpdy1bOCzs17RnPLs htl5wi07IqFcf0bA4uh2MtPfK9LsIJ1ooZyAceGF5kt5fVqRkyr0joJjRO+MuFoalHJqSl lIKTQL2NLdTcpRuAR9sFANgh1y+Gi3r+YJwYLwHFAIvus9l09uXoaUpYnw/HiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uIpMSeYUfoAiobLBOZcFfn3712IAiV5jw0KWYT6DNk=; b=t/Qjb3LFNafzTis6MjU6h/Ik0PL3utUIfMl8jM8BI1c/veKZYbzxB7QnyzBAdjTdClVlBI gwP4eg9HKPmSq5ceAphacQwgNVDc9oONgQxY0Ol9lulfpMM8CP39zwJdI6l3ZrRWEx0lpB Ib/UaAO1hr2h3UITud6ymSL1J22wVzER5eo17wxNNHozPYbVdI+rShVQE5V4i5OWCqEZjr YjQLSPycSIqEeNLw5UukF+fIUgqn8v8GXRLHHrQlYY9tv3kJs8XrxqM12vma9P28al2LHD KbljnDdjukyk+Yccj73kE6SCoOySunQbXKI/Hmlc49BD/wY53Kkd5DABNfby+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 4Wt8Wk5Gk2zT9W; Tue, 27 Aug 2024 01:06: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 47R16g2U057265; Tue, 27 Aug 2024 01:06:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16guu057262; Tue, 27 Aug 2024 01:06:42 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:42 GMT Message-Id: <202408270106.47R16guu057262@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: 067abd7d0b06 - stable/14 - nvmecontrol: Move self test status page printing to little endian orderinng List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 067abd7d0b0678cba0dede7e1813660e9e269d6e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=067abd7d0b0678cba0dede7e1813660e9e269d6e commit 067abd7d0b0678cba0dede7e1813660e9e269d6e Author: Warner Losh AuthorDate: 2024-04-16 22:36:19 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Move self test status page printing to little endian orderinng Also, add printing vnedor_specific field, which doesn't have a valid bit, so is always valid. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44654 (cherry picked from commit 98f841efd8ce387d9cd060174b9dcc9ff9850648) --- sbin/nvmecontrol/logpage.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 845dad0cd539..897bb7a59118 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_DEVICE_SELF_TEST: - nvme_device_self_test_swapbytes( - (struct nvme_device_self_test_page *)payload); - break; case NVME_LOG_COMMAND_EFFECT: nvme_command_effects_page_swapbytes( (struct nvme_command_effects_page *)payload); @@ -574,13 +570,14 @@ print_log_self_test_status(const struct nvme_controller_data *cdata __unused, { struct nvme_device_self_test_page *dst; uint32_t r; + uint16_t vs; dst = buf; printf("Device Self-test Status\n"); printf("=======================\n"); printf("Current Operation: "); - switch (dst->curr_operation) { + switch (letoh(dst->curr_operation)) { case 0x0: printf("No device self-test operation in progress\n"); break; @@ -594,19 +591,20 @@ print_log_self_test_status(const struct nvme_controller_data *cdata __unused, printf("Vendor specific\n"); break; default: - printf("Reserved (0x%x)\n", dst->curr_operation); + printf("Reserved (0x%x)\n", letoh(dst->curr_operation)); } - if (dst->curr_operation != 0) - printf("Current Completion: %u%%\n", dst->curr_compl & 0x7f); + if (letoh(dst->curr_operation) != 0) + printf("Current Completion: %u%%\n", letoh(dst->curr_compl) & 0x7f); printf("Results\n"); for (r = 0; r < 20; r++) { uint64_t failing_lba; - uint8_t code, res; + uint8_t code, res, status; - code = (dst->result[r].status >> 4) & 0xf; - res = dst->result[r].status & 0xf; + status = letoh(dst->result[r].status); + code = (status >> 4) & 0xf; + res = status & 0xf; if (res == 0xf) continue; @@ -631,21 +629,24 @@ print_log_self_test_status(const struct nvme_controller_data *cdata __unused, printf(" Reserved status 0x%x", res); if (res == 7) - printf(" starting in segment %u", dst->result[r].segment_num); + printf(" starting in segment %u", + letoh(dst->result[r].segment_num)); #define BIT(b) (1 << (b)) - if (dst->result[r].valid_diag_info & BIT(0)) - printf(" NSID=0x%x", dst->result[r].nsid); - if (dst->result[r].valid_diag_info & BIT(1)) { + if (letoh(dst->result[r].valid_diag_info) & BIT(0)) + printf(" NSID=0x%x", letoh(dst->result[r].nsid)); + if (letoh(dst->result[r].valid_diag_info) & BIT(1)) { memcpy(&failing_lba, dst->result[r].failing_lba, sizeof(failing_lba)); - printf(" FLBA=0x%jx", failing_lba); + printf(" FLBA=0x%jx", (uintmax_t)letoh(failing_lba)); } - if (dst->result[r].valid_diag_info & BIT(2)) - printf(" SCT=0x%x", dst->result[r].status_code_type); - if (dst->result[r].valid_diag_info & BIT(3)) - printf(" SC=0x%x", dst->result[r].status_code); + if (letoh(dst->result[r].valid_diag_info) & BIT(2)) + printf(" SCT=0x%x", letoh(dst->result[r].status_code_type)); + if (letoh(dst->result[r].valid_diag_info) & BIT(3)) + printf(" SC=0x%x", letoh(dst->result[r].status_code)); #undef BIT + memcpy(&vs, dst->result[r].vendor_specific, sizeof(vs)); + printf(" VENDOR_SPECIFIC=0x%x", letoh(vs)); printf("\n"); } } From nobody Tue Aug 27 01:06:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wm1WfGz5TjLt; Tue, 27 Aug 2024 01:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wm0Lwqz4lrd; Tue, 27 Aug 2024 01:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQc3iMd6zy+1GhZH/TrDw8AsbPKbs7oIH3hLpk2DDfc=; b=buzDEzdqxG+yTQ5+cQfWJ1btsU25LtajmjEJpZThNO83kJlb58bO3ZPyw6iykDvvPqccxJ N72tONNeXDt1SLb+PMeu8iuawCUtOTfNe4jRirVjG9SMm7rhZnekxJQkHwGSawfTotFD5P dgDckG3L3+R8J9+SeJOGfJp2/LOAHz8vdW8aYAMWymWhgxHd85S7HnnT7wZ/gQkbQikpXN y0E3KokmBRI6ijfpV9vgZ7mKAn3IQD01YV9CszkKOKicYXbuhXafdavTTzK0Yu5Ktl9cqj Z/DqkYmMNhO9ZEt0Hx+V4I4D2kHKGKh+aQgtsMN6JxXWrTTIyzYmo7ws1WLZPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720804; a=rsa-sha256; cv=none; b=KkHX/LTWrw4KONXFghxy69eLj2T975yrbFJ/Fo6X92kny70b4bFsGS8b0mtCYxXa3XxyeI OhMy5KCx0yud05AJDL2/j3O6xsYm8FUtnABhoqDq+UTbAtNcB+ZiK2Yp4du1skMKbrF67a Z0F6uXdrfOLqPjxzFXlkdIrY/HrURmzJ/EFZKUV3fjLy828TZoAahqvcRjmqpCO9Mm2b3a CbDfVlHrELVjJg0Ar1H8GOSJpzsgWMB0K54G5FnCe3EWH9qY43JXbFNhvn5Qllcxrnk/Ug sYvDXANNmNkIzfj3CTyuyKu/627M7NYec6mxaxSIGyjA2ZKm8P3y2tnK6zAADQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQc3iMd6zy+1GhZH/TrDw8AsbPKbs7oIH3hLpk2DDfc=; b=ymPx4SlxCJZWUuVBL9b4iyEdrslbodzaHmmD7tQE0iolZePd79O3xeitdgfXMMn1bKq+/R b7ikRbO2ST/qtUuHiMtgo0Gzy4FmFgizvd1asCzrr6uCBFDptvrPCcrPbZyrS6TbRvZNE/ 0E7rYkMmuEYemJdn23c3MNimxtxglS1/K5Q87XTr+WDiUU4oIIWMTHxPVDPler44fBVr/h uHyQItOI27OOI/UTJJav9ZfCJdKudBlbjbhQWDM/nnSL6EIsowJQxlJ3BO94X4gICoPP3+ r1CdcgbVEc9Fo+pfd4VMdsm5t4Uq6OZq5xd5K7J2jq3eTHlLswjD4TLVKuFaMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wl5zMjzSkL; Tue, 27 Aug 2024 01:06: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 47R16h85057323; Tue, 27 Aug 2024 01:06:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16hag057320; Tue, 27 Aug 2024 01:06:43 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:43 GMT Message-Id: <202408270106.47R16hag057320@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: 71484bbbfff3 - stable/14 - nvmecontrol: Move command effeccts page printing to little endian orderinng List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 71484bbbfff3cb93be026749cde3af55ab885c2f Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=71484bbbfff3cb93be026749cde3af55ab885c2f commit 71484bbbfff3cb93be026749cde3af55ab885c2f Author: Warner Losh AuthorDate: 2024-04-16 22:36:25 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move command effeccts page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44655 (cherry picked from commit b850caf7b7099636fd4323cb47a82f5201309fed) --- sbin/nvmecontrol/logpage.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 897bb7a59118..67d296df6afb 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_COMMAND_EFFECT: - nvme_command_effects_page_swapbytes( - (struct nvme_command_effects_page *)payload); - break; case NVME_LOG_RES_NOTIFICATION: nvme_res_notification_page_swapbytes( (struct nvme_res_notification_page *)payload); @@ -442,7 +438,7 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused, printf(" Command\tLBCC\tNCC\tNIC\tCCC\tCSE\tUUID\n"); for (i = 0; i < 255; i++) { - s = ce->acs[i]; + s = letoh(ce->acs[i]); if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("Admin\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, @@ -454,7 +450,7 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused, NVMEV(NVME_CE_PAGE_UUID, s) != 0 ? "Yes" : "No"); } for (i = 0; i < 255; i++) { - s = ce->iocs[i]; + s = letoh(ce->iocs[i]); if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("I/O\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, From nobody Tue Aug 27 01:06:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wn3KVpz5TjTT; Tue, 27 Aug 2024 01:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wn139zz4ly7; Tue, 27 Aug 2024 01:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smNXzD78gP1njYMMXZAcqaLdd4Wai832Cz9S76mp8hE=; b=EiW1zf5QI6WOKKYcfUx6tpHkOg6hGyGSNmCzJkTrj+pue9rHerdX2F5UmyKOzeQltmXppL m6XvyxE9pD2lyrY4dOZ2nLHM8EgiFtGJvm/U6SmbUelT3w/x8M09gX5J3ehdvegnPYZu8p f/8H9P/wl8y1ZEb09NeS9nMEykyhr7XRnI2YD7iE33zF8Wet0Cm2nWgpkJ2/WxHcklf/bf eh6K7lDkVJeKyeGHHjMiwa1GcMQjveyNCZDYtkBsrK3oVahIHx4W2aIr2N1btSOMJF4Toz gNMvgVzbvCgQRtOVrDDgNYi+BpfgG1C0ivttP654Wu5Wc5R/aBPdDCa+exrr4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720805; a=rsa-sha256; cv=none; b=YIRBlElDr4vhglh/OIOPRJFlNPnYlrSJcjdgKnYd23F2jN3i1nWJRWltnDfho29TGejRR6 lUylEbhV1jHuZuf7UM06JcQvFr2qCkmkgA3shNc4e4OjFFXYlfhoapmiC/ek4CXFTUoSyY k70mm+XVlzz3YwREQNhw4B/wBz8hkUaiEFkqYos1eWgf0rDmicsGs8uapyVFac3PCLPtUo i4ZRIYJVJqbFXDoDv7AGAgP/HhPA46uvABaTxwZPuWhbZGxdFdCFY1sj7qp1N6I2mBT7ST a2kkn6UXS+nDKQmFwxLWtdKND6AOipkAzawM5C0FNdkJk/ob7HTomE/npivsMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smNXzD78gP1njYMMXZAcqaLdd4Wai832Cz9S76mp8hE=; b=MNZZ2tbcFvjImBzbgDlc8WnV9YBX3PfPqZNEJ2SsPTEGkWSlnicTYsZtrxFM9HkowOU1eL PjJb4vc/p6riEBkEWFR/VHrdO3LRjyRQB6xcMHr8+Lk+108OBv+DwdZzQgPi302YxpgN8C T8iYfE+ObhiCF9+MA2vGCxPJWXux8ynLa+lL1nr4rAz16GxQ0zNJdOhdxaCG7PvWJPF9Jy 6QtOdr3s/9d+74bWOny4wy+fj0SN5iCRdwnXCFQJuL1eR10ZJu2TOrB4twjKTknLD+5PmK 17KWKvxlJp1+JZxT45V7g5JapPgYJGaoBc5TvDpVkagqAP5if4k0LI3KKPQDmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wm6nlpzT9X; Tue, 27 Aug 2024 01:06: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 47R16iMq057380; Tue, 27 Aug 2024 01:06:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16iJI057377; Tue, 27 Aug 2024 01:06:44 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:44 GMT Message-Id: <202408270106.47R16iJI057377@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: 36269290fcad - stable/14 - nvmecontrol: Move reservation notifcation page printing to little endian orderinng List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 36269290fcadcb617c5f02348bc056b3084d8311 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=36269290fcadcb617c5f02348bc056b3084d8311 commit 36269290fcadcb617c5f02348bc056b3084d8311 Author: Warner Losh AuthorDate: 2024-04-16 22:36:31 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move reservation notifcation page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44656 (cherry picked from commit 3d28a9c608a382af669e22e9e8eda7fd0bc02cad) --- sbin/nvmecontrol/logpage.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 67d296df6afb..b4f9996b10c2 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_RES_NOTIFICATION: - nvme_res_notification_page_swapbytes( - (struct nvme_res_notification_page *)payload); - break; case NVME_LOG_SANITIZE_STATUS: nvme_sanitize_status_page_swapbytes( (struct nvme_sanitize_status_page *)payload); @@ -473,9 +469,10 @@ print_log_res_notification(const struct nvme_controller_data *cdata __unused, printf("Reservation Notification\n"); printf("========================\n"); - printf("Log Page Count: %ju\n", rn->log_page_count); + printf("Log Page Count: %ju\n", + (uintmax_t)letoh(rn->log_page_count)); printf("Log Page Type: "); - switch (rn->log_page_type) { + switch (letoh(rn->log_page_type)) { case 0: printf("Empty Log Page\n"); break; @@ -489,11 +486,11 @@ print_log_res_notification(const struct nvme_controller_data *cdata __unused, printf("Reservation Preempted\n"); break; default: - printf("Unknown %x\n", rn->log_page_type); + printf("Unknown %x\n", letoh(rn->log_page_type)); break; }; - printf("Number of Available Log Pages: %d\n", rn->available_log_pages); - printf("Namespace ID: 0x%x\n", rn->nsid); + printf("Number of Available Log Pages: %d\n", letoh(rn->available_log_pages)); + printf("Namespace ID: 0x%x\n", letoh(rn->nsid)); } static void From nobody Tue Aug 27 01:06:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wp5HY7z5TjWy; Tue, 27 Aug 2024 01:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wp1cqFz4m8K; Tue, 27 Aug 2024 01:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dEo+Qh0ATv07NqYJeGpqs6Q3lEbHzgQqwxu+Fswq8c=; b=Pw5vtVSmxZoSB94LMOMqBirZm/SsmFwn2zEEKR0iEhVnFbkqECTmXYVE0OCxwplerzkP5J G6Lm0BMdiiMkwW4XkZxvMKaRBdmEXlaJFWiSonCW52F+gwJexLturTQYKvSspkl50ubYT6 sjS0XHJecgmsGWuMv+gruw+sbwGtrZ1wFmZPSqFGSIKDzWdO87ZiRcyc8WHIhdgsu1B2GM Ve/TISzbX9IEY9hzRFvNcVdgm0rgG8i376gWYH0r6ZDQXK0Wd2yBY5PiA0VDaaQtdCuKVR 6fCt3GWEFCwg1yo2TZfyADjgPbV0jwMK6bDcGMXt2O9D6ZdP+XosvLlSXDzE2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720806; a=rsa-sha256; cv=none; b=WH1Iw2TqH6nJge7+Ye4cdwa8UfVnn6eevGI28zpq5mdHnkKQFWNFwSWArLcB3hxlljnT77 cQplRRIYcQeJJ4fA9IchkgOi8gceUS19UL0sBx8TF3KugxUb8RVjtnfV+LIODvnabk7/JM nRZhGWkPXOjl/XIrHhc3gygrgP7Byccjqd0miT+McN/TKbG+LtaaybUz9E8U5nygI7PLxp Cc29f0nuWfqOp+AU6kiWreG/2I/OYdCZuk2GZt6dJvaOCuKdeU0YqtftSCG5ekPq3QI5Ge z9H2fpOXbqd7l4O1doQDQTPgTCW/qTw8ODFrKc63SNYo2iWJn1s3TluIOxzM7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dEo+Qh0ATv07NqYJeGpqs6Q3lEbHzgQqwxu+Fswq8c=; b=Tpf5psigJptDJ1a6UkGB47IeZkhdHppxE55mPM2+oFvSGwCZcpCmc/YVlMulolzIJYJkJC nZcVJiDRjGQ3/xwrKHqaL8dgfmAr8NhMgvKe9HSRg15f+ppgedz1UW+WshsI1OaKpMUcKV ZAgvptSJv/vI/096/P0sRlO4S7urwDK9lhijSj97rAzFKUcXHDNiQvLbJH6sfV45r4pI7r T3CEyu6TpHzbMbq898GJZDyw7bcvHMhiUtnes1P5rY26gac9fu6R6sst8vhkHwD1nEg8xs etqBJoaat/G34BtZiCHZ2OfUyLTVimN0iIIkbYYDnVje+Wxcv4nVpxjbkV3XUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wp18SFzV6h; Tue, 27 Aug 2024 01:06: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 47R16k9V057439; Tue, 27 Aug 2024 01:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16ksL057436; Tue, 27 Aug 2024 01:06:46 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:46 GMT Message-Id: <202408270106.47R16ksL057436@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: 1bc8c6d40dc1 - stable/14 - nvmecontrol: Move sanitize status page printing to little endian orderinng List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1bc8c6d40dc19cc9a42abe2e8834e8a5dc3855d6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1bc8c6d40dc19cc9a42abe2e8834e8a5dc3855d6 commit 1bc8c6d40dc19cc9a42abe2e8834e8a5dc3855d6 Author: Warner Losh AuthorDate: 2024-04-16 22:36:36 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move sanitize status page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44657 (cherry picked from commit 55a1679ece1f56beda5f68e929a6b2fc553fb501) --- sbin/nvmecontrol/logpage.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index b4f9996b10c2..a01ce8d0f237 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_SANITIZE_STATUS: - nvme_sanitize_status_page_swapbytes( - (struct nvme_sanitize_status_page *)payload); - break; case INTEL_LOG_TEMP_STATS: intel_log_temp_stats_swapbytes( (struct intel_log_temp_stats *)payload); @@ -499,15 +495,18 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, { struct nvme_sanitize_status_page *ss; u_int p; + uint16_t sprog, sstat; ss = (struct nvme_sanitize_status_page *)buf; printf("Sanitize Status\n"); printf("===============\n"); + sprog = letoh(ss->sprog); printf("Sanitize Progress: %u%% (%u/65535)\n", - (ss->sprog * 100 + 32768) / 65536, ss->sprog); + (sprog * 100 + 32768) / 65536, sprog); printf("Sanitize Status: "); - switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss->sstat)) { + sstat = letoh(ss->sstat); + switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); break; @@ -524,22 +523,22 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, printf("Completed with deallocation"); break; default: - printf("Unknown"); + printf("Unknown 0x%x", sstat); break; } - p = NVMEV(NVME_SS_PAGE_SSTAT_PASSES, ss->sstat); + p = NVMEV(NVME_SS_PAGE_SSTAT_PASSES, sstat); if (p > 0) printf(", %d passes", p); - if (NVMEV(NVME_SS_PAGE_SSTAT_GDE, ss->sstat) != 0) + if (NVMEV(NVME_SS_PAGE_SSTAT_GDE, sstat) != 0) printf(", Global Data Erased"); printf("\n"); - printf("Sanitize Command Dword 10: 0x%x\n", ss->scdw10); - printf("Time For Overwrite: %u sec\n", ss->etfo); - printf("Time For Block Erase: %u sec\n", ss->etfbe); - printf("Time For Crypto Erase: %u sec\n", ss->etfce); - printf("Time For Overwrite No-Deallocate: %u sec\n", ss->etfownd); - printf("Time For Block Erase No-Deallocate: %u sec\n", ss->etfbewnd); - printf("Time For Crypto Erase No-Deallocate: %u sec\n", ss->etfcewnd); + printf("Sanitize Command Dword 10: 0x%x\n", letoh(ss->scdw10)); + printf("Time For Overwrite: %u sec\n", letoh(ss->etfo)); + printf("Time For Block Erase: %u sec\n", letoh(ss->etfbe)); + printf("Time For Crypto Erase: %u sec\n", letoh(ss->etfce)); + printf("Time For Overwrite No-Deallocate: %u sec\n", letoh(ss->etfownd)); + printf("Time For Block Erase No-Deallocate: %u sec\n", letoh(ss->etfbewnd)); + printf("Time For Crypto Erase No-Deallocate: %u sec\n", letoh(ss->etfcewnd)); } static const char * From nobody Tue Aug 27 01:06:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Ws5sl6z5TjP3; Tue, 27 Aug 2024 01:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Ws4dhLz4mKL; Tue, 27 Aug 2024 01:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LCn77Ag3FwovXzwn0AEWGDjyBsHQ4eN6fIbwTOkLosU=; b=sa72z+f5PiHgjOIGxg5imr1Esgp757DcRhmVui/YhiL0/FpYifDoIvJh2Wg+xbd1CT1F2p G4/vx7NOYj832uC8VWS1vo/pMwJJ+Xx3roiWHjyJRZGT+g80PYirhGOasYw2o2pe/Nwdw9 Ht+1ZJPgw+N5OvfMR+kEefGKuA2O84ERlvrd2VJhmZWYdLU9EbI37JC9LYCLALLfhk7lb3 JILIvshKnW1zARyAwvRAj4+PemjBLBWs6hXLjk/Hkl5VvG1qPaV1k8YyIbvi2tKWzjQbGX 6rBsXGnqxin9c6oLzYOi+s7CQC//I/whblprAcT3AOIVO5AOwIznj4J3r9FqKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720809; a=rsa-sha256; cv=none; b=fLW04ejzoY7CN+R6RU8X86eZORk5PH2Lwx0VTS4/3wqi0J8SPwi3gmue8yOfw8/f++miw4 RayoQo4avxR78Nl+4Nqay4dVx7ZiFtNPJkgtSJ8WtIC8V3GGE/Y9bJlPryvCcavwkFf13T mDE7hO5p1xuKvLfG7gz6JpDhcStLq4aD/W8dCkmBpJ5qI4xY9TMharJBQaL0byaMSNuktq WonHBVgFFLJC3t4U2pAOevwtBZMGWYRvJDOBOKx+MZlMsqsfUbRTtblHnPKz3gT+E7M6W1 0L2mySb3MFsXQDj63CS8op2pwCUNyPsf+trWqJJdAxYnH+xgAdS+eedNyectGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LCn77Ag3FwovXzwn0AEWGDjyBsHQ4eN6fIbwTOkLosU=; b=W1kFCXkdXm3ATO7UiPe5DzwoUJj55J+9otHY7F18IjIctK/jdvk1L8tVMtH579i3G/4sci yrOndNE02bL7DlQozJ+2JR+fHgnhBnKEApdB3kuwTHcizAmlo5ocXcauYaEhtZ6LxMxIJs hxeyGOwsFGhK86DdiWw0paf0gs0rj/CiLNn4bQwYqczscvnNVPnGoKohOw6MPVjF6mJ3h0 ctY/PVYFIKg3DaQSkKdD1ZyCvcM6D1QlvTkkzAG4HLG6GCh8gYCPbknaUA9UUCxKN1vh6t bfQmDnLxCE4VWuT2FWSb5nXdwEP0Ga0crqRQbbgcUKGALbubFnqjVmRYbyaF+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 4Wt8Ws460HzTf7; Tue, 27 Aug 2024 01:06: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 47R16nSU057591; Tue, 27 Aug 2024 01:06:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16nKQ057588; Tue, 27 Aug 2024 01:06:49 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:49 GMT Message-Id: <202408270106.47R16nKQ057588@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: 37109ba0ec1f - stable/14 - nvmecontrol: add newlines where needed for ns command printfs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37109ba0ec1f5d17f5e006ec8f7a76aca4d7765d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=37109ba0ec1f5d17f5e006ec8f7a76aca4d7765d commit 37109ba0ec1f5d17f5e006ec8f7a76aca4d7765d Author: Warner Losh AuthorDate: 2024-04-16 22:36:54 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: add newlines where needed for ns command printfs Sponsored by: Netflix Reviewed by: chuck, jhb Differential Revision: https://reviews.freebsd.org/D44681 (cherry picked from commit e39873820da7ddfddb59823efc3421125b92c17a) --- sbin/nvmecontrol/ns.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 27f622162c7d..70392af19111 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -647,7 +647,7 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (delete_opt.nsid == NONE - 1) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (delete_opt.nsid != NONE - 1) @@ -713,7 +713,7 @@ nsattach(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (attach_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (attach_opt.nsid != NONE) @@ -783,7 +783,7 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (detach_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (detach_opt.nsid != NONE) @@ -860,7 +860,7 @@ nsattached(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (attached_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (attached_opt.nsid != NONE) @@ -913,7 +913,7 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (identify_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (identify_opt.nsid != NONE) From nobody Tue Aug 27 01:06:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wr6gYwz5TjP2; Tue, 27 Aug 2024 01:06:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wr3mtyz4m6c; Tue, 27 Aug 2024 01:06:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awyvXD3ZPz3W6JIsbSzZPq3T3+GNsf+D2KHoRvp5JHc=; b=vieFDVG0O918VurDexQyHEeI9sW50aFHZKzXCLZQDMGhz5xKhFZW1uQ/AqqfzS7cM2Msd9 bgQXuasDd9H/Yc4fIdFvZA/Dr5eIrpGfYIrj0aDy6FQCaU0ABGTBAfoZScIoSTlFN/cXHU zudSP9aMRlYI59UO4+dLXeYLknBJuZ84lVFymdNyEyrXMCvia0CY5doMMmAEjhYkM7TAL2 SigYLKNpiVvjEvF42yOEezMASYAgmzMovrwqSoQ8+IyrZTDIHZc44Vxe/YeB+lzOOU1ayo 7IeH1I4xeYx+8dNxk/QGNRGZladAiTml7n0AvyfxJioB0v0kXtIPCkIe1CZ8zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720808; a=rsa-sha256; cv=none; b=Pphq2yDfEr5eJCxH8STryiTd/B9jxiDw+uqfXIsrFjv6/5pEq6iYikr2eV/sIBj1dDDYpZ 4cfphfVvIMTJssQx6d2TD8OVFfhhcP4YcMJBKb4iUVZ9QdP8DAa809jL9S69lbOmyQXUrx yrfEH0uhjoKdhwK+3kB2M7TwwCACBM/+yyoZw1ESVcvqjD2iC8DxDRs26DyHsSorxFFl8C 0f/HZVd+UI3MTioLdj4aR+a7IGSbPpwL0TG3WaTT3V3mVwnzw6YDZJSAuUO7Zttpa5N9go Z33gdiQlPT2/bs3DVyQ06OeVawYz4LvefweyJ98yRBlsSL23PErgRxNT5bcH+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=1724720808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awyvXD3ZPz3W6JIsbSzZPq3T3+GNsf+D2KHoRvp5JHc=; b=LD1rUSO8IkMftIKL37ev+yKX2zDXQlfjSDSBalN8hjoNLLgcpuXXVdpa7t+5XNdTNpFajT rAeNmTkkgS02C0TVwZnfnFe/Tg38PeAhviZ3951AXyL0BExJUIc4fL2FRMWi5xhhzDwt2C IJT7LqEXLflspNsBXIy0K+e2mwbL92hVfPLUweVFLofoe3R6yBiIf81TajJzCCFuLlt40k sI4BuBB3N75mEbUET+sTJDJUP3HfH/HyxG+y5i7/aShFDESBndV6IAGbWU4ncmyglgMijP N2dzc4NvVtqY0Hv5TzaPeSPfUiJXVFpP8FznkuxflFk4UL61jXd4oc/hsb9+1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wr2v2TzV4R; Tue, 27 Aug 2024 01:06: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 47R16m6n057535; Tue, 27 Aug 2024 01:06:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16mex057532; Tue, 27 Aug 2024 01:06:48 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:48 GMT Message-Id: <202408270106.47R16mex057532@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: 1dac1524786b - stable/14 - nvme: Eliminate intel_log_temp_stats_swapbytes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1dac1524786b6600a2218adcebf4ad8977aa0341 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1dac1524786b6600a2218adcebf4ad8977aa0341 commit 1dac1524786b6600a2218adcebf4ad8977aa0341 Author: Warner Losh AuthorDate: 2024-04-16 22:36:47 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvme: Eliminate intel_log_temp_stats_swapbytes We can't post a AER for this page, so there's no need to be able to swap it to host byte order. It's not one of the standard defined pages that can post via AER, and the vendor's public docs for this temperature page don't suggest it's possible to get over or under event changes. Since nvmecontrol no longer needsd the swap routine, remove it since it's now unused. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44659 (cherry picked from commit 97b77de2d951b4946fb3219a99c98f2dd4c0120f) --- sys/dev/nvme/nvme.h | 17 ----------------- sys/dev/nvme/nvme_ctrlr.c | 4 ---- 2 files changed, 21 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index cceafc743519..45133c7a9b91 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -2225,23 +2225,6 @@ void nvme_sanitize_status_page_swapbytes( #endif } -static inline -void intel_log_temp_stats_swapbytes(struct intel_log_temp_stats *s __unused) -{ -#if _BYTE_ORDER != _LITTLE_ENDIAN - - s->current = le64toh(s->current); - s->overtemp_flag_last = le64toh(s->overtemp_flag_last); - s->overtemp_flag_life = le64toh(s->overtemp_flag_life); - s->max_temp = le64toh(s->max_temp); - s->min_temp = le64toh(s->min_temp); - /* omit _rsvd[] */ - s->max_oper_temp = le64toh(s->max_oper_temp); - s->min_oper_temp = le64toh(s->min_oper_temp); - s->est_offset = le64toh(s->est_offset); -#endif -} - static inline void nvme_resv_status_swapbytes(struct nvme_resv_status *s __unused, size_t size __unused) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 52e412c5202a..5a825c10f584 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -729,10 +729,6 @@ nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl) nvme_sanitize_status_page_swapbytes( (struct nvme_sanitize_status_page *)aer->log_page_buffer); break; - case INTEL_LOG_TEMP_STATS: - intel_log_temp_stats_swapbytes( - (struct intel_log_temp_stats *)aer->log_page_buffer); - break; default: break; } From nobody Tue Aug 27 01:06:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wq3w3mz5TjLv; Tue, 27 Aug 2024 01:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wq2jtXz4m6T; Tue, 27 Aug 2024 01:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=327REn5C/Io+qb6zi1i1V5e0SilIMf6OIserZp7gWrc=; b=aNgy3xrcLEErsgyZPTxmIsXn37Fth83qiOmL965nbyJ0bm/PW5n4BtPH5qhe5umZaHBHdr bpcEEqjr6x+p8V8WnTqTxmJJ6rp3WEdYBlD1ohzLxdnrXz/ykYOOl1zxfchkTT67oSqqJW bZAOTnm03svEhVXmv9FnhybuK1tsvmakQI484ZHEzyPK2QhVDNuupRRkVmXAGPHkVOwHZV Ren2xWeLJsSpzp5MY8e3Pvwh2kGUxqa6uVaYLoIM+f+Hg8iXSYO2YitH3UhcOrhTuIbwB4 tZo+kaeWU0RcGOWxCXXE9JCDHvfI8gEeJx0hLTF6QLlsTFrpsdNndvaDrG3rEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720807; a=rsa-sha256; cv=none; b=sOvC3gOd15KM7/IzkuebqL5+kL2N5LOXnb2JknpLt+6qU+V3VDRVvXpwWcqSRfJUtZ/fkk 1YsvqKD5lPRjuQfaVxy5IvDRGQH5VfhkDbVNyDpLz8THNCq+blaCZtxhhvdaH9qAv0EFei gVSSrsAmnJPIwJLLHuAdo5UJwvvXrB3hPsT6NsaJg0diCCqrE4lyPY0iVw4Rv/rxRpeVSd Hx3mBUsP0ptpFwhZWw1ZQNUDr9mlBAs40bNsCfId3/8FwtcRBaPkBopRlHzhkPfsWP3r2M KpZMJ7j4e80Bf9pZOpAGsm38q6bwfi8HUowmSvQ9c6LhW2OygpGPC+vYdo1cXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=327REn5C/Io+qb6zi1i1V5e0SilIMf6OIserZp7gWrc=; b=JVnZ6FfAiqQPKgJSnY2llFSJYJ9nitGDwSHmQTvhOJXkqI9vZxgh1PlvcvZ+znO+3KiUXi DQtDD/TA5Re/xfuaucoafwE7Bw4T1fWv9oN02NLXroejHbDeUfXtiCo5kQz7lRd84teIUG XtyvX+QstdJgXYFipMNEpxzVFG+Kj8RF1xWnZlub9SxX0pHKgbLbItZsikHc2Yzj/KAEmQ 7ktCHTYaRHAFRds146jenMAxOHTnpdjgivwv2fqqtG2/nP1aAf33Ks6mfN+X57td3zQ6Vd z/HFP/YV6C1N6sbLXecI+FYtkYwS0Zt5gxL0N1J51As0BUlE9dniA9PSLdWFmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wq1s04zTf6; Tue, 27 Aug 2024 01:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47R16ln9057498; Tue, 27 Aug 2024 01:06:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16lfi057495; Tue, 27 Aug 2024 01:06:47 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:47 GMT Message-Id: <202408270106.47R16lfi057495@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: 4e7cc8f545c2 - stable/14 - nvmecontrol: Move intel temperature page printing to little endian orderinng List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4e7cc8f545c2bd3c7a104c9d53a9ca5329121094 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4e7cc8f545c2bd3c7a104c9d53a9ca5329121094 commit 4e7cc8f545c2bd3c7a104c9d53a9ca5329121094 Author: Warner Losh AuthorDate: 2024-04-16 22:36:41 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move intel temperature page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44658 (cherry picked from commit f0f7e9616da052e3d77b6e41301ccd655ae434fa) --- sbin/nvmecontrol/logpage.c | 10 ---------- sbin/nvmecontrol/modules/intel/intel.c | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index a01ce8d0f237..385b7d70c2aa 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -218,16 +218,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) err(EX_IOERR, "get log page request failed"); - /* Convert data to host endian */ - switch (log_page) { - case INTEL_LOG_TEMP_STATS: - intel_log_temp_stats_swapbytes( - (struct intel_log_temp_stats *)payload); - break; - default: - break; - } - if (nvme_completion_is_error(&pt.cpl)) errx(EX_IOERR, "get log page request returned error"); } diff --git a/sbin/nvmecontrol/modules/intel/intel.c b/sbin/nvmecontrol/modules/intel/intel.c index cc5c9c49beb5..5e58727cbfb1 100644 --- a/sbin/nvmecontrol/modules/intel/intel.c +++ b/sbin/nvmecontrol/modules/intel/intel.c @@ -62,18 +62,21 @@ print_intel_temp_stats(const struct nvme_controller_data *cdata __unused, void * printf("=====================\n"); printf("Current: "); - print_temp_C(temp->current); - printf("Overtemp Last Flags %#jx\n", (uintmax_t)temp->overtemp_flag_last); - printf("Overtemp Lifetime Flags %#jx\n", (uintmax_t)temp->overtemp_flag_life); + print_temp_C(letoh(temp->current)); + printf("Overtemp Last Flags %#jx\n", + (uintmax_t)letoh(temp->overtemp_flag_last)); + printf("Overtemp Lifetime Flags %#jx\n", + (uintmax_t)letoh(temp->overtemp_flag_life)); printf("Max Temperature "); - print_temp_C(temp->max_temp); + print_temp_C(letoh(temp->max_temp)); printf("Min Temperature "); - print_temp_C(temp->min_temp); + print_temp_C(letoh(temp->min_temp)); printf("Max Operating Temperature "); - print_temp_C(temp->max_oper_temp); + print_temp_C(letoh(temp->max_oper_temp)); printf("Min Operating Temperature "); - print_temp_C(temp->min_oper_temp); - printf("Estimated Temperature Offset: %ju C/K\n", (uintmax_t)temp->est_offset); + print_temp_C(letoh(temp->min_oper_temp)); + printf("Estimated Temperature Offset: %ju C/K\n", + (uintmax_t)letoh(temp->est_offset)); } /* From nobody Tue Aug 27 01:06:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Ww4txWz5TjK7; Tue, 27 Aug 2024 01:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Ww0jz8z4mN0; Tue, 27 Aug 2024 01:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3kVlSuc6/d407iH5kszO5dTB6WfVLOO4CYv6C+bEmc=; b=NvufISk1rbnV64ySCB15VHOwJ+ChxwH4Oncbg/Fy78AvrhMbCEsxSJ8aEec3HIqLpQLLSb xLIcQMlp9hAm70+jNHLx32BIQ1pwpcCeNVUhIQJ1TkdtSTPptf5k2BbZxm1X7ohAE87a1M oy/yUwatdBZluzKEs0PcgzGtb1P5LOhhdAvVlu3E0/WrxTPMU7sP5+q6jytx5zspZ//RIr sH9PqYmjS8zALNshQveWSaOD68T+u/1OMDwTAUj/Pmi+i4wRNJ5V9Fu3scN62sh20PocAc 7Ag2Uc7XAxpzFRpdE7Ln4RjETc55yb+ZRCJk0qG9V9AV/3Yib3fQ8voUfwKYGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720812; a=rsa-sha256; cv=none; b=Z+bnHWmiVjJtcllL6LxNwbl93MPg2zL52uF/m1euyD6bqhbJjecii5Dk90c3qFihp7Rhk5 PpChJajF4ycGP17YHE/QGwf8J5dkQUTpO7/nB2fQN7kVdhkLS6btEYTAss7dm83k2JuSW9 epyrOFpebzkrwYWKg9kx7ZWSXHPN7UqAnz+O8buBukpWjvskJ2mtM8SgnQE+jIX8laLIyX hmhJIpTgdNjCZGUVYQmCJ0nYJAdYsME7Wfh3mrd5XCqhDAxwO007udouI1UEhTjMSm1nkF B1AdnEBD0s0BocGJx7+8ljMOfp8vnjeUJAk4vvw82XeAUt6sQLi+ahWejf+N4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3kVlSuc6/d407iH5kszO5dTB6WfVLOO4CYv6C+bEmc=; b=D+FSQhnuSLdVjBPvM8Yspi9jIKyO6sQPcKACZ8y1AHmjbgG0MudZnp5IaJJy5ZrVeeIIm3 a2Rg28h1dxRySQMOaN+U8NWlPcj4ckH/FAbZnwBAHQecBBpLcqFmrAHPkthC9e+IbiWiYq 42r+foHQ/3QQJX00V+/2vQpqK/l8nibuxERBaPf41JjXA8xkx/fzy3n+1HhAJg4EizmRhw UDSn55hEDhzp/ZOL3ru/KcSuwygkgSQAhye1D9/8nnFBmMWfcr9MFQaODaq8zOD6cY1NMV r1nxhPyw/tHjA7QnWrHEqx+OuofuD+uVl2E5YvWCephF/6RbK8CV0IzeOrkHow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wv6TbhzV6j; Tue, 27 Aug 2024 01:06: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 47R16pSk057686; Tue, 27 Aug 2024 01:06:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16pnU057683; Tue, 27 Aug 2024 01:06:51 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:51 GMT Message-Id: <202408270106.47R16pnU057683@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: efb91b313c64 - stable/14 - nvmecontrol: Add nvme 2.0 fields to read_logpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efb91b313c644c6bd50b24685a16cff83eb41a07 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=efb91b313c644c6bd50b24685a16cff83eb41a07 commit efb91b313c644c6bd50b24685a16cff83eb41a07 Author: Warner Losh AuthorDate: 2024-04-16 22:37:20 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Add nvme 2.0 fields to read_logpage Add the lpo, ot, csi and uuid_index fields to read_logpage. The logpage command has not been updated to allow these to be specified. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44683 (cherry picked from commit 98ab7d0a30f8d0fc9c51e1e97ac29f87750b526c) --- sbin/nvmecontrol/firmware.c | 3 ++- sbin/nvmecontrol/logpage.c | 15 ++++++++++----- sbin/nvmecontrol/nvmecontrol.h | 3 ++- sbin/nvmecontrol/sanitize.c | 3 ++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index 8fcc4ba4f46e..74d185313f50 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -103,7 +103,8 @@ slot_has_valid_firmware(int fd, int slot) int has_fw = false; read_logpage(fd, NVME_LOG_FIRMWARE_SLOT, - NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &fw, sizeof(fw)); + NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, 0, 0, 0, 0, + &fw, sizeof(fw)); if (fw.revision[slot-1][0] != '\0') has_fw = true; diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 385b7d70c2aa..770eed3d7848 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -191,7 +191,8 @@ get_log_buffer(uint32_t size) void read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, - uint16_t lsi, uint8_t rae, void *payload, uint32_t payload_size) + uint16_t lsi, uint8_t rae, uint64_t lpo, uint8_t csi, uint8_t ot, + uint16_t uuid_index, void *payload, uint32_t payload_size) { struct nvme_pt_command pt; u_int numd; @@ -208,9 +209,12 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, pt.cmd.cdw11 = htole32( ((uint32_t)lsi << 16) | /* LSI */ (numd >> 16)); /* NUMDU */ - pt.cmd.cdw12 = 0; /* LPOL */ - pt.cmd.cdw13 = 0; /* LPOU */ - pt.cmd.cdw14 = 0; /* UUID Index */ + pt.cmd.cdw12 = htole32(lpo & 0xffffffff); /* LPOL */ + pt.cmd.cdw13 = htole32(lpo >> 32); /* LPOU */ + pt.cmd.cdw14 = htole32( + (csi << 24) | /* CSI */ + (ot << 23) | /* OT */ + uuid_index); /* UUID Index */ pt.buf = payload; pt.len = payload_size; pt.is_read = 1; @@ -795,7 +799,8 @@ logpage(const struct cmd *f, int argc, char *argv[]) /* Read the log page */ buf = get_log_buffer(size); - read_logpage(fd, opt.page, nsid, opt.lsp, opt.lsi, opt.rae, buf, size); + read_logpage(fd, opt.page, nsid, opt.lsp, opt.lsi, opt.rae, + 0, 0, 0, 0, buf, size); print_fn(&cdata, buf, size); close(fd); diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index 4187c9bee432..2ce4ad4c5c2b 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -84,7 +84,8 @@ int read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdat void print_hex(void *data, uint32_t length); void print_namespace(struct nvme_namespace_data *nsdata); void read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, - uint16_t lsi, uint8_t rae, void *payload, uint32_t payload_size); + uint16_t lsi, uint8_t rae, uint64_t lpo, uint8_t csi, uint8_t ot, + uint16_t uuid_index, void *payload, uint32_t payload_size); void print_temp_C(uint16_t t); void print_temp_K(uint16_t t); void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, void *buf, uint32_t size __unused); diff --git a/sbin/nvmecontrol/sanitize.c b/sbin/nvmecontrol/sanitize.c index 4611a6964a4d..52e1b0f4dad7 100644 --- a/sbin/nvmecontrol/sanitize.c +++ b/sbin/nvmecontrol/sanitize.c @@ -183,7 +183,8 @@ sanitize(const struct cmd *f, int argc, char *argv[]) wait: read_logpage(fd, NVME_LOG_SANITIZE_STATUS, - NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &ss, sizeof(ss)); + NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, + 0, 0, 0, 0, &ss, sizeof(ss)); switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss.sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); From nobody Tue Aug 27 01:06:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wv5wKMz5TjZL; Tue, 27 Aug 2024 01:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wt5fjbz4m9J; Tue, 27 Aug 2024 01:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRWeO6/MfCKWRRWEp5+n74tVlxizUYi2HoOfBnJ+clo=; b=nA2OkyDWHMtwL3JGDqthqswd6leJLLycO8B6FPRVxz8n4dl4e5Yfkn/H7DayGy/nFu2+gR kdQNwsdxGpnJbE9can/VISqNsYI7aFtax/Jy7TvAHrOSpNncxXEPqtjJHP5ZpkS7ukCwkf 5Plyl+FWXxMXToUlrzHH89oDTDEOkbS/w0s3Q9WB0AW+XUM58VmWyqYNxjS+hFPXE3YMmW eGDfnDZuuukehQH6AMr3MY/aSBzNaje1TERclYGh+TAr8lBKWNs79wZ88LsO+0VzNFnhS4 a0l9R4UN2NLV0fwwd3zskUYZnkOy8X2mqVj7BhlS5JkxsSWc367u5UL3G8zcZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720810; a=rsa-sha256; cv=none; b=Qif4XlMO3FQsjSjPUqlPe6cNk3czK1/gkfkAEpa8g1i2Hnqw9TmJNjKltPrLFR7IDolXfr 08/v4kgmo4mn5UfXkkFkAp8FftobFEKBdL2khYdG0MDfRJqy/3z9Ocix+mzFFGNL/7btK9 2vxifvnLfLRAXhIN2y9PmoCIEg1Jb/M4gwAmxyZ/m1Wil9dS0UGFnC58pGFOZWzKjSMMg6 hdDe6NPFicYsAf8ZpymGje9blI9lyDaAJEEPAYLVCC5qrzdDsNGia68hBpNt1QrzjxJets n2TIjWDkRkIu5t5kYRJIlZu/jSYk7CBskkMf21MO/axS7eMUZ5b1lCgMMb1wYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRWeO6/MfCKWRRWEp5+n74tVlxizUYi2HoOfBnJ+clo=; b=vAGfbTea2rGTRJj0P1mI4cvNwaxKa8XszwNWmhOqUeWLabNDuKW/S9Y2/GNCFzKkzEN0kz 2JKcSmpO7gM8ZZ7FezpFoyzf4sge0IqpSfhFTo9zvmf2Zb9iyMQCGzdeG1hM3gybkFOADs 7/s6P7ijrmpY+Te689+1a0zWwWqbQ5vW+vFzsEI6g1gDx5KSFk718zmCyXyngxACTyFNiY vQiajS/5V0rgKZz+e7TJ4VnqkvXwFPS7c/HwBqg9ZxIf9dOXJyIF99svov6fMmCqCYotGm +BQ+WhZM28Dw1Ko7L1/Y7p+tPbxB9BaS7mLvPluzFCM/G8+//7ki1fyVgag8Dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wt5FXWzTf8; Tue, 27 Aug 2024 01:06: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 47R16o4c057636; Tue, 27 Aug 2024 01:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16oTk057633; Tue, 27 Aug 2024 01:06:50 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:50 GMT Message-Id: <202408270106.47R16oTk057633@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: aaac429c1259 - stable/14 - nvmecontrol: Preliminary namespace documentation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aaac429c1259555fa990c1a97df8de7fda5f60f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aaac429c1259555fa990c1a97df8de7fda5f60f8 commit aaac429c1259555fa990c1a97df8de7fda5f60f8 Author: Warner Losh AuthorDate: 2024-04-16 22:37:02 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Preliminary namespace documentation Provide preliminary namespace subcommand documentation, along with some basic definitions from the NVM standards relating to namespaces. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D44682 (cherry picked from commit 383a44fc0bcb36bf67127856f0c5fabfea522bab) --- sbin/nvmecontrol/nvmecontrol.8 | 43 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index edeeb9afa10f..b812149b5c7d 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -33,7 +33,7 @@ .\" .\" Author: Jim Harris .\" -.Dd February 28, 2022 +.Dd April 17, 2024 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -302,6 +302,47 @@ will set Retain Asynchronous Event. Various namespace management commands. If namespace management is supported by device, allow list, create and delete namespaces, list, attach and detach controllers to namespaces. +Each NVM device consists of one or more NVM subsystems. +Each NVM subsystem has one or more NVM ports. +Each NVM port is attached to one or more NVM controllers (though typically 1). +Each NVM controller is attached to one or more namespaces. +.Pp +After a namespace is created, it is considered +.Dq allocated . +All namespaces that have not been created are unallocated. +An allocated namespace may be active or inactive. +An active namespace is attached to the controller and may be interacted with. +A namespace can move from active to inactive when detached. +An allocated namespace may be deleted to become unallocated. +For more details on the nuances of NVM namespaces, please see section 2 +.Em Theory of Operation +and section 3 +.Em NVM Express Architecture +of the latest NVM standard. +.Ss ns active +Provide a list of active namespace identifiers for the givne NVM controller. +.Ss ns allocated +Provide a list of allocated namespace identifiers for the givne NVM controller. +.Ss ns attach +Attach an nsid to a controller. +The primary controller is used if one is not specified. +.Ss ns attached +Provide a list of controllers attached to a nsid. +If only a nvme controller argument is provided, a nsid must also be specified. +.Ss ns controllers +Provide a list of all controllers in the NVM subsystem. +.Ss ns create +Creates a new namespace. +.Ss ns delete +Delete a namespace. +It must be currently inactive. +.Ss ns detach +Detach a namespace from a controller. +The namespace will become inaccessible, but its contents will remain if it is +.Em activated +again. +.Ss ns identify +Print detailed information about the namespace. .Ss nsid Reports the namespace id and controller device associated with the .Aq Ar namespace-id From nobody Tue Aug 27 01:06:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wy4ZKsz5TjRZ; Tue, 27 Aug 2024 01:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wy1zfZz4mWN; Tue, 27 Aug 2024 01:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=anyKFEDXQ47y3oM+JLqzLKYgn7SQuCqNCpWYsWrJrAM=; b=Yo07i+QIWYZtd73iu8G2Ylr63+YRB5QQy9HLhvAa2qWVUVy6v1ROg++pc2UCFgpo0x4JJG lH3jOTHWEI7ahhJU3wTJTXPQPudUoHnJEyI5BITWNkGOQcxR+H7SgbrgJ4zJFYKJVspDSa usrqQl+cVTsslqvurrNu+B1BAu+gXJfQqLRj5NZysTRrs8OkosOuITfgorSmXLMJffn2YK T+1W5AC5x/mmShvh+sk5/Tk9T7T745ZyDNba46mC3pGHSxbPZ50xqMKbWDgyisnS8CNUzL LN7ADkt9FYhSoZ0gpq5N0V+7daQwrsXqdiIuEnyhn7k+S1AYeT8toSlAr+S/Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720814; a=rsa-sha256; cv=none; b=W6ERnjIqa+H0MZZ7dRB1QgbBB6nJcyr4CX2CUg57TgJmy4esp/GOLMXB+ovtqpfySJcS6H pwJ985Y4DL1G5V/JPI5xECY7N3rzXAxiO4N0QL9s7EtKMXJE8ewjv38aCLjav5POn1idZ/ hhSxdWpLt38ZyYzA4wJc1agVPgwzogL9OnNys8ZrV0P1Nbu9G/axIuoRbwOWy1+um628e2 tTCThfL3/CifGD1fgfoMizBQGUmIk99ZndAPTM8ElU1RLoPA6ne2uGzUFrEnGFq4PwocvN GQFjKTKvh9/hKvmXLAntq7IDwGKBncivvpZ6cn+P+iqChPf1iTWpXMUmyuN/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=1724720814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=anyKFEDXQ47y3oM+JLqzLKYgn7SQuCqNCpWYsWrJrAM=; b=PGOI/r8Zfbasx90iJK8a4JhuX1sf3jU8fBs3t6AfeziGfVjHh3tlUzPgt8pz8Rvr5Tik8s sK3D6b6eV7897x19pvG5xmvsiQtVwz5/sktrNN2l/NCUdtR+A+cr/jm2JdeUbKOw4nyb8N uLv63GjNmj8TSp+T2NfiFKq+Cw86cpeGKqzOJX8c0YA3uZxU89/7ohTxI0jInQiuZzYCh4 r69TsBBCSssUDr+H4A5D3tgaYk25Jtf3A+ObpNIMbUOWFxH28OohQWDVg1PIoXKohfAjzH urnAfyvOMLTNKjtt8eylD66UYwa03tx4npezUjK7XWb2QpZq7D1IzIFV5b3/3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wy1YbKzTlf; Tue, 27 Aug 2024 01:06: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 47R16s9H057767; Tue, 27 Aug 2024 01:06:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16sr8057764; Tue, 27 Aug 2024 01:06:54 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:54 GMT Message-Id: <202408270106.47R16sr8057764@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: aba2d7f89dcf - stable/14 - WITH_NVME: Remove from broken. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aba2d7f89dcf7f17f3f9a13ea0b62a6bd02c0db9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aba2d7f89dcf7f17f3f9a13ea0b62a6bd02c0db9 commit aba2d7f89dcf7f17f3f9a13ea0b62a6bd02c0db9 Author: Warner Losh AuthorDate: 2024-04-16 23:07:49 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 WITH_NVME: Remove from broken. NVME works everywhere, so we can eliminate this. We may remove the option altogether. Sponsored by: Netflix Discussed with: ken, jhb (cherry picked from commit 2fda3ab0ac1903a977ef5d39d4dfb2ffe86ff1b7) --- share/mk/src.opts.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 3ff71df3e0da..ea5931ad6c1d 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -347,12 +347,6 @@ BROKEN_OPTIONS+=MLX5TOOL BROKEN_OPTIONS+=HYPERV .endif -# NVME is only aarch64, x86 and powerpc64* -.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ - ${__T:Mpowerpc64*} == "" -BROKEN_OPTIONS+=NVME -.endif - .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != "" __DEFAULT_YES_OPTIONS+=OPENMP From nobody Tue Aug 27 01:06:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wx4qXHz5TjZM; Tue, 27 Aug 2024 01:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wx14lGz4mKy; Tue, 27 Aug 2024 01:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlRR2qvRYwPLBUR/0ojssMzT/yg9iONiQnZMDm9F+ZM=; b=UQtChHJs3fRMy4a9Yf5kpTzVwEmBDvEQuntHBm1HbX0egoFvDEoFZmjF6KncbOGfeOzOkk as6z7uTtx7eAT5x+3pTAxqWlL7JnNTn/lgLmXit/zfjNMtc9L3pQVNJGIVstbsnirNoglW Op1P3TgbZz7K/+IKrphnrAboGc74xcKFkfAB/Q5eOM4ejKV4Nxie47icmYJ7jymkjM6O5U A6F3fut4SYJu6dZpGjjnOHXt0Bzn/T2DG0cBaY3TK4UnNavi1CzzsoI562M02lEUvAqA1t UXwFK+1PfndzicVXXrMb7K69z8nNPeJGdeno0t2FFL5L5j5hn76B1S2jEMFZ4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720813; a=rsa-sha256; cv=none; b=XvhTvVJs0VPBp3/TN3BFE6+t3ZGjl12cxGbRnwQVvnHEEHjVBCbMWGg/guISD1gr/CtyMf sEM+77+m0Q4t1yKPzJ5wUaJ1A+O/4gq3Pme0kUNwRUTRZixRiEnfYKXBx8yesTlryum2Y0 dt/X2snbaaI588m2K11etIWurgX0jRayIx2IAtVSXbnXoUNkRsGNNuLJq/y2Bqu9QPE/Vo MqxyxAnIOxDP9U2GTkg24AVA8u8wHNo4nlwZOZYpQ0wT+VJ1CJo+Jxk3DwmQvKGf5Ao8Bj u413tvstWu1X3ow3t9Q8B8hbVbmbgu029JNBKBrUHiJ40NFBGPnjA5qRDXJykw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlRR2qvRYwPLBUR/0ojssMzT/yg9iONiQnZMDm9F+ZM=; b=yIkjFLxkXOQtMTFkqKQIhGB1dEUibNq7DJOtnS8ZBQkJ/ErCXt7zBmiZxy4H+OhvXtK+0a Dbf5FQhkkq+buhZFnVRfwbI42mu7uGtyGGvIiFWAEceO3E6nIPBwMQrcTn5XXnDuQG6LIV PfVi1TG4QjAQTN8gFHXfYfXyzxKJCQJWhaSIt6WXEos+DszWXCMwaqld4GUeZOyxe2jhJS VYQY19+1qX9Ux1HcaBCsUaHGFDPcwUJXPbxtjBAsGZU6JDB6oN7+cDXA1VGjvKg5kAboSH y6ARSQL+IlBo08BfteuUJjgNfeZslcOdI3JI0Ah5DJrzKNl0KQe8XKtRFaqtBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wx0f94zV3p; Tue, 27 Aug 2024 01:06: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 47R16qip057728; Tue, 27 Aug 2024 01:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16quX057725; Tue, 27 Aug 2024 01:06:52 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:52 GMT Message-Id: <202408270106.47R16quX057725@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: 37eb64d7d25b - stable/14 - nvmecontrol: One file per line List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37eb64d7d25b5bcf92e4eb8352874cfb25c96e1c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=37eb64d7d25b5bcf92e4eb8352874cfb25c96e1c commit 37eb64d7d25b5bcf92e4eb8352874cfb25c96e1c Author: Warner Losh AuthorDate: 2024-04-16 22:37:30 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: One file per line Move to a one file per line setup, and sort the files alphabetically. Sponsored by: Netflix Reviewed by: chuck, jhb Differential Revision: https://reviews.freebsd.org/D44684 (cherry picked from commit 49ea0889f2cb5e786e166fa9536c84f4a9994a6b) --- sbin/nvmecontrol/Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sbin/nvmecontrol/Makefile b/sbin/nvmecontrol/Makefile index e3d363b123ed..f534093b1332 100644 --- a/sbin/nvmecontrol/Makefile +++ b/sbin/nvmecontrol/Makefile @@ -2,11 +2,24 @@ PACKAGE=nvme-tools PROG= nvmecontrol -SRCS= comnd.c nvmecontrol.c -SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c nsid.c -SRCS+= perftest.c power.c reset.c resv.c sanitize.c +SRCS+= comnd.c +SRCS+= devlist.c +SRCS+= firmware.c +SRCS+= format.c +SRCS+= identify.c +SRCS+= identify_ext.c +SRCS+= logpage.c +SRCS+= nc_util.c +SRCS+= ns.c +SRCS+= nsid.c +SRCS+= nvme_util.c +SRCS+= nvmecontrol.c SRCS+= passthru.c -SRCS+= identify_ext.c nvme_util.c nc_util.c +SRCS+= perftest.c +SRCS+= power.c +SRCS+= reset.c +SRCS+= resv.c +SRCS+= sanitize.c SRCS+= selftest.c MAN= nvmecontrol.8 LDFLAGS+= -rdynamic From nobody Tue Aug 27 01:06:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8X010Yzz5TjX3; Tue, 27 Aug 2024 01:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wz3j3Wz4mJ6; Tue, 27 Aug 2024 01:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXmX0KRnkYb4fbbNytiYS787zrwdX9qzhTDGTrVqe7o=; b=oOzT2uOSzj8tP14Pc2BrT63aRsqV+uACqMArm485jpt974xpAKQkoS4zFb2DQ8Hoeubnrd 5Wa8zufBr98/r1KwS3L0BHaKLzg5C98Sd6D/fZGWRB7lcML6+ZUbsqra3d+UHH2T8Gg2Pd lwsCEZqECzpQeZDjt0gbqUFIq36cyusPrpUpfB2EjylbqhuvrSHDnpJjxBOTIyMP1aSUJf I4sUnI2YxxIeFytF6/YbgY1Ftc1R1UTLiFKM/UxuEYGC0SzELQMexbf04SuSCyMSffrGrV 6w2Mzq1q0W7Txvh84Jz00zwl08KExyUou8U4ql40mxmrDGgaxUW/etAWlkm4eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720815; a=rsa-sha256; cv=none; b=H1H7iZtk/qpYEicB1jI8V0C4roTnKX+N8WDJ8quHDqq9IXmLIj4Nb9L38BrHlBT9IvNgnK ToOxAgBgGDO3LFMdw3X2gAxuXIGlQxDcLNtMnUkBsil1VuIMJ7OPXNQX50VAIJkJLpal55 iy/t/Rju7aDCohDOW+puzMye/IKM9/HKWAdn01fz1qKmxbm59OGfA7TdzTR4W2IS96Rqt5 p41sBU8uLAb5vgoGXQ1Xel3pZ+PnZpMXvGDPZ38zRb+iRg+K43psoseMLOcNHcAaS8pRod vHv05yDxiS888HWNllxGvCLt5eLw/3B56jbrHQOOMd+8cQLNSz/nGbGo8b8hgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXmX0KRnkYb4fbbNytiYS787zrwdX9qzhTDGTrVqe7o=; b=rj4LyNessC9VF7phrAGy53XOeVnZBAJm3WxJdDF9TX7izUwDtd/2ejtvHjo/DijGmphfP5 5HKoGKlFq7M7mvEFT5jN+f4AsrUHhtjukixn1ogduTT1zwF5zTr/iIGifheBVlsi5n5CF5 b1NrLLKOpEfeIeCOvUqnZWGz9EjBeA+SH4Hs8CHIV5igPDfJgmUoBwX8JmJyvgXZ6rUb4y 0xMWgSjhHGNGpp+skV2ejT5MHkMoUHffe6sz6yBQkwNeQMSQ/uRVRVTtbEjq4VqgTZ1/kj XdNOhStcj59bSHHHEOUM4+VOdlwP6RPtugYvwujoo9IgNqZi0oFsvkZuoLO+Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wz3JzYzTfh; Tue, 27 Aug 2024 01:06: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 47R16tf5057815; Tue, 27 Aug 2024 01:06:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16te6057812; Tue, 27 Aug 2024 01:06:55 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:55 GMT Message-Id: <202408270106.47R16te6057812@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: ec8c44812a50 - stable/14 - ObsoleteFiles.inc: Don't remove recently added mixer(8) tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ec8c44812a503b3541297ede11332939a5e85b27 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ec8c44812a503b3541297ede11332939a5e85b27 commit ec8c44812a503b3541297ede11332939a5e85b27 Author: John Baldwin AuthorDate: 2024-07-31 19:09:19 +0000 Commit: John Baldwin CommitDate: 2024-08-26 19:03:57 +0000 ObsoleteFiles.inc: Don't remove recently added mixer(8) tests An earlier set of mixer(8) tests were removed leading to this entry, but now the entry is removing the new tests. Fixes: 94a86f3f6920 mixer(8): Add tests (cherry picked from commit 09ed116dc5b84e6b3478b42e5b1076604e92f676) --- ObsoleteFiles.inc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 788edc0eac38..f74ace221420 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -3644,11 +3644,6 @@ OLD_FILES+=usr/share/man/man4/ng_h4.4.gz # 20210923: rename boot(9) to kern_reboot(9) OLD_FILES+=usr/share/man/man9/boot.9.gz -# 20210922: Old mixer(8) tests removed -OLD_FILES+=usr/tests/usr.sbin/mixer/Kyuafile -OLD_FILES+=usr/tests/usr.sbin/mixer/mixer_test -OLD_DIRS+=usr/tests/usr.sbin/mixer - # 20210921: remove cloudabi OLD_FILES+=usr/share/man/man4/cloudabi.4.gz OLD_FILES+=usr/share/man/man4/cloudabi32.4.gz From nobody Tue Aug 27 01:06:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8X06Rhvz5TjP9; Tue, 27 Aug 2024 01:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8X04g1Dz4mNt; Tue, 27 Aug 2024 01:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/DKFYAoKw3IRicfeHGXQoyjaEOStQ6Nd2a/W0NYDA4=; b=eosh9gDe4tcRKi1aQjFUfJkpI554k8J+ns1qgQgAvh94jMDbsE8BLWqC9ctyFAvnwuAU80 vJ+6paeVjTr3vaz02IMyzA3EmjZzPdCnfz/P7LMAt6XmJTeTYS2IoTkAw4Rm4ux6OgzlJC xIES4lX1+1bSYAjxqObUua9ecW8DRLSzERKOT1rOzOs3+l/LTQ/mzA46TsbGTjuxZctdCF hD5urQLkIJ7F1MoqfpgiAnaWNSL3X9IxQ8PRg592vcH3ahjccp6gZR5mzEJkal99Hh2pDH RZJj3pXqLlw0MOYUHHK9cA8tYtLuIqvN2sOOMKtXa8ftgrmluhflBhlopNrO4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720816; a=rsa-sha256; cv=none; b=Lg5hXY6+wZ10E4EEzcV/FDvIASkKNQV+0/fM0Xunu/u8rTtyBy1BodFKbxVqvWPMN192ZA xciEiJRGcLzVCXz/jQlNKhfdmDjRR6M+sQJh9nWIsh+c2Nj0Ku2lLmB3uDPdJq5IEPuEXB 0yZOCXGyFMACsl4ydMW5+Ntx912355S3pJQgReVIGX+IYHcmLSw9KMGOxwUXd3iQLAXivq p8n4Ln5yleZic7Wnzi9TSB2Xi55LcBpqS9VMnT5Gw9Y21LuOGY+e0O17YD+dZU4d+aNjdO Hfx2Hm2Gr8Ju9YfYTUo5PTD2pqbaNXFSfut3Z6hMwfItTK8zfjoLB+pGk97udg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/DKFYAoKw3IRicfeHGXQoyjaEOStQ6Nd2a/W0NYDA4=; b=u+OH+X00fM0Au8PwjtMLPdAuliDVAE+ghcBchDHPSOOdDPDMdfL8s0RMe0QGqpakvY5kTM PpkLtqNNYQacp4i0lmyPSPHPYOpqpIXNhj3EPUc3IFimDObIKndkbZYs3Q0S3RONHgKWnb K0iU4b2kah6Vh2xph2lKLs2IILnwVio35oiWZAIi8xFOAqMmCWcNcNfEibHZYwvcVhe7F1 kJYumNwXiSyr5bx95CiRASprjnJITOKqCsXF5f8koF5HbevsfsS+29OjZRD+873+Hw7VTl PfWZW75/NZRDkFKzrPHMTJYg1yxAcT4/mhBinYGRsCG4wPKRiMKb+Xnn1AijOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8X043nXzV6k; Tue, 27 Aug 2024 01:06: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 47R16uWC057869; Tue, 27 Aug 2024 01:06:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16u8q057866; Tue, 27 Aug 2024 01:06:56 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:56 GMT Message-Id: <202408270106.47R16u8q057866@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: 8d2b36ef6cbd - stable/14 - Fix incremental build with WITH_NVME newly enabled List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8d2b36ef6cbdc6b147d5fce93b3e2e7336c5becc Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8d2b36ef6cbdc6b147d5fce93b3e2e7336c5becc commit 8d2b36ef6cbdc6b147d5fce93b3e2e7336c5becc Author: Brooks Davis AuthorDate: 2024-04-18 13:57:38 +0000 Commit: John Baldwin CommitDate: 2024-08-26 23:39:15 +0000 Fix incremental build with WITH_NVME newly enabled rescue.mk doesn't get updated when options change so nvme_util.o is now missing on architectures were NVME was previously marked BROKEN. Reviewed by: imp Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken. Differential Revision: https://reviews.freebsd.org/D44826 (cherry picked from commit 26a09db3add30238b99e3214c56a3aee63fd71d1) --- tools/build/depend-cleanup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 2627b19d4607..a18b9ca75a45 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -159,3 +159,10 @@ if [ -e "$OBJTOP"/tests/sys/fs/fusefs/mockfs.o ] && \ echo "Removing stale fusefs GoogleTest objects" run rm -rf "$OBJTOP"/tests/sys/fs/fusefs fi + +# 20240416 2fda3ab0ac19 WITH_NVME: Remove from broken +if [ -f "$OBJTOP"/rescue/rescue/rescue.mk ] && \ + grep -q -v 'nvme_util.o' "$OBJTOP"/rescue/rescue/rescue.mk; then + echo "removing rescue.mk without nvme_util.o"; then + rm -f "$OBJTOP"/rescue/rescue/rescue.mk +fi From nobody Tue Aug 27 01:06:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8X31B67z5TjPB; Tue, 27 Aug 2024 01:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8X15xzDz4mCW; Tue, 27 Aug 2024 01:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HazOU6R1Hq6BSlw5EXQ7ZNEPflGwr2wPXmgiOb+d5I=; b=NDo5XD+Srha4ucqHgbe3tNS/tnGNjx4gjO8SxgCStbuffHE6KdCGK7XDjUWXd7GdHOS93X u4sGRwLh/2byG7cjPOBL7TANCGiDJdX0m5SSwklaSGAWSVLSrxgpuCu32+GaQIbbJBd5WV F1odm3CJK1nsuVIvd6e27bEoPGqsN0/PfrmYY83SgbMxUVmiuHu66tGh+m6XAsH9qw8vXi IpFypJzOcnutjvj9rr1djI/lD35Mt6aCirb49YOiSnuYtUo/45VIi/eyTL4xYh3wRmjBr6 Kbnp0MfEmV9KOGajD3Ft8DiyYsw/3IJsjvCZqAcNa9XU+pygX+Quej9Wb4fBLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720817; a=rsa-sha256; cv=none; b=Orgefw+cbGJXrwLAPiJQ//QynJp6Sa8NEeraIdGpy21wPzLdqx1Q9pLe2/T2wGPLwbUJOu 67PlFWl57SP1USmXGhF/xgVHorvX1W6opYR3uDR6xBUPcuVXWZEveyJBL0nZx8qN10h218 Y5PtvUWLB1OHAVxOykTnWXbeJVRljOM0cLPdPvQwmqVlw/abUk2hzTyar52TGUquxEdwH0 qb/WSwnuWJzerVPnA56Q5Mqd9UNqeQbSymvQjYCdJPEAZNN591VCi4fM9+hvaUbIbyz+LQ IVoH+hc/bjkURW5pR5yBag7vBTDLj3IpTkCsVGCx2JOXXWgmQ4pSWnsNPNu2sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HazOU6R1Hq6BSlw5EXQ7ZNEPflGwr2wPXmgiOb+d5I=; b=YfbSNyGD/kUxNFi7wAGbHsemcQHA1jQFo1XyNlO7LXTTZ+3IJKi8y4ezRV0p6CvIutPEVG f6HqLa7fgpvmjYAv1wBtmqePrk3VEtoplWIwpSPIvmSEHOzxK+7rVSK3yCHrxqHnf1s9lG jzqa/KjylZwHee10l9XbZzU4pkq3thptbaMNKuql73Cqo1XFp0/JUcjcQ10IMUcZq+FkTE 6jAdYh3ayQ63xvU4x3uDa+7sdLov2RwVmbRpIo4E5qfKvR2aTACAwHfWQ1w8N81l6wnzdU pCl+nEnp7QX9+hfBHPISVp/G2Sh7y0A3MKBF2O4ajzk71iCVGjoQ6CPE25rl5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8X154glzV3q; Tue, 27 Aug 2024 01:06: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 47R16ve5057913; Tue, 27 Aug 2024 01:06:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16vs3057910; Tue, 27 Aug 2024 01:06:57 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:57 GMT Message-Id: <202408270106.47R16vs3057910@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: 818e3dc03d0c - stable/14 - tools: Remove stray "then" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 818e3dc03d0c2f90c3ddf67eff7bf7080e8027f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=818e3dc03d0c2f90c3ddf67eff7bf7080e8027f7 commit 818e3dc03d0c2f90c3ddf67eff7bf7080e8027f7 Author: Cy Schubert AuthorDate: 2024-04-18 14:31:13 +0000 Commit: John Baldwin CommitDate: 2024-08-26 23:39:32 +0000 tools: Remove stray "then" Fixes: 26a09db3add3 (cherry picked from commit f7f570eb97c70bc7f545d79a96c3192181bb8dd1) --- tools/build/depend-cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index a18b9ca75a45..271aac789be3 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -163,6 +163,6 @@ fi # 20240416 2fda3ab0ac19 WITH_NVME: Remove from broken if [ -f "$OBJTOP"/rescue/rescue/rescue.mk ] && \ grep -q -v 'nvme_util.o' "$OBJTOP"/rescue/rescue/rescue.mk; then - echo "removing rescue.mk without nvme_util.o"; then + echo "removing rescue.mk without nvme_util.o" rm -f "$OBJTOP"/rescue/rescue/rescue.mk fi From nobody Tue Aug 27 08:09:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtKvw4cxwz5VJv7; Tue, 27 Aug 2024 08:09:48 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:13b:240c::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtKvv4Rp0z4XN3; Tue, 27 Aug 2024 08:09:47 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail202005 header.b=iIlULw04; dmarc=none; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 2a01:4f8:13b:240c::25 as permitted sender) smtp.mailfrom=herbert@gojira.at Date: Tue, 27 Aug 2024 10:09:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1724746177; bh=l9PJIrhGmu8b3okJby55exTrQiRwD5jPhHET43Io5PQ=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=iIlULw04ItTTLgutshagECob4pfhGNIkBpIon5yWVTEfex2FnWapdA9kqbDYOJkOH yaQH85+csiTlFaDJS1MLgjRseGnsjF6bRoxv4RSyAEvxtahrh/gSMH8TlOwsRlmwRW CLJOMT1ZQw9/7r4Ts9R6R0NeTxQu5ZdVuODq862ixqQQz0jwo9Gv+3bKR6PvXNFjdp IoxCbUlIRvvlTaio6aQ03MCT6CE5MpBieP+7dThBx/npf+/QLCAAPqNbb+NFb/9h+k 75EtTUbIx0apblylhl0o2JUGyAQLF7FW+EOXuWSRClZoJmIT7YxMWGCSlXVCnXeFUG 5aR7D9HU96duQ== Message-ID: <87cylubd5v.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: "Sean C. Farley" Cc: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: fc43a1b6842a - stable/14 - tzsetup: symlink /etc/localtime instead of copying In-Reply-To: <784ce21d-a604-bb91-c52e-29c78e2bb6e4@FreeBSD.org> References: <202408011538.471FcJDS026885@gitrepo.freebsd.org> <784ce21d-a604-bb91-c52e-29c78e2bb6e4@FreeBSD.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:240c::25]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail202005]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; DMARC_NA(0.00)[gojira.at]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-branches@FreeBSD.org]; DKIM_TRACE(0.00)[gojira.at:+] X-Rspamd-Queue-Id: 4WtKvv4Rp0z4XN3 On Thu, 08 Aug 2024 06:35:38 +0200, "Sean C. Farley" wrote: > > On Thu, 1 Aug 2024, Ed Maste wrote: > > > The branch stable/14 has been updated by emaste: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > > commit fc43a1b6842afa806dfd7ba48de5bece63d04456 > > Author: Ed Maste > > AuthorDate: 2022-10-14 16:44:35 +0000 > > Commit: Ed Maste > > CommitDate: 2024-08-01 15:11:45 +0000 > > > > tzsetup: symlink /etc/localtime instead of copying > > > > Using a symlink means that new timezone data (installed by an errata > > update, say) will be usable without having to be copied again. > > > > Reviewed by: bapt, kevans, philip > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D37005 > > > > (cherry picked from commit 5e16809c953f4cd19fadb1767469dec319de0353) > > I ran across an issue with this when using "etcupdate -D" to update a > jail from the host. "tzsetup -r -C /tmp/chroot", as called by > etcupdate, prepends the path of the chroot to the link which breaks > things inside the jail. I have this issue whenerver I update jails with 'make installworld DESTDIR=$X'. Will this be fixed or reverted (at least) in stable/14? Or works as expected? Thanks. From nobody Tue Aug 27 12:18:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtRR22brbz5VdTQ; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtRR21vbjz4shd; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=da8KHlQHnrSAIAKIvra1F/Yt7o8XtjTq3Ptulvp9H5Q=; b=fcIqvBgqORszj20OPbyaY/FTdoKXarH/+EvkBNHQ3+vc1wABzaFNEbLG8s3MFj+1fWJoHM 2zDVQVPe5u2ct5qz4KYXrdhdny54jXlwODC+0linCnO9ttDblBPWXWXvSYGr1a+bva6qNn DudMKEHN431hKJw60HbTT666j+484JRJ/OLQuh0+6Je/TsvlXGTzreN1qZd2EA7M2tWz7N dIc6s1/E+Hx+S2xbKKjFg7lxobud0rpz5757J4cWfO0h05qFyv2EGrboBD/ltHJBmgWK72 wuiPCxKLcd2aMeUS18DiNPnt8irA/YOrNhq1c2EjIxEtA7JXd4cqQ1VMPSXTag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724761118; a=rsa-sha256; cv=none; b=wHCDVhufqJvMUrJJTN6ZB0JdkcrwGzVqh/7QpG8t4bAuAuwPzN1ugBoZxg1cn8RbxbLE75 Ij2tKnm6202qQcAw12JL2cGbMVciv6gORrOzI7GEg/MmD2qMSuhEmz/QnOXowluh9zk5RG kQZm6yYUAU6z+sg7n3XkF5jlTRuKmuqeMYMK+6NP6/JAc6VXfklKzFDJr2mI14eBelsyqI 0G6TNNQyNgtzfraok4guZxAnw6RGuf2OSa3teECxtXajYd0TC+C9Z2aL47o5LuNg0vK4WJ llMVdghWFRb/5m9nJbG5qkMr/GebN4Oirty47+HIqI6sdFCkUHT6Aj+FEaE2+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=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=da8KHlQHnrSAIAKIvra1F/Yt7o8XtjTq3Ptulvp9H5Q=; b=c+FUQ16VMY3QPXGZ7wDufSERl05huCPugToIkj1gD5ggg+hQCpSnE2nYaSgggIZlfaDtv3 3fCmizbZTHzHaROSwHXSxbmrt4urB+fA/csgHNHCRtEdB/cdo6BFh3/7qRAVwpNqO3XRDl iJQS7HdcJzsykT3lH3sdQh4bIK304TVQojQio8GxwV2194APy4dl6r8qqkaiJtaDfN4PTu 5JwQlA7qGcRQxvMK4n9bI1jknqeuHQTLQt97qJLaV5D6GIj/DDNvhRnzgRYkL2yK16zkVb I7wnt44w29fXJiKHp1xsrMeZ+tCHCs5Uf/Q10lC5Lale7B1sEtloRADYeHFyYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtRR21NpmzqRZ; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RCIcWe099476; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RCIcn3099473; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 12:18:38 GMT Message-Id: <202408271218.47RCIcn3099473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 485bd1630810 - stable/14 - pf: cope with SCTP port re-use List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 485bd16308108f84df7b2768011a65f3dc97db9b Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=485bd16308108f84df7b2768011a65f3dc97db9b commit 485bd16308108f84df7b2768011a65f3dc97db9b Author: Kristof Provost AuthorDate: 2024-08-12 16:18:36 +0000 Commit: Kristof Provost CommitDate: 2024-08-27 08:09:10 +0000 pf: cope with SCTP port re-use Some SCTP implementations will abort connections and then later re-use the same port numbers (i.e. both src and dst) for a new connection, before pf has fully purged the old connection. Apply the same hack we already have for similarly misbehaving TCP implementations and forcibly remove the old state so we can create a new one. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 82e021443a76b1f210cfb929a495185179606868) --- sys/netpfil/pf/pf.c | 9 +++++++ tests/sys/netpfil/pf/sctp.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 381d0f8b193e..fe3ae843f68a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6106,6 +6106,15 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, psrc = PF_PEER_DST; } + if ((src->state >= SCTP_SHUTDOWN_SENT || src->state == SCTP_CLOSED) && + (dst->state >= SCTP_SHUTDOWN_SENT || dst->state == SCTP_CLOSED) && + pd->sctp_flags & PFDESC_SCTP_INIT) { + pf_set_protostate(*state, PF_PEER_BOTH, SCTP_CLOSED); + pf_unlink_state(*state); + *state = NULL; + return (PF_DROP); + } + /* Track state. */ if (pd->sctp_flags & PFDESC_SCTP_INIT) { if (src->state < SCTP_COOKIE_WAIT) { diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index d07d1122048b..95a780747d82 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -181,6 +181,64 @@ basic_v6_cleanup() pft_cleanup } +atf_test_case "reuse" "cleanup" +reuse_head() +{ + atf_set descr 'Test handling dumb clients that reuse source ports' + atf_set require.user root +} + +reuse_body() +{ + sctp_init + + j="sctp:reuse" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now do the same thing again, with the same port numbers + jexec ${j}a pfctl -ss -v + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + jexec ${j}a pfctl -ss -v +} + +reuse_cleanup() +{ + pft_cleanup +} + atf_test_case "abort_v4" "cleanup" abort_v4_head() { @@ -691,6 +749,7 @@ atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "reuse" atf_add_test_case "abort_v4" atf_add_test_case "abort_v6" atf_add_test_case "nat_v4" From nobody Tue Aug 27 12:18:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtRR256cdz5Vd4j; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtRR23q5Gz4sWj; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z4RAkcornG5yMOEKvsT/x1YUu1rbUb9+m7uoPnrnYR0=; b=c+7z360/g/oe+Md0XELWTnQsQ6LswNdOzLEhraBTcRhY4BB9sHZGSzTUP0cmcv0TFiv2M5 mlxcMe6Ld1GSCv+6303fLDUNVHhlEAaInjCWzIkis/htmsRhtAi6as43F/0XX9QbPtWize zNe2cziH/Kbz5vzLa+bSunwqji61EuMBHAGMZS2gn84dP8+yFLsqntSW0SHiM8dMsD45xp vkmMV7NehVBFvWRqP7CLnN/a43VdKyQUwR0Kvc83eC9FkNAju1u88cP8gJH0o9emhp2qjO Sw6D48icCd8Htd0HpRoR9B5x94ayHFQPgqTZPce6vFIibt2ev7FLwg3Po4WGMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724761118; a=rsa-sha256; cv=none; b=T8RYumgPEsymlmalO9NCgSmCgBQnEebh3lK4kaxr0ftSwpHNGeZzrKrW807p+LUX5mUu0o Sj+0ZSxRAtBcznRa31tLOIArIDCDk+7Qv8GWWWY53724fok0AwciklDpZ7BoqvnMQRMbZF exS0bZlwIrU+IFUEi1i//sHT7R0pCb4MuYDvumETGQU4QbHC+G5wnt+QmwjYlo192IlUjt Voi2naxPdzlAMmg50bBx54B3+8vjA7keSrclelJjUmXP2o+kTASbWxH+F34U789jj4PYmq ucxslTX+l99yACrR7QBZWUlMyVK7UVEOc8qvQJHL/Wj9BWX8D3iiM4H7dkM7HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z4RAkcornG5yMOEKvsT/x1YUu1rbUb9+m7uoPnrnYR0=; b=txBlJxX64wMAvqg1Q1K10IDqWZrj+WsPSMrXSOjdgn6SOUu9GdWWfH6CLJ+E+5wW4kcHGo uoFV7to4h3HS5h7Yd75tDjdLQICN6UBWyL016aIHBmhDef3S4BiHCvtokf67Z/wpBKBQLg Zx2KHNDxQL1bpeC6w53+OuiOCzEuDSuobis15nOGxZ+90iXzie97C8NE9nU/TzEnWWHqqU PvR8eAAV8N5QBIIea0LzefZObEaxdcLFuEuTsiSWa4o4MjUBySaPMzCskoqkqBKlWTVYgH iUVX3U0HYLN6JGHkci1kJ3OnY7d7aNapjR8tXXujAnKfTppi2EgHzZrK1UHxvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtRR23QQSzqDD; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RCIcse099569; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RCIc54099566; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 12:18:38 GMT Message-Id: <202408271218.47RCIc54099566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 6b3bfb16e53d - stable/13 - pf: cope with SCTP port re-use List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b3bfb16e53d6cf7afae27e0bf3f6fd09254cfd6 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b3bfb16e53d6cf7afae27e0bf3f6fd09254cfd6 commit 6b3bfb16e53d6cf7afae27e0bf3f6fd09254cfd6 Author: Kristof Provost AuthorDate: 2024-08-12 16:18:36 +0000 Commit: Kristof Provost CommitDate: 2024-08-27 12:17:59 +0000 pf: cope with SCTP port re-use Some SCTP implementations will abort connections and then later re-use the same port numbers (i.e. both src and dst) for a new connection, before pf has fully purged the old connection. Apply the same hack we already have for similarly misbehaving TCP implementations and forcibly remove the old state so we can create a new one. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 82e021443a76b1f210cfb929a495185179606868) --- sys/netpfil/pf/pf.c | 9 +++++++ tests/sys/netpfil/pf/sctp.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index dfef2d132e85..f56037c58572 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5513,6 +5513,15 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, psrc = PF_PEER_DST; } + if ((src->state >= SCTP_SHUTDOWN_SENT || src->state == SCTP_CLOSED) && + (dst->state >= SCTP_SHUTDOWN_SENT || dst->state == SCTP_CLOSED) && + pd->sctp_flags & PFDESC_SCTP_INIT) { + pf_set_protostate(*state, PF_PEER_BOTH, SCTP_CLOSED); + pf_unlink_state(*state, PF_ENTER_LOCKED); + *state = NULL; + return (PF_DROP); + } + /* Track state. */ if (pd->sctp_flags & PFDESC_SCTP_INIT) { if (src->state < SCTP_COOKIE_WAIT) { diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index d07d1122048b..95a780747d82 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -181,6 +181,64 @@ basic_v6_cleanup() pft_cleanup } +atf_test_case "reuse" "cleanup" +reuse_head() +{ + atf_set descr 'Test handling dumb clients that reuse source ports' + atf_set require.user root +} + +reuse_body() +{ + sctp_init + + j="sctp:reuse" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now do the same thing again, with the same port numbers + jexec ${j}a pfctl -ss -v + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + jexec ${j}a pfctl -ss -v +} + +reuse_cleanup() +{ + pft_cleanup +} + atf_test_case "abort_v4" "cleanup" abort_v4_head() { @@ -691,6 +749,7 @@ atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "reuse" atf_add_test_case "abort_v4" atf_add_test_case "abort_v6" atf_add_test_case "nat_v4" From nobody Tue Aug 27 18:07:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb92650qz52ZHc; Tue, 27 Aug 2024 18:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb925bFpz4ZCc; Tue, 27 Aug 2024 18:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tvGRoQ9iLKPbzrLZAb/TKNZlv39VmcZeL/GRihlWAyc=; b=PYo9uQJWyAfs7GQDiy7TpkKO5ws6KUaD/0ZlF2elhZX0T9DU0NOkVon5MWXnYKV1lcB35o QDNUmhq38wdW4Jpxw1mINdL2mFyFzFHDEFp6X3Ya6mln5+EKBg+5Xs/3d3T6nqmhkBdAZl pUSgNPHSaLTQsfkD3dPsvXtypa6jNwZMPS8JWo02kNE57/oeBpLD088FuH6YTEYkIdxQeu zprEd+bRm1hUtKCTdGAfSmmQMcd8ki7rAQHpijkAUlg+gRBQRPtm18zinw4Ix1rrqkWlr3 0po9gdwUU8ZT8C2BdVjVfdQB6bi1JKzsrwLS1Exh2nlcEulGcxQeHnjsCkQwSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782022; a=rsa-sha256; cv=none; b=YIuQ3R7QPyaYTULjPTUb/Gj+sITexg16nwYArTs4n/zXhsbqyZ8e4EETxHJkw+v4o5CwPo UGnLc978aLyFHcGuBQI/tVR5RZKC+S495PVwg9056e7esRUZyfYFGPgdn5869y2Zr4AwY3 iGpTta1htwjtCt4JrvKcfA2Tkq8NEzbMDJp4dx4cbIhgmInWTIMuO01/lfl9yCAzjTg5WY Vxn5efFCzlWZqoGz5t7ycGEKsqrEH1/0XTlKLuJKjXmZAydXZXgKSpO6pdXd1t3v+Thtz7 cslSg6a78WgbKyZWhIaBX6KuM4wRJjM+SfcsIS7QCgJazqQGHqYKVR7MjPro6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tvGRoQ9iLKPbzrLZAb/TKNZlv39VmcZeL/GRihlWAyc=; b=WnqSgKheTHUvWV7MYnw3jUeNxwHYeRuMKWWssZ1bNwirPBxrr0Uu4iW7zzezWXAg9Bf8td AGVGyRptaQW9H1NdR+O+QrWEUBNXi1MggFHwTGGyYvoiwD3amk4dNnOn/yyVtYjMnPl4D0 CaWkLA3JSaZFl8lZ5X6BFWLSYazAy0c1LnOOV+rfr1m8haMAMcWDD6qjujCwfgPVekdyo+ zXv1vCfBTVqMryFqCQbHKa9dFEiEcn0ovcDpqBRthrlOZziGBF34am4PYSZgYNeEeTMk7X xhowlw4o7BsNaFYqBu6uIbzfgUNNFYTykrOjhtin5PTodNkeGzJArWMW7OjCdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb925BkQz10pn; Tue, 27 Aug 2024 18:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI72pB093523; Tue, 27 Aug 2024 18:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI72p7093520; Tue, 27 Aug 2024 18:07:02 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:02 GMT Message-Id: <202408271807.47RI72p7093520@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: 40f573de8adb - stable/14 - src.conf.5: rebuild after WITH_NVME changes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40f573de8adbf87be4200300595364128072fee7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=40f573de8adbf87be4200300595364128072fee7 commit 40f573de8adbf87be4200300595364128072fee7 Author: Brooks Davis AuthorDate: 2024-04-22 18:41:44 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 src.conf.5: rebuild after WITH_NVME changes WITH_NVME is no longer marked broken on armv7, riscv64, or powerpc. Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken. Differential Revision: https://reviews.freebsd.org/D44850 (cherry picked from commit e5700dab1e7ad84b9a97025d263f0acd3599a1c2) --- share/man/man5/src.conf.5 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 3a7789a95a07..03675250f9cf 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd April 15, 2024 +.Dd August 27, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1327,14 +1327,6 @@ and related programs. Do not install the limited cloud init support scripts. .It Va WITHOUT_NVME Do not build nvme related tools and kernel modules. -.Pp -This is a default setting on -arm/armv7, powerpc/powerpc and riscv/riscv64. -.It Va WITH_NVME -Build nvme related tools and kernel modules. -.Pp -This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_OFED Do not build the .Dq "OpenFabrics Enterprise Distribution" From nobody Tue Aug 27 18:07:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb940LlTz52ZF1; Tue, 27 Aug 2024 18:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb936ZfMz4Z4Q; Tue, 27 Aug 2024 18:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AyRsbFZFSrISsJ6gUCu4Vgx+ujR9xo6WFwJOEpLbgGw=; b=D21r+pb20PV0EPtX4dCtA0WwhZjUQSE/EYVB6/3QmOWJ3VU2epMtnu13iXszuIiH/mGu1m xfOAixEL5dPRdzg3ixKLrBO/WoNx6xWwe6CivEaGPuuNrJLwmc74pAzTW60Un354pYBzRO ZAH0clP45NPEmSwci9gYpO9YNGbFAAb4LCVpMgICXStPKdBBYGnEWXgP3BkSW2yVJF+xWa 9NRFyJ+vYZ8aVjqSsnjs+nOAvus7LI1SPESMEKMqC6KBOvJL5mX322rVj6AuYbdgDp2W/I 5kLxh3kYMWDUqLsXcYb/QuxnjfrG8vY8DYepmtjfGIWBfngUKPL1ZqhWxhPjiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782023; a=rsa-sha256; cv=none; b=oxSGoJB3pV5yxyRemVrwRng+/oiykqc+s93LgKtuKGvT1dy8QU6MItnSonQ/osLDXFXNKJ h4X/RWSVjTZ2FIHyDZ6GAQfXShJp7a1pbwn5UKlwyDEwRT9JllX0GX9w+SNXDd5TZqrQo4 W7nVbPd81W50IVxgoT0Oz0tOOqvGzPx5HTYSXnM+KrqmQ4xvte9K6k7fn6x2f9tjIMa0oD F1JfWQMj7mw3E8/soAAbaDWiHv0NIwkVCjkUDhIrW1uZp1qFyBMEItSY8lVq0U5YZNUijj GNuimI17z1xmEZNGg3rQKPQbfZx1xX9UhSH3B7/Pw803pmylltxWDSuOgsg9nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AyRsbFZFSrISsJ6gUCu4Vgx+ujR9xo6WFwJOEpLbgGw=; b=urKPJWnYwLjJo3H5TfXpqwjQZd4ShvsLHNkHcngZAy9mnJ7ld+b8OWa2h9aRrl4YX/Ntgw 8pDFv6dDa/CTdI9s+jw+inmII96aLiB+ItpcFvUjj9FKyq+AwgYrt1uktV3DlH2Gkwhve3 CaAwfbXhb2PMtw1mB4t1L04YETtILGprwkqFeHN4QfrqTTATnmar/mvSQYBjPG2uKf6RTO eq42TVcvAE4g3exaKzDbTpXNlv0FqY22Ojhg7C6FaJtoHbz0KFu1oE1bes1MFiw27K4/Bh 3ElOwj1wCMdzlvVjqtNpiI7rH4DrT6/2AkoELS9w1reocSXAtFhlWRfXrMgL/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 4Wtb936B4xz10Tc; Tue, 27 Aug 2024 18:07: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 47RI73Pm093579; Tue, 27 Aug 2024 18:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI73qQ093576; Tue, 27 Aug 2024 18:07:03 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:03 GMT Message-Id: <202408271807.47RI73qQ093576@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: e13b9fb02ffa - stable/14 - camcontrol: One file per line in Makefile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e13b9fb02ffac7019895ca0aaa1eafbd1b31d705 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e13b9fb02ffac7019895ca0aaa1eafbd1b31d705 commit e13b9fb02ffac7019895ca0aaa1eafbd1b31d705 Author: Warner Losh AuthorDate: 2023-12-01 03:07:53 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 camcontrol: One file per line in Makefile We have enough files now that moving to one file per line makes sense. Sponsored by: Netflix (cherry picked from commit 69ae43a1e6a53a1b8898a31c6b7140bf52b2c3ad) --- sbin/camcontrol/Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile index d47dbdc43bd7..e0407dd20a56 100644 --- a/sbin/camcontrol/Makefile +++ b/sbin/camcontrol/Makefile @@ -3,12 +3,22 @@ PACKAGE=runtime PROG= camcontrol -SRCS= camcontrol.c util.c -SRCS+= attrib.c depop.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c +SRCS= camcontrol.c +SRCS+= attrib.c +SRCS+= depop.c +SRCS+= epc.c +SRCS+= fwdownload.c +SRCS+= modeedit.c +SRCS+= persist.c +SRCS+= progress.c +SRCS+= timestamp.c +SRCS+= util.c +SRCS+= zone.c .if ${MK_NVME} != "no" .PATH: ${SRCTOP}/sbin/nvmecontrol CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME -SRCS+= identify_ext.c nc_util.c +SRCS+= identify_ext.c +SRCS+= nc_util.c .PATH: ${SRCTOP}/sys/dev/nvme SRCS+= nvme_util.c .endif From nobody Tue Aug 27 18:07:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb952MDvz52ZKy; Tue, 27 Aug 2024 18:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb950T0Jz4YkG; Tue, 27 Aug 2024 18:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iuJtdy8hV/V75rh4Lyn7TV7Yh23/kYxIhl1c98hEw+8=; b=GEJOUZKC+QfSYjyfARdpkGGJDUiIXx1SeB59Puqz0aZ8ZSY0+pkdKj4I9fwgcsVA8frzZP UZrAcayq+cFZ3DwQDofke3E4Ui0gFg1tkeiYYQ3QVt3tyeG63JRYluV+c/49etVOHuQvPv 6Ht3M1puTb9yHLrTj3MTERiW7tz+51z5vJ6xoI6T2p4OpgyXVeEXOhvMKR1u3GK9j9s4cO s1XN90OnuiOXjOJYScI47vkvjtNywov6bct4OduKn0Bha9irVRthAzTBfl/jGdZsEnkVMG 4/AKsMe4+pU5/amF3o3UL/j33SxBbcCO5czYmXJsmJ2Y3x+F76/NYMpEQbq30Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782025; a=rsa-sha256; cv=none; b=pTOr0gjVSaSIkTuZsw+6Fr3OpQSp/PUNHokXulbBquZ0+0tyADGVuDmTixnCmr/e4bhP9W E/ZH0+aTniVAkTT5NxXItI8aYM/TDFV0198K7c6CFW9yy1pPsnwCj7ngxHz9+lGhjDnbNy 97T95mDUM+wXDafq5WS8FegMn2ig0NEnbn6DgOvVHDiy3ZaGcg5t7bHAJk5bh0iOLb4iAs tRUmv7PLv93YKw/+Fy8MTIfat2z7woxb4wu+SLQQXgj1kx7R3XNCFKpo+HuiC1tSMEGntr ZPwslaoaJBJS6pCkeB0PJ6Hap2aO0InzyX1bZ8WL/L6HdzmdjyMEuN5IDRYO5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iuJtdy8hV/V75rh4Lyn7TV7Yh23/kYxIhl1c98hEw+8=; b=CMz8+4ZNoFm6LruhsXA7jbLthe1rVkTmMaAWOgjRfyWFoo53Yb/eA9wlbmK+DER0tYwOPP PmV4CerCjmxCw4nY0UP9qeVthwfOpQdk7YE8s0jvm19bD3AWMU8reOCZvCucbw+RHcoFE4 d4YUAqxJ7XtsaRRopcL6/yGNfHvWpuSl78E1YLbU5DKvN31gbA02R/8JwAgtO3fk9vObEs 6bxn2W8i/dso/QcSs5vy7tEe6vn+lM8hm/zQUCoPoxxxtkj/czMzDo/T2ABruOdZnjp1N/ xBgP7LPszwVRONwuvVyeC9NIiy0Th62uElBwJ3OWJpeLktkw9XJoO/Ich6kH5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9503mHz111X; Tue, 27 Aug 2024 18:07: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 47RI7487093618; Tue, 27 Aug 2024 18:07:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI74F0093615; Tue, 27 Aug 2024 18:07:04 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:04 GMT Message-Id: <202408271807.47RI74F0093615@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: 8f586587daad - stable/14 - camcontrol: Enable WITH_NVME unconditionally List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8f586587daad64cb1d6c1bca0201bf97f0eae4c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8f586587daad64cb1d6c1bca0201bf97f0eae4c1 commit 8f586587daad64cb1d6c1bca0201bf97f0eae4c1 Author: John Baldwin AuthorDate: 2024-04-23 18:46:53 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 camcontrol: Enable WITH_NVME unconditionally MK_NVME is no longer marked broken for any platforms, so just include support for it always as we do for ATA and SCSI. Reviewed by: emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44841 (cherry picked from commit 2b676a66c00af03e4b64d072658d2478dbdf0a97) --- sbin/camcontrol/Makefile | 4 +--- sbin/camcontrol/camcontrol.c | 14 -------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile index e0407dd20a56..b04eb5614c62 100644 --- a/sbin/camcontrol/Makefile +++ b/sbin/camcontrol/Makefile @@ -14,14 +14,12 @@ SRCS+= progress.c SRCS+= timestamp.c SRCS+= util.c SRCS+= zone.c -.if ${MK_NVME} != "no" .PATH: ${SRCTOP}/sbin/nvmecontrol -CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME +CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol SRCS+= identify_ext.c SRCS+= nc_util.c .PATH: ${SRCTOP}/sys/dev/nvme SRCS+= nvme_util.c -.endif # This is verboten .if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 555a67001443..db26b45ac508 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -60,9 +60,7 @@ #include #include #include "camcontrol.h" -#ifdef WITH_NVME #include "nvmecontrol_ext.h" -#endif typedef enum { CAM_CMD_NONE, @@ -278,9 +276,7 @@ static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr); static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr); static int print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr); -#ifdef WITH_NVME static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr); -#endif static int requestsense(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); @@ -600,14 +596,12 @@ getdevtree(int argc, char **argv, char *combinedopt) skip_device = 1; break; } -#ifdef WITH_NVME } else if (dev_result->protocol == PROTO_NVME) { if (print_dev_nvme(dev_result, &tmpstr[0]) != 0) { skip_device = 1; break; } -#endif } else { sprintf(tmpstr, "<>"); } @@ -781,7 +775,6 @@ print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr) return (0); } -#ifdef WITH_NVME static int nvme_get_cdata(struct cam_device *dev, struct nvme_controller_data *cdata) { @@ -843,7 +836,6 @@ print_dev_nvme(struct device_match_result *dev_result, char *tmpstr) cam_close_device(dev); return (0); } -#endif static int requestsense(struct cam_device *device, int argc, char **argv, @@ -2489,7 +2481,6 @@ ataidentify(struct cam_device *device, int retry_count, int timeout) return (0); } -#ifdef WITH_NVME static int nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __unused) { @@ -2501,12 +2492,10 @@ nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __ return (0); } -#endif static int identify(struct cam_device *device, int retry_count, int timeout) { -#ifdef WITH_NVME struct ccb_pathinq cpi; if (get_cpi(device, &cpi) != 0) { @@ -2517,7 +2506,6 @@ identify(struct cam_device *device, int retry_count, int timeout) if (cpi.protocol == PROTO_NVME) { return (nvmeidentify(device, retry_count, timeout)); } -#endif return (ataidentify(device, retry_count, timeout)); } @@ -5410,7 +5398,6 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) "enabled" : "disabled"); } } -#ifdef WITH_NVME if (cts->protocol == PROTO_NVME) { struct ccb_trans_settings_nvme *nvmex = &cts->xport_specific.nvme; @@ -5427,7 +5414,6 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) nvmex->speed, nvmex->max_speed); } } -#endif } /* From nobody Tue Aug 27 18:07:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb964MpBz52ZL2; Tue, 27 Aug 2024 18:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb961Rh1z4Z9R; Tue, 27 Aug 2024 18:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HtPsTX7BCKJ3TFlp27TIIjoC4WUu82ZN6EziEjbjZhA=; b=dBXffpqvb0Kr2l/ixdOq6gWqZFgaGTmuI89TtMNU98i4IoEiKHBN0Wwo/ug4op0OuX+3hV +rnefpaF9/iWUzExrjULoKZEsqMB+i6ZqIH5SpEBz627I+e14ITMGJzGHOcBqSp6X/pbHI m1wZ2HHLwGAXcYkdfxr5YTQA/dJZoeXNCi+lNdOrs6gLtkzD63rNJZuKVA7tbbmQYUtRd8 Z4cQKltWumnKwnGX3phqCyKwoS0pxx+MQeAmsmujxr380A/c1NJjtmQ2cTyZj2MtAjNKYW 7fO2K2k8fog9I2wB9spAfUiTKrsgIz18b5I7b/uvBwLnYKZcBdkcV1DPuU8wnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782026; a=rsa-sha256; cv=none; b=xhdJ2PyBz+hylICu9zO813fr4mI8Xh3yzuEs1ZK4knAg5rVB6+qSKxBq22FVnlwcJJfK64 MRhcyyj1JregatwZLSJNrDDvcGICZl8Qf8tXeJIwj4XFjp8/UivUNw2ra8EXv8dn/1geOn o6L553cNxXtJ+rYaEZrA6Y9v26DX/GowSwSqLnMri0/Pm6zETVFvNoAcP51W7cXHMXpMkI iOrgAchuGxdwx1nYPV+63kZFG6RQB04vMkvOrwadVXbduAh592bI8WDtFvxWW3At+SQJYM a4++ep4AnO5A+JgYWxCHXoIYxKUsheTOHwJyHgqE5pLUGxl7cC/ErUlDYru1cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HtPsTX7BCKJ3TFlp27TIIjoC4WUu82ZN6EziEjbjZhA=; b=MR4JGfYqtQemxJRfRP1dtsgMr1nVjepYUqv9N/HpmgwBy8+apuENgw+zsCgyzy9pS1EYLn WwACWP/qG3nS3HkW3L7EPZTszMgrO42GMQpHMYLPVxxWSAZsjbgR6hel3HL2/n7Pq1bl1x lJ1y0AxzmEo0JQZgqgmwnkX5MqxkA7YmrwlnNKLYUb4F5kxgw6htsfvcLzQUkZZfQ+J/qt FRppJQDoccidb84cXt0Y9GsOOits1Yuc3WAIrocLEMEAidW0BY2rjO2Dj5eylY5kl4zsdl Vq9lhAyfrxR2aSPHoL01cR3pNBPFUaEwyjx6brfjinE7QXooazKN47KNLLw8WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9614Jsz10Td; Tue, 27 Aug 2024 18:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI76Vp093672; Tue, 27 Aug 2024 18:07:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7681093669; Tue, 27 Aug 2024 18:07:06 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:06 GMT Message-Id: <202408271807.47RI7681093669@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: a3a8eabcdc9c - stable/14 - nvmecontrol: Always build instead of being conditional on WITH_NVME List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a3a8eabcdc9c603cbd57e4eba8b1485e03e7fd12 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a8eabcdc9c603cbd57e4eba8b1485e03e7fd12 commit a3a8eabcdc9c603cbd57e4eba8b1485e03e7fd12 Author: John Baldwin AuthorDate: 2024-04-23 18:47:26 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 nvmecontrol: Always build instead of being conditional on WITH_NVME This now builds fine on all platforms so always include it similar to other tools such as camcontrol. Reviewed by: imp, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44842 (cherry picked from commit 2d51a9898e26c87586ba50e71b6b3fdf1591713d) --- sbin/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/Makefile b/sbin/Makefile index c125075c6696..cbfff38cc626 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -52,6 +52,7 @@ SUBDIR=adjkerntz \ newfs_msdos \ nfsiod \ nos-tun \ + nvmecontrol \ pfilctl \ rcorder \ reboot \ @@ -78,7 +79,6 @@ SUBDIR.${MK_INET6}+= rtsol SUBDIR.${MK_IPFILTER}+= ipf SUBDIR.${MK_IPFW}+= ipfw SUBDIR.${MK_IPFW}+= natd -SUBDIR.${MK_NVME}+= nvmecontrol SUBDIR.${MK_OPENSSL}+= decryptcore SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd From nobody Tue Aug 27 18:07:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb974vx6z52ZHk; Tue, 27 Aug 2024 18:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9728kNz4Ysv; Tue, 27 Aug 2024 18:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TwLyv7pahDvVkPsQcR02/sO4a4A2jSHIrbly4vHTHMM=; b=ee8wYa6NZsZ3uG5H9a9Fe1y0izioFwdBguRYz6FDqrzT2ZxivuPpRKqqYQWAkLQV7Q73y6 ipjCCAEjwRyDpQ7iB9UzyMNNan9aAze6WZ79pNxCIWW5oRzRRuqf2hgY75qFizDZ4X8DwG +H/lck8YpPkJKCJMTm/wYKwueTMcnDEMtQ/8tZfP45FYjIPTzMKBwgmb9XVR1rxbit2ILJ AqknGYHqKaLcQetrb7XIXdb3k/7V28VBVHm4yjPLaiH52FaeKbai+LDOl9LZIOQiAUNu1M sQonvtiR87AGqGGpIiItqIZ/7FdIEiHfAkEhCp+Ur/x03RHtPJ6QZS4VFrSBrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782027; a=rsa-sha256; cv=none; b=eA22mDlWN/OpvbKj9MsZ3hL3szybHv/co9Y0E38JEYDtcVH2DNyzVL7iVxngSufLljYuL5 TVgZwi4mavDiqrtcMOTalG3QSx7VMbxclEmmQ5+D9Rc/HXCkQuXqmFtTyr9iT9+54uI/d/ jVEVm+db3su6/IeXFxV1zzlAuQztr0puw7e79s7EmDNTNy5/4E9QV25U7+Jc1IP6Pt8UUC FST/DuALQz9k84nNs6xZM3CK4L9lQBcYHw+rcpFYfne3c29KNbkUlMEdgCA1JFLxHtvRkF sR9Z1+Wl0As4lvRYyZ87P7i/XUY6LdCf7nbV5fqsIYBXUVRQCa2Hc20pUjveDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TwLyv7pahDvVkPsQcR02/sO4a4A2jSHIrbly4vHTHMM=; b=woQ24jG38+1mAH50sheC0UrIoE1DnnEh+vy2zRR2XbOUMvx9MitIa/cT8FLyP95YpSrjuP kYE9Hiz3hn7f9EsIRXr1IH/a2BwH8dTHz0IYQZtl6ilZzT8cDQqtBkj8Ig2kpCAJsBV1gt ulfZkd93/bNdlTHoeDAYfdQIqZ/g4wBKgne9ZpWdfTgADDLhW+4/em95Abx4c1wE+9lrk3 yVH8R1BmckJQ6ySYZ13rmgvS2egnZ7gxPxcWyTCoa4WUrUii9fiMHG/lU2wk4lGdcGWbcV EzSpUe+Hpm6djY0vrGILVBfvu7RSrKiIL4szQrBahIi/vFAox+95wUJjdNiiSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb971n5Nz10pp; Tue, 27 Aug 2024 18:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI77CA093714; Tue, 27 Aug 2024 18:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI77P3093711; Tue, 27 Aug 2024 18:07:07 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:07 GMT Message-Id: <202408271807.47RI77P3093711@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: 7b182a286d42 - stable/14 - Remove the MK_NVME build option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b182a286d42c0d7d799b5d2e05905dee803297a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b182a286d42c0d7d799b5d2e05905dee803297a commit 7b182a286d42c0d7d799b5d2e05905dee803297a Author: John Baldwin AuthorDate: 2024-04-23 18:47:44 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 Remove the MK_NVME build option The drivers and utilities are now built and installed unconditionally. Reviewed by: imp, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44843 (cherry picked from commit ee3187f6fa7986c6bfaa97528e050b796eaca343) --- share/mk/src.opts.mk | 1 - tools/build/options/WITHOUT_NVME | 1 - tools/build/options/WITH_NVME | 1 - 3 files changed, 3 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index ea5931ad6c1d..a12a748a6055 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -151,7 +151,6 @@ __DEFAULT_YES_OPTIONS = \ NS_CACHING \ NTP \ NUAGEINIT \ - NVME \ OFED \ OPENSSL \ PAM \ diff --git a/tools/build/options/WITHOUT_NVME b/tools/build/options/WITHOUT_NVME deleted file mode 100644 index 9669deb2ed9e..000000000000 --- a/tools/build/options/WITHOUT_NVME +++ /dev/null @@ -1 +0,0 @@ -Do not build nvme related tools and kernel modules. diff --git a/tools/build/options/WITH_NVME b/tools/build/options/WITH_NVME deleted file mode 100644 index 053cfc568b10..000000000000 --- a/tools/build/options/WITH_NVME +++ /dev/null @@ -1 +0,0 @@ -Build nvme related tools and kernel modules. From nobody Tue Aug 27 18:07:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb985LRBz52Ypx; Tue, 27 Aug 2024 18:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb983WJbz4ZFR; Tue, 27 Aug 2024 18:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oixNhjcCsvp+iZC2C4Efb6CdOuO4cIqHYRww+ro5MRc=; b=l1D3dpFWpvtOw4BmRkQHrbpiEpKIoanttMjyaCn93BvIVrhaVmbJWLSHv8Jnt7JhvhdcVK +tiJASSjywXAj/bi9SkfU5IDLD2iooTjmDQNM264jiEuM/TvvTr7E7LSWXvKDDEDPuvrZ3 xR2uXYT4VYDDwu2qMlyVxKfEUIjWz+LlUiF50KjcXlm5qVyrPEjLgYvhbOHUQwTREfZoje Pzp40J7Mok58E8zPdU3ua4TgKD0wKSsICcSvwSWH1/itvf11rlH4m3XPLn3AGE18h5rSth R9P0PJWEERncO5rLDXKfyYLw23qKKrwporAFqDHqsc96GTyNTtiJfNs24se1JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782028; a=rsa-sha256; cv=none; b=Be4Vb9OyeHAwK40tejQy9mpdyTX5smHXvr9X48d5eslVhBgL9QAmaERy4pBR1g5Bcix5QS gnlCNLd0og5zuKU2WTBysRvuwtrfPTfem/djAOnynOi0pjd7IftHTFQbcncqbJ2VGHR5wq 8jp2KSoBg3suBE75xj6XaGaYSbCl5aOHeWF1ejkn/2BKzYdF72vTXGl3Mtbg57UOgq2sz/ ExBPaSmiUs/fFQjAtigIBybdbMcDtbQnMujFLxQYjjaNRZ5CoU5G0Y4Wclyy84R+v30313 YCydVDj4O7Q6BKsJ2Cei4gxqbfs3AD9WX3CeSgsnFZiKvHBLKQswBLbn+hVQTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oixNhjcCsvp+iZC2C4Efb6CdOuO4cIqHYRww+ro5MRc=; b=ynHeDjjM07IH0ICYUbd+x/HiH27xGNoESXZ0A+huizkJBZCQjMZ+OEXoUll89IG74oq9CT atkwlgsNIEwzujK4SjRqblveQ6ylF1jLHmxKg2gKbWWArAd45iXJji/L+CYaZFJlTvpkHj wDWC+4eUp29khPlvPVP6Gi534o5xrd+1q7Ov2VH/8h/5pORnG8bEL/VDcRRqJjFGm2pWRr ebp5a7bw5v/fCCYGzEypQK1hMnLwc62MWDKmY0b2vExfxkYfdi4SuINJgLiYqLV6QlBobm BYQ4QJHq0VD+xaFo3cfZCHq/US2PPqWaa03+5/2rU9rYJdm6e2gT3xJDiznDrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9833crz10pq; Tue, 27 Aug 2024 18:07: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 47RI78RO093756; Tue, 27 Aug 2024 18:07:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI78jH093753; Tue, 27 Aug 2024 18:07:08 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:08 GMT Message-Id: <202408271807.47RI78jH093753@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: c7379937a2d4 - stable/14 - src.conf.5: Regen after removing MK_NVME List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7379937a2d41d53731601454637d02d77c5fa99 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c7379937a2d41d53731601454637d02d77c5fa99 commit c7379937a2d41d53731601454637d02d77c5fa99 Author: John Baldwin AuthorDate: 2024-04-23 18:48:50 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:55 +0000 src.conf.5: Regen after removing MK_NVME (cherry picked from commit cbbc5770a30b6769d9d9a3a4504b81a5400a9110) --- share/man/man5/src.conf.5 | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 03675250f9cf..2713ad0c418c 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1325,8 +1325,6 @@ Do not build and related programs. .It Va WITHOUT_NUAGEINIT Do not install the limited cloud init support scripts. -.It Va WITHOUT_NVME -Do not build nvme related tools and kernel modules. .It Va WITHOUT_OFED Do not build the .Dq "OpenFabrics Enterprise Distribution" From nobody Tue Aug 27 18:07:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb996plBz52Z8Q; Tue, 27 Aug 2024 18:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb994LSGz4ZNQ; Tue, 27 Aug 2024 18:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2mHjY2jqefD7KRLYYZQyFof2UiXbUgWU+Jye6pePj4=; b=Bp1JMPGAfnng0J6IBqrcTr/pzfR2Wn7XLNiwUcmqvFcb5ln5MmjWA74A817BrF5WAZHMTV jMVIhhuIu8gXWkhhaTe/PYuS8Z1apQiqbtiZ2UcGmmPoEVSF6bmWXcctFfDJWpESRNv+vC 3Aw+FWO+1KBKoMxefxQrv9pcDXgrH+4T9dUkQl0NQ/yMfl7tZEAIBnSGKFkB0IflnHfr1C lUfRDJgtowliI3rnyQkeSTYe4GAhSMr5UHLSUp8KB2p4tvAPqM04xeZTQerYNIv1ru2eOD uX4lCtoIVUn9gZUQE25+m6z3NH75v6JgaieEoV6g5QG/DqRs8ZpGWxyCZUHFkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782029; a=rsa-sha256; cv=none; b=q+7iH7InNyNYp7C9Aueglwutx18GBw0ajY7cNPPVdP6RjYLdbVgbdP4eS5n8WD89nXaEXw xejjwjRWzxybroH02lCo+jdGblH2Rlsj4Y1XwESUOXeybF0ejXaOU7EBS/6hDDypCktclZ HKSVOXqnSxmPtrOpVdXqo9e9CjOweEdrG6NdFC32ROvcGeVFTEbVBUO0/oP7LmJrq2SKis /N3NsNTPk4DPmXsFs9CgjRFeyJMQqHcJxNbvEd6rPhNcuJgRVnBRY0JC4RHcuhmjZwtTIa QPYHBcQ3bg3/9sxF4SXFpd8a8Gcwik/rX2Ryl/8P6TlF/BsTXgNC5P/S+eni6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2mHjY2jqefD7KRLYYZQyFof2UiXbUgWU+Jye6pePj4=; b=QkUDk3LFouWNs5xjfTax+i7LtAOyVzWaCqJ/xb+jZQCVnrQhfELaIhbwXZ9O7CndXSlYTg OHO7AIrhswq1AgjMNTm3LRw15E5dpqjRTXFBzMcm1JfVPFZJcAjG92KjzDGy8omUJHMqkB TPg2gXET/KkVwH3LwA6ScbG8doafg8tGbp0qVDR+PvjZOoljMEu9Lnc7Xj43G3hPIbAAa7 LM77QcQQf6yyw9Epu/+TDMpSiwJGGoaaRXacgF93cKtlznPtMtHrmQeCBwhVpo3SJkNgot Nu0IJRJsC7kh75QTjJtNn623JRzC9VNKtoAxeIS5auq8eOf+dSDaLTjYGqpfCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb993ys0z10S9; Tue, 27 Aug 2024 18:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI7938093819; Tue, 27 Aug 2024 18:07:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI79w2093816; Tue, 27 Aug 2024 18:07:09 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:09 GMT Message-Id: <202408271807.47RI79w2093816@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: 38b00f73b8dc - stable/14 - options: Make it clearer some x86 / BIOS only things List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38b00f73b8dc453cc976c56021578d01f5fc3f55 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=38b00f73b8dc453cc976c56021578d01f5fc3f55 commit 38b00f73b8dc453cc976c56021578d01f5fc3f55 Author: Warner Losh AuthorDate: 2024-08-06 23:39:10 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:32:54 +0000 options: Make it clearer some x86 / BIOS only things Suggested by: jrtc27 Sponsored by: Netflix (cherry picked from commit bf4f27e85aa62e459fb4cde9ebd51e32bdac7910) --- tools/build/options/WITH_BEARSSL | 2 +- tools/build/options/WITH_LOADER_PXEBOOT | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/options/WITH_BEARSSL b/tools/build/options/WITH_BEARSSL index 9dcebbf1ae30..ff443a20586a 100644 --- a/tools/build/options/WITH_BEARSSL +++ b/tools/build/options/WITH_BEARSSL @@ -9,7 +9,7 @@ signature verification and related operations for Verified Exec and .Xr loader 8 . .Pp -Due to size constraints, one may need to set +Due to size constraints in the BIOS environment on x86, one may need to set .Va LOADERSIZE larger than the default 500000, although often loader is under the 500k limit even with diff --git a/tools/build/options/WITH_LOADER_PXEBOOT b/tools/build/options/WITH_LOADER_PXEBOOT index 01d4a0b86a66..37cf1fa254ec 100644 --- a/tools/build/options/WITH_LOADER_PXEBOOT +++ b/tools/build/options/WITH_LOADER_PXEBOOT @@ -1,4 +1,4 @@ -Build pxeboot on i386/amd64. +Build pxeboot on i386/amd64 for BIOS booting. The PXE Boot loader package needs more space than we may have in the boot loader. If you need to increase .Va LOADERSIZE From nobody Tue Aug 27 18:07:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9C1Cbsz52Yq5; Tue, 27 Aug 2024 18:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9B61Whz4ZTn; Tue, 27 Aug 2024 18:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGzTjw+VakiOzx0f9/1ac/3pJ9g3tQdF47mGH0HGMnE=; b=yAn5XtNsLIN5K2B57cmYrdmijusfcWWTenqCex64Iu3sjygIZB/x17p//MGuEhnsrc7Cv6 Fmmmrj2RqHqd8WDGWuO7AXXs6HTEumh+qvo96tfU3GdwoBN0+lcIu+tIavL3pVsfzaV+Bv oNd8dI4lRgKrj9ZsY6yNMMEQHa2cEauA0QTX7O1xN14+qs8U9+jagdHSx9P5y5obXwlsQq brvDrV/sBsA8XYcfjujRulP0LuPvbLLkc3YfiivYhtrhHF+mIowfYmeVyqF0Gld9CkaKx5 bEzrCTCVK6BKbFVsW1Y8r5hC2tpS+9vAxPbOyNALS2608gZzI+8hg3cpqJjNhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782030; a=rsa-sha256; cv=none; b=XnYQdFy9uKPLnghGmMsMBQiRI8vd9zXSj3RyjyxJlbBJaw2oo+6vPd6dbHe3RJ9Po7wIIA i0NYi0/BxYkkKBkG5yC2q8ADpGTRYV3bwVBN1Ey6ex1etY1Zi6ue/DAuXU3+3DAe/dCiZq 3kGiY1L4VWksclP2ULFAWC2v+4rgkRLXabPijZWfZWaSOHPHsNNzd8Nfk9Bk4IEyCMwCbv E+okEchws/pvp6eeMkeDbamauc8p8D5iSF86qYX40CaqowMGI9kx7cRpiXa26ffD18jvc4 uAWu5sNuckx89R6abeoo+Szt1n/BFGhTi/FLdGqANWTiMPS5mTNKPI3aYJ3X4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGzTjw+VakiOzx0f9/1ac/3pJ9g3tQdF47mGH0HGMnE=; b=SZC3VUvbc758aclBVvc4rrWSEj/f0FhwPen89nqMdNvyVDLUmxjE+750qT0QUA5OjMCeYj +NotDeAiIq0SnF+S/bVMFCQiL9KBTG8zCyxJwunEN0lNChnQyn92uEq4uyTRBOxAdsVNQl 9kRD6aVSgQ9/6mWYZrhVWdCAyzCh0Tz01n3dkwe+6QM4UHxDea/U+nLA7MipmFumQx6Sk1 eSNPzfJDiKJnOYDAXeJkc4ZeGPyaSauzDdmtNL7VVu8mHqRPPeNZQ7uUASlzU2DNMGH2y9 0XybGlHXkXv5e4uanwTJ1O6YEOgZ9Acsd2LfeGmyT8LIxd+aho4zHj5ZYF9wfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9B52T6z118P; Tue, 27 Aug 2024 18:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI7AWS093858; Tue, 27 Aug 2024 18:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7Arl093855; Tue, 27 Aug 2024 18:07:10 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:10 GMT Message-Id: <202408271807.47RI7Arl093855@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: 3cff088ebdac - stable/14 - src.conf.5: Regen after ddcd3b606c9d List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3cff088ebdacc1e3b2646e035b3e6edc7aa05cac Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3cff088ebdacc1e3b2646e035b3e6edc7aa05cac commit 3cff088ebdacc1e3b2646e035b3e6edc7aa05cac Author: Warner Losh AuthorDate: 2024-08-06 23:42:52 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:33:16 +0000 src.conf.5: Regen after ddcd3b606c9d Sponsored by: Netflix (cherry picked from commit 9ed58aa60fd9cfcc7b6d9f4efa3a0631da393fc9) --- share/man/man5/src.conf.5 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 2713ad0c418c..11801456716c 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -154,6 +154,25 @@ This library is currently only used to perform signature verification and related operations for Verified Exec and .Xr loader 8 . +.Pp +Due to size constraints in the BIOS environment on x86, one may need to set +.Va LOADERSIZE +larger than the +default 500000, although often loader is under the 500k limit even with +this option. +Setting +.Va LOADERSIZE +larger than 500000 may cause +.Xr pxeboot 8 +to be too large to work. +Careful testing of the loader in the target environment when built with a larger +limit to establish safe limits is critical because different BIOS environments +reserve differing amounts of the low 640k space, making a precise limit for +everybody impossible. +.Pp +See also +.Va WITH_LOADER_PXEBOOT +for other considerations. When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1047,6 +1066,17 @@ Build openfirmware bootloader components. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +.It Va WITHOUT_LOADER_PXEBOOT +Do not build pxeboot on i386/amd64. +When the pxeboot is too large, or unneeded, it may be disabled with this option. +See +.Va WITH_LOADER_PXEBOOT +for how to adjust the defaults when you need both a larger +.Pa /boot/loader +and +.Pa /boot/pxeboot +.Pp +This option only has an effect on x86. .It Va WITHOUT_LOADER_UBOOT Disable building of ubldr. .Pp @@ -1068,6 +1098,8 @@ with support for verification similar to Verified Exec. .Pp Depends on .Va WITH_BEARSSL . +May require a larger +.Va LOADERSIZE . When set, these options are also in effect: .Pp .Bl -inset -compact From nobody Tue Aug 27 18:07:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9D3XPnz52ZNT; Tue, 27 Aug 2024 18:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9C6YFtz4ZVK; Tue, 27 Aug 2024 18:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CI2YiuB9XzclafVqF8U5czZIc4Zw/XydQDP1VlYJyjg=; b=U9f/sY061GEmgysPZ8HYxT6blueuMlowOOiUzDJ4ZXIWNsdxYscOyEAohbpQnAP1+A4HSi vONLGBcwqNe5Y0zeAB6m8ioTDzJ3Rbu5JNIVurZr41U5gRk/L/lK390pf4hAjqDrHysG9y AtQ7T7ON3nM1xsermmq/FiO/rFsMe7Jx6BNRaupxBFg6E4OCStrL+S+qeTEuJyzegwOhA7 6vfpOtrSUlFG2FlP765dy/nT1r26q/VIHdU/ksPZ+T0bXfYXldwhFRq5leqpWcYJmUEQB4 xwClndyg3PPKos6dsAjvYBs9zmEMzSRGqOd62w0SxB0ZwRylWgIEnMEIZvRjOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782031; a=rsa-sha256; cv=none; b=ngDJajV1Pr3Se5e3vOZzhVUgXe7+B1Ppx9gnVV4Eyfc+Dsm5aFtXQSzENjrUBTQFm2qNpp TVICfl8SXs+Qhl9tBBujRecXiIXrak8WWNG1KHOZegGgVcSor4RZclZs1zbfKkX6peT8Jm +XHKXhEiVWAsz6/0i35itWOUzBiOK3fckdWCXHK7dzlKj/fWpUS4Ugz/I9I5saNyv7r9ue 691WFjLGijbPJfhZz54WtIdflnCiZVEcAF0vNXFIpFe9DY8YAdyFI5MGk6mgKBaHuJxzGX Lp2LUDaexdy9letIrJnvaop+5wuP0f0zUnVOm1HmW/TMY/Av9RXmx8Zo+AaugQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CI2YiuB9XzclafVqF8U5czZIc4Zw/XydQDP1VlYJyjg=; b=QbmWMX0t3e5dsVL2JR+7EXsyE3Mb0hZ6/QrIf1ptTgmJooJBZsEtr8/JHU6V4NWnsxgkV3 uIexrk+n+kRImxE8CeE6y5Ju28PNWWfkGvGLTFVPhRp4NDXZBnIjFmtu8dFDo603VraR96 wgRkEnmzfGJw4efZBTCRA9wJEC2ohkXGu2PIyMvHFts7/poOJxRfIZSNQ33xw0Ei24SxRl TnAdZP7TdyWfZ0HGQwiXPy0gxNDchIPRBOoPvNwWkOaL34IivjP2Se4CVXoWgSOwtYbAzb WpEs0lkjzdZoWUBSCI5MuNDwZibN9/RaTDrPSsapMsh4aUwqDw8AWeb2cuJChA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9C66N1z10SB; Tue, 27 Aug 2024 18:07: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 47RI7BSw093894; Tue, 27 Aug 2024 18:07:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7BOg093891; Tue, 27 Aug 2024 18:07:11 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:11 GMT Message-Id: <202408271807.47RI7BOg093891@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: c4fa138c2a1b - stable/14 - camcontrol(8): Fix typos List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4fa138c2a1bc32e239f17239ef4e1a89422df22 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c4fa138c2a1bc32e239f17239ef4e1a89422df22 commit c4fa138c2a1bc32e239f17239ef4e1a89422df22 Author: Che-Yu Chang AuthorDate: 2023-12-26 16:07:26 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 camcontrol(8): Fix typos On line 748, "bigger than" is mistyped as "bigger then", and on line 765, "more than" is mistyped as "more then". Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/949 (cherry picked from commit f8f3b16b6cb671649345352c16894f59679c096f) --- sbin/camcontrol/camcontrol.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index 9d2eec87e0e0..9ae3debceedc 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -760,7 +760,7 @@ Disable block descriptors for mode sense. Display/edit block descriptors instead of mode page. .It Fl L Use long LBA block descriptors. -Allows number of LBAs bigger then 2^^32. +Allows number of LBAs bigger than 2^^32. .It Fl b Displays mode page data in binary format. .It Fl e @@ -777,7 +777,7 @@ The editor will be invoked if detects that standard input is terminal. .It Fl l Lists all available mode pages. -If specified more then once, also lists subpages. +If specified more than once, also lists subpages. .It Fl m Ar page[,subpage] This specifies the number of the mode page and optionally subpage the user would like to view and/or edit. From nobody Tue Aug 27 18:07:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9F3Bfhz52ZCt; Tue, 27 Aug 2024 18:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9F0QNFz4ZZt; Tue, 27 Aug 2024 18:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FB79oHF19fpKu/4hCt2z3ZpUUTIC8ND+gzraZkjx6B8=; b=KEhLN9bfkzG4t/yBgGNolYYi+DNzzCgXOF5+YmEBTcRhYcyhcUyCWzgh8KFHt2EZcbAYRz 8CtcNk8jd+yO0APRNNdyiUU3a0Fevyw+2TpkTkG0OA0LWvhWplZIEFJjLZyeha/EG2MDgZ MNmmtOR1hA/ejFrxZrs92+L9oCB1mtjDbSGJciUcfhSBLmsNbXL2bG3gp+ZzpUCoMy8a2o /94Vgjs8NTUGfvd4u7cRouETWP9gNiJhEFAQcT5DCAEvgJyNBFjYVTNhnBdAQILau6XyqY KgfKmKare79NCvMPqJBa9ZXS5iHoKXQiOWgx7YQ4pa3+3bv/wStzd6fUQEBxNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782033; a=rsa-sha256; cv=none; b=dCI+K9jgkwwgbiuWmnarRry/bq+hDrp7/BwcuO51hNxaMnByitni1r8sV/rSONV+VQRIVe Xwq/ejVnclaDrEvgkhkXO4nu3A3pQfIlt8SX7BUsJ9GwHK/WJx4xr3l7KeDGhlM5Ou6Cv5 FaWLYpChI/HZSbCGIHtvxucykUyoPRtwozN0KvCd3XvkfJ1avErrxEUhTem4O37rGuA5ky 3AX2hkEOByXnfi9hRIc5hgNi/KvvthNaYUP3fYWy/OYLbGwNnIlYrp2j6ScoBcp4HDeVdt cezaKkfcYLJUD73hprc6fW4D3UPiKt9awUyZ1g97aWeK1tDRkNkO3QapIJRSKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FB79oHF19fpKu/4hCt2z3ZpUUTIC8ND+gzraZkjx6B8=; b=L4TVn7/YVish5OUexZSimGOFATZ0vvWcs/bzSdwXPAyo7n5cO6mxhKAoMKZ2dDGg+smLik fpbVIFqq9wbieEK01xpDJaaTIeMPfwvY1S25VU4Z6ZjGUPP3evCk0fKPiMkRSgKnaoSryc 5q1tg6PkAsooP6Z42xM3dwPHKfIKrNUwQf7TCUN2Wa8HG4TtXaigVmlBtMopRY1P+Lu1m/ qr/GU7478EtS4DQibMiGNzWE2YdiXeOmg5SJTFESnkO2mSOkJ880koriRGkhf6HPnGsEB0 o3Qr+9g6CqnHykvRU5dY39fPYDXC4nnRLA4U2HnTT4ak39Ut3TwuDdsxAFT0wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9D73lPz10Tf; Tue, 27 Aug 2024 18:07: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 47RI7C34093945; Tue, 27 Aug 2024 18:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7CsF093942; Tue, 27 Aug 2024 18:07:12 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:12 GMT Message-Id: <202408271807.47RI7CsF093942@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: 152a9cfe6d45 - stable/14 - camcontrol(8): Fix grammar: a ATA -> an ATA List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 152a9cfe6d45709d41f6323f30dbf0b69a6afe46 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=152a9cfe6d45709d41f6323f30dbf0b69a6afe46 commit 152a9cfe6d45709d41f6323f30dbf0b69a6afe46 Author: Yi-Chen Li AuthorDate: 2024-01-12 06:37:41 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 camcontrol(8): Fix grammar: a ATA -> an ATA Event: Advanced UNIX Programming Course (Fall'23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/1030 (cherry picked from commit 9977fb8042a4b2f2b3386684e137dfb42bf1707f) --- sbin/camcontrol/camcontrol.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index 9ae3debceedc..bdda1828abf5 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -524,7 +524,7 @@ This is to aid in script writing. Print out transfer rate information. .El .It Ic identify -Send a ATA identify command (0xec) to a device. +Send an ATA identify command (0xec) to a device. .It Ic reportluns Send the SCSI REPORT LUNS (0xA0) command to the given device. By default, From nobody Tue Aug 27 18:07:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9G2jBgz52ZNV; Tue, 27 Aug 2024 18:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9G1BM4z4ZGs; Tue, 27 Aug 2024 18:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pu3ws5pD2Ey3EEy0IHDI6WpbJMJIDI9xe7x5FkZY0Bs=; b=HExHqyZ9iwNh7BUJ3BKJEgPN0q56EEyEknwSJ28ZGuQaWgE5aBM/5UdFfdqwTQbizqRoxW j7maBrKj1P0cDZQXhgpbkaAsocI/tl49mMEreD/2nh5/GCRGqTmC5u0t9sUBA2KhGr9kek wWo+VDDKselqeazjR76UD+8/OSXTJEor9lyaBl23i/IpJrnCbpdibRs+R33W9HSD6PuwHt MvVMpZtrKLDdenhNhoV5ypab/4WN3TXvimfyr9J0+fq9cGgr1fbvAL0pTJra2XFXQ2GMBJ 4wghqWXQsmaXbzniwNpzxuoBHOfkB9a21N73u/zXvt4F92gwiA4PAtUH8tZodw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782034; a=rsa-sha256; cv=none; b=FtmTqsNUoqTYHKPQAE25jtKkiiB36LhxScWBbguBcTYHa6I70802vJFw8qCWViHKFzSzVL hqkjtJcY88LaIifhco/WBWWTcIGW/HG6sk6hhc5Hg2+F3xhY9fKmpmjzFy0oQskd6JEaPx QMxLt63kPOMapSbNzU2lPM4IeQrIoPs+3hqKQ1InbFY/MG0K71+SklpG3slS8/UR/a96Xu wnNwgJHkyE88RkpovB1AD+WcfvARHDwf+pNYkiNT+MDmBj9PjWzDhXQjy0vYP49SI3dgkm z7quavSq/FFgqgeqqp2VUCOUZMG+E57HndZrir1sHvYVsJy+mn/nCLe7+zATkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pu3ws5pD2Ey3EEy0IHDI6WpbJMJIDI9xe7x5FkZY0Bs=; b=DLnwQjgScfHqQZnI9y86z3+uIXRXAbQoUUcWpxGRoHcIIKqKjZRAmeJhq04CYIYrjh5BxM UWhLRP4b3pmCA82gjmw0WVHBz5tr2HXSV71hnLvdHlIpkRTnBFIOXYp/F6zJIovFlykVej aL2nNHsL30a12Ujd0L1vpXOVhmLuaZ1/aBjQyRR++gFkek44V7qkN34AAvNydY9P/PcvoQ +mxmx7N7++KwYDMFbkcl8hxlSYBKHGXMimlzzpDdrkRHYb2OHiuefjxAW+SU1axUWbLSkz UkebXhyamxgjW6FIqd2HbtCwReq5kfTjhIrUtpqRw+1x5+w3QR2P7SlkO9rE7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9G0lpjz10Tg; Tue, 27 Aug 2024 18:07: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 47RI7EQr093990; Tue, 27 Aug 2024 18:07:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7E55093987; Tue, 27 Aug 2024 18:07:14 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:14 GMT Message-Id: <202408271807.47RI7E55093987@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: 169c76b9b65f - stable/14 - camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 169c76b9b65f97043af32058a86ceda8da4375fe Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=169c76b9b65f97043af32058a86ceda8da4375fe commit 169c76b9b65f97043af32058a86ceda8da4375fe Author: Elyes Haouas AuthorDate: 2023-11-07 17:37:33 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas (cherry picked from commit 7028e630d6110789502cfc0f17b36b6f513ec297) --- sbin/camcontrol/attrib.c | 4 ++-- sbin/camcontrol/epc.c | 11 +++++------ sbin/camcontrol/zone.c | 7 +++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sbin/camcontrol/attrib.c b/sbin/camcontrol/attrib.c index 7e89dbc3d48e..4cf9832756b4 100644 --- a/sbin/camcontrol/attrib.c +++ b/sbin/camcontrol/attrib.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -265,7 +265,7 @@ scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num = 0; status = scsi_get_nv(elem_type_map, - sizeof(elem_type_map) / sizeof(elem_type_map[0]), + nitems(elem_type_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) element_type = elem_type_map[entry_num].value; diff --git a/sbin/camcontrol/epc.c b/sbin/camcontrol/epc.c index 206b34594f4f..4273ad19047c 100644 --- a/sbin/camcontrol/epc.c +++ b/sbin/camcontrol/epc.c @@ -33,10 +33,9 @@ * ATA Extended Power Conditions (EPC) support */ -#include +#include #include #include -#include #include #include #include @@ -151,7 +150,7 @@ epc_print_pcl_desc(struct ata_power_cond_log_desc *desc, const char *prefix) max_chars = 75; num_printed = printf("%sFlags: ", prefix); - for (i = 0; i < (sizeof(epc_flags) / sizeof(epc_flags[0])); i++) { + for (i = 0; i < nitems(epc_flags); i++) { if ((desc->flags & epc_flags[i].value) == 0) continue; if (first == 0) { @@ -466,7 +465,7 @@ check_power_mode: } mode_name = scsi_nv_to_str(epc_power_cond_map, - sizeof(epc_power_cond_map) / sizeof(epc_power_cond_map[0]), count); + nitems(epc_power_cond_map), count); printf("Current power state: "); /* Note: ident can be null in power_only mode */ if ((ident == NULL) @@ -638,7 +637,7 @@ epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(epc_cmd_map, - (sizeof(epc_cmd_map) / sizeof(epc_cmd_map[0])), + nitems(epc_cmd_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) action = epc_cmd_map[entry_num].value; @@ -715,7 +714,7 @@ epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(epc_ps_map, - (sizeof(epc_ps_map) / sizeof(epc_ps_map[0])), + nitems(epc_ps_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) power_src = epc_ps_map[entry_num].value; diff --git a/sbin/camcontrol/zone.c b/sbin/camcontrol/zone.c index d651ca0e2acf..dc87cd9a9570 100644 --- a/sbin/camcontrol/zone.c +++ b/sbin/camcontrol/zone.c @@ -34,10 +34,9 @@ * This is an implementation of the SCSI ZBC and ATA ZAC specs. */ -#include +#include #include #include -#include #include #include #include @@ -353,7 +352,7 @@ zone(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(zone_cmd_map, - (sizeof(zone_cmd_map) / sizeof(zone_cmd_map[0])), + nitems(zone_cmd_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) action = zone_cmd_map[entry_num].value; @@ -387,7 +386,7 @@ zone(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(zone_rep_opts, - (sizeof(zone_rep_opts) /sizeof(zone_rep_opts[0])), + nitems(zone_rep_opts), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) rep_option = zone_rep_opts[entry_num].value; From nobody Tue Aug 27 18:07:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9H3Y7sz52ZF4; Tue, 27 Aug 2024 18:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9H2jfCz4ZS9; Tue, 27 Aug 2024 18:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IQDvxuyGbScrF/jgNAqNc50anKeasI3aiD2zBFt0fBY=; b=vFXs8LxXJYXPQcZyqkn9sd8Ewe/1AOsM9JkUeXK8GiXoTWyUDfo9MS60oKdyLlpZgBVIsD vX1BpT1X/1uBf3kEtrQBqwlEVUPmAda+6q5xwQs2DuBQLY5hYDV5F/5tjGiNHIECVG0O/s 6ZkabYYlmiyxKn68qW7oo9LS7V63IMlJ0kOTqwqQI/QzcJUguIMz6yd/uFT70dHyxUliBI M4k2Zw/pZQyDzgygpMYV+7T5WlxHTxUl7UiqNEeUQg0VhYYZcoMDsamMHOZ8PABobplEip yaPqiHFkfMXYVQXd96d0F2GNtxiSAzrkOGjN3jIPLn6fvAjdkjlmteNQlD7YTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782035; a=rsa-sha256; cv=none; b=V/9dmE9M5iVaaTtZ3IYUsWytTe8HZ6BQAtF391vYZLo7asM5xGb+JF3wGAuIjD8OcB7Num YspJICdMDQ842/9EYMPKgchbte22iIkmwkdgj/05KsSfQeFw3HR4/wqFO9n5uFU3HRrY1g KjuYkYKp2FHaGOOcT/edVDoQZq0lLVXXP9tN7pHCO6RpAsl+qSLWxNX3UlSjy9oBZQ3Psd a8EybDVCT4b9t6Z8Cdnx0Sh65e8A9ka6KsEs2R8RTuaO5Vyaq0r3sT1aA6rqkFXD33trrQ Wo988b8hFJX1Ii5T+HZUFBx6BUgG83yUlqa72Cu+vYX6/24xaUB67A7V9D4qKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IQDvxuyGbScrF/jgNAqNc50anKeasI3aiD2zBFt0fBY=; b=xTg5IQRUzTCpj4w1rWND9FEiBTbwrumWwTNQzGkGebKaqh4UlFgfHrwVqpSujEaCvoC6jn 1yDzYNjC/4fkF1zaM6rfq84pV7p0EX5dwtd3vxpGKAA44tBvPmfoLgFIVMAXW9r7TibCbX 2azvlDdsOF+gRLTX7Kr41/e0F9IrAiWY00SVi1Y8oIMzS7FQNAb0ysSWD9pFHAa8zGWYOG F9NzEu3xuw5wV3Xk+REwLJghUNKEnozqqFF7tTtcBNMOWArw1jgsapbSJaLKXZWdGUFREI relSVVW2jK3kHmC8ELvNAnIikgRMpBi2evvJZyWxxMi1bG3aGl6fkvtPqQ4e9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9H2L3cz113Y; Tue, 27 Aug 2024 18:07: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 47RI7FDj094053; Tue, 27 Aug 2024 18:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7FVu094050; Tue, 27 Aug 2024 18:07:15 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:15 GMT Message-Id: <202408271807.47RI7FVu094050@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: af6673e6a5d5 - stable/14 - nvmecontrol(8): Remove a double word in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: af6673e6a5d5959316d02674716d2946a3fcf464 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=af6673e6a5d5959316d02674716d2946a3fcf464 commit af6673e6a5d5959316d02674716d2946a3fcf464 Author: Gordon Bergling AuthorDate: 2024-04-20 09:18:59 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 nvmecontrol(8): Remove a double word in a source code comment - s/the the/the/ MFC after: 3 days (cherry picked from commit 6573ce292fc5ddc6c846860b3fa98473e3f5d1c6) --- sbin/nvmecontrol/nvmecontrol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index 2ce4ad4c5c2b..394a88608692 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -96,7 +96,7 @@ void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, vo * this. Older compilers will support 128-bit ints on 64-bit * platforms. Otherwise we truncate this to 64-bit on 32-bit systems with older * compilers. We also check for > C18 instead of >= C23 because clang 17 was - * released before the the __STDC_VERSION__ was defined. + * released before the __STDC_VERSION__ was defined. */ #define UINT128_DIG 39 #if __STDC_VERSION__ >= 202311L From nobody Tue Aug 27 18:07:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9J6CzGz52ZD4; Tue, 27 Aug 2024 18:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9J3zC2z4ZMt; Tue, 27 Aug 2024 18:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDLTx7dM55ttv2J1BNj5W4PXepGzQDjvEXO5kN7rqlk=; b=BBxwKNsF4N6QMNteqCOEf0sS12lYtVtRrYAbxTvZJWSFXTDwXvaau9snTDakpiQ1BZzQhL NTkh8ioDRYuKDykcz1mir8S5S7ixlUJtCoG5Uje+U99Tsdtmf/knclWQqf6R99oz8Ugbal Za81rbR0+eNGiC7UBWcqb5iWYCslX5/3bhCHrZotYl05ywCqpOnO2ZJnz0n+q0aionfIat 6ZqW04d8sUPFWtD7rw6CNBXh+D6AG102I0fpvwF+p+vUID2VhyGkO8WFWHzRlgweTVMLp3 7h+q9YzD4xI35A1CrXBitGi/l+VopqqRsUAN43mLhXHMuMDT5Hft/nmXs9jtyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782036; a=rsa-sha256; cv=none; b=k8s5QkJjsT/qc5IaULYs+Va2TDn+yVViR+5J/NxmlHEw9Bo7iUk3VTWpNSCBEwthLqcigQ wPwUjcFTac31w4kWyimvIAijXZzUmIjEsxpqwhfilzI7zqQDssmVXDcgPBab7nhOzzHbBV RFGR4z13BvJDYlBAqkYT5POt9Lw0V5Tf7mk4tkeZrgUXVDaAcQ8aY1FhbPa9S0gECVrCcE SiSA86DaY4mpkFaBNVzXYFq9NTwRrZI2/T1ymgCCpPsNdwtLlYgHpUwe10XQXLBTueAK3U 4EAjKtejKd5CMrEobc0AYRa4t4KCzaYj6Io/7ungAmQvXF6BXsIqLco+lhjc2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDLTx7dM55ttv2J1BNj5W4PXepGzQDjvEXO5kN7rqlk=; b=mlmLPsvcvDu6Os48JVxKvIB7sWz7XYDXICxuOGQXgCk490xsx8Q/lhda7vA7+Boq9vl58A PcGHRsRyeieN8lljb9WpVQlKZAGDvQiGVm0MIJZZb04r5o2WykoGfMpQ8low5mvqXLlbEV +oiHIAvZtOtTVF1xTHxt+Ug0rTpvmyl7N81D1qAAEGUaY9ulzs5GarDleIIh0F7kkO+IPJ w1vBz8W4+xGprI2Qf82VOy+QotOBR9BfgJjbH1RTnE9wYkzCh2OpyfaCzgkiSubYVyeA4V KAux7ETdjA2CV9R4qTcofVo+k/CDicha5n6fkEpQTGuoXBqFiwjG1qZYv5hRJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9J3Yv9z10Th; Tue, 27 Aug 2024 18:07: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 47RI7GWZ094099; Tue, 27 Aug 2024 18:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7GXg094096; Tue, 27 Aug 2024 18:07:16 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:16 GMT Message-Id: <202408271807.47RI7GXg094096@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: 1d56b7ed637c - stable/14 - nvmecontrol: Flesh out nvmecontrol format information List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d56b7ed637cf283c7773c857a86e8a6ab218751 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1d56b7ed637cf283c7773c857a86e8a6ab218751 commit 1d56b7ed637cf283c7773c857a86e8a6ab218751 Author: Warner Losh AuthorDate: 2024-04-25 23:47:18 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 nvmecontrol: Flesh out nvmecontrol format information The format command takes a number of different parameters. Include a brief summary of what the values mean, though since the driver's support for metadata is at best weak, 0's are almost always used for values other than -f format. Add an example that ties it all together. Sponsored by: Netflix Reviewed by: pauamma@gundo.com, chuck Differential Revision: https://reviews.freebsd.org/D44958 (cherry picked from commit ce3b53ffcc3ecc00fa6283542c60ff1fe697d853) --- sbin/nvmecontrol/nvmecontrol.8 | 81 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 11 deletions(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index b812149b5c7d..b5a85b1ab9f5 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -442,24 +442,62 @@ Use Extended Data Structure. .Ss format Format either specified namespace, or all namespaces of specified controller, using specified parameters: +.Bl -tag -width 8n +.It Fl f Ar fmt +The index .Ar fmt -LBA Format, +of the parameters to use. +LBA Format #, as specified in the identification of the namespace using +.Dq nvmecontrol identify +command with a namespace specified maps this index into these parameters. +.It Fl m Ar mset +Metadata Setting. .Ar mset -Metadata Settings, -.Ar pi -Protection Information, -.Ar pil +.Bl -tag -compact -width 6n +.It Dv 0 +do not transfer metadata with LBA information +.It Dv 1 +Transfer the metadata as part of the extended LBA information. +.El +.It Fl p Ar pi +Protection Information. +.Bl -tag -compact -width 6n +.It Dv 0 +Protection Information not enabled. +.It Dv 1 +Type 1 information protection enabled. +.It Dv 2 +Type 2 information protection enabled. +.It Dv 3 +Type 3 information protection enabled. +.El +.It Fl l Ar pil Protection Information Location. +.Bl -tag -compact -width 6n +.It Dv 0 +Transfer the protection metadata as the last N bytes of the transfer. +.It Dv 1 +Transfer the protection metadata as the first N bytes of the transfer. +.El +.It Fl E +Enables User Data Erase during format. +All users data is erased and subsequent reads are indeterminate. +The drive may implement this as a cryptographic erase or it may +physically erase the underlying media. +.It Fl C +Enables Cryptographic Erase during format. +All user data is erased cryptographically by deleting the encryption key, +rendering it unintelligible. +.El +.Pp When formatting specific namespace, existing values are used as defaults. When formatting all namespaces, all parameters should be specified. Some controllers may not support formatting or erasing specific or all namespaces. -Option -.Fl E -enables User Data Erase during format. -Option -.Fl C -enables Cryptographic Erase during format. +The +.Xr nvme 4 +driver does not currently support metadata and protection information +transfers. .Ss sanitize Sanitize NVM subsystem of specified controller, using specified parameters: @@ -763,6 +801,27 @@ device. The corresponding .Pa nvmeXnsY device is used automatically. +.Pp +.Dl nvmecontrol format -f 2 -m 0 -p 0 -l 0 -C nvme2 +.Pp +Format all the name spaces on nvme2 using parameters from +.Dq LBA Format #2 +with no metadata or protection data using cryptographic erase. +If the +.Dq nvmecontrol identify -n 1 nvme2 +command ended with +.Pp +.Bl -verbatim +LBA Format #00: Data Size: 512 Metadata Size: 0 Performance: Good +LBA Format #01: Data Size: 512 Metadata Size: 8 Performance: Good +LBA Format #02: Data Size: 4096 Metadata Size: 0 Performance: Good +LBA Format #03: Data Size: 4096 Metadata Size: 8 Performance: Good +LBA Format #04: Data Size: 4096 Metadata Size: 64 Performance: Good +.El +.Pp +then this would give a 4k data format for at least namespace 1, with no +metadata. +.Pp .Sh DYNAMIC LOADING The directories .Pa /lib/nvmecontrol From nobody Tue Aug 27 18:07:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9M1H3Hz52YqK; Tue, 27 Aug 2024 18:07:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9L5zFBz4Zps; Tue, 27 Aug 2024 18:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uArt6MNtGWi3Qkoazz384YSt+VoDFiq6IQxkbQ5AH0=; b=lAXg9NXFy9eR73dN2OIaUFzJr9CvwSF7m7m6kJ3qeO/xqG6DTpNObioVMMYatW3TdwDd8k stVWtNqSm1C35/3pSL331i+z7W/HuNVsjHkLnKfG+b4D8WXC9clCuSadB2qduKAf3cc4UW 2YBAvikDCozduYtn2u42+bX7CLWSMY4xSZpDrevtjVANU7r+3uU2FU6BCQt7crztqWgpwn nXXf/oZQ2m4D0aFyvgSJwAMx4uEjS4Ne3CpdTMkdsjPNUtDjU+16VdnMuq8/gSpexOfTiH i5SU//hfjwaK6cbCNkUX3eJxmaBSuDJmwvplaQ6D5Ahz4ydVpuoKLhbKqXk8qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782038; a=rsa-sha256; cv=none; b=q2hYIqA4TrM6tZSwkYxkv1XlXECaF6dQtK8T4VBwd8sMpoRMZPvADvBPSzbWJi25b13GMT gHjTP7aoJqIWW5CdlDWCbQpcPhVmj5ltP8n9DeQVuf2GCttfiR3l5C6x2wbTO7/q+Vm4OB NL0WgApmcK2MT9t7Q/stL+6MN7bHVvqw7I61P5EfBW2o/DHQ/nGqXJeRdkdE3z3tKh9Dbg yiT7esmAJWpvFfgph71/HDB1PsWaOfT0CCS7z1we4NpRlwV6BnDCAgdZSsGAgfywRdi6/x WKjIejW4LraYbh65JjiMrqSInrKueKDukdUIFLyM/4x65IvA2JhzWFFChBNQeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uArt6MNtGWi3Qkoazz384YSt+VoDFiq6IQxkbQ5AH0=; b=X415El7jcAtx6Z4iZq4zAgAXGw999Aux9txGBZZCpZRaAUg8tj6cQKjd1lRWEFjPVbEV2r 68W811LlqDSyJZ3seP7fKpaQ5DFqrmxM2i5/XWFEDaShd5pmSgAxEoKnjjYgs+SjfPTa8R 6hgjeirHshQxVLE33U2rXe571lxXz2jCe+cgOF4JmmhOXyp4q2E2WASCcxZX76fKQ2YvsS 9EyVqxHJY5lIedV6byK/tQxowsiNFZstL/LhLvN3tLZ5roLnlV6KVmBZXE+mPb7ghK79ki QMxp/jsh/gvG3Yu9piDx0r+maOhQ9yoMYCzWbk745r7p5XxPXs8zEAcKKB6ETg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9L5Wz6z111Y; Tue, 27 Aug 2024 18:07: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 47RI7Id0094199; Tue, 27 Aug 2024 18:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7IUK094194; Tue, 27 Aug 2024 18:07:18 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:18 GMT Message-Id: <202408271807.47RI7IUK094194@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: b2a3826e9d59 - stable/14 - ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b2a3826e9d59d5662126986f43b942307b9f52f5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b2a3826e9d59d5662126986f43b942307b9f52f5 commit b2a3826e9d59d5662126986f43b942307b9f52f5 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:34 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas (cherry picked from commit 8f65dcd6276bf139a2fe87c1bbeffcc1fed015e4) --- usr.sbin/ctld/kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index cbb8e2c25f5d..ec46a9b765a8 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -169,7 +169,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) @@ -291,7 +291,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) From nobody Tue Aug 27 18:07:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9L0Fr3z52ZD5; Tue, 27 Aug 2024 18:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9K5DyVz4ZWc; Tue, 27 Aug 2024 18:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jarrI+BieoerOhhczpDUng06r7B1Lgk+tywN+H/j/HI=; b=a0vgXjlAXFuDwkqbf8YD+WFaqN6ifKd/rdomL3MAMwwr7phdMOoCPin3znHPtKj0QnHT3U G1dU+ieojG5VarQivmcrbMZFww7YISpAuwmlyOsFvH6neiOP/jiHFSE4f19vmKSrIsHryw bQnOMkStVk8JtfoIJhY5HZzAZozbSsKhS+VP4mr9owdXFSLhjO1bxwSXZpQ5qHZ3ut/qBO W8Of2morcgpUwS9yw8TRSUU6+ssP3YDSBShBIYVxrVtE9CHUvkHmK8m8IupyFb1W9HEHvB 3+wuy+0kdUzLJktX4RBjRA7C6aaZaCJhumwoN5ath6w9ONpM8POw+9bh9G0GHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782037; a=rsa-sha256; cv=none; b=rj1llPcXpg854NKDtfv+PxlQxvRG8eA0t00JgzlVTs+YKAozhsufCfufjKpyps8lUy9hqx St+TiY49UynUQPoLdRfTd+VlD5Oge/LM8zxvy2rrW4SsuB0g+rA+zDWfMOTpbisSriWUhH PMtScdD8TfRGex3tyvmDHaJKodOhO8TrC7NNCLmhrNQou2VKYieH96QlkzdzZNVN8XzeAj GxaBmD2rbtraXu8SR91REb9JAiINGGxzwFwl0dPMWV3QEPV1DvZEFpq2BCfh2n6vjLJ/vE 4Y0NlPOAY/fcMN+ZPggLciK9NRSnljquSCV3m2CAs0Lx3DtFFsazTJqKZU1rpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jarrI+BieoerOhhczpDUng06r7B1Lgk+tywN+H/j/HI=; b=tt9rIK1dSMx/zyDrTeY7hoYo2RGSzozrmcpyUsGKvciozoXqWQiap1zKUX6S4ygD9hFTm5 AD0EIJT/yWYf+dUBJvLiMd+7eD+SV7Brpr3exRSBd5X4gjGfsyScw/i+Yk173XvtZnuWie aFodhGlhY5yW/Zy0guB0y7p4LUuS7Sv6kbuLP+aepHEJOJDIkjeiFS03nXbLvRPEPok0/1 WkTDjWCaTxoGC50nCaSdh3670MeLu8bVJFm4+z/qcRMlmQRDVCqjxFL/GdVyp1BOPaQySF LgkIBsek7j4ik7TJkKuC9ZeVZMS5wtPI5ph+CIwvbD2G2aQ7qoMrgJxMI4OAcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9K4q46z10SC; Tue, 27 Aug 2024 18:07: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 47RI7HLm094147; Tue, 27 Aug 2024 18:07:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7HLC094144; Tue, 27 Aug 2024 18:07:17 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:17 GMT Message-Id: <202408271807.47RI7HLC094144@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: 86a8ea7444c8 - stable/14 - nvmecontrol: Allow optional /dev/ for device names List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 86a8ea7444c850c287200c47f95ddded6826e943 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=86a8ea7444c850c287200c47f95ddded6826e943 commit 86a8ea7444c850c287200c47f95ddded6826e943 Author: Warner Losh AuthorDate: 2024-04-28 17:01:24 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 nvmecontrol: Allow optional /dev/ for device names nvmecontrol operates on devices. Allow a user to specify the /dev/ if they want. Any device that starts with / will be treated as if it was a full path for maximum flexbility. Sponsored by: Netflix (cherry picked from commit b12cae88cfb6286bc85a47b36ddd84f52b5c38ca) --- sbin/nvmecontrol/nvmecontrol.8 | 4 ++-- sbin/nvmecontrol/nvmecontrol.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index b5a85b1ab9f5..1310184ac309 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -33,7 +33,7 @@ .\" .\" Author: Jim Harris .\" -.Dd April 17, 2024 +.Dd May 3, 2024 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -687,7 +687,7 @@ or .Pa nvdZ . The leading .Pa /dev/ -is omitted. +may be omitted. Where .Aq Ar device-id is required, you can use either the diff --git a/sbin/nvmecontrol/nvmecontrol.c b/sbin/nvmecontrol/nvmecontrol.c index 92fbf9e25378..3876093451e1 100644 --- a/sbin/nvmecontrol/nvmecontrol.c +++ b/sbin/nvmecontrol/nvmecontrol.c @@ -146,9 +146,12 @@ read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata) int open_dev(const char *str, int *fd, int write, int exit_on_error) { - char full_path[64]; + char full_path[MAXPATHLEN]; - snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); + if (str[0] == '/') /* Full path */ + strlcpy(full_path, str, sizeof(full_path)); + else /* Add /dev/ */ + snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); *fd = open(full_path, write ? O_RDWR : O_RDONLY); if (*fd < 0) { if (exit_on_error) { From nobody Tue Aug 27 18:07:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9N2cBzz52ZLT; Tue, 27 Aug 2024 18:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9M6yyDz4ZkC; Tue, 27 Aug 2024 18:07:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xJupswGXPDZMyUo7skMGIvwfYqMz1go5rY7LtMHuWvA=; b=oLEc0wZ6wkRc+w2P1+aKVTMcdxVx7yY0JlqNO1zVUPcceQTF0IcRb2Ftacq3O9Wn2O3Q3Y SA9OkkdiRV44uxYWzG90iSUXyFq3odCObegYmpD/LSiN+vUjwFL/zpG6L6zoms8fE60P2I +IGMQ0HLHlknDcLqwjzRUDzMqCYC/Ql3n4IdoOvgFEGxOmOE742fWnBGadcHm1YKpqaRVQ pwUlArYxZM79UjUj/k5gAja3ObI2WRySAdiUUUXhB5Z09FZlhhu30tdbcx4BTH97Z06dNL piensGnzin/Ll66TBQ0qFpHP40KYwcZouDWpAvbNv5czx/40/e8cvk5A34BdsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782040; a=rsa-sha256; cv=none; b=DNRTzVxUz40+xtSlEh46Ddxdg4ajQe06Lv5EpBgmzz2KEaOziGPJUSFH4fZeY6rtEvBCCH 8pEuOyELm/5OOqBwQDa/5DZCo3msBdCKkjIUgSJOMTjsOebodoKszT8tlxw7mMe3k3lcim JQ8A+BkPgcQzJr5dAeFbBU99eKXKsTJuM0ibh8DR1qfkZx1mAjPDTt0Zb433vo+5Jm8Tm8 DDb1hx/Sg7RYqa6QQ0pc+teMqNlHlqCX0zkGGp9Ns4VjvdPhALJ5vY9DZbWbXVvAFlIJM8 0zzfSfAAiozSLushlGqPYCwmK8ln5wZ5PAoNqtMc/2sxZIPVU6PdtgvL+3ukxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xJupswGXPDZMyUo7skMGIvwfYqMz1go5rY7LtMHuWvA=; b=xoRCYHH30TueAr2owV5PNYrZfNzd8k1WLcsR49rsZZsWWNnxf8n8wBObIUUUlI36whcVdc ah8vyza67UCZElCP/bbphzaxIbdLI8KCNNbnxWK254q9t0gkNzdZN0Um+PKj9ucxNKwgCn qb5FZBoD4514SeUSZlufsAesvtAXVA4TrYcWjNl46JcC+eJXooEO+Vu+26QL0iGHE6F+J/ Glwm/KwpBrrPfZ4Jze7KxIJKqhaG83BSIJ37VpItfUpAt3ZpRpncXUMDfl/TiSKSYob6sq FCNrB2ZL1Aw+h7KKHE9EO/2MYfP8X/jgabwCakwIy35tQGGo0mFsJ4cAdEsmqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9M6YSgz115y; Tue, 27 Aug 2024 18:07: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 47RI7Jj4094268; Tue, 27 Aug 2024 18:07:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7JG3094265; Tue, 27 Aug 2024 18:07:19 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:19 GMT Message-Id: <202408271807.47RI7JG3094265@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: 9f01ac2f7d6b - stable/14 - ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 commit 9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:10 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas (cherry picked from commit 2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6) --- usr.sbin/ctladm/ctladm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 228af7bae8c6..f06e70322708 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -2810,7 +2810,7 @@ cctl_islist_start_element(void *user_data, const char *name, const char **attr) if ((u_int)islist->level >= (sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0])); + nitems(islist->cur_sb)); islist->cur_sb[islist->level] = sbuf_new_auto(); if (islist->cur_sb[islist->level] == NULL) @@ -3241,7 +3241,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) @@ -3505,7 +3505,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0])); + nitems(portlist->cur_sb)); portlist->cur_sb[portlist->level] = sbuf_new_auto(); if (portlist->cur_sb[portlist->level] == NULL) From nobody Tue Aug 27 18:07:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9P3jN1z52ZDD; Tue, 27 Aug 2024 18:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9P0pszz4ZsS; Tue, 27 Aug 2024 18:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h26UIMmp7l8JKpCGwXnrJq3GVIz0yIMsjdxEi3Ej40k=; b=q2/YkfICDQB8ryk1sVpxaLrrAbBd1Lro74f5Uq1WdUQW4k7rwJqHgWnQQZNLV0w1KGaqtJ sXRzQOaQkirs4fHTW+XGDTBeZzp0xL6/ZiDTr3LNWBaNq2zflVZhSxQpbPpD7YlgYBM8G6 O1n2wuhiMe5YsCgvqPNjKEj9AhmB/T4EqIqcNu38jxckpKIuDHRdrHTmQliRf05YEsW6E9 8DhfMq17DBwVWOIFILP7KMQp7BVF0RQ9j/D/ICRVeB4z4P8FqXHAnjayRjUjtTXEYk4WWH DB8yURPpsOlsQmPm8QcNFEK5+UlsnMG0+LB+n7X/P0HKMsfKskZOSMZBaJTGyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782041; a=rsa-sha256; cv=none; b=a4V26HnX86hgIyh0KnNaZas62O68RAwJklPmtnVkFmNgkKnKKQwuR1qYnepvhTAetXEa/R SjCM0wF2JwC7oFGB00RxWzGLO/fiao02Ags3t29+t6fZPQphtvnSflswYbt5WexwjHsgT3 tHc7ifsjABlLjs2ZaaZc2ftEUSrrUButHOcTbQcdE1KoYoXBXvlWW2xZSDorMopSUy47aL 8r3N/Gs8gb1sCIhcL1atxmsAfIWPHFn/j1tfGr+yXcolzoaXOmzc3VFoUiUrHt8CeyWaWe W4bBhukrfitTi/EcA+c/JPsjNVdJq10aPJ4ZH1s+6Em22TfodJtGQkxycYuKUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h26UIMmp7l8JKpCGwXnrJq3GVIz0yIMsjdxEi3Ej40k=; b=a/NGPccfRlK8FDbXUAR/IWmA3j1zJJU76KAb1S7z/1Oc9jG7PdNnPH7NJu0h6AcxD1gAXR hNGSdA/RRcF3Ezl+s50l+FvZ7XPlWQjyjfFmiMf+wiGrJD6eBs4nTinzqJy+8SYXNqjpJO jZyXFgebsA4eHgjXa35P1xoGWKAI6OsXiuC7P95dN6+AGUcQwu34Ig56QlNb2vrVEGHkYK 4OYm+Mg2Ion6YDSKisoPbwEOI9ht4hX266BidPQ2OD4L6FdijWMC4UJoDG9kpi89Z02a+g usOosDF56fmkZG9gKYq1Kxk0Z4kftloFY5M14l6ys3bgObDMsZeQ72CTTmE5Sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9P0R2gz10SD; Tue, 27 Aug 2024 18:07: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 47RI7KT4094326; Tue, 27 Aug 2024 18:07:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7Kbn094323; Tue, 27 Aug 2024 18:07:20 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:20 GMT Message-Id: <202408271807.47RI7Kbn094323@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: 52bc3fae713d - stable/14 - ctladm: Use nitems() in a few more places List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 52bc3fae713ddbec6310d842de1d8bf2cecec9af Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=52bc3fae713ddbec6310d842de1d8bf2cecec9af commit 52bc3fae713ddbec6310d842de1d8bf2cecec9af Author: John Baldwin AuthorDate: 2024-05-02 16:55:15 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctladm: Use nitems() in a few more places Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45017 (cherry picked from commit afd0c206a6ce9a182c1a26a4d8dbb66a8335f519) --- usr.sbin/ctladm/ctladm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index f06e70322708..4426274fdd44 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -2807,8 +2807,7 @@ cctl_islist_start_element(void *user_data, const char *name, const char **attr) islist = (struct cctl_islist_data *)user_data; cur_conn = islist->cur_conn; islist->level++; - if ((u_int)islist->level >= (sizeof(islist->cur_sb) / - sizeof(islist->cur_sb[0]))) + if ((u_int)islist->level >= nitems(islist->cur_sb)) errx(1, "%s: too many nesting levels, %zd max", __func__, nitems(islist->cur_sb)); @@ -3238,8 +3237,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) devlist = (struct cctl_devlist_data *)user_data; cur_lun = devlist->cur_lun; devlist->level++; - if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / - sizeof(devlist->cur_sb[0]))) + if ((u_int)devlist->level >= nitems(devlist->cur_sb)) errx(1, "%s: too many nesting levels, %zd max", __func__, nitems(devlist->cur_sb)); @@ -3502,8 +3500,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) portlist = (struct cctl_portlist_data *)user_data; cur_port = portlist->cur_port; portlist->level++; - if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) / - sizeof(portlist->cur_sb[0]))) + if ((u_int)portlist->level >= nitems(portlist->cur_sb)) errx(1, "%s: too many nesting levels, %zd max", __func__, nitems(portlist->cur_sb)); From nobody Tue Aug 27 21:26:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtgbK3r9hz5MR0B; Tue, 27 Aug 2024 21:26:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtgbK2wvDz4y1N; Tue, 27 Aug 2024 21:26:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DdS3BQaBzhuhSF3a42EVj11hy9gn6L8LhexXkXYm1bA=; b=AFeSWdWG1Tn022w7OY2AOZ+XoERr3MVzaPAOOKDy+ZCxhq9b2/nJiCV9z2WBiLpzu2Sizo y9IagINnFCC+AyaH66QuGRi1e+C58K//3d6qgQjsp9w87MjI56Xdo2aOVp7/d/WVvRBryJ r/0KxFkEfUZszGhOmAb/puCpwh9a/fcmWM4sg0ELMg2sFEZ3LnxDbrEvfOCFMaVlrrDLFK uVyJ/TGdo5NlTJPN7WfpD8DZ2DfJ+OhoVeh3pKhrtKKvz8QGrUdMkqW4/MObd3CPbPiV+l zwRgpZ8aK1AGWhusjPtqfct7xQf3wC3n3ljrW/x7XzKZtSsrbsqUokAq1qniKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724793997; a=rsa-sha256; cv=none; b=qf7nl2/bIzuoStlQ5LDCXfXe2r+m6TLky6ZVnPLfcclBwOmwj1MyHoQzihRgBPet882W4F Ghdxx6kL7MXzBF6g2J8/dj8OoVtVoPoY3AEFTdm8BWe933g4M9uZbJQ6otw9WlozG+IcuT Pq5sL86jl+WUKaEYvinEvF9klTfLaAaX2oXO2iBPeOtujn+4PnR6+/u31UfAyPJM9tvv2G 4L3Fd7+HSrjzkWuvo72c8CZ3Magxq9imQwIeofsmiEoUIQip3zOL+3Fy6yHpwSHCO/tf0m FexLZZQosC+q9SvDPQl682xJyFTH6vAEHK2lBqeSZ1bjARFXZTC/QRwrB2r8dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DdS3BQaBzhuhSF3a42EVj11hy9gn6L8LhexXkXYm1bA=; b=bP2nQVm58HFPxq8g89XsBiep/wuLNMsCkODQ7jYpH8+yYI9Nnfrfdyvx+1ahjhyKR8xXL3 jg2+d3UyiGDh0/NnkmtB3DX5TNLOrSAOLabMiOiuD7MUJKOcnQ7DzGdFsBbaxjSTySeA4p xQ5S8Hpk40FaXk4p8KePX6RE6ViRVc5w4FWIJU1BX8vwSr1WGydNesdC6MM8XeQs7Iel88 p+gAVflDiX0n4jmbiT4fKtNoY5z44KSoNYddXVnQc6xZtgez3b2+CiGcrdH18Frz6nWKsz p05wQupzWBVMB+OwBNUTGnuClCgkIUN+obkPPiAwhbDJ0Km1aS4I75G7JEwvVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtgbK29mlz15B0; Tue, 27 Aug 2024 21:26: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 47RLQbui034390; Tue, 27 Aug 2024 21:26:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RLQbYT034387; Tue, 27 Aug 2024 21:26:37 GMT (envelope-from git) Date: Tue, 27 Aug 2024 21:26:37 GMT Message-Id: <202408272126.47RLQbYT034387@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: ee104259c72c - stable/14 - rc.d/ldconfig: Compute ldconfig paths in a function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ee104259c72c24ca2495f7d7c4aac2672c010478 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ee104259c72c24ca2495f7d7c4aac2672c010478 commit ee104259c72c24ca2495f7d7c4aac2672c010478 Author: Konrad Witaszczyk AuthorDate: 2024-04-12 21:34:59 +0000 Commit: John Baldwin CommitDate: 2024-08-27 18:15:48 +0000 rc.d/ldconfig: Compute ldconfig paths in a function Move logic that computes paths passed to ldconfig(8) to a ldconfig_paths() function that can be called for multiple ABIs. Reviewed by: olce, kib Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D44751 (cherry picked from commit e6e38bc522e29de6299536b547bf11dab11e9679) --- libexec/rc/rc.d/ldconfig | 55 +++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/libexec/rc/rc.d/ldconfig b/libexec/rc/rc.d/ldconfig index 5c404a823dbb..fd54b2d3444e 100755 --- a/libexec/rc/rc.d/ldconfig +++ b/libexec/rc/rc.d/ldconfig @@ -14,6 +14,31 @@ ldconfig_command="/sbin/ldconfig" start_cmd="ldconfig_start" stop_cmd=":" +ldconfig_paths() +{ + local _dirs _files _ii _ldpaths _paths + + _dirs="${1}" + _paths="${2}" + _ldpaths="${3}" + + for _ii in ${_dirs}; do + if [ -d "${_ii}" ]; then + _files=`find ${_ii} -type f` + if [ -n "${_files}" ]; then + _paths="${_paths} `cat ${_files} | sort -u`" + fi + fi + done + for _ii in ${_paths}; do + if [ -r "${_ii}" ]; then + _ldpaths="${_ldpaths} ${_ii}" + fi + done + + echo "${_ldpaths}" +} + ldconfig_start() { local _files _ins @@ -23,31 +48,12 @@ ldconfig_start() checkyesno ldconfig_insecure && _ins="-i" if [ -x "${ldconfig_command}" ]; then _LDC=$(/libexec/ld-elf.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' ') - for i in ${ldconfig_local_dirs}; do - if [ -d "${i}" ]; then - _files=`find ${i} -type f` - if [ -n "${_files}" ]; then - ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`" - fi - fi - done - for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do - if [ -r "${i}" ]; then - _LDC="${_LDC} ${i}" - fi - done + _LDC=$(ldconfig_paths "${ldconfig_local_dirs}" \ + "${ldconfig_paths} /etc/ld-elf.so.conf" "$_LDC") startmsg 'ELF ldconfig path:' ${_LDC} ${ldconfig} -elf ${_ins} ${_LDC} if check_kern_features compat_freebsd32; then - for i in ${ldconfig_local32_dirs}; do - if [ -d "${i}" ]; then - _files=`find ${i} -type f` - if [ -n "${_files}" ]; then - ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`" - fi - fi - done _LDC="" if [ -x /libexec/ld-elf32.so.1 ]; then for x in $(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' '); do @@ -56,11 +62,8 @@ ldconfig_start() fi done fi - for i in ${ldconfig32_paths}; do - if [ -r "${i}" ]; then - _LDC="${_LDC} ${i}" - fi - done + _LDC=$(ldconfig_paths "${ldconfig_local32_dirs}" \ + "${ldconfig32_paths}" "$_LDC") startmsg '32-bit compatibility ldconfig path:' ${_LDC} ${ldconfig} -32 ${_ins} ${_LDC} fi From nobody Tue Aug 27 21:26:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtgbL431hz5MR4N; Tue, 27 Aug 2024 21:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtgbL2xCTz4yQB; Tue, 27 Aug 2024 21:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3oBA8cGEg5pOqJd6TlM0ETayoPUh/tYJjsWgqAJQEQ=; b=cH7nQ2cTb1CN8UdSP0EwEA0k7iBme4o4fWd7C5G8BKWe1JPDvOZuB7loal0dWdqOKCaeWI F4CW+BOKwpxN5DOSAhwtzy9PTRMMXuRS4j77OaVYC8vZIXskNDgWUW/vgkdV4R5K1yWJ9t OzRV8wvCqF+nDj4IbjUZTYj9ow3mFwDbBrm1TSVtTpVvPZ3uzRbMjd+RL+ouf5VWR+E4nt 9p/u1N0hYnk5Nf/mlBmlp+l1UrW5dhGI6odFgQ0l5rT38xfMPC6jrxfz9DkgDbFUi0MHuB yeRToYnZk3bt9rlO20zUNAAQEpc+Hnpq44NAqvNlhBjZkaBiy4M5MFOkZyHRTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724793998; a=rsa-sha256; cv=none; b=SNDgT60daATllSg35HrZbAXUjd81CONG8V/GIt99FNvQFvneUpx+qyxC3OuwMXA+D/B8wK 5FZ0jXzp5qMSLJ3ep5CetTwP2gMomD2Xb6rvlj1tQ346U9CkHlxZxsDlAaNSJd0pGXDE/8 /1mvCbyHM22ZvNyadkOzH0EECaO6RM9Olh+8sJDnSjOMbum+Kson5CLpkGiWM0NrQ8RxNv srrSejmhzldKzuAPPBuut604REAqhsTibwbWMVL9lPdQwTcLcy6OcHJdEd4xQ6ENbMGPH3 ojkgnuYA3paaeBT6q4T3sRHwdgC62f4JQFqPa+lzFLPz8G18KypogDdgYVsNAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3oBA8cGEg5pOqJd6TlM0ETayoPUh/tYJjsWgqAJQEQ=; b=AYmKtU+iBxQe9zMkG9TC6Rxx7eVxr5nkMXpQ1Qzg7gZ35qMGcQ26YIKzY4NyngQxRxomIq oJ+k2wmC84xQBfR9k48txCReSwgDN6tuGNnOxbqEDt5iSvNREVYIniRyER8uTkQwqtZyBv oEUfnBkGzBSxXE1Z05fdwBmQaJ5J41HwmGdFDmHB4t7Nt1bkbY8u/lES9XX7U8OzBNAZcl qcSZsfv2mUAp6x6T6BRlcPThNVnOfyJPMZMKeyoc/DZU7OFu25QenQIxs+JKPM10Umpy0o GBmCCyIxxcy1WpR8CLp6d0Zifz2RjwTJFmQRst+OEaS33ryloiQFOW4NoBK/fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtgbL2YPbz15c1; Tue, 27 Aug 2024 21:26: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 47RLQc3m034433; Tue, 27 Aug 2024 21:26:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RLQc4H034430; Tue, 27 Aug 2024 21:26:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 21:26:38 GMT Message-Id: <202408272126.47RLQc4H034430@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: 7b9327d6b2df - stable/14 - defaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b9327d6b2df22004d64406e51a9568e4245fb93 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b9327d6b2df22004d64406e51a9568e4245fb93 commit 7b9327d6b2df22004d64406e51a9568e4245fb93 Author: John Baldwin AuthorDate: 2024-04-12 21:35:23 +0000 Commit: John Baldwin CommitDate: 2024-08-27 18:15:55 +0000 defaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths Commit 99132daf6f70cb0cc969c555d3612547fa3cf1db prepends /usr/lib32 to the list of paths in ldconfig32_paths since it is a standard library path in ld-elf32.so.1. Remove /usr/lib32 from the value in rc.conf so that it is not listed twice. Reviewed by: olce, kib Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D44752 (cherry picked from commit 4bf5db113f760619bf754c22864b1d7e2acdeabd) --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 8b56a490b5ec..eb971a76ecf2 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -675,7 +675,7 @@ clear_tmp_X="YES" # Clear and recreate X11-related directories in /tmp ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks ldconfig_paths="/usr/lib/compat ${_localbase}/lib ${_localbase}/lib/compat/pkg" # shared library search paths -ldconfig32_paths="/usr/lib32 /usr/lib32/compat" +ldconfig32_paths="/usr/lib32/compat" # 32-bit compatibility shared library search paths ldconfig_local_dirs="${_localbase}/libdata/ldconfig" # Local directories with ldconfig configuration files. From nobody Wed Aug 28 00:40:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtltv6Lrwz5MS4C; Wed, 28 Aug 2024 00:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtltv5s0Zz47dQ; Wed, 28 Aug 2024 00:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MKd4RhTe2HfyWAlSa9krHS1nc/FVypUM+j1cOjzxC8=; b=DFqYsJPPm/5NT0nfxGMnWTHMPxjlYVVUOVRuLT3PYSx3MDjS3UVT7WmjDikX/VImdDhUx0 kvZ5ASteskbK/YIVk1BBFnqgSy5MtLkYG42S8+5/D6kTWIXAqrFaN9Hd99tdYr9wH+FgM9 UktsEcoCTkMt5UI3xbk+AB39iN6d2mWgT2tbLd2Fvmoo6eWGxb3hhDK0U3QRoO3kNxfOA3 tiozBEyAEeGsrga6FJ05o1qdvJ6rKo07BMGw/zQch3ReJNxBgqZ/bh6UOKY0l1sCDUdf8N LQuXG2g2ahjGc06CXhAGCemaiKnuo1UKpHxkWtUUj184IW987j8QzUlO9uiibQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805623; a=rsa-sha256; cv=none; b=JZXP70VVoXocNI5TB3J+D85iMNqyvMPGHpgx7/ZPK0EBYPac1JVXTW/NYjoCOLNx0bO0+C T/8NaxyM1nD64BrfG6lzdfKHB6h7v5yUu0YKJ/UBTFDtP7dKFJBTAUx2kHheUDEA9hOFWW 2P09ouHN+Ajffn4xFO8cwZJczP5XeWWM0a2NTyNV7JKfp34Q8lF+f24AUMyHomXse3WsMr D5JKCcmGreKtV0bQbtOF506iNq2629yuAcSgtYJaQrHU1Bij1VY7DLL3WF6usozs5FH4t+ q0Hc2ahIzdws5yCFfP3vQ7Q4rBuBPCj/BZgFnLyy8AgeB2/AkDq94yGCIsDSUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MKd4RhTe2HfyWAlSa9krHS1nc/FVypUM+j1cOjzxC8=; b=EdbYgvlA8DOYf6C2y+k05Dc9TZmIaz8RplAgoVJH8QR5ORZBCSFTU5kENHFn4zIOi8+dAY jV+Z4VWl4Q/Y2su9G/Ca6RhNUGpuEPVeiEHJp/medeblW7t4DFs7j2knhcRWYbQFXjhUw4 0h0p6VF50U5AcA6Ih5BsEkiraMLhKJF7qR1CouSRL/iZM7hE9mWgRVaS78Pvcdl7mjZ2rT uHRRSfPbR/xT/WYv9WIf8nC10rQSkbNSY6/R1ywkJk8XQ8Nke9p0MQW9zQb0xmfVp7W31B WjrCsjVvoPCBCi0XBftgtYGHvVDG8XuRkY2ZPYh64drupligZflat1ohoM/1GA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltv5LMzz1Bhg; Wed, 28 Aug 2024 00:40: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 47S0eN1k064577; Wed, 28 Aug 2024 00:40:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0eNVA064574; Wed, 28 Aug 2024 00:40:23 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:23 GMT Message-Id: <202408280040.47S0eNVA064574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d66c4853b840 - stable/14 - DMAR: clear dmar_devs[unit] if attach failed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d66c4853b84002c064bc314a0824a8667a0089c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d66c4853b84002c064bc314a0824a8667a0089c6 commit d66c4853b84002c064bc314a0824a8667a0089c6 Author: Konstantin Belousov AuthorDate: 2024-08-20 14:41:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:33 +0000 DMAR: clear dmar_devs[unit] if attach failed PR: 280817 (cherry picked from commit 45543d3424d46f84a5399879e190fc359dcefbd4) --- sys/x86/iommu/intel_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 0b25620114cd..636534173715 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -422,6 +422,7 @@ dmar_attach(device_t dev) &unit->reg_rid, RF_ACTIVE); if (unit->regs == NULL) { device_printf(dev, "cannot allocate register window\n"); + dmar_devs[unit->iommu.unit] = NULL; return (ENOMEM); } unit->hw_ver = dmar_read4(unit, DMAR_VER_REG); @@ -449,6 +450,7 @@ dmar_attach(device_t dev) error = dmar_alloc_irq(dev, unit, DMAR_INTR_FAULT); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } if (DMAR_HAS_QI(unit)) { @@ -463,6 +465,7 @@ dmar_attach(device_t dev) error = dmar_alloc_irq(dev, unit, DMAR_INTR_QI); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } } @@ -496,12 +499,14 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_inv_ctx_glob(unit); if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } if ((unit->hw_ecap & DMAR_ECAP_DI) != 0) { @@ -509,6 +514,7 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } } @@ -517,16 +523,19 @@ dmar_attach(device_t dev) error = dmar_init_fault_log(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_init_qi(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_init_irt(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } @@ -542,6 +551,7 @@ dmar_attach(device_t dev) error = iommu_init_busdma(&unit->iommu); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } @@ -551,6 +561,7 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } DMAR_UNLOCK(unit); From nobody Wed Aug 28 00:40:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtltx0057z5MS6H; Wed, 28 Aug 2024 00:40:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtltw6Vqjz47kL; Wed, 28 Aug 2024 00:40:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzLf1HeWO2m+kWO26CIYQLHLp1oQSKkxD4AuPaj/lKs=; b=AbVYcgNN6veip3+iPRk3kzaIq7rRk3brd6Go6T+UxGR8gEdG77p41N6vOlKDgy9rbZr3Ph UCGrIBs61ZnPnT73JdgRoVeaK3uXT/ilq6tNGLcQ7j/igONLBTpjew6ftAd/XZJJQTMc0k mzz8OknntzChH/D3Dev42IxdMry8WLQ3bNEgLoaGhP271TTLslcC/Aom+uaAmg+zOGUCY4 hmfz2O1/jWx8bMEnAzpisaVnDikx6prPwXVa9EMARuK7AYqLBUfiF+KvrDnmhkg3v1DPnh E6mTQoCBb1Sw7fKIsKqH1jOt/FNsC7/tyYh+euAof4bd/paJOTTfXwPY8uxuWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805624; a=rsa-sha256; cv=none; b=eUnLCQHuuqqiH48eylFYGt0oSwNhMrEUWcac3wRHkJE4oXAQX6Z14BPW1GOJyakIlf6Lh9 p/g3y5/6XdI+EpmSCNW9j+QwYsXCY7ulAZepihXedcCtVH7DrOZcA8efOiMJU+QvOUIjqr b5uE5r2Q6p9fCOCwDYATC9+C/Fat6qSC6jvQdqKZCB6+rgSNMlX3lOEj/ev6YW37Ld5h79 vKeFWND4jnabRFL9WihH9frEq/mi+VTWzh4nuJUzBF8bSkH32epUeqDfXvzyTpxk4mlsiJ gXtIL/cVFcLq+PtLQlLYt8QhDqrD6UxMr1Ep7bJgeE5hOYSX2ktC/pHW89Ki2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzLf1HeWO2m+kWO26CIYQLHLp1oQSKkxD4AuPaj/lKs=; b=GRmn+0NbKXqiS4Vf18aXjPOtSRIxNEnwMPku6iPf/jY+giqiB+mEl00I1POCd+f+x1vEyd GvKzY7lEF3VubHt0wRg6Kg5SywAfOB/ATYDN0HcPKdyqHGLWVWtGZe3tfXKXzdIutRxbmI dKWW8ErG/vLCyM/H0L0E+TRGpklCY9BPnBC5uEgAWBAmLJoXyY6gbBmZlHI4sZE2pfH3G5 KxkJ/h1TDNc2GmblPxE/ThmUWwbJEsDBWW2EKva9QUp6W6afNw+ICyYLn4yspLjmS49FKa MzvpHBdFqsJ1n9wcXnL44aH+ZAnIlraE31xCNyQpLTdXBL52X9sqQXK+h13M9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltw66SGz1Bhh; Wed, 28 Aug 2024 00:40: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 47S0eO14064628; Wed, 28 Aug 2024 00:40:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0eO4g064625; Wed, 28 Aug 2024 00:40:24 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:24 GMT Message-Id: <202408280040.47S0eO4g064625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c3cd4db461fd - stable/14 - amd64: add convenience wrappers for INVLPGB and TBLSYNC List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3cd4db461fdb686b2aa3a199e7f1c8b89049208 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c3cd4db461fdb686b2aa3a199e7f1c8b89049208 commit c3cd4db461fdb686b2aa3a199e7f1c8b89049208 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:40:07 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: add convenience wrappers for INVLPGB and TBLSYNC (cherry picked from commit 111c7fc2fe21356a637f89fa58c407958f05ad93) --- sys/amd64/include/cpufunc.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 44d93494d830..b9893b8896d8 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -529,6 +529,29 @@ invpcid(struct invpcid_descr *d, int type) : : "r" (d), "r" ((u_long)type) : "memory"); } +#define INVLPGB_VA 0x0001 +#define INVLPGB_PCID 0x0002 +#define INVLPGB_ASID 0x0004 +#define INVLPGB_GLOB 0x0008 +#define INVLPGB_FIN 0x0010 +#define INVLPGB_NEST 0x0020 + +#define INVLPGB_DESCR(asid, pcid) (((pcid) << 16) | (asid)) + +#define INVLPGB_2M_CNT (1u << 31) + +static __inline void +invlpgb(uint64_t rax, uint32_t edx, uint32_t ecx) +{ + __asm __volatile("invlpgb" : : "a" (rax), "d" (edx), "c" (ecx)); +} + +static __inline void +tlbsync(void) +{ + __asm __volatile("tlbsync"); +} + static __inline u_short rfs(void) { From nobody Wed Aug 28 00:40:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtlty2LtCz5MS6L; Wed, 28 Aug 2024 00:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtlty0XYDz47gm; Wed, 28 Aug 2024 00:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WmCASC4QVJEBicC+m409lsDAc9l7zMsTTIMwbRrTCGg=; b=YOzD8Ait3luVsuUX3e0drvlpICKDU7KCzFegJNXzZYeZOrkxggL2feXX8HzjJ5Tvwml7pz oTngdzTULom7zBIp+s6gJSNUdUta0wPLlI8vjxnNfv0QoXIPJHb+Ft7vZngTKqZfJyoUDC TvpfS5jHR0uZ2fRyB9Q0Mcfz9kD0pOyEhP2pO1NukMRFmkkZAKFGQhRlbFnW1UZrG2RCLL aFAChxsGk8aHX/rwo/smsBeQKxWtR8iOXP8g+vCsrS0+umwE9Y+2a3o5nuRoZTOok3JxtS kYuRQKRsnoJbM9hVkewnBn8UJYFeBEHUvcuLJDNH/xLrgGB4wFelLMVhYM+MdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805626; a=rsa-sha256; cv=none; b=LKDXZR7kZmz83d4Nq9WP4/jGYKA5sXdnO8AAPbrvHbyYJ9/iGpgIUWJDPXtL98zWexylKK CQTNIGuSQxGk3ndjDI6aVUJyNcEncE1JzNrsxA9EEp38qbBcnWsAnq4jDeS2bfrHwa2Ein o4dTv030ej64jSO3mvba2LndF9U+Wo4f5N5jwDwS8vbqHPytxU5v0ee0x/dqQa0G7Kdxxn do44k6+CWKPfhDHrLangTvF4MgpwfLDbxSnqoEj3GVEP/Pm6h2Lu9JD3VQ388p2sb/08Zj Rmv/LRb7i1DEjVr1YM9xsi0ypgPPLAtrYJSsvIZEoGlLt4kAvQTevd3UNysUXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WmCASC4QVJEBicC+m409lsDAc9l7zMsTTIMwbRrTCGg=; b=jKAsdtArhVfEomd2fIC04SPqoKe+WK3RCSMa3aP2IoZtz1y8tvU2jfh7IjL/iHv3PqEm6a 8z1SreM2FW4OwoBI3xe06eAW0n6OJA+p1Y9oABDcGfd5Loc1GujEeIcsloNmq+F8IbprmF mjMnCKPU2qV85/UgFF4e+yF5V3A68ZZfFqou0brR4WOPxblOtOMuk1oVdSq+5MSaJ0i1do e0fcBZRm2da6CzZCOJnSzzuX9++1qK/wp6aJjOIgYGwftuxNxe/s/hu6oztGY1UpuEdOOS +8hnz8yXewk0Vz+hfuKcAwHZ1f0Glt8J/Wq5BJbMguZPNMoW25yHlINjDf0JzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltx6sS9z1Bf7; Wed, 28 Aug 2024 00:40: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 47S0ePdv064673; Wed, 28 Aug 2024 00:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0ePwZ064670; Wed, 28 Aug 2024 00:40:25 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:25 GMT Message-Id: <202408280040.47S0ePwZ064670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 23117748f297 - stable/14 - amd64: add variables indicating INVLPGB works List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 23117748f29793915905d14a2868916e7f06c0b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23117748f29793915905d14a2868916e7f06c0b7 commit 23117748f29793915905d14a2868916e7f06c0b7 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:41:17 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: add variables indicating INVLPGB works (cherry picked from commit bc4ffcadf2681c954444e1853200dca3f5e65676) --- sys/amd64/amd64/machdep.c | 6 ++++++ sys/amd64/amd64/pmap.c | 4 ++++ sys/amd64/include/pmap.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index f5c49c6ca243..83a57ad3316f 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1488,6 +1488,12 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) finishidentcpu(); /* Final stage of CPU initialization */ + invlpgb_works = (amd_extended_feature_extensions & + AMDFEID_INVLPGB) != 0; + TUNABLE_INT_FETCH("vm.pmap.invlpgb_works", &invlpgb_works); + if (invlpgb_works) + invlpgb_maxcnt = cpu_procinfo3 & AMDID_INVLPGB_MAXCNT; + /* * Initialize the clock before the console so that console * initialization can use DELAY(). diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0d364dec7c82..f23488a2174d 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -552,6 +552,10 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, int invpcid_works = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, "Is the invpcid instruction available ?"); +int invlpgb_works; +SYSCTL_INT(_vm_pmap, OID_AUTO, invlpgb_works, CTLFLAG_RD, &invlpgb_works, 0, + "Is the invlpgb instruction available?"); +int invlpgb_maxcnt; int pmap_pcid_invlpg_workaround = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_invlpg_workaround, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 506b28562bcc..0e989de558b3 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -427,6 +427,8 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dmaplimit; extern int pmap_pcid_enabled; extern int invpcid_works; +extern int invlpgb_works; +extern int invlpgb_maxcnt; extern int pmap_pcid_invlpg_workaround; extern int pmap_pcid_invlpg_workaround_uena; From nobody Wed Aug 28 00:40:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtltz2sP3z5MS8l; Wed, 28 Aug 2024 00:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtltz1QzRz47mq; Wed, 28 Aug 2024 00:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TDO5C0ysbjDP8fQBntCvTLc6U4PMoxs7ch2eV8AWjfs=; b=rPrOXsaFpXXIogwc32PmRchxbg/oTQOGlypFk9yAJCI2AqvhrP1LW0rhqZOWKXGnCy2bvG lnwoy4d2EQqfy3GWww9jfIA+XwKfGSE0wtjWxuVqvIV7ZAoCKMmeOPk1Sol8FHnQU7mzgt tdSUEGvJPRYQS5iRTDznnVm8a4zQssVT0XbuRE22r3tV9FPt8YCD4QB0avhMAsBiUo3Z3m Gs/lB5HLVmZNKGUVoHcBpRgYghC+F2vWtKn2oV2SFhvbSH2Enu4D7G4mMJarZci0ygFOCH 9w6DyLkFllRiKY0WFGReN8Z+BQZASrER1mzHh3fUbipuX9hRUUEYrgDILnfWcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805627; a=rsa-sha256; cv=none; b=C5pW9+GWcFEIXFwfkUcecJkZjRhzTUYXNPQX+K9HihyPnbnoUnT+auZokRr6FaQ3sUeXQv jwILPzWS+Y4sW9/DI2Dm7Um1PZCdYBvUePckyLl+wf5eU3bBgzlioxwjm1/um3zuwxzsUb UQ4S+9jh7KYYtk83sbbDwC/GGHKhjeGjPsRlRq9/aynRUbOxxgGuNtnmEBPC46jvj+9HuE E3rZYYdIZthe7hakQvGNkGgTi1NptkI6BpcjX1O5hbmsvq5I8t3GrKxI4h5GIkr+zUVnhH cvCHB/tMZ/a77Ru+rC7GGpdNT0w38hIpxo3krocqpOmmnrO0ytyerZANGXaecA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TDO5C0ysbjDP8fQBntCvTLc6U4PMoxs7ch2eV8AWjfs=; b=IAJqa3PhaHCnfRSi7zZer5At01eBq1pe8C/WzF7/wFJ6zC41yoLv6N3aXhzVrBRcOHdE+o Elll4Vxl5wq4DHmrZv3a75cR3bVcEa78/GbpGaVdVpKDkcfhSfoo5UjbzKpIGF67TKl6BF TDszjYQtHcLuZQxe27d0BDX8iVKTKPCjrdEerJAww+FxUWNdG59tmCNdZtuh8HuYQ2hBvc a5lLj60PdLlhXQmgvNFVVffE+a9qehgiY8bbuWHEZnEO9TALyUFo4Vmq5sC0sDuhLD263Z zq+Yxb6Mq2cM8xEal1GPqNl8TAE2lwH5rWu+/g2VgqtPEcqjA5kfafww1tEgxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltz0lcWz1Bf8; Wed, 28 Aug 2024 00:40: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 47S0eRRi064721; Wed, 28 Aug 2024 00:40:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0eRUl064718; Wed, 28 Aug 2024 00:40:27 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:27 GMT Message-Id: <202408280040.47S0eRUl064718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 43605618aafa - stable/14 - amd64: use INVLPGB for kernel pmap invalidations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 43605618aafa834cbd18f91f19f2565584a7fa5f Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43605618aafa834cbd18f91f19f2565584a7fa5f commit 43605618aafa834cbd18f91f19f2565584a7fa5f Author: Konstantin Belousov AuthorDate: 2024-05-13 22:42:08 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: use INVLPGB for kernel pmap invalidations (cherry picked from commit 47656cc1ef1cac307f24de88a4fe23a1389af44e) --- sys/amd64/amd64/mp_machdep.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 91737637b714..12abb8b6bf8b 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -679,6 +679,20 @@ local_cb: void smp_masked_invltlb(pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + invlpgb(INVLPGB_GLOB, 0, 0); + + /* + * TLBSYNC syncs only against INVLPGB executed on the + * same CPU. Since current thread is pinned by + * caller, we do not need to enter critical section to + * prevent migration. + */ + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, 0, 0, curcpu_cb, invl_op_tlb); #ifdef COUNT_XINVLTLB_HITS ipi_global++; @@ -688,6 +702,13 @@ smp_masked_invltlb(pmap_t pmap, smp_invl_cb_t curcpu_cb) void smp_masked_invlpg(vm_offset_t addr, pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + invlpgb(INVLPGB_GLOB | INVLPGB_VA | trunc_page(addr), 0, 0); + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, addr, 0, curcpu_cb, invl_op_pg); #ifdef COUNT_XINVLTLB_HITS ipi_page++; @@ -698,6 +719,39 @@ void smp_masked_invlpg_range(vm_offset_t addr1, vm_offset_t addr2, pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + vm_offset_t va; + uint64_t cnt, total; + + addr1 = trunc_page(addr1); + addr2 = round_page(addr2); + total = atop(addr2 - addr1); + for (va = addr1; total > 0;) { + if ((va & PDRMASK) != 0 || total < NPDEPG) { + cnt = atop(NBPDR - (va & PDRMASK)); + if (cnt > total) + cnt = total; + if (cnt > invlpgb_maxcnt + 1) + cnt = invlpgb_maxcnt + 1; + invlpgb(INVLPGB_GLOB | INVLPGB_VA | va, 0, + cnt - 1); + va += ptoa(cnt); + total -= cnt; + } else { + cnt = total / NPTEPG; + if (cnt > invlpgb_maxcnt + 1) + cnt = invlpgb_maxcnt + 1; + invlpgb(INVLPGB_GLOB | INVLPGB_VA | va, 0, + INVLPGB_2M_CNT | (cnt - 1)); + va += cnt << PDRSHIFT; + total -= cnt * NPTEPG; + } + } + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, addr1, addr2, curcpu_cb, invl_op_pgrng); #ifdef COUNT_XINVLTLB_HITS From nobody Thu Aug 29 18:12:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvqB90Tb0z5TKkW; Thu, 29 Aug 2024 18:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvqB8702rz41bk; Thu, 29 Aug 2024 18:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724955137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3qWZa4eMH/KqeLGASSJmoC6GjeZNk6gfkW8C1LKFIQo=; b=ZnqmskT/aSutCaYXwWeCt1TMdKSs5K0mPy9n3O1kvY9vvALqQ+C4nK9sGUakc6Og8pGf6k 8qwLvbWJ3TYRJcO6G6Lr0NphUQJHZzuKRFpT3YBPJFL3ckmUem5E75rl/w17EdlG2ZwxG1 kk8nurAmQvt4GF0ioK5KUBryK5XrX+PyIyExhaRySxhIsfhQ8engdhJxSgJj0GZSKs4Nh1 DYaxXbj+G+cnyZtoktoNIeR6RX14q1gTmSscd4AkvDzCdrdfaA9GNCiIe3I4+wtgKGmpOp 5SkDfxkdMS/PCFSofDFTXMsL/9zQb45ndiSzKxjzu751eh/Z4HtESq/3yLqp3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724955137; a=rsa-sha256; cv=none; b=eAP8BO8Boc37jhLtGPKoTNehL4/bcpNEAlhLtGjXUny+aqeakfPX6SHYp6/dvUf0JGTjtE EEYS5zKJZiHLoV2dme68G6MhgXWA/4oFv13Rz1evtX7EFs1rlrnUQyYaybAm8V72WPPFG2 r/h+Vzqa0jPKSzKAi8HimV2itONUO6YVn1L4bxYz/2I5cCtUqtjsPoz3nm4wTWPX0aHshW wIFLWxtoKTUZuew6/bBzYXPL2d9D8MsJlRHqKGR7ZBru6G0jgapHIqkVESwTPtL5EF0jtt QnAE+2RSeLpCjSfcHKNeDKiVJckmZTsybA5TSdgsdg0ynRSM+3EeJj8yJuXr/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=1724955137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3qWZa4eMH/KqeLGASSJmoC6GjeZNk6gfkW8C1LKFIQo=; b=P4KTjjMveEZDYtaTHHr8XyCYF0wdDFw7AuUH+AIaWoPJfNBSqSsgmD/xGPb4uSyh3XB+kT /aPfKveRBiYKvVV7fKvKQFFWvX+MEJCe3oq7K7tJpMRyeQZEzAh98qhgxGWHlwiDtjyCF3 f+jlGUtuAu7llTVmHtdfAsPUop4s1HmNnvJVEFXM6rhZNo9x3f4jGAiy0Mn28+l3Ch6PYk u9H8Ry+GEow8AC7WduZgtEuThvpE7F64HuuRVn/pyFDjEE1a5zi6UoRQg5/XhZmVAgEBLt 3JQrQmaIada+zD9Ab4EVaXVz/Qnb+PgEsJhDiA+tdPxQO1IfYLyhrpKkUjhSbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvqB86bHwzSD1; Thu, 29 Aug 2024 18:12: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 47TICGPK000733; Thu, 29 Aug 2024 18:12:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TICGnL000730; Thu, 29 Aug 2024 18:12:16 GMT (envelope-from git) Date: Thu, 29 Aug 2024 18:12:16 GMT Message-Id: <202408291812.47TICGnL000730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 455dc6ffa843 - stable/14 - loader.efi(8): beef up the updating the ESP List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 455dc6ffa843b20e2555f1884d1a07d47de78123 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=455dc6ffa843b20e2555f1884d1a07d47de78123 commit 455dc6ffa843b20e2555f1884d1a07d47de78123 Author: Warner Losh AuthorDate: 2024-08-20 15:44:38 +0000 Commit: Warner Losh CommitDate: 2024-08-29 18:12:27 +0000 loader.efi(8): beef up the updating the ESP There's a huge variety of situations when booting with UEFI. Document more of them, hopefully better. Feedback from: jrtc27 MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 871911a4ab738a54a88f3533f553f5eb68c28012) --- stand/man/loader.efi.8 | 142 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 22 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index cc24b25594f9..a0c0df9a9c35 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 22, 2023 +.Dd August 20, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -355,43 +355,141 @@ The default location for the ESP mount point is documented in The following example shows how to install a new .Nm on the ESP. +The exact placement is complicated due to the diversity of +installations, setups and situations. +In this section, paths that are all lower case are Unix paths. +Paths that are all upper case are relative to the ESP mount point, +though they may appear as lower case on your system because the +FAT filesystem of the ESP is case insensitive. .Pp -First, find the partition of type +Locate the ESP, which has its own partition type of .Dq efi : .Bd -literal -offset indent -# gpart list | grep -Ew '(Name|efi)' -1. Name: nvd0p1 - type: efi -2. Name: nvd0p2 -3. Name: nvd0p3 -4. Name: nvd0p4 -1. Name: nvd0 +# gpart show nda0 +=> 40 7501476448 nda0 GPT (3.5T) + 40 614400 1 efi (300M) + 614440 7500862048 2 freebsd-zfs (3.5T) .Ed .Pp The name of the ESP on this system is -.Pa nvd0p1 . +.Pa nda0p1 . +By default, this will be mounted on +.Pa /boot/efi . +To check: +.Bd -literal -offset indent +# mount | grep nda0p1 +/dev/nda0p1 on /boot/efi (msdosfs, local) +.Ed +If it's not mounted, you will need to mount it: +.Bd -literal -offset indent +# mount -t msdosfs /dev/nda0p1 /boot/efi +.Ed .Pp -Second, let's mount the ESP, copy -.Nm -to the special location reserved for -.Fx -EFI loaders, and unmount once finished: +.Xr efibootmgr 8 +reports what we booted from. +.Bd -literal -offset indent +# efibootmgr -v +Boot to FW : false +BootCurrent: 0001 +Timeout : 2 seconds +BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 +... ++Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) + nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI +... +.Ed +Often there are several options, depending on the BIOS. +The entry that we booted with is marked with a +.Sq + +at the start of the line, as shown above. +So in this case, this firmware is using +.Pa /EFI/FREEBSD/LOADER.EFI +from the ESP. +Often times it will be the UEFI +.Dq default +loader, which varies by architecture. +.Bl -column -offset indent "Architecture" "Default Path" +.It Sy Architecture Ta Sy Default Path +.It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI +.It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI +.It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI +.It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI +.El +However, care must be taken: some multiple-boot environments rely on a special +.Pa bootXXX.efi +to function. +Before updating a +.Pa bootXXX.efi +file, make sure it is the FreeBSD boot loader before updating it: +.Bd -literal -offset indent +# strings /boot/efi/EFI/BOOT/BOOTX64.EFI | grep FreeBSD | grep EFI +FreeBSD/amd64 EFI loader, Revision 3.0 +.Ed +.Pp +.Xr bsdinstall 8 +copies +.Pa loader.efi +to the default name if there wasn't one there before. +Check to see if they are copies before updating (with X64 substituted using the +above table): +.Bd -literal -offset indent +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +.Ed +Copy the loader: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI +.Ed +replacing the all caps part of the example with the proper path. +.Pp +If ESP path was +.Pa /FREEBSD/LOADER.EFI +and LOADER.EFI and BOOTX64.EFI were identical in the cmp step, +copy the loader to the default location: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI +.Ed +.Pp +.Bd -literal -offset indent +# umount /boot/efi +.Ed +Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent -# mount_msdosfs /dev/nvd0p1 /boot/efi -# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi # umount /boot/efi .Ed .Sh SEE ALSO .Xr loader 8 , .Xr uefi 8 .Sh BUGS -Systems that do not have a -.Dv ConOut -variable set are not conformant with the standard, and likely have unexpected -results. -.Pp Non-x86 serial console handling is even more confusing and less well documented. .Pp Sometimes when the serial port speed isn't set, 9600 is used. Other times the result is typically 115200 since the speed remains unchanged from the default. +.Pp +U-Boot implements a subset of the UEFI standard. +Some versions do not support fetching loader variables, so +.Pa efibootmgr +may not work. +In addition, +.Pa efibootmgr +is not supported on armv7 or riscv. +In these instances, the user has to understand what was booted to update +it properly (and in most cases, it will be the FreeBSD path and the UEFI default +so just copy loader.efi there if there are loaders there). +Typically in these embedded situations, there is only one .efi file (loader.efi +or a copy of loader.efi). +The path to this file is typically the default removable path above. +.Pp +Managing booting multiple OSes on UEFI varies greatly, so extra caution when +updating the UEFI default loader. +.Pp +The old, now obsolete, boot1.efi was installed as bootx64.efi in +.Fx 10 +and earlier. +Since it was quite limited in functionality, we created very small +ESPs by default. +A modern loader.efi will not fit. +However, if the old boot1.efi still works, there's no need to update +it since it will chain boot /boot/loader.efi from a copy that +make installworld updates. From nobody Thu Aug 29 18:13:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvqD602p2z5TLLy; Thu, 29 Aug 2024 18:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvqD56czWz41sv; Thu, 29 Aug 2024 18: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=1724955237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRRxzCGyNo8CrRpMpzkXQ0rOKIo43Qp4rs4wvZ0RyDs=; b=nnCpmkVN+tE0HjLVvNCoPf7uMLotHxSAZx5AyACevO6TCAjrc5wXKzdcx6s6VM9aGctDF+ gnIPsEFsVv1qjjGu/pI2xE43GTcZWOpgjo2aOA3ZbynVHpmc+HJehhYyM5PfEc27XDkp3Y OXG9xUbrklG4wEtukWrYZsr8V6QJIb5Z/d5bdRfbCQNi5go/diZKqd8MStBK/OOS4rom3U NaYYUZBeZzbXET+Y18ucgcDPtNiazFRQQEQEXuH5oIMXtaqNmZKRTRi2zH4HhCf8KdEtYd 16w/XKLkaGQCJSmOgkQBFt4AZmOMaIlAELRhtc/FwakVgfeidNWBw4QWGaS8zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724955237; a=rsa-sha256; cv=none; b=ZN3NLDl1BiJ0Wx/FYfZtTQU1dBJCdpqLRHpxDlzhM9RdmwPFAhfAI3xwgmv2o86cXr0Nnu aoRRd/JULSOWH27ZLysGvL4hmRJNM8/9wTTCclOorSApR0KcGXGfimBb1ytQzVYr2oZgg8 naf+Ags2oj9V8yr7ouyjF3+It0nWCunbOEAmgJFIEiK8bmeGN1ZEenQrx3ZprsEtDGRqDJ fjvBTCI/RpzeCPVDRswfb7X+0sG+F27XM+2UU7kTBq/IBlqXPhD+1pvtRIwjCBijOSrzfM 4otsApDi/vK1CPTtBf84L50Yry/cNaZ/1qW1y9bPglsfpdTY/C6oAeu/1iG0SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724955237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRRxzCGyNo8CrRpMpzkXQ0rOKIo43Qp4rs4wvZ0RyDs=; b=BxnpuoAUiv2scPEMFPEGLnt/AjkfrKL49iqhOuHkU2AqHAXLj/14Dq0UpGQYzOiFjeku6I 7BbH9QMpPn6XoEQmFXDi2tk9zHpO3NwA6po3Kx8CRjTsd7WUQrAMS9cUdI3u3/xZ/ksUDr k+3AitLHHYAk4FtI55PBgLIPSecd4y/qswZ8299AFb1CNXfdZBxmP5G3nSoMgSZBR05WFD zWN0zTtYJLooneYYH5PZyTzO0y2wscm94VTwhjQeeKu3VZIXp5SXnuZtJeI/bNmaNfLrFk p8lmeD/On21ZRS8P+YvthT9SAxovosU9q9nIzjca5zryeWQ/PpEz3xe04fWGGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvqD56Cq8zSVS; Thu, 29 Aug 2024 18: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 47TIDvbd001082; Thu, 29 Aug 2024 18:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TIDv7q001079; Thu, 29 Aug 2024 18:13:57 GMT (envelope-from git) Date: Thu, 29 Aug 2024 18:13:57 GMT Message-Id: <202408291813.47TIDv7q001079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e95ffda78ac0 - stable/13 - loader.efi(8): beef up the updating the ESP List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e95ffda78ac0d61b8c17100e2061fd7542323f0d Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e95ffda78ac0d61b8c17100e2061fd7542323f0d commit e95ffda78ac0d61b8c17100e2061fd7542323f0d Author: Warner Losh AuthorDate: 2024-08-20 15:44:38 +0000 Commit: Warner Losh CommitDate: 2024-08-29 18:14:09 +0000 loader.efi(8): beef up the updating the ESP There's a huge variety of situations when booting with UEFI. Document more of them, hopefully better. Feedback from: jrtc27 MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 871911a4ab738a54a88f3533f553f5eb68c28012) --- stand/man/loader.efi.8 | 142 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 22 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 37f56cf7be3f..4dd9f66790f8 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 4, 2022 +.Dd August 20, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -345,43 +345,141 @@ The default location for the ESP mount point is documented in The following examples shows how to install a new .Nm on the ESP. +The exact placement is complicated due to the diversity of +installations, setups and situations. +In this section, paths that are all lower case are Unix paths. +Paths that are all upper case are relative to the ESP mount point, +though they may appear as lower case on your system because the +FAT filesystem of the ESP is case insensitive. .Pp -First, find the partition of type +Locate the ESP, which has its own partition type of .Dq efi : .Bd -literal -offset indent -# gpart list | grep -Ew '(Name|efi)' -1. Name: nvd0p1 - type: efi -2. Name: nvd0p2 -3. Name: nvd0p3 -4. Name: nvd0p4 -1. Name: nvd0 +# gpart show nda0 +=> 40 7501476448 nda0 GPT (3.5T) + 40 614400 1 efi (300M) + 614440 7500862048 2 freebsd-zfs (3.5T) .Ed .Pp The name of the ESP on this system is -.Pa nvd0p1 . +.Pa nda0p1 . +By default, this will be mounted on +.Pa /boot/efi . +To check: +.Bd -literal -offset indent +# mount | grep nda0p1 +/dev/nda0p1 on /boot/efi (msdosfs, local) +.Ed +If it's not mounted, you will need to mount it: +.Bd -literal -offset indent +# mount -t msdosfs /dev/nda0p1 /boot/efi +.Ed .Pp -Second, let's mount the ESP, copy -.Nm -to the special location reserved for -.Fx -EFI loaders, and unmount once finished: +.Xr efibootmgr 8 +reports what we booted from. +.Bd -literal -offset indent +# efibootmgr -v +Boot to FW : false +BootCurrent: 0001 +Timeout : 2 seconds +BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 +... ++Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) + nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI +... +.Ed +Often there are several options, depending on the BIOS. +The entry that we booted with is marked with a +.Sq + +at the start of the line, as shown above. +So in this case, this firmware is using +.Pa /EFI/FREEBSD/LOADER.EFI +from the ESP. +Often times it will be the UEFI +.Dq default +loader, which varies by architecture. +.Bl -column -offset indent "Architecture" "Default Path" +.It Sy Architecture Ta Sy Default Path +.It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI +.It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI +.It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI +.It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI +.El +However, care must be taken: some multiple-boot environments rely on a special +.Pa bootXXX.efi +to function. +Before updating a +.Pa bootXXX.efi +file, make sure it is the FreeBSD boot loader before updating it: +.Bd -literal -offset indent +# strings /boot/efi/EFI/BOOT/BOOTX64.EFI | grep FreeBSD | grep EFI +FreeBSD/amd64 EFI loader, Revision 3.0 +.Ed +.Pp +.Xr bsdinstall 8 +copies +.Pa loader.efi +to the default name if there wasn't one there before. +Check to see if they are copies before updating (with X64 substituted using the +above table): +.Bd -literal -offset indent +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +.Ed +Copy the loader: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI +.Ed +replacing the all caps part of the example with the proper path. +.Pp +If ESP path was +.Pa /FREEBSD/LOADER.EFI +and LOADER.EFI and BOOTX64.EFI were identical in the cmp step, +copy the loader to the default location: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI +.Ed +.Pp +.Bd -literal -offset indent +# umount /boot/efi +.Ed +Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent -# mount_msdosfs /dev/nvd0p1 /boot/efi -# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi # umount /boot/efi .Ed .Sh SEE ALSO .Xr loader 8 , .Xr uefi 8 .Sh BUGS -Systems that do not have a -.Dv ConOut -variable set are not conformant with the standard, and likely have unexpected -results. -.Pp Non-x86 serial console handling is even more confusing and less well documented. .Pp Sometimes when the serial port speed isn't set, 9600 is used. Other times the result is typically 115200 since the speed remains unchanged from the default. +.Pp +U-Boot implements a subset of the UEFI standard. +Some versions do not support fetching loader variables, so +.Pa efibootmgr +may not work. +In addition, +.Pa efibootmgr +is not supported on armv7 or riscv. +In these instances, the user has to understand what was booted to update +it properly (and in most cases, it will be the FreeBSD path and the UEFI default +so just copy loader.efi there if there are loaders there). +Typically in these embedded situations, there is only one .efi file (loader.efi +or a copy of loader.efi). +The path to this file is typically the default removable path above. +.Pp +Managing booting multiple OSes on UEFI varies greatly, so extra caution when +updating the UEFI default loader. +.Pp +The old, now obsolete, boot1.efi was installed as bootx64.efi in +.Fx 10 +and earlier. +Since it was quite limited in functionality, we created very small +ESPs by default. +A modern loader.efi will not fit. +However, if the old boot1.efi still works, there's no need to update +it since it will chain boot /boot/loader.efi from a copy that +make installworld updates. From nobody Thu Aug 29 18:50:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wvr2N4Ndlz52Q0g; Thu, 29 Aug 2024 18:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wvr2N3YHVz44Dq; Thu, 29 Aug 2024 18:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724957436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=abGNh4VyEnFys/1PaAczgtzBZl/snInrTmvJfqHAJgk=; b=sPlEqtYMmQN6vvsqh4hPprU+I4he+uenghoAoTRr8VD3o4HY7lQ8YrSEGLljGiAWdYULld nv+DRKtfd5BojYf5YxdN8Sp6aGFT5CzRzDKWY1EAbdZisBkLudo+lp2S4kUu1wWDBipA88 kfKB0Qe4cw9RHsKbP7wf9g+AHtn+03RAnxEsW1nwM/TCqCVeuaYKMAR6BS09yFGvsR7ed+ Q76bhgpo2azMcy4n93w4QjSXi8WevFm4dv4hb/6MnWKuV8YJhqsaCaTq4npHZLb5qMzXFg V2KXaOkn7hguGeLw1TLzLB6fCD3nBG5lU84wtMbQaeOGJ2F/Eg4dFLApwtlfGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724957436; a=rsa-sha256; cv=none; b=XjeUUhEFD4AIfrcmFyemBmB+KNWtDlBZfIfdBPAdySTily2G8TMB6w7a9zTkC02ZVMRl1x 65zXhScjzP0MVgA3JTcGAiUYETA5Xf1tYA4JnF1/fdNP9sRfshQs11Ar24OZtO3vFc0b7k urGjVp4j/0eoNJfRd0f+CFVMnzTZylIdIuMYjmnw0yKa6mWEZUVRLscDsbmck2cdNQREmi 9XQYYuk9iD+KuZ9O5Pp2sqvyboQ+YUJNg0giTtSQQxtTYNGDp2mKcLddwgKZ6O+IdzCmzt +JkIl3qTy3Tv0wL41rDTa4hH/5b3aLbRj1pziIJ7HnFYT1QlKMfnXS6LhEtrkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724957436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=abGNh4VyEnFys/1PaAczgtzBZl/snInrTmvJfqHAJgk=; b=NZzibFJazGzEVgnC6suMWqaHrVDEm/dDsUG2DMT3ACqWnTl5tx9Y76GBQa8Qv2BCvCPK9L sLzh0o1Wv/0kd2DSyaoIZ1jfCNm54AO7Q5CeIDIGqOdXvkTva+iRTEoi+hivSkN6cyuuDt GWC27+4fn6uRSTy+omcl75Ytg7OIKFGM9Yaur0/280uUhLxGtItaAK2Fj+HV+rnDtFGxsV gpQB3TinubOtsn12Lc9Pir2/7RePiBxpsb4OT02trwpjGrJMVws5xmgxj5TXJnvcaJptJP fEZa5qeLZ/FCHCyCkQ7ubIx/+IdHCkfmJyXDSVqLwB0vPdwxFIIaVlJ3K1szLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wvr2N38cTzT8M; Thu, 29 Aug 2024 18:50: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 47TIoatt062311; Thu, 29 Aug 2024 18:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TIoaNi062308; Thu, 29 Aug 2024 18:50:36 GMT (envelope-from git) Date: Thu, 29 Aug 2024 18:50:36 GMT Message-Id: <202408291850.47TIoaNi062308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: faf94e22a3da - releng/13.4 - loader.efi(8): beef up the updating the ESP List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: faf94e22a3da99dc35abe21b2d8e79f5eefd31f2 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=faf94e22a3da99dc35abe21b2d8e79f5eefd31f2 commit faf94e22a3da99dc35abe21b2d8e79f5eefd31f2 Author: Warner Losh AuthorDate: 2024-08-20 15:44:38 +0000 Commit: Warner Losh CommitDate: 2024-08-29 18:50:49 +0000 loader.efi(8): beef up the updating the ESP There's a huge variety of situations when booting with UEFI. Document more of them, hopefully better. Feedback from: jrtc27 MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 871911a4ab738a54a88f3533f553f5eb68c28012) (cherry picked from commit e95ffda78ac0d61b8c17100e2061fd7542323f0d) Approved-by: re (cperciva) --- stand/man/loader.efi.8 | 142 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 22 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 37f56cf7be3f..4dd9f66790f8 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 4, 2022 +.Dd August 20, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -345,43 +345,141 @@ The default location for the ESP mount point is documented in The following examples shows how to install a new .Nm on the ESP. +The exact placement is complicated due to the diversity of +installations, setups and situations. +In this section, paths that are all lower case are Unix paths. +Paths that are all upper case are relative to the ESP mount point, +though they may appear as lower case on your system because the +FAT filesystem of the ESP is case insensitive. .Pp -First, find the partition of type +Locate the ESP, which has its own partition type of .Dq efi : .Bd -literal -offset indent -# gpart list | grep -Ew '(Name|efi)' -1. Name: nvd0p1 - type: efi -2. Name: nvd0p2 -3. Name: nvd0p3 -4. Name: nvd0p4 -1. Name: nvd0 +# gpart show nda0 +=> 40 7501476448 nda0 GPT (3.5T) + 40 614400 1 efi (300M) + 614440 7500862048 2 freebsd-zfs (3.5T) .Ed .Pp The name of the ESP on this system is -.Pa nvd0p1 . +.Pa nda0p1 . +By default, this will be mounted on +.Pa /boot/efi . +To check: +.Bd -literal -offset indent +# mount | grep nda0p1 +/dev/nda0p1 on /boot/efi (msdosfs, local) +.Ed +If it's not mounted, you will need to mount it: +.Bd -literal -offset indent +# mount -t msdosfs /dev/nda0p1 /boot/efi +.Ed .Pp -Second, let's mount the ESP, copy -.Nm -to the special location reserved for -.Fx -EFI loaders, and unmount once finished: +.Xr efibootmgr 8 +reports what we booted from. +.Bd -literal -offset indent +# efibootmgr -v +Boot to FW : false +BootCurrent: 0001 +Timeout : 2 seconds +BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 +... ++Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) + nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI +... +.Ed +Often there are several options, depending on the BIOS. +The entry that we booted with is marked with a +.Sq + +at the start of the line, as shown above. +So in this case, this firmware is using +.Pa /EFI/FREEBSD/LOADER.EFI +from the ESP. +Often times it will be the UEFI +.Dq default +loader, which varies by architecture. +.Bl -column -offset indent "Architecture" "Default Path" +.It Sy Architecture Ta Sy Default Path +.It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI +.It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI +.It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI +.It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI +.El +However, care must be taken: some multiple-boot environments rely on a special +.Pa bootXXX.efi +to function. +Before updating a +.Pa bootXXX.efi +file, make sure it is the FreeBSD boot loader before updating it: +.Bd -literal -offset indent +# strings /boot/efi/EFI/BOOT/BOOTX64.EFI | grep FreeBSD | grep EFI +FreeBSD/amd64 EFI loader, Revision 3.0 +.Ed +.Pp +.Xr bsdinstall 8 +copies +.Pa loader.efi +to the default name if there wasn't one there before. +Check to see if they are copies before updating (with X64 substituted using the +above table): +.Bd -literal -offset indent +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +.Ed +Copy the loader: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI +.Ed +replacing the all caps part of the example with the proper path. +.Pp +If ESP path was +.Pa /FREEBSD/LOADER.EFI +and LOADER.EFI and BOOTX64.EFI were identical in the cmp step, +copy the loader to the default location: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI +.Ed +.Pp +.Bd -literal -offset indent +# umount /boot/efi +.Ed +Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent -# mount_msdosfs /dev/nvd0p1 /boot/efi -# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi # umount /boot/efi .Ed .Sh SEE ALSO .Xr loader 8 , .Xr uefi 8 .Sh BUGS -Systems that do not have a -.Dv ConOut -variable set are not conformant with the standard, and likely have unexpected -results. -.Pp Non-x86 serial console handling is even more confusing and less well documented. .Pp Sometimes when the serial port speed isn't set, 9600 is used. Other times the result is typically 115200 since the speed remains unchanged from the default. +.Pp +U-Boot implements a subset of the UEFI standard. +Some versions do not support fetching loader variables, so +.Pa efibootmgr +may not work. +In addition, +.Pa efibootmgr +is not supported on armv7 or riscv. +In these instances, the user has to understand what was booted to update +it properly (and in most cases, it will be the FreeBSD path and the UEFI default +so just copy loader.efi there if there are loaders there). +Typically in these embedded situations, there is only one .efi file (loader.efi +or a copy of loader.efi). +The path to this file is typically the default removable path above. +.Pp +Managing booting multiple OSes on UEFI varies greatly, so extra caution when +updating the UEFI default loader. +.Pp +The old, now obsolete, boot1.efi was installed as bootx64.efi in +.Fx 10 +and earlier. +Since it was quite limited in functionality, we created very small +ESPs by default. +A modern loader.efi will not fit. +However, if the old boot1.efi still works, there's no need to update +it since it will chain boot /boot/loader.efi from a copy that +make installworld updates. From nobody Fri Aug 30 00:45:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wvzvr4wSYz5MkR3; Fri, 30 Aug 2024 00:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wvzvr2lnkz4l4t; Fri, 30 Aug 2024 00:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724978728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMpIUAMXprScJQKmXveRjechz5Kda/zNmCnwj/Axw0U=; b=y0laINRk2z67RXqzp+JTna7+dpKCxIKPu7+8MQcVu/gLvnJlsHHrvex8M012mKmgP3TBIE HyHF4t45ZnM+LS8aOpG9t1jyFecWjzF3tFwzAzeDccZdRwdQrMh4bkY4mDsZRgHmBXARto nKoMwsejohHeAxnGp1ByjCJKER0fkkVVf+0HX1fLb44TtuT90aWxbcRz2LPZBRnXm3IdFP rGwtKh9cUSAGKqtFVBU9vICQJ03bYP3CyypyTfi9i2BWSkEncJ4c6VXwVSkClvJWflTFPN hhzVT9ADC3aMcmcudnAbjKRTpK9L8qaCFTAuA03Qr3gQpPr3xsPIu3YjaEaJTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724978728; a=rsa-sha256; cv=none; b=b7ks8zGpryEbmhjwPf4w6rOlsng+SuILPDRWvneVw/Vx9nUMQeX0MCT3NwDZ8OMh8cH49u tT7/gNVLg+Csv2RtQ7nPhaoVZ8Ei1jlYqWQQTMimxp1yE9gKmcGz8gc4Jg4IKNZugLa0m3 JTRjKomWyiKe9lcvcRVm3TC5OFO6AiJtljao2fmK5S3gP2RFbIMd/toK9OwpTKf4VQmjE9 KpOn8bhhBnXKgS1RGnjLy+HVHfJX382R435Jowvc0xGomiPk9HP0oN1NgL1wCKaCgitXVN +4RGtJKtQBpGXb9FfjLr0M6BWALHn8eY37Y7a9VdL4kF1KjaxuWXWjM86L1QuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724978728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMpIUAMXprScJQKmXveRjechz5Kda/zNmCnwj/Axw0U=; b=skNzC9So5tzR8/whjzYHS5MXaj3vOi1EDO4M1LAWj/UGXHhZm8ctj+b4pTUg0suUHiZS8x Nzlyx61yk1i5Fiz8xrXEnkVSLfLyav0KEVqdJVAoQPbhfIw8JmLcUGDA/WKxzkPe5weBXi gFgNWv7KsV18zD6LadpGNS1cFcUHfraVnCJlp5/AS9qnkcroSZpPNtr1S9QmzRmT2gy19c FiNVU5x0Sa99/D5ueci9BNRtcCZhTAeIUdoy4tr99XQ5ixOh1T8KoGNpQxvtaZ0VA2B5tM P60cxVeoi6aKpjHD/vqtSRRUrOEGbyC0jddCKKgqo0BGBxFxdrgs/6CF1PB8Lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wvzvr1vzlzg3X; Fri, 30 Aug 2024 00:45: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 47U0jSHU060910; Fri, 30 Aug 2024 00:45:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U0jSZ4060907; Fri, 30 Aug 2024 00:45:28 GMT (envelope-from git) Date: Fri, 30 Aug 2024 00:45:28 GMT Message-Id: <202408300045.47U0jSZ4060907@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: 73da0e55aa90 - releng/13.4 - 13.4: Update to RC2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 73da0e55aa906c86aaade60d0bd8e71a84c6dca2 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=73da0e55aa906c86aaade60d0bd8e71a84c6dca2 commit 73da0e55aa906c86aaade60d0bd8e71a84c6dca2 Author: Colin Percival AuthorDate: 2024-08-30 00:45:01 +0000 Commit: Colin Percival CommitDate: 2024-08-30 00:45:01 +0000 13.4: Update to RC2 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 4323fb23657c..4bb01ad3de32 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="RC1" +BRANCH="RC2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Aug 30 06:29:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7Xy6QbFz5T9Y5; Fri, 30 Aug 2024 06:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7Xy5jMKz4F4w; Fri, 30 Aug 2024 06:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LmUKg7iog7gIXfGuAQEgL/Da/cvpYn/XxmgFFR3HTM=; b=yAz48Q7Y9gOIx7YWOtwXhxFTfM6blTV9ZV1RyiHRWLGTQoocOT+XCOqJB4T4+2zNxTBD55 K7fAv6wBo+XAHRltgtrSfbiD4xP0PcZ5MxlsG1pUc57AM0JMmTurwYpMbdW7G2bDFdShLH NmCLfhNZpakHJGeCm7DZVJ3mptA1jvkGsrPRfLdZ/LuSw36epgQMca69pRoUDWPe10Ov0g kd83oQ0PWp6KZNlVdVJL34kNAa91MHhtFLdTAJUimPXAAr8P1rNINTvjQjizXNVZavypsf 4jlK/X81qHfO4E5/9LsADRY59SM/9sBzGnRNKXcxtUaWD269ox1HAldU/x0Wmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999378; a=rsa-sha256; cv=none; b=Qa4gbE1sxSaLvsb/RIBSMrTT/67qYQAhhHC2wIIuNAm+YxGgRKMrIkMt3Jdjh9YCmidK+h 9BAuiSDuOtGjVGOOEfcvc8aJUrQGeBXJOHcSYyCs9ZyiXFLMgjVgaf0yxzeR5g0DjIwKtd DN0dAOAVwc5FpU7l4lyqPdfdxMLaABFffp9Tv9Ev+zBZO1FZ0avEzPg7Ugkgqfuo1sdnCb G63TVbJdBdLfDozG2vC046Zvr+tQRYPfbmL3zDYIfI3TBWcaW7x3rqp6FAkfxQE416vEBj XpAy6R2BAI+muVzs/AJ5LeV/+dRRHIzU2LELdX2MJtony8s4Lns5dQ7GLuOaWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LmUKg7iog7gIXfGuAQEgL/Da/cvpYn/XxmgFFR3HTM=; b=mUaXRX16fpfIyZ9NGGW4b1KiGCTdmCW2828aoVWDMzSweRYcpbuDhJEahyqT9jmAZ3EL6J F6FgL0e0MmS0Pjx3cf+HNcGf1Anx/01x2g8HK92DAL8uwGeuXl4PzWM7lGhHX2blQZambO p3R/An2St4ZRgQgshfDcr6pW/AumVb4Zf1x31VjLWJIj+vlcxa5vlHc9Fg1RLHNFvHqmfn CNEKJ9FwCoxl/z7Vj8KOIPiA0zcLaEEq+u49YRLdd/OcIEYjvJNY324W11swtdybDvS23k jeaHWOjYkLybjmIVfW2FOtrBg2HkRRYcDsT6yHyIU2KoE+DZb2833cVwaOxp3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7Xy5JRhzpwZ; Fri, 30 Aug 2024 06:29: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 47U6Tcj0041683; Fri, 30 Aug 2024 06:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6TcZd041680; Fri, 30 Aug 2024 06:29:38 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:29:38 GMT Message-Id: <202408300629.47U6TcZd041680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 118ab70d5789 - stable/14 - tcp: fix list iteration in tcp_lro_flush_active() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 118ab70d578934236251368c894973a4159ac514 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=118ab70d578934236251368c894973a4159ac514 commit 118ab70d578934236251368c894973a4159ac514 Author: Michael Tuexen AuthorDate: 2024-08-20 22:07:37 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:29:03 +0000 tcp: fix list iteration in tcp_lro_flush_active() Use LIST_FOREACH_SAFE(), since the list element is removed from the list in the loop body, zero out and inserted in the free list. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46383 (cherry picked from commit 64443828bbe7c571db8d8731758ec8c4b8364c86) --- sys/netinet/tcp_lro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 921d28f82517..2811cf25a052 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -599,7 +599,7 @@ tcp_lro_rx_done(struct lro_ctrl *lc) static void tcp_lro_flush_active(struct lro_ctrl *lc) { - struct lro_entry *le; + struct lro_entry *le, *le_tmp; /* * Walk through the list of le entries, and @@ -611,7 +611,7 @@ tcp_lro_flush_active(struct lro_ctrl *lc) * is being freed. This is ok it will just get * reallocated again like it was new. */ - LIST_FOREACH(le, &lc->lro_active, next) { + LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { if (le->m_head != NULL) { tcp_lro_active_remove(le); tcp_lro_flush(lc, le); From nobody Fri Aug 30 06:30:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7Yj2hKGz5T9cs; Fri, 30 Aug 2024 06:30:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7Yj26ypz4FFS; Fri, 30 Aug 2024 06:30:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8bC6TWBdOA13lnPX+r/4Yq10q9CVFKu4CaBnwn/3FNY=; b=fLocUuB3+44vxzy1wUJ6eMTSsetsLgF46olTmHCHeG/YCws6o65OOVk5NfYAdaA1FT6suf LsW1QY/MJRMTcuvlUI0gjOVN2iZhgLom8IfsGp3GD16v8Vvkae85GHmL2s0ZkDKkgLq9Xi COMlSeBuMY8kFLsNwD7ORGApe73AxFWUgPXTU4JfhdtfGZn+Q7sg0TzPwKJ2m2UPZOJHzV fkBtTCzzJGrocYXcBFslPiTDPryjeS/ccJjrmmQfFTjUpOaMtkKc34J3Zv0V3w6LJ4I8uS +Bb2YS1rWWDa2i0fFn4xseRYv2TrpKRiBSDffvJwzi5GMoCGIT4wJgdDdCMfzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999417; a=rsa-sha256; cv=none; b=GoHigOInrkNfGsMNbOFqvCN9tclirIhMf69KMTrQtEEZcNyqHNCT3yV1y3MASooXTgMET+ ZjZBjB18mTNZMk7Z/zbXYwTu6wfkfNfKI5/s4g1f3invGfkMystBk5Y1DJwvlDJb/VZcWr DXxF/zX9HdqFNfEaEuxo1wGd90agW3q6IZ1b8FOy+7rMjg7MWas+cqz4MWRnBbauWIPjli +zxCXvfKcYgBGK9Bu7sf0hdHTZ/rPHG4am3YLwgFoMOYQzgDItxab7qjLyhQv1DBhfE4oB tZK7cxU0Yx4Qx7F+dN5SCZxNXiUkkA9QRdBriFYTckbLnu/f6qe2FRYUm9d6WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8bC6TWBdOA13lnPX+r/4Yq10q9CVFKu4CaBnwn/3FNY=; b=BeGr++FqK6JMAhAwcXfjroEidaw4sEQq+bUGotBK5SkZmsPwMmhHHvT08UcHt9EdkLK3wR +x6ulPqCtmMHwwYIwKe94LllkXehBnOSnspc+y7besTgnnqE+NCLpZKYgsXvlWpELffLIX agbN4NYV0u6wliYz1ZiXnvurk89NXaCgFuSX9xIz6MR7mscYzQJMygeG2V4aHCrSl7kONT aLg72iDvfOckm13FpUCMdJ2eHlFsoxGoxJy6AcDkgGtmMofqGssuIrSyiwz+ejV6iq2fzb eqefxMu455FylrCBMJU7x88ueBeYUN4SIRXGsUPLdv2pBFYz537axwJX6QzbTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7Yj1kLRzpwc; Fri, 30 Aug 2024 06:30: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 47U6UHu8050118; Fri, 30 Aug 2024 06:30:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6UHEf050113; Fri, 30 Aug 2024 06:30:17 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:30:17 GMT Message-Id: <202408300630.47U6UHEf050113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e0bcb3aa4f07 - stable/14 - tcp: initialize the LRO hash table with correct size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 commit e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:29:50 +0000 tcp: initialize the LRO hash table with correct size There will at most lro_entries entries in the LRO hash table. So no need to take lro_mbufs into account, which only results in the LRO hash table being too large and therefore wasting memory. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46378 (cherry picked from commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa) --- sys/netinet/tcp_lro.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 2811cf25a052..906e01257a04 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -175,7 +175,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, { struct lro_entry *le; size_t size; - unsigned i, elements; + unsigned i; lc->lro_bad_csum = 0; lc->lro_queued = 0; @@ -190,11 +190,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, LIST_INIT(&lc->lro_active); /* create hash table to accelerate entry lookup */ - if (lro_entries > lro_mbufs) - elements = lro_entries; - else - elements = lro_mbufs; - lc->lro_hash = phashinit_flags(elements, M_LRO, &lc->lro_hashsz, + lc->lro_hash = phashinit_flags(lro_entries, M_LRO, &lc->lro_hashsz, HASH_NOWAIT); if (lc->lro_hash == NULL) { memset(lc, 0, sizeof(*lc)); From nobody Fri Aug 30 06:31:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7Zv5wYGz5TB5B; Fri, 30 Aug 2024 06:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7Zv5SqRz4Fg7; Fri, 30 Aug 2024 06:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pgigmzog4p1mrN7H8JAQN2OHGARaOXqPgAj2pDT0zSQ=; b=OkAKJvEwhJUUMUkppjhEU8PVPLc5pc4TfRR9rEGSR7mAEPI088Qepz4m/m/ET9O+FdHmYk pGuejPNxc69Q5HEwMPppgoshJje6EefUrYsHe9zdZIkz+/59xbTZsA+wizPk3xAd/aP9zG rmyD02iue1KDYV6tOToGJQnimuwGybeLEGMuSuw3saZRG2MqiDoriQN3FXhjHu7dNGybvJ V5nE4jXbw59tYnetARK3M/eFV0nmHePnI+w8h32/FpMuonaVfq3SUTh59cmfVUnJLCCN3j SkNV2W9zhhbvUW18YbzDGYvdWWeYDQPwOmxnk5lLRC3xRGH9Ca+WdXypaT/sxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999479; a=rsa-sha256; cv=none; b=Ml2lBHr10LV8hxVXMgZl8C5wHeyynesn9J1nLIOg1yaAqkO+Zr/zLYYQDCh8EGpC0Y94z0 IxYca1pt38OmKPA1pINp8WbcW4pbvDFUv9bBse9Cr9F633mR6p10yYAeIBd2gxvOVrxpIv PsHNqIXOAPEJUoxN1QVsJ/QeYRjrjUx1JirLGyjNGUJsY6o8c22iZODgTW+VhIS0T9wx2l bTeLH587Mizsl/jM7tPeIq/KAIG+rxghEMYMmUozJIsFhHw+JsBr5vFlmpUuNLqhdX5AMO Q7lDTuclplHpPVp8ZBqpCBopAGbN6Fwkazyn7cZQVBrrUhEyvX2cm+PaV4/h5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pgigmzog4p1mrN7H8JAQN2OHGARaOXqPgAj2pDT0zSQ=; b=V+POCERlURibvZBW0ha9Gr5/8cBhilJAscVPe2Cs54Yc6mffg9Nv6voyCXXw8Ty5ruCdS6 F8uI53e7R1aAgthzKdWrJVPOr8m/qXcq+L1+WRuk27EvQjRCbVwLvsL6TRxbHHF+0zdhjT HxfcIgDndoPqL2RdASGZ10Kpv2ALx708h5fX8VZ9FkWjC7zfKcOonGYiqZedPGs6LYfug1 MSl3xr8WCPmhD7loAvMPzGX8DMZ0sUJg1EVE3UTveH0f0rZREWuCcjpcZr10+l3TCg4A0q 3ITAPyi+teI0uEdDN3213HI8N+jrZIHLOvmqIPvnQ1IOxq1ZYFJJ6HRuWHoZ5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7Zv54Hyzr4j; Fri, 30 Aug 2024 06:31: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 47U6VJvp051623; Fri, 30 Aug 2024 06:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6VJir051620; Fri, 30 Aug 2024 06:31:19 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:31:19 GMT Message-Id: <202408300631.47U6VJir051620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6c0fb6c5ac7b - stable/14 - tcp: improve consistency of SYN-cache handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6c0fb6c5ac7b3319ac823ef279b12a21604cf84a Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6c0fb6c5ac7b3319ac823ef279b12a21604cf84a commit 6c0fb6c5ac7b3319ac823ef279b12a21604cf84a Author: Michael Tuexen AuthorDate: 2024-08-22 20:17:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:30:54 +0000 tcp: improve consistency of SYN-cache handling Originally, a SYN-cache entry was always allocated and later freed, when not needed anymore. Then the allocation was avoided, when no SYN-cache entry was needed, and a copy on the stack was used. But the logic regarding freeing was not updated. This patch doesn't re-check conditions (which may have changed) when deciding to insert or free the entry, but uses the result of the earlier check. This simplifies the code and improves also consistency. Reviewed by: glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46410 (cherry picked from commit e41364711ca3f7e214f9607ebedf62e03e51633d) --- sys/netinet/tcp_syncache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 052e257a3cb5..287728fe9162 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1730,9 +1730,7 @@ skip_alloc: * Do a standard 3-way handshake. */ if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { - if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) - syncache_free(sc); - else if (sc != &scs) + if (sc != &scs) syncache_insert(sc, sch); /* locks and unlocks sch */ TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); From nobody Fri Aug 30 06:31:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7bd4FtYz5T9YQ; Fri, 30 Aug 2024 06:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7bd3nNbz4Fvt; Fri, 30 Aug 2024 06:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Np2l5ScjqtrBnBs9CMLPfrisS2zunfdmexIvGczmq14=; b=gHjmm7Im9CS4CDPcc4BgqEnJHFZejS/yuMh04ZG+IhQXfv83zB5vTZcOjhoyoHVfbkHs6n gDYG7FLqk7PoAnE6MChInQN89XgaMyClNyyeRog7L1BD2ipkSw4fLRjlPsfIUs5nz4KFx7 MzZtNHtqE2P/aHSM76oFcgilFizD40Iki5LGFo5DzsQ8Ub7QbFIuTWuxm0NIMsCvxyx7vx NDkTPXj0G7FNyslNJYre1He/k4mN+zuieani95w0a26Gn+7BXyczOnF/Zsnm+7Zg/NOlMi flaoNx440mwpXYgDvQiG08CRd6sqsjd1hzIcN4KInzLfrKHFDrmg05IWpNnpJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999517; a=rsa-sha256; cv=none; b=RHFRtZdPaNQnyFs0HZunrwmCM/+MNBDyW76gyJP7Cb1oaI+k/4eNOYqmcr61L8GEjAgtT3 xEtGhjA2iW8QTvMxIsKIwMEyopMihL5acgMGB8O+hpCoOr5f6CU01ASIsZc39kfiVRWMMn zvan428NFQgVO3deyoJ88qzzwQ6LURnTI4hG6yx1XR7FJze50Bq20/B67ub9z5afWiv+sv M83ZGMuKUXPNzGiWNac0FuqVrg4hEvqf9ckTiNTkdlTy5p79gqnWrxy70yUU84De2Qjj33 eH9fcGLpPN1o5UEmIdK1VWGk+T/81i88OiZJPSlLUYzaMtcS1jFe8aH/0api4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Np2l5ScjqtrBnBs9CMLPfrisS2zunfdmexIvGczmq14=; b=Z61kP2iGD73ekPzxYirMDEIPs0eM9xBbKF5t5EnXl3vfQ5bslY0n3g4OZrzuQLISeAiIuh 0AA0exXYudncb/2GfUl66SH+iR5QAY45UUmTxMsK2tDzklPj7sSjiCSeYwiSB8D/gE9dfm OpFifTmDnbyonECLEk7QWg1sUO2qL4e/r02gfFmsi8dWhpLD4dTGvwhQh0AFnbi0mWKXbb klJ7CC/5HwvsoYE/NYfIoXTHtT9npbXV9ROi/qzNXBUhDLLlBhyTw+Qzlk2gHyVL28srBb zFiRgx1zYHLn6y/3VcFMsnflzCkK2lZC5yX4LsnefDCc7IciMLq3Qclky8IylQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7bd3P4dzqSG; Fri, 30 Aug 2024 06:31: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 47U6VvmM051850; Fri, 30 Aug 2024 06:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6VvOJ051847; Fri, 30 Aug 2024 06:31:57 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:31:57 GMT Message-Id: <202408300631.47U6VvOJ051847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: bb31f15d179e - stable/14 - sctp: fix format of sysctl variables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bb31f15d179e3269bd6d16f77437342bdca37e82 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bb31f15d179e3269bd6d16f77437342bdca37e82 commit bb31f15d179e3269bd6d16f77437342bdca37e82 Author: Michael Tuexen AuthorDate: 2024-08-22 07:07:27 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:31:35 +0000 sctp: fix format of sysctl variables (cherry picked from commit a1d9ce19b13f220c5738e6aa58cf0c3750a05526) --- sys/netinet/sctp_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index a4be3471e2fd..a39429ec046e 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -894,7 +894,7 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) return (error); \ } \ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, NULL, 0, \ - sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + sctp_sysctl_handle_##mib_name, "IU", prefix##_DESC) #define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ From nobody Fri Aug 30 06:32:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7cR4FQWz5T9qT; Fri, 30 Aug 2024 06:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7cR3RP5z4GHK; Fri, 30 Aug 2024 06:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zHAYN8Yqjn7Iw2Hy1QYFEOcfVyi6HlwRXLdBMVPDLgk=; b=xg/EO8yHSiJW/gUqFJAmQKWTxUUyaiWhUJFDs1HbsJsF8RPMyCbLL7kiX5cIIHhzPCrntx LdnT8n8Qpn7AlyjZUBnQxETJXgKUhV5uZUuOVWVshg18PQ7hh5/G2UBwgdFU8nQE3ZznYP OPLnkQpB0QHGYqTrDbKDt1Ai+NPGscHGkMu1XpY0yrfuqBWUmfLx7lQ1qEelIC9dwt7Q4s AcGnaaDljJCY98NqFlSfJ9LYTab2xUQR2HXahAOOgXnNC2V3X25ET9jgvHFxbCLQAWIKTN RoyGo8JLOsaglx8r6THuaqgwliUXhWltJnVqtx7uKz/LecF7H/SJ5qCqWBrRdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999559; a=rsa-sha256; cv=none; b=FPFQp1NV0LpfQGoPucz3A2U9hFqN0xNplrILWw7eeOv3PuwaMpg4THHCRnCm3iL2TFsPQc ezk0uNUknYXstjnJn73ABZDsQR6sat9chuwi/CDmp/QRQXVPfSePaQiV6QtVyw5GDjyUz6 sCAe3/hh462PpxqcbEHW2toOPo0dP6rad5aGf9wwmuZSc1zCgYTir6Yyif1Po5uq6Ljlar Hn395Sgw/5TXV4GHeW3R46IzyeACF5WkuuCTnLKrd2iJ1O9NJRZqWbubSyde4vHi8PxtVf oTlZGbfdxFxD67su5PzUDCPmYv/UQuWwftqy7Nfq2AZH1VQS71O52l5Js0/iPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zHAYN8Yqjn7Iw2Hy1QYFEOcfVyi6HlwRXLdBMVPDLgk=; b=ncLsR9wt2KTcE7y3KxMJwa+wLD2PWbNxLCePTW6hz9bGQT2HGV58nGCQA51OeZCnen3whe 2WMjY/fHt06dK0pOUnBY0cu7f6QM396piie90Jut7iwgaYuNbPYvESC3pQAGLoOuwb4vqj WJ3ASpP5qAALAVp8NrsLdudmYNzN67M38FfqZKjxgw0XNN+0CZbGNiSqs2vtZI1RfSYFA0 zxEl7SvL8FNpGJhi3OmgYdeKpFi6aoRT0M1RvbpSUg3E70gi3YsQKvhXVRjRoS5OKglG9k jyLom89ff3vm9vL7sE261epsK2ymSSeT1sQ+wEMi1wnuq3qV80FLUWONZkCFGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7cR3191zrDP; Fri, 30 Aug 2024 06:32: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 47U6WdhS057557; Fri, 30 Aug 2024 06:32:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6Wdi7057554; Fri, 30 Aug 2024 06:32:39 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:32:39 GMT Message-Id: <202408300632.47U6Wdi7057554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2dcd21ddab9a - stable/14 - tcp: fix format of sysctl variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2dcd21ddab9aa72da3bc2de746318f518ff779f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2dcd21ddab9aa72da3bc2de746318f518ff779f8 commit 2dcd21ddab9aa72da3bc2de746318f518ff779f8 Author: Michael Tuexen AuthorDate: 2024-08-22 12:44:47 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:32:11 +0000 tcp: fix format of sysctl variable The format for CTLTYPE_UINT is "IU" instead of "UI" as specified in sysctl.9. Reviewed by: cc, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46408 (cherry picked from commit 498286d4e807d6b9e4caad22b96ebca7f16e9b18) --- sys/netinet/tcp_syncache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 287728fe9162..e24249048fd6 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -215,7 +215,7 @@ sysctl_net_inet_tcp_syncache_rexmtlimit_check(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_syncache.rexmt_limit), 0, - sysctl_net_inet_tcp_syncache_rexmtlimit_check, "UI", + sysctl_net_inet_tcp_syncache_rexmtlimit_check, "IU", "Limit on SYN/ACK retransmissions"); VNET_DEFINE(int, tcp_sc_rst_sock_fail) = 1; From nobody Fri Aug 30 06:45:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7tk4WmNz5TBTG; Fri, 30 Aug 2024 06:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7tk3s7Pz4HQj; Fri, 30 Aug 2024 06:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pIDK99A/Kd9SEAAAmd2xrukYMJvFhNzLfaEDpXrq/38=; b=o6T9U7eY9HoGGrRaWFR0G8QhuiEob3NHDMhXDCieOVQQrga446EBaeelA6mvxSVh97d0UZ J+lhI2xsw8kZ5gpUMVV0CaQ/wpUSwAJARmCtS3Z6S9JI+d5TFgMFBBLf9SPd88eqXbXVZe z1xgyZb3CN9zzWOC64cULGhaVFF/r4bnjkookqPrdu0c1TfWzvovB+/8dP5yhW0arEIFjU 8bIk9pjDqXHFH08DbnKgjOmhrA7QhdGcGazOcJFjWqGk+xILaJZzbuog3vJFtRa4ijTF5X Xqh+156Mbb4NsYWkciehySvPeSpGOHriiyXZevsXUwirCwbGSnzwLCzOTWQznQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000302; a=rsa-sha256; cv=none; b=KuIVAAIce9cTx+/iceQ/gz3tWse9aVj6+5YQf+DBmuJ4JTdb/bgixG5mXeoZVrZ9UIVV5b DaCfzSfPQh9x1t398Ei+g0FaMlQ+CuOYaFeyNXddchV/5vh2MmXLQZ3IlkZ5b402lGD66+ 3sFxLElwQHSKYAxfmXZ/VPT463TYDQrSVTKc9w3AUUVvK3s1NzsCcvuxz/Y82ag3ir4iXR y/21cKnlqEHnAqOAiZ39Zqw+f8Y0B5bRuh2V+VUnRo1n2OTz17NAXVwblzwrm9bHn/WiEH P1pHKPWSEb95gOjSYqGmt4jA9eCS45m/0TipOiFgYOdZSDC24iwmbTvA+11cgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pIDK99A/Kd9SEAAAmd2xrukYMJvFhNzLfaEDpXrq/38=; b=aFfBKRPiQBpaieKiAprMaOTz7yC3pM5rbVZteIDaLRNrnbYqneU81etqAUZMIWFf1oTJSl gyMx4duGYpndSMJ/XcBWXxhmfUptFmaElvSHuxYFIB4kRhIwLV8dNuIiL47cPtMKZVaGE0 QEW//YIjk24ENfJu6aSyA+VbdtCvdWUQdt/3yHo62vAgvlSWU7i/VJCpWA5WglTNqxjsck RKzJcqFS15up2oD7VALCJGXjMr5aL5NcJ+nWfwbRVv6G6yPEtVLdP4A77u4xt5SjxraSqi t2eEyO4KLENYsZOmMXVOGKT+W8hJhCc7KbO58IgisvzrtibbzmXpcBfFKVjVew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7tk3L6BzrMt; Fri, 30 Aug 2024 06:45: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 47U6j2c4074707; Fri, 30 Aug 2024 06:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6j2Nb074704; Fri, 30 Aug 2024 06:45:02 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:45:02 GMT Message-Id: <202408300645.47U6j2Nb074704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 5420e4f56389 - stable/13 - tcp: initialize the LRO hash table with correct size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5420e4f56389c841322f1bf4aad1cf288a9a6482 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5420e4f56389c841322f1bf4aad1cf288a9a6482 commit 5420e4f56389c841322f1bf4aad1cf288a9a6482 Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:44:35 +0000 tcp: initialize the LRO hash table with correct size There will at most lro_entries entries in the LRO hash table. So no need to take lro_mbufs into account, which only results in the LRO hash table being too large and therefore wasting memory. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46378 (cherry picked from commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa) --- sys/netinet/tcp_lro.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 83b730b15558..7f54da48c5f6 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -168,7 +168,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, { struct lro_entry *le; size_t size; - unsigned i, elements; + unsigned i; lc->lro_bad_csum = 0; lc->lro_queued = 0; @@ -183,11 +183,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, LIST_INIT(&lc->lro_active); /* create hash table to accelerate entry lookup */ - if (lro_entries > lro_mbufs) - elements = lro_entries; - else - elements = lro_mbufs; - lc->lro_hash = phashinit_flags(elements, M_LRO, &lc->lro_hashsz, + lc->lro_hash = phashinit_flags(lro_entries, M_LRO, &lc->lro_hashsz, HASH_NOWAIT); if (lc->lro_hash == NULL) { memset(lc, 0, sizeof(*lc)); From nobody Fri Aug 30 06:46:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7wp61jgz5TBps; Fri, 30 Aug 2024 06:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7wp5Cgyz4HXs; Fri, 30 Aug 2024 06:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4bSSN6jxfe2hyOxnXa++XWUKpqm+U1br6K6jYhjWsNo=; b=KvMnQPG2shyW02vMa6LAL9HdgqhW3GG+1RfzGQAivOAfn5f5b2u5Ml2DHrYGCthLRyXXhw heTi/ocfcEukH+0MUWR9qFfFs86nZAb8I7wOHt6FuiVUIgCox9q80JphPrVPUAS4VgZAOC /vJAOIgAyfgtf2PbWMF/rY8fJfmcxRF8mJ+Mucw43EpMuN/zRYoQXet4vmyu/gatfM5CBa HbFrvFu0n7/ju98MD9gwzUVyXte7oQRnThhVusKJWE1iExmP//D3naDcoxxhQfCipnmehe 8J+404nIdWxzwAuvZi+HF+W/iezLJE3/JGz+LKeIldCs5/xNtvwbnw0AvUV4og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000410; a=rsa-sha256; cv=none; b=ThhXTWA4zEwTLuiREZ6kTWR8SoYlJnn3rthGhc5a3FVw2nSR1ju9B7HLq/+WcToseGsKOz /Evma0UMtG8qpyy3/Xx+UqK6JTnnqEd8U2yN3j5air7Y3Ky4eNvGNnvX1KK0HSfzsbt0Qo sBg7SwNzK5GQHy0ZzKkeWxBFOPlzNxgbRgdvgva7u7mSOyj1pK7evP5yqV+kj0wEFZMxue Y/ZQdkwhJXNtfz/4qp5o/qEbXJDOyTVqOLnE38PBzJPNgfemBpTW1coyORK2RGigWnv5MM JKAaQCm52SCkyL96nQmsZxZWeBWF7W8qPyKKlf5GxCzTFqm8UWkwlEOjs7SOmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4bSSN6jxfe2hyOxnXa++XWUKpqm+U1br6K6jYhjWsNo=; b=ZiekmUQBxNDsW6HOzA9B1P+fPadrvX+fAXfFU2Qnag/9o8LVXkH6Krz7Z7QtxlIloH0xqm Iz08S28nf5MylRFdY3dnGNqLm3r81m0htd3V6hd/9mJw7X5uvxQoqY02eTdMhJEQCNOWZg KQUeIX/Sw/QjESf/PPwJEUvEDflgjIUbWqpAFbl2k3V9gT1Tmb9ebJ3wgTyM070PNiMQKA l2wCB7G07Aw/3vozkwKjk79xIZ0nXdPwdu9mB0nJ1TMowuRqJXwgpflJz44jS1JbfE6BFE wnnUohtvK8d9gOexMiMdLT1RPvUtLfYh4OhSOvfMp+p6KtnGvd6XlnFXQUxRmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7wp4hlHzqSy; Fri, 30 Aug 2024 06:46: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 47U6ko6t075132; Fri, 30 Aug 2024 06:46:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6kog3075129; Fri, 30 Aug 2024 06:46:50 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:46:50 GMT Message-Id: <202408300646.47U6kog3075129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c467031b6143 - stable/13 - tcp: improve consistency of SYN-cache handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c467031b6143cffae3260812eed4951352567297 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c467031b6143cffae3260812eed4951352567297 commit c467031b6143cffae3260812eed4951352567297 Author: Michael Tuexen AuthorDate: 2024-08-22 20:17:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:45:44 +0000 tcp: improve consistency of SYN-cache handling Originally, a SYN-cache entry was always allocated and later freed, when not needed anymore. Then the allocation was avoided, when no SYN-cache entry was needed, and a copy on the stack was used. But the logic regarding freeing was not updated. This patch doesn't re-check conditions (which may have changed) when deciding to insert or free the entry, but uses the result of the earlier check. This simplifies the code and improves also consistency. Reviewed by: glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46410 (cherry picked from commit e41364711ca3f7e214f9607ebedf62e03e51633d) --- sys/netinet/tcp_syncache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index ea5ee033f6e0..54f7f4784490 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1761,9 +1761,7 @@ skip_alloc: * Do a standard 3-way handshake. */ if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { - if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) - syncache_free(sc); - else if (sc != &scs) + if (sc != &scs) syncache_insert(sc, sch); /* locks and unlocks sch */ TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); From nobody Fri Aug 30 06:46:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7wq6Lxdz5TBVL; Fri, 30 Aug 2024 06:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7wq5nySz4HVW; Fri, 30 Aug 2024 06:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QfQcxk4ZeIMTdwlFFxqYfg2rPT7bacm+bfT71Xp62T0=; b=MIWIgrJf0lsKX4ovsUrXgPyilclo8/lS6ENSBaSxkJ5YOZhAstTFv59S2Up/+s0WTXBQt2 UzC1zTTu7D4ETKfLpbGzlf/kpPyHgyJKsAVhqSlIgLQvTvNULpGpspXDW1rGlok7PL/J7I dOOyn2FLt/HpORJGY5aVg4tLiVm/cRDTZMUyvnI5/bz9hV45QS+p5gt7hvSYHHpkjoklsB 8DYlehLMBoIQI1h7tTZPW8gGqr4Nq8muW37tDAizLilJXDm/if2Zyv4pG33Iy65RfSs/48 wiiFdoA+zuYU43lG5LAojwm0R5ELT+Lrs3RA5XJ7eatlgYIv/aIGEIhuXx8/1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000411; a=rsa-sha256; cv=none; b=A+F1nHxuA4//lk7gkfRxLtGT9aHkZ/YNpXb9Tm2Dyl9Q+9yQUoP6RXglOAFrGjmMG06xOP 6diLeYJ297KHY7UZbS5IVSa9gt4SxmDwBefSE5wtVcajd/4qjTT7Lp3HyMGO5kPLATkovy 3e4Tli1T5kDH16rbpZ2SPjRZFsXGAi05PCH5hKWs1uWR9bK9TxViAI7/JEDZaQbg8j+GXH Z9zzxn0oWmO0NguOq+kEh9Q5J4sDWMKlcQx9Kc5Ca4yU7xR7N2X51D1lwwzoTb96NDgm+Q Ob1cMBRNcmKTYx0Dde5l7T4n8yrDc0VpOBQUpcYd6M7R/rNmUPkpHapAZ1EafQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QfQcxk4ZeIMTdwlFFxqYfg2rPT7bacm+bfT71Xp62T0=; b=uopC/kIMdOR+GdGKYSEGaA2Zk4XMXb0Opm5COTjC+CkYPifdpX0WzaqXdhhR6AvS4Egjbh 5C4BWdDQDU7LujmfKsILslY1B/KIcz9crz7nj1qRbxjUmROWJwCAvI0BmOdgORQH+LtZZ2 5sfjBiXHUSRxgxFY1JXBvb4neWddsD5NgCv2VoMFmtTHiwZ1JlDnKzp1ucd+B+PqtWTyFP 42yIygku4mYL/owZ3wwD4ffQlcN+XDMuILpwH+byQMOlHzELTHAsGnycW6ZEsXPNdBwIt5 OkdWEKZXlXkM/r84AXXyF9Ue1DTr4m3QwXJl8Fj1/mUuBICPyBpml4GaknQORA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7wq5PS8zr5Q; Fri, 30 Aug 2024 06:46: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 47U6kpmR075178; Fri, 30 Aug 2024 06:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6kpEE075175; Fri, 30 Aug 2024 06:46:51 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:46:51 GMT Message-Id: <202408300646.47U6kpEE075175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0e6dbb673276 - stable/13 - sctp: fix format of sysctl variables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e6dbb673276f2a08c4216ca92da3577bc0a1d46 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0e6dbb673276f2a08c4216ca92da3577bc0a1d46 commit 0e6dbb673276f2a08c4216ca92da3577bc0a1d46 Author: Michael Tuexen AuthorDate: 2024-08-22 07:07:27 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:46:24 +0000 sctp: fix format of sysctl variables (cherry picked from commit a1d9ce19b13f220c5738e6aa58cf0c3750a05526) --- sys/netinet/sctp_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 60c4a506ddae..326e981dde05 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -890,7 +890,7 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) return (error); \ } \ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, NULL, 0, \ - sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + sctp_sysctl_handle_##mib_name, "IU", prefix##_DESC) #define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ From nobody Fri Aug 30 06:47:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7xc3Mqdz5TBRj; Fri, 30 Aug 2024 06:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7xc2tQsz4HvH; Fri, 30 Aug 2024 06:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyncIpGZgDEiDOEhhVbN+UVIt3Y712DK0L7ZKXuUUag=; b=nnwj0uCZg0Bkkr5/4NmRSUMmjBHPVjA1vAmoUbcSV2xc6vLOMuIvt5+fCa1iTV/Y/71azU GFe10N80EHkSBKkGly0/X9X1Hlc0tvMqr/rTOupBcVMuUOuruOZRPAdKC1V+vt/r/D7v+C c14f0STlJ0yZw3KTCaeaFZoLv8MBvlLIm42sLhipya2clIxjdkd+grQRMECYLEdgs4XB0s apF0cT2VhchJ4A6WtP0K+CiXDJYrCtTJRNv3d1u1dPNrNwtPrHi+3f09HcGPc1+X02liSl vtec+6sDOxeT9Ol74VnC8yHObWjddy1s4J46UCtFUELQrdv3wbLZ8AzlAQL52w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000452; a=rsa-sha256; cv=none; b=ll9AdnHTVuMQyij1Uc0R7RP/RA8LY7MYiynnTuiOKmX2VS0XcMKGDYEro+h7/TKzrdWOaM Cefp/SnCKBkF2J796EkOytEc/MLgQF4kKd0hFeg68Jyq/lsuAO4wBdUHvdBR9xHvPVpbh6 ixpMuyMqXjJdQqeNDtJc2xzvEAc2iNPHb65XPJGOHMlvME7m5XUWptXkqsMibAhGo9oujl fVRJP7JOBmhZMkI+T+dtREKGhp06OFlyn7tV9dvzl6K+VOctZbwi5rgb/BthPJWkWtqvi1 RFBFv/0iLHsGlT2LgsQBOSXFey4IyY/xdvZ5aP78Nt07RuW4wdLv429NTJPqjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyncIpGZgDEiDOEhhVbN+UVIt3Y712DK0L7ZKXuUUag=; b=FqzGx+7yWKg9l4iV2flzsAXUVZ2LOjOJ5L1deOA2TxsObxFY4nE7SWbLU1IUaxkrBe+BqH IAYvaRPsaPD3SVUK9CGGSSkqWLSVa0YZTubXo/Fo9gx2NkV0gxfSHcvwSdGFYYJzbA2QTz Upi2gjjbEWiyukHHgjxoqC40pn9wPwrsEFvPx7aDv+rY9mTY175aRwNduJbnUD9L9RqXmz gzQJbZN1SyA3hvohkat51wgJf7HyTVSmwSmQOjn6iSa7Vns6EQVzuGk3ovvnKc7BTBqAED /wOCqWS8y8SN4aBmVa8MkVRkcXq/YPC9m2qOqJir2fHxgW8tC6Y/Tzi1g+nbMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7xc2Gk5zqtx; Fri, 30 Aug 2024 06:47: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 47U6lWWV075388; Fri, 30 Aug 2024 06:47:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6lWAV075385; Fri, 30 Aug 2024 06:47:32 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:47:32 GMT Message-Id: <202408300647.47U6lWAV075385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a1b4e5731736 - stable/13 - tcp: fix format of sysctl variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a1b4e5731736425c715a51c91c6f9e26e757aaae Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a1b4e5731736425c715a51c91c6f9e26e757aaae commit a1b4e5731736425c715a51c91c6f9e26e757aaae Author: Michael Tuexen AuthorDate: 2024-08-22 12:44:47 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:47:03 +0000 tcp: fix format of sysctl variable The format for CTLTYPE_UINT is "IU" instead of "UI" as specified in sysctl.9. Reviewed by: cc, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46408 (cherry picked from commit 498286d4e807d6b9e4caad22b96ebca7f16e9b18) --- sys/netinet/tcp_syncache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 54f7f4784490..86df6c747ea4 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -211,7 +211,7 @@ sysctl_net_inet_tcp_syncache_rexmtlimit_check(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_syncache.rexmt_limit), 0, - sysctl_net_inet_tcp_syncache_rexmtlimit_check, "UI", + sysctl_net_inet_tcp_syncache_rexmtlimit_check, "IU", "Limit on SYN/ACK retransmissions"); VNET_DEFINE(int, tcp_sc_rst_sock_fail) = 1; From nobody Fri Aug 30 07:04:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww8KR128Wz5TD6X; Fri, 30 Aug 2024 07:04:43 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww8KP4gggz4Jqb; Fri, 30 Aug 2024 07:04:41 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail202005 header.b=db81LrCG; dmarc=none; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 94.130.200.20 as permitted sender) smtp.mailfrom=herbert@gojira.at Date: Fri, 30 Aug 2024 09:04:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1725001473; bh=9hmkor3SXzUp8azu8bb5G63YrGgIsEvJYO56LTg+W84=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=db81LrCGtHPUKFwBQmD6xgJ0gya9xl9lLppw1Hf/gNQJDDnl/4MO8XobphICc4gZV 8E5UM6nC9yMpD10eLWqta6pfBAg1nHHa0+pq+WGCCYDezot0PkDQBU3VWWIubnsYK7 2XF6yDFtUZ2UPQmXArrK7qxjQVhq9JS7X0/SVWWm3ipCXUBK+x8cZuyoLqkIrAa2hx zG39DWqUbVWGpcqAnTSGlSaMYi4uQCqmn+OfX737Q9h8gPjhkWvK3jup8pMJBOsxTK uPHN9GoRZzkvGgMgZEApvJ2xmefR9auzhuxa8LYULGfPfOQWLXuZnBvHW1l8mnYr+E 2zQR+/6cogE5g== Message-ID: <87zfoujxuj.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: "Sean C. Farley" Cc: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: fc43a1b6842a - stable/14 - tzsetup: symlink /etc/localtime instead of copying In-Reply-To: <87cylubd5v.wl-herbert@gojira.at> References: <202408011538.471FcJDS026885@gitrepo.freebsd.org> <784ce21d-a604-bb91-c52e-29c78e2bb6e4@FreeBSD.org> <87cylubd5v.wl-herbert@gojira.at> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_SPF_ALLOW(-0.20)[+ip4:94.130.200.20]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail202005]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:94.130.0.0/16, country:DE]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; DMARC_NA(0.00)[gojira.at]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-branches@FreeBSD.org]; DKIM_TRACE(0.00)[gojira.at:+] X-Rspamd-Queue-Id: 4Ww8KP4gggz4Jqb On Tue, 27 Aug 2024 10:09:00 +0200, "Herbert J. Skuhra" wrote: > > On Thu, 08 Aug 2024 06:35:38 +0200, "Sean C. Farley" wrote: > > > > On Thu, 1 Aug 2024, Ed Maste wrote: > > > > > The branch stable/14 has been updated by emaste: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > > > > commit fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > Author: Ed Maste > > > AuthorDate: 2022-10-14 16:44:35 +0000 > > > Commit: Ed Maste > > > CommitDate: 2024-08-01 15:11:45 +0000 > > > > > > tzsetup: symlink /etc/localtime instead of copying > > > > > > Using a symlink means that new timezone data (installed by an errata > > > update, say) will be usable without having to be copied again. > > > > > > Reviewed by: bapt, kevans, philip > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D37005 > > > > > > (cherry picked from commit 5e16809c953f4cd19fadb1767469dec319de0353) > > > > I ran across an issue with this when using "etcupdate -D" to update a > > jail from the host. "tzsetup -r -C /tmp/chroot", as called by > > etcupdate, prepends the path of the chroot to the link which breaks > > things inside the jail. > > I have this issue whenerver I update jails with 'make installworld > DESTDIR=$X'. Will this be fixed or reverted (at least) in stable/14? > Or works as expected? Maybe: diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 617de4efb765..38d7ccf5e00c 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -884,7 +884,7 @@ main(int argc, char **argv) } else { sprintf(path_zonetab, "%s/%s", chrootenv, _PATH_ZONETAB); sprintf(path_iso3166, "%s/%s", chrootenv, _PATH_ISO3166); - sprintf(path_zoneinfo, "%s/%s", chrootenv, _PATH_ZONEINFO); + sprintf(path_zoneinfo, "%s", _PATH_ZONEINFO); sprintf(path_localtime, "%s/%s", chrootenv, _PATH_LOCALTIME); sprintf(path_db, "%s/%s", chrootenv, _PATH_DB); sprintf(path_wall_cmos_clock, "%s/%s", chrootenv, -- Herbert From nobody Sat Aug 31 01:55:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwdPc4fRQz5TKq7; Sat, 31 Aug 2024 01:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WwdPc46wFz4FDp; Sat, 31 Aug 2024 01:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PPNHY+V45BjC8WEOf1kSyXQfsYivTwHTUbVRpv9UJo=; b=pCqpkw1xeijRsiX/XEkKROLRnWPsfbPaZZTcwkBJhuFBO4YKpdX03dt1jZz6mvhKI9K51t /7va0ZhTNuO2BKRYDDRJ/bqnT96fQ6ciApG4ZCM5l3+iHIhc/z00po97lXQrLH/47w+Td2 gWRZEu2UROSM6fOl58ZMuVavbrS84S45kRkJyMwY3Aq/xU1cW6Ma6krZOuxsadbMo8PGTQ nb1j4y+gj62MilwDbXPrrQXSbhMKgODRElUcumGzkizIy6hbLhbxPHbSMDAmJ83LaGhxSW H348LKnw5kyMXgIun3T6rUM/A+Z+DEB3i/klEp8mu028+GIuIkRWMM9zZA+g1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725069300; a=rsa-sha256; cv=none; b=TXLaNzjTRyqaTB4JTGbnNrL6BJL9f/f57iPCmJNr3/Mwjl0J92LEG3yLCiHPBUm9XztMna XL7b9MAHFHp8FTlB8p2m+K1pwkHFW8vWQcJvtzj4Ue9vMZJfdIwFyV+4s4SCwdYtyQfPBa QkpiOpUVXrS+HqH7mmld8zTvyJ+Ai7+bbjsiBcozC4KOgTnsq3RkWM6hAnOofPRjBlB4H3 4v/MLMBrOZbIcg5mskaDsRex7NCH7HIpV4vzGreogv0wBHug4aagVQjTnotsrkFekqrvXp 7t0GqC7diSzG1rpbHNOpxbNtOyBmzZdK6eY01+kVUye8sTWTAoRxhTs2W5C0kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PPNHY+V45BjC8WEOf1kSyXQfsYivTwHTUbVRpv9UJo=; b=EMRyIYu34Vy1Bzip1YcmciPVyQ57T9Pq8fM64g/XVKxGwldMICLMfE1KS4FqqHUOvig5ei cSSz4qnCRqmudIZZRGaSvzurL5UmZDMQ5IeinYw/WR1zONbFmCKI782H3ddng9PoKZX9km Yd65HHa6bJHBOE1aTIRqvkt8x6J7gZgjdxrJxxTKwXeSErXeC0K2DNjFFLRBdyrFviA3/b Tb69B6gO2dS2oRlBLvWYcQa+hiVGacnK53PRdgBeJIU8VYEYNVt2sLAStRjSIQ0yI1fhlN smQQOEl1pO9se+jAI38KnNSHipWJyilv0Z5jtRVIYhNC9vVyiDMloUqncVwWWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwdPc3kLgzQZ8; Sat, 31 Aug 2024 01:55: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 47V1t0rE023731; Sat, 31 Aug 2024 01:55:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47V1t0db023728; Sat, 31 Aug 2024 01:55:00 GMT (envelope-from git) Date: Sat, 31 Aug 2024 01:55:00 GMT Message-Id: <202408310155.47V1t0db023728@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: cfcf0db9097a - stable/14 - nfsproto.h: Define the new mode_umask attribute List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cfcf0db9097aba82450bd79c40c08eb8251d4df7 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=cfcf0db9097aba82450bd79c40c08eb8251d4df7 commit cfcf0db9097aba82450bd79c40c08eb8251d4df7 Author: Rick Macklem AuthorDate: 2024-08-17 00:40:52 +0000 Commit: Rick Macklem CommitDate: 2024-08-31 01:53:55 +0000 nfsproto.h: Define the new mode_umask attribute RFC8275 defines a new attribute as an extension to NFSv4.2 called MODE_UMASK. This patch adds the attribute number to nfsproto.h. Future patches will add optional support for the attribute. This patch does not cause any semantics change. (cherry picked from commit 10d5b43424da7fadfbdcc41bbffe40d130af1e1d) --- sys/fs/nfs/nfsproto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index ca9c732b6a43..0268940fd8a6 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -1004,7 +1004,7 @@ struct nfsv3_sattr { #define NFSATTRBIT_SPACEFREED 78 #define NFSATTRBIT_CHANGEATTRTYPE 79 #define NFSATTRBIT_SECLABEL 80 -/* Not sure what attribute bit #81 is? */ +#define NFSATTRBIT_MODEUMASK 81 #define NFSATTRBIT_XATTRSUPPORT 82 #define NFSATTRBM_SUPPORTEDATTRS 0x00000001 @@ -1088,7 +1088,7 @@ struct nfsv3_sattr { #define NFSATTRBM_SPACEFREED 0x00004000 #define NFSATTRBM_CHANGEATTRTYPE 0x00008000 #define NFSATTRBM_SECLABEL 0x00010000 -/* Not sure what attribute bit#81/0x00020000 is? */ +#define NFSATTRBM_MODEUMASK 0x00020000 #define NFSATTRBM_XATTRSUPPORT 0x00040000 #define NFSATTRBIT_MAX 83 From nobody Sat Aug 31 02:03:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wwdbb0pjRz5TLZ5; Sat, 31 Aug 2024 02:03:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WwdbZ6z56z4G48; Sat, 31 Aug 2024 02:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfOm6DH1pVRwwJA7YoAvpyu2bEeKXxfuqkYZvzjmGoQ=; b=hplFi55V0xwMIgupLHmY/Bh1f2EMs1jdu6Pkx2QD7ux5tj5pF79B46yWHr+P7MusHbjdiF VqNLipRgweLPwOeAgX0XQ3YjbFq+6mR2zh2Y9ES16NiHpi4ZE8RpZpd0Nxi0ZYombE2QXX +4N0/imDmWtPp7NDBvpEoXfT7XxozOtRF85MnO4gHZITBbLGIWAnhrpcWQLKR/WykKDSls D/vIwosrMIj6MQBKZHl3BFaLGBoYSTcd3gZH9yJoJPraJIDMj7iwEPfIjojxbGB+/fZNga 0tzxpDo2K8262hNSb0mKObILmd8zaR4LBhV7tct2SM2kDSoxVaS4eRe0WSPn/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725069819; a=rsa-sha256; cv=none; b=Q8YJWmOO2jA9W3OWLeHzO0WZCZrBIl7HSf0goZTyyHbiumSu0SuN+l2z+f4oNsGqfIxw2T NAcmTnljs0VvXI9AD03jg5qwsxGroN4IJDwhIqFcYWkfYearK6xukfnUGO/Jmy2/HV+pSv u+z2Om+omrYHTWJt6qLM/u+BsF2CLdrKL6LnQep85BxhX4GqQJGWzpq/U61RHvVvEmIrk9 GSojt0p2x/I6vzSW9EKC99H3fP44Vl0b6XuTTlfBPO/iCLwaJDVHmxn8vwpI3ToEsBJpI5 n2FxzPDMnguStpnlmpwH0jfHM+H+DNdOHqKj3YSsi0j8Jr1y5G7wooB4wyVVlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfOm6DH1pVRwwJA7YoAvpyu2bEeKXxfuqkYZvzjmGoQ=; b=mWyjulFPkas1v8yxw7+YBre90hoEF3nFi8DUomkZkKxd+eGC580uIxuDBxFSzwFzlh8ljs B+b133NQLFMP6V3xBJikElsvMYnyI9UgXQ55vF/k+Y8XYEs9vVQyk4U20Uz9wvrHKwi9aj t9cy1f0+ADccP4O5+Wf8sGS3bKFmcrNh4QkFn8BTOw6EN2lJcCRTTh/aNhnz8Slj5I5I0g MPdSrVhX7FJyGqZDw2sTBAepRGMFa/hR8/Gg9Yn7pMhmmr1dvMN1i5dEJa22aaWzNa/vWz XFTEdM7SLrU9qnXB4ij7fVHfVjIFgEMKe/AgaqGInPCTFSmXTDZptLmvTRTnOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwdbZ6TNrzQd6; Sat, 31 Aug 2024 02:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47V23cTm041068; Sat, 31 Aug 2024 02:03:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47V23cxu041065; Sat, 31 Aug 2024 02:03:38 GMT (envelope-from git) Date: Sat, 31 Aug 2024 02:03:38 GMT Message-Id: <202408310203.47V23cxu041065@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: 6bde10b638d1 - stable/13 - nfsproto.h: Define the new mode_umask attribute List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6bde10b638d103f18b2ba08ea743f7999b0a9abe Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6bde10b638d103f18b2ba08ea743f7999b0a9abe commit 6bde10b638d103f18b2ba08ea743f7999b0a9abe Author: Rick Macklem AuthorDate: 2024-08-17 00:40:52 +0000 Commit: Rick Macklem CommitDate: 2024-08-31 02:02:57 +0000 nfsproto.h: Define the new mode_umask attribute RFC8275 defines a new attribute as an extension to NFSv4.2 called MODE_UMASK. This patch adds the attribute number to nfsproto.h. Future patches will add optional support for the attribute. This patch does not cause any semantics change. (cherry picked from commit 10d5b43424da7fadfbdcc41bbffe40d130af1e1d) --- sys/fs/nfs/nfsproto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index cf162dbf24e8..9c0569d97215 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -1002,7 +1002,7 @@ struct nfsv3_sattr { #define NFSATTRBIT_SPACEFREED 78 #define NFSATTRBIT_CHANGEATTRTYPE 79 #define NFSATTRBIT_SECLABEL 80 -/* Not sure what attribute bit #81 is? */ +#define NFSATTRBIT_MODEUMASK 81 #define NFSATTRBIT_XATTRSUPPORT 82 #define NFSATTRBM_SUPPORTEDATTRS 0x00000001 @@ -1086,7 +1086,7 @@ struct nfsv3_sattr { #define NFSATTRBM_SPACEFREED 0x00004000 #define NFSATTRBM_CHANGEATTRTYPE 0x00008000 #define NFSATTRBM_SECLABEL 0x00010000 -/* Not sure what attribute bit#81/0x00020000 is? */ +#define NFSATTRBM_MODEUMASK 0x00020000 #define NFSATTRBM_XATTRSUPPORT 0x00040000 #define NFSATTRBIT_MAX 83 From nobody Sat Aug 31 16:19:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx0Zj3PpTz5Mcyw; Sat, 31 Aug 2024 16:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wx0Zj2v4Fz4LFk; Sat, 31 Aug 2024 16:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iifHXfU6bPhSNdm/J2q11KPKMckK8gDiI56Yp0Aa8eQ=; b=SEl7dwX2X4H4WRlLWJ0jvq76W3/S3+CCszLZ86s3d47t1S11LtUu/on6L0Qvv7KOQl+Xy2 kuJog0K3l9T4vum/YKeKvLDsgOzciKG7VGB1iSTGDk2UQloYQr0xFsSwQQeU6ZyVuyt+2z R0trRhqsES+Ip5uVtdVOiEyjvDdRHaGBt7X4p2WwfHLW27kN/NMmnNCKA+fxII1nH5GDNh j36TJhRM6jQXOXI29DUo0cE/6GyVVyFu/mH50Mhza/gu3X5Qmm0v/KLNKb4Hk8cvCQbx9m xuohJheMkiv8WH1YdoSd+/DvJIuwGflZytELmyqvoyKI3k8AG2etR+phJ4Nicw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725121149; a=rsa-sha256; cv=none; b=YzCbd+PvEbeGTHbz/An0o42QP1DFX3weCCwOv2C+yQMhC7LreqJ83dbXte5ELVSjeN4d8e bUn0Ucl9lV+jUipfoHGzMkrSwUWzjm5wjZn4p8QPzPhekKCB1vY8HSMgiFpU1gT4gHkn3W edqsM/HO/gWToyqZHSQEtRiw69gLPrEmqKoDGHt08p9BdS/pc/1aGNhl9hFIBPUjjsqK9r KX1rjMlHeyyg6H3jljcAWDNzwW7Y6pniYbX5oznYu97fCWVZvtfY/jQwxnfaytbz8y4Sop evboNWz88sD8GTb1hNWRKOHOAnlxEuwLSlilQ90GbVqxG0YC1gjiqpERLB2nww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iifHXfU6bPhSNdm/J2q11KPKMckK8gDiI56Yp0Aa8eQ=; b=qmoaGYQSJn4DOidAxRjwV30AeM1umi4u6KhEzLu43/e73mVMdyNSy9b+I/f2xH2nfXdoV7 gy71Js/7uEnJGl8l/p3N20pT+bupxMrzxwX3Ko1SnvcWxiaQISbASeO6pwWSh2LYI/sEHW FtXSKE036FJ33/T037zVwxqXxBlipHdSaMWH+dySQv2PkzA+a/+8E1r+BKp73kYZpxTH/Z tDsh4Y5UbQLTOGWls2gRdQBTEZfwVLs8JlWcIS22RQ314OhvFJe5UaNHt7RGGNfR6D8bTk 9PjeuTKK9DCO5z69q5sZc+cG+IiWNHn4awxhoFkNMLlQxiSmtZN15CROTwfsaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wx0Zj2LmRzs5d; Sat, 31 Aug 2024 16:19: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 47VGJ9ZA081107; Sat, 31 Aug 2024 16:19:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47VGJ9Ve081104; Sat, 31 Aug 2024 16:19:09 GMT (envelope-from git) Date: Sat, 31 Aug 2024 16:19:09 GMT Message-Id: <202408311619.47VGJ9Ve081104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 5a542a605537 - stable/14 - release: Redirect etcupdate logfile to /dev/null. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5a542a60553780b51fdd822af1d9aba53707fc29 Auto-Submitted: auto-generated The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=5a542a60553780b51fdd822af1d9aba53707fc29 commit 5a542a60553780b51fdd822af1d9aba53707fc29 Author: Gordon Tetlow AuthorDate: 2024-08-24 05:35:07 +0000 Commit: Gordon Tetlow CommitDate: 2024-08-31 16:17:55 +0000 release: Redirect etcupdate logfile to /dev/null. Stop shipping a log file for etcupdate. This is a source of non-reproducability as it uses mktemp thereby guaranteeing the output is different each run. Differential Revision: https://reviews.freebsd.org/D46317 (cherry picked from commit e972e408d19a58c4f2855eface487d06ef73b799) --- release/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index 32e59a1a5c90..9ca32e168fe7 100644 --- a/release/Makefile +++ b/release/Makefile @@ -129,7 +129,7 @@ base.txz: sh ${WORLDDIR}/usr.sbin/etcupdate/etcupdate.sh extract -B \ -m "${MAKE}" -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" \ - ${NO_ROOT:D-N} + -L /dev/null ${NO_ROOT:D-N} .if defined(NO_ROOT) echo "./var/db/etcupdate type=dir uname=root gname=wheel mode=0755" >> ${.OBJDIR}/${DISTDIR}/base.meta sed -n 's,^\.,./var/db/etcupdate/current,p' ${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate/current/METALOG \ From nobody Sat Aug 31 16:19:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx0Zv1sk1z5McwV; Sat, 31 Aug 2024 16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wx0Zv1L2nz4LXl; Sat, 31 Aug 2024 16: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=1725121159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmGCUcFk4wPeY8KayP1/Ti8BXPUpTZ3RhnbiYj7s61g=; b=POLg61x6cUhFTTDw1T1YH+NYLEcpjyd46Lth7XaA2mZd5R8g2J6tAljNoNhRifbbLz4HK/ 8VOP4/e0Ku6HJgJgqM82I3KdZFX/a/pSKPZ7J7B+9Sfn/rIZrg8KZ+c+Nph+8SC54sIHuh EG3n9mmd7sElNuggy1QVNHsi7xlqRI7SvdrKPbSqdPLKtQ/9w25RitVY5eYkFuHQSQ8KrI U6WaH5nk9onIRCwcxNsc8xJmDN1lCcoaOrtZqlfHeELyE3QZMXYeJfPHTPolOO952UDtc6 OzEkxA9yRJOaqSwwea1a58hD72Vdu0Nux+qLCtCHjb0jUUmosvfXXU83SjKQbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725121159; a=rsa-sha256; cv=none; b=hC2+trvm2hXqT4k9D38J4Z4SOn90fhbZ9Do/SBlfuVBvGlO9kgr3Pfn7NGM54uSZ2QI7d5 RZ0vP7Evw6sIJcOj/6fnXargogRNcI/tDMP36SJH07UYdqEI7hSgaJ0Ci4M2U8mEeL6OM6 kLKi/CF0NsHaY4Wy5ShNIBq+qZBxF+5ARbDXfUIcZpbDDiJ8WEA2KR8ilGqkDHTzPYKsb0 RfSFCjMpt0T4NWP+4G0ukNd67/YpiMQb8UYpaEIMhYmNTy55nxnuDJjkWmiEFgUVrWeNlp XQbjy2JsOjXvhl1yGR+MrDRoOq24hlsLc/Al1QnB2FXvJiYQL3mOVvvrvfg0cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmGCUcFk4wPeY8KayP1/Ti8BXPUpTZ3RhnbiYj7s61g=; b=Jo8aEI8VL4bSKnTKCTWY0qfrc3jZvH86Ku+N0939XtgaVR9OjokcwfsYa1fuodH+rAwl+N BBJASGG5iKxsT98PX4jm32prOCMSo06j5v+Wwhq4h1L0kaYOXjY2xSti3Sdn2wqih2oXWu lB2EYJXVSJEDXgLo8+G7r+1HlFgmRnPslSiTdcf2XYljceIaw+t+l7AG5PRKWZZZQmV4LY fwFnCk05clr6B3+UJRPSTRYe7Ot+ZXgPP1Zo3FTZNgIMZzm4Pcd5u3E3+lqqc5WAywP4J5 KqIBrpo9+lHqH5p7DswCM3ETlyqodbsy49sqQDNxkX6orYuvGmBnNz6PAh2jiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wx0Zv0NR4zrW3; Sat, 31 Aug 2024 16: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 47VGJIOO081265; Sat, 31 Aug 2024 16:19:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47VGJInb081262; Sat, 31 Aug 2024 16:19:18 GMT (envelope-from git) Date: Sat, 31 Aug 2024 16:19:18 GMT Message-Id: <202408311619.47VGJInb081262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: b8abafb4de41 - stable/13 - release: Redirect etcupdate logfile to /dev/null. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b8abafb4de419dd063d4da1e049b87652c847af6 Auto-Submitted: auto-generated The branch stable/13 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=b8abafb4de419dd063d4da1e049b87652c847af6 commit b8abafb4de419dd063d4da1e049b87652c847af6 Author: Gordon Tetlow AuthorDate: 2024-08-24 05:35:07 +0000 Commit: Gordon Tetlow CommitDate: 2024-08-31 16:18:49 +0000 release: Redirect etcupdate logfile to /dev/null. Stop shipping a log file for etcupdate. This is a source of non-reproducability as it uses mktemp thereby guaranteeing the output is different each run. Differential Revision: https://reviews.freebsd.org/D46317 (cherry picked from commit e972e408d19a58c4f2855eface487d06ef73b799) --- release/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index 55d82a0d0f5e..9feb4d170a41 100644 --- a/release/Makefile +++ b/release/Makefile @@ -122,7 +122,7 @@ base.txz: "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} ${.MAKE.JOBS:D-j${.MAKE.JOBS}}" \ -D "${.OBJDIR}/${DISTDIR}/base" etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ - -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" + -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" -L /dev/null # Package all components cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} mv ${DISTDIR}/*.txz . From nobody Sun Sep 1 00:55:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD2145dyz5MQsg; Sun, 01 Sep 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxD213fXPz49hL; Sun, 1 Sep 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S7GN5bMPB/mN51SQMxFngxvsVeGqAcn6uxI4C+ofqp4=; b=jPA2okdMCh+yIeKj5M2W5TTvwZQ34sZH1hbsGAUZYv9uIUixliA/ynvmdAMnr7yQrrKZ6Z pf1U7pnNjc/5wMVMXGqmiBwIINw2OL7kuNFdThMiQprGbks66FBOL4aZ+xBwWA+j4YSCck 5fYqEZrqyuIheQINpM1MeWbCJPAoHI+ramFusOl/7SYMhCl4YkH42OKlVtHoftRY7znbpe rSOicCfP/rBC7YvC5kSPJoqcp+kvSZn6ChphtOtq48fj94MznGpu2vrYVL+ADsuu9Q0aZ3 fHp94kDS8dYwWMWo0EpdabaolzG4Uo1ANmvOkym2UTKtpUrhqqU/N7+w9OuNWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152105; a=rsa-sha256; cv=none; b=yNXSKcQr9lc4v7pYbLyLx98xCxbiKL6DCAHOw2gbr/PKIjUeTeR7Thda1obowLeNQZ6eYR QEVKOPP7XU+ijQ0xkNBJij0j1c4Sbuze6ChexAuXNWlCHp4A639Jx1t3wUoIwP8lwwZOM8 VVRchbzai3n0pXxuhl6BKxcZOR8L2ZMlNmHiIhjoApwxgpAL9o7BzY85pcwGnmjP//i7co j4afVXWUUdF5jl3LdiQhogrDU46vR/pnhKaU/cchP5ZUJTidLHiBvuV7g2p2r4pbk/NT3x kk+Vul0MLO4G+WKkCD6H22RNENFimHlkK76E0DhdMw5Bn8UbRfqOfEf5Gr6ESA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S7GN5bMPB/mN51SQMxFngxvsVeGqAcn6uxI4C+ofqp4=; b=fP+A6cg4GQCyflKIIQ6WICAHdiiqBAR/KksXGJRBwNY2rMIUprwP3ogF/ddszKO8j/cKPP fNuUDYyBg1CL3aG3AV1rqZuU46/Y/Xu54U3J+ecQWLAcVhF3KPXK3hsfrmFNZ8dR4XAP+u N8eFWF7rkOu23MOcdyKaSzybBSPS/2FAr9gsYJSxCdZq3QnfO1PxlfYXBLVEmQ9DY+2qLr 9KA/vGTLrrHJFlGMVirnTTjzP9rfs2xuSXB6PYAOPHrYUMaipXe3xNKC+AyVzqLKqsLm4l VBSDJ1dkvwzh9Kx9qhE2BnZJgYgei8hFHiL/JTEByaGlOpsb9l/VMOU2V3Ymkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD2137d7z16PX; Sun, 1 Sep 2024 00:55: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 4810t55i059286; Sun, 1 Sep 2024 00:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t5au059283; Sun, 1 Sep 2024 00:55:05 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:05 GMT Message-Id: <202409010055.4810t5au059283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 65ae1d493e31 - stable/14 - msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 65ae1d493e314f5270cc92315cea0bb2e1afa3b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=65ae1d493e314f5270cc92315cea0bb2e1afa3b0 commit 65ae1d493e314f5270cc92315cea0bb2e1afa3b0 Author: Jose Luis Duran AuthorDate: 2024-08-25 14:50:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE PR: 281033 (cherry picked from commit 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880) --- sys/fs/msdosfs/msdosfs_lookup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 2a90339d0878..e799a5ce05f6 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -198,7 +198,9 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname switch (unix2dosfn((const u_char *)cnp->cn_nameptr, dosfilename, cnp->cn_namelen, 0, pmp)) { case 0: - return (EINVAL); + if (nameiop == CREATE || nameiop == RENAME) + return (EINVAL); + return (ENOENT); case 1: break; case 2: From nobody Sun Sep 1 00:55:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD2251R4z5TbZ2; Sun, 01 Sep 2024 00:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxD223z1wz49kp; Sun, 1 Sep 2024 00:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PFAJso0qInRbkCXRc/x0VjZoIlh7+amwVQgXCEPN4Ms=; b=VnK+zFZiqVZ/7Ba+qbZCARRpTeWVx0HgJm69WsB+mLLKwjOC89mcArEhmWjipTbtUESVOj YbOc+sNU4UaPe72MFTvP6OxCabawvfUBiSg6+ZhfYUnB/q+oHR70RrrcY+FIUT3Qb6tekk VWZ4Yr61prextYtGQGjg1kEmOrVtUuZbJB1hFt/A7gnb7OKm7RDfyhTr4HQE963SyfdhWa PjL/xdG45T83P5uFpDAtoSYPxcBqflik48vkcqNqRp5zfjTuiW24lfw4mrPBf34QruDgCf 5g9hp6lsLDC7bbHAMEP9TKX1+VTKRsf+LLx71UPllKc1+5jqWs5m6JPNQcAZag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152106; a=rsa-sha256; cv=none; b=kf+zly2JW352jEkrH0nvkYoyb5JH981NeQ42iEZ9rjC/UJzlbvbJWFYJZQfPW7wnhATcmT 1JkqA6D9kRCBeMksQaug2Ap1TB7pmTPR5sy9hGJifjgV/WEKoHpmSA/Ei/pDHn9w33H6+B Wxla7Ai+44diXNvlDQupCuj+qly5Q50vLLaGH2imYR2Z3JDmH+V9v7GLwZagxQgJ/F4/iB YJzYrN3620baa9gbp+NdFrJDfB0Y9xhEgvhIRc6Alvr6wXT2uwxpreijDnEpJpLg8wqmqU sYZyhqMeOOxMYYaOSlMsNRXsrA096TupqCsF69Ulg1HaS1Dt8TI1Ws/HxiBypg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PFAJso0qInRbkCXRc/x0VjZoIlh7+amwVQgXCEPN4Ms=; b=ZrFa6i3ne9KQhlF4LqkgzJL+AfNJlserCkpzLlXZIntRiwXnYKMI3eoQIWyb6wqVYhSTnu Xr0dFsrRkUz7JzsCwQWH24ePPhvSOfL00vHgcxqkz0/V0zGgkkO6LfNreR7OCEENYkbmTj IQO7E5j2AuKD47Yi8uxK17gOJXEFiaEdxHq4mzovuyp5SZsetIIo6EdLNDhyy9a1g59E/+ soOg+aA5EkaDB3gPC4QxpRp8Aeng6jhX9KGVsWCZqhuLMFeRpsqptyvIWJZyoao/aGVwvi w0oHrglSjzwoavoirWQXx/Riri3HFnXYKJe7vZfXFfVFUSXQooy3/jrynLHVIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD223b2nz16h4; Sun, 1 Sep 2024 00:55: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 4810t657059326; Sun, 1 Sep 2024 00:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t6lD059323; Sun, 1 Sep 2024 00:55:06 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:06 GMT Message-Id: <202409010055.4810t6lD059323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f968e0819ddc - stable/14 - open(2): mandoc -T lint List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f968e0819ddc3b26537d046304472877ff4849c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f968e0819ddc3b26537d046304472877ff4849c1 commit f968e0819ddc3b26537d046304472877ff4849c1 Author: Jose Luis Duran AuthorDate: 2024-08-27 03:48:09 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 open(2): mandoc -T lint (cherry picked from commit f5a37f8dd319e3007b126b77376e61ad96f44d8b) --- lib/libc/sys/open.2 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index aac3ef1318f8..220561cc5683 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -252,7 +252,7 @@ controlling terminal when it opens a tty device. This is the default on .Fx , but is present for -.Tn POSIX +POSIX compatibility. The .Fn open @@ -265,7 +265,7 @@ initially opening a TTY. This is the default on .Fx , but is present for -.Tn POSIX +POSIX compatibility. The initial call to .Fn open @@ -487,7 +487,7 @@ The system file table is full. .It Bq Er EMLINK .Dv O_NOFOLLOW was specified and the target is a symbolic link. -.Tn POSIX +POSIX specifies a different error for this case; see the note in .Sx STANDARDS below. @@ -661,7 +661,7 @@ to .Er EMLINK instead of .Er ELOOP as specified by -.Tn POSIX +POSIX when .Dv O_NOFOLLOW is set in flags and the final component of pathname is a symbolic link @@ -679,7 +679,10 @@ permits searches. The present implementation of the .Fa openat system call is believed to be compatible with -.St -p1003.1-2017 , +.\" .St -p1003.1-2017 , +.\" XXX: This should be replaced in the future when an appropriate argument to +.\" the St macro is available: -p1003.1-2017 +.No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) , which specifies that behavior for .Dv O_SEARCH , in the absence of the flag the implementation checks the current From nobody Sun Sep 1 00:55:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD236gjtz5MQwC; Sun, 01 Sep 2024 00:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxD234twtz49ks; Sun, 1 Sep 2024 00:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Re/44g5+k3PS9OM3d1tDN64A4umzzdKLKOZo/PH0GCA=; b=oWSY02wOxI/jT7beqcG64t11sWwkqO1gxK4akIc/cLn25KVMJHfJ6iyCiBQDhLorgYJocy eG15nnUD++xSDphnGFIwO4NDLuytvxWxIIf83H7YxVLQoFu0i+t3LgTNGD0nibia0/jR3t hBGqBGhNdO5FVgrm7EaaYuNQPOtm63EzF3snlbNvBtEkmTCprJb81f1nHhJnLFRxzBkE5o /Gi3jPqiTs8KsaBNBbktMmhINCKkGAvz9sxruGnHBJ+ReoVInAE5/SKUtlGDLB59F9PFIB dbirqi+xjeiPJE5fH3v+Dop1ZaW9Id8JGCLLejmbbpI4lrTaGQjLPTxYnTn3yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152107; a=rsa-sha256; cv=none; b=ubcIzsZMgzlXxfYnQcpqrw/P85mgdKLZZVoxf3y56zKWfuKnGOIwZHCnsjQsgD6K1iTrgX OgH1W0DQnJ9zDytJpT4T62KnzR4emNCjzxxloIA6aVKDDmrdyaoS9CKL3buxY+AvwujnW2 K29DJoBm7it3StAoCwvclBIOjGJtPUSHeTfn8+4+AgSNOSjfxol4+tbYQJMKKh1MNR3OFV bRBQEeqrhL01TlkLSOsW1ym7RUjAXgkiLHYrjBvDwaFlNPLUiZ3wMxt0NO+FFQpw8lB5q2 YaZ4fX9boZ4L2pTVrnSW7Wmpl+Bs/cGCiPq4apUXn/zeozh594xzUt9C0ReGdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Re/44g5+k3PS9OM3d1tDN64A4umzzdKLKOZo/PH0GCA=; b=KsM9qNIoVuSrUrqmpMfzNdDEGfmHfiCO+ioYc1yV1GU49uqCUe7plwTbdT3JcsJCryfuGY NywwFZy+rF0FNXtIy8Wu6cN8JPPctfgtlMAXgWd2WjDJ1jHN7GZDqZYEbtf4dae+MwOt9d /+CiLySegcr1VmG94Hajikey47zKMQVldsqP0pr0AVrb7MmLT3miVsHFZ9Gfb0QKJFr+M/ +BOVKYw7yQF4AhtujOlGNLY+Mj0BeQDNmmYhqVrItrIiJ0hQkf08190VJJY1iK0b6OdaGO mQ/X/Y8doPt2o5PeN1dW2JJNRoKGH/4IGXBVzK9cCrrztcoqV111sFiwKbCziA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD234WHgz16v0; Sun, 1 Sep 2024 00:55: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 4810t71X059374; Sun, 1 Sep 2024 00:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t7n4059371; Sun, 1 Sep 2024 00:55:07 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:07 GMT Message-Id: <202409010055.4810t7n4059371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 97ccb41979bf - stable/14 - rename(2): Extend EINVAL's description List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 97ccb41979bfee6d5bf35886b310e6c9bc7e8eed Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=97ccb41979bfee6d5bf35886b310e6c9bc7e8eed commit 97ccb41979bfee6d5bf35886b310e6c9bc7e8eed Author: Jose Luis Duran AuthorDate: 2024-08-26 01:32:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 rename(2): Extend EINVAL's description PR: 281033 (cherry picked from commit 33f58ac0795b2b02593ad0a8bf8a1ea24c1dc5e1) --- lib/libc/sys/rename.2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/rename.2 b/lib/libc/sys/rename.2 index 2b68274e4a8e..4faba81ff509 100644 --- a/lib/libc/sys/rename.2 +++ b/lib/libc/sys/rename.2 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)rename.2 8.1 (Berkeley) 6/4/93 -.\" -.Dd March 30, 2020 +.Dd August 25, 2024 .Dt RENAME 2 .Os .Sh NAME @@ -257,6 +255,10 @@ or an attempt is made to rename .Ql .\& or .Ql \&.. . +.It Bq Er EINVAL +The last component of the +.Fa to +path is invalid on the target file system. .It Bq Er ENOTEMPTY The .Fa to From nobody Sun Sep 1 00:55:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD250D7Vz5MQt5; Sun, 01 Sep 2024 00:55:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxD245xG9z49nG; Sun, 1 Sep 2024 00:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6QZti04r7UlX/LmBD4Bn07rSNZDbbR7gVmL2xJiiio=; b=crC+xfFPEsybZon3c7bmJYQK+p8nGw++L2gyjDlwuOX3MCrJOG+nZFlV6ZHkxWd3mkREEz YKXFNqlvrDmi/SJefR6x2pBFLiS9YC6FaInR8yYn/Je2at2X3RoNejROBmQW38DCWRExet +k3C/msdFqR/27HjyZ/wroJICMtGRD7KfFRjTzX0aVXMg4/okYmqAj+qtGAwR0G4kKr8Z7 YFM0vSGsE/yIb3+cqxfjIprvieAeoWguOPG4XMrt/swwIq7aLJ7DAteeh18Jz79PhuofCc +buVaqutJOGK7GHgBICp9nCSvYwy76EmyRn7QeGLyTgLpFtrRWXWOz/9EPY+Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152108; a=rsa-sha256; cv=none; b=qaAaRcMhzRRABTB7TKegjImx3Qgbhu8ZKQzDlHFDgRqro5nsIoLgPsXiNBoxW0EggB4JOr SHB03kDurSKOMFz7AOloQPIaOGUolKZ9FzqBOldKcvExL4sliIBwD20VBDxnY2trtzOrgR VdIYt6jancyzu9A11sepou2dqfzv21zt2RzjINf4c8/j9vPsMzyhbE0zHt2eCJDjkcPX/3 zeBB4kpSlv5tvEBx0M6/dRa6Bd3U+mTbsQRSy0jh2nyxDrbBuAl900nV3KpAKsdbJSQv6j sL8ggr132s6UNPp8PBMrkahFJgu1Rxp4gsrnNQ//FjMrxYn6HNE9N9j4JgYNLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6QZti04r7UlX/LmBD4Bn07rSNZDbbR7gVmL2xJiiio=; b=OJH0AlclnIigFR94X8Fzr4Zn4CxmIGwNTQeYSvRCbgcq3byoEkggqtIrMZ3ibIze+e776J pf4S5jTn3qES8BkuvTqFWVYf7Sr5YgBF1SJTCvcqYsbQMYkz3kb9dGhuYK92TG3iBbE5N0 OYAvoxYhAL2D27znXBHnAbGNEo0MxBlfrFv5CsuB/jHXVMmUHv+TrhhYhgJzclTN1VTNbq veX2rD+ZRKAOVPDCqKiWJSZtKhy+f/cu9FbWwxKcsDyVQ0j1+y34Cgjl3581GLpPi5OiMD nsrBhKe+gFNYU7YfoD6IQsxGnRAqPrBuUnaEGTSdio0Jap+G4wgy6qKQK79OrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD245X0hz16v1; Sun, 1 Sep 2024 00:55: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 4810t8um059414; Sun, 1 Sep 2024 00:55:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t8f4059411; Sun, 1 Sep 2024 00:55:08 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:08 GMT Message-Id: <202409010055.4810t8f4059411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f7eb6b134db8 - stable/14 - open(2): Extend EINVAL's description List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f7eb6b134db8fed6a6851b6a3d00a2ea0e11eadd Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f7eb6b134db8fed6a6851b6a3d00a2ea0e11eadd commit f7eb6b134db8fed6a6851b6a3d00a2ea0e11eadd Author: Jose Luis Duran AuthorDate: 2024-08-27 02:23:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 open(2): Extend EINVAL's description PR: 281033 (cherry picked from commit 02c23c3b5ac9c9c1115c8b892034bb5d67b05c06) --- lib/libc/sys/open.2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 220561cc5683..4cdceb336532 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2024 +.Dd August 25, 2024 .Dt OPEN 2 .Os .Sh NAME @@ -580,6 +580,12 @@ and .Dv O_EXEC or .Dv O_SEARCH . +.It Bq Er EINVAL +.Dv O_CREAT +is specified, +and the last component of the +.Fa path +argument is invalid on the file system on which the file is being created. .It Bq Er EBADF The .Fa path From nobody Sun Sep 1 06:29:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxMRy5xzmz5Tcq2; Sun, 01 Sep 2024 06:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxMRy550nz4gGr; Sun, 1 Sep 2024 06:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725172174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xg0G7/2objscSRqXNkyf4Mio1lcKcMldUkK9Pa7XuUc=; b=LWifh13xiWdFSe9cYA72JC7xVizsXD8Jd9My88ZXOOZ7dzRFBC/c/GIn2Pw+V8tf3s6B7v jDFJ3/fNglQCoXO8MCxozPiijKNRhWJ+Wt7lnZR+bAZJYrGWDsu2q5vSlDuJ6XCa55U6b/ QRgR+/w66QJkOB6VcPIHMp51k1atF+tZJyJVPKPxukxWwUdqQWU9DW72quKfcmgLvmze1C wdMNhPubY4lBsyCIoHxhEkZzB/O5NTgMOxw+HYoVLxpxesT0R6Iu/MBru80tVQ/meI3fk2 3FtoqSTluBIpZCGQY93hESwx2Fz7ZZlGnmg8nzu88H2v2qEAoFzfU1LxIRHXtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725172174; a=rsa-sha256; cv=none; b=xHhtC+u7bTva2T7dT9CPu/EYSCgSTTbKqvQLECP6n/omc4bvhCuHKYycmM6DiO/7ZPj89N 8gQCb/qemqZHgtxshy/HBQXu3OKQ62L9arUDE2csjzcEkE6Z7EZ16K63gFx6+Fes2tN//3 zQJ+Rzef1iDFxe1XGh8pK8opneIRXU3Labh2zJDXge96w9QoyqeR8biCG0KexEdPs6b9cV TAPQpll/q/ESUfENjOwyDj1qQ/HFOVRrqmL6eNu8iWOJRBIv8Ypm9da0TX3VY+ZXCRcliM R/bwkJq5Qu1L4uOMVyM1MqnFRgdr3NXRABkLa9Q+EaYqv1qKi2DMzjNcN08Vpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725172174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xg0G7/2objscSRqXNkyf4Mio1lcKcMldUkK9Pa7XuUc=; b=DtpCtEKXTl+YrT5nVloPChR2V6Z0kx01V349IqVz7dFmPoEcux8n563W9YqEeLoPmFbo/I sy0v0RTReI31lo/rNrqijg2/Vu1DRzYd1AHMJsnSn6y9jbPYa0BYoyg9qEGVNcHIg+IEVq Kchpr/1GsT94axbbCh+GxTLclx7uVRiGw4I/9T6ybItJILg+p2DnPjS7Y8WDxC/njs5HXi pwbDHftbdrbeXC5yfS9cNzOVrcrcElHbYS0USypxdY8IsPku7nW5TBZQCKz5TayrEhrDKi lObiWcSwlRec7DAXzHPxW2sZ9OZbgwsuFuS3yKkT7mRYOYENrFWvHBne/qgtAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxMRy4hvlzHwV; Sun, 1 Sep 2024 06:29: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 4816TY77021308; Sun, 1 Sep 2024 06:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4816TYHE021305; Sun, 1 Sep 2024 06:29:34 GMT (envelope-from git) Date: Sun, 1 Sep 2024 06:29:34 GMT Message-Id: <202409010629.4816TYHE021305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 2d203f534bae - stable/13 - bmake/unit-tests/Makefile use _shell List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d203f534baef0568989555ebd26278134ef4c6b Auto-Submitted: auto-generated The branch stable/13 has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2d203f534baef0568989555ebd26278134ef4c6b commit 2d203f534baef0568989555ebd26278134ef4c6b Author: Simon J. Gerraty AuthorDate: 2024-09-01 06:29:19 +0000 Commit: Simon J. Gerraty CommitDate: 2024-09-01 06:29:19 +0000 bmake/unit-tests/Makefile use _shell Set _shell like later versions of bmake so that .SHELL does not appear in conditionals. This avoids errors when an older version of bmake parses this makefile such as when doing src upgrade from stable/12 or older. Direct commit to stable/13 since this is the only branch where this issue arrises. PR: 281151 --- usr.bin/bmake/unit-tests/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.bin/bmake/unit-tests/Makefile b/usr.bin/bmake/unit-tests/Makefile index 96bde713ba38..2b20de2498eb 100644 --- a/usr.bin/bmake/unit-tests/Makefile +++ b/usr.bin/bmake/unit-tests/Makefile @@ -441,14 +441,15 @@ TESTS+= varparse-mod TESTS+= varparse-undef-partial TESTS+= varquote -# for now at least -.if ${.SHELL:T} == "ksh" +# some shells have quirks +_shell := ${.SHELL:U/bin/sh:tA:T} +.if ${_shell} == "ksh" BROKEN_TESTS+= sh-flags .endif .if ${.MAKE.OS:NDarwin} == "" BROKEN_TESTS+= shell-ksh .endif -.if ${.MAKE.OS} == "Linux" && ${.SHELL:tA:T} != "bash" +.if ${.MAKE.OS} == "Linux" && ${_shell} != "bash" .if exists(/etc/os-release) distro!= . /etc/os-release && echo $$NAME .endif @@ -465,7 +466,7 @@ BROKEN_TESTS+= \ varmod-localtime \ varmod-to-separator \ -.if ${.SHELL:T} == "bash" +.if ${_shell} == "bash" BROKEN_TESTS+= job-output-null .else BROKEN_TESTS+= \ @@ -771,7 +772,7 @@ _SED_CMDS+= -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g' .if ${.MAKE.OS:N*BSD} != "" _SED_CMDS+= -e 's,\(Error code\) 255,\1 1,' .endif -.if ${.SHELL:T} == "ksh" +.if ${_shell} == "ksh" _SED_CMDS+= -e '/^set [+-]v/d' .endif From nobody Sun Sep 1 13:29:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXmw2fLZz5VD45; Sun, 01 Sep 2024 13:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxXmw24j8z4MLW; Sun, 1 Sep 2024 13:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KFtL5DH0/cZu6egOqt7sdpgP41o+FZUClsa43uGjECM=; b=jGjjxMo1VyheZ+6+5cLhCIadK+tg0fMjN71Foe+vS2g6iyKgL03V38qSHXe5vP2kYPOzEz LSNzzi9If2iGLenE3mqIv15cyfGHfTAjkKy+MAxoSPIzSvGO/SfscwQnUN/3IavOsIyQSM psec3soMThzVqVeALVPK+Q6XqT16/ZpYSEBkA3onvvfGTQaQ2jK9Mbe3A7gsOs1rRA1/5O Y3+1Ocw6wcnZBQhkLIoR9PJeGpx6SBhcay8+fH5S87rZlWFF3KSSgBiAzHcESA1QIPxZdv VibJkcZHWhQwim6n8X784ZdIFt8h/qh/XdJcyqE/vdx2p5fQbQbj8Bgfq9Ae4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197392; a=rsa-sha256; cv=none; b=ww1rMsyeyMkKpMI7ASVD8RVpmky4Kgm/f8xz1iA9/GYCi7rzRGwGv5rpyOdSjsZ7c/wYUz fwgIRXC07FZEOJAB+6McFazqRCMjhGB05cDcmRhtmFcPkp6eTHajPn/kZjL8p+WgJcNviN Mu+m/Hp2KI3HT7/3hRkC1wW4GcyI8UyGNxdGvtk9F1gbl5j7vk05zb6kPRhk3XJQN0Qg7x wzDJjmZMPxIZ9xGhOEobWROtxKax9+UmODgBaSPS1sbSgoMlGFh+BF9iIMBxKxkfFr6GU/ Ex8Hqp/Mwf5D4+TQXIcjsl114b6CyQUuavawqq6FLJm1UVBHryTYm1q88zNDsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KFtL5DH0/cZu6egOqt7sdpgP41o+FZUClsa43uGjECM=; b=itdf3Gcl0FwAFuFl7w1rB09WI71l9YSrWo94PgWkpPQMS9xknIhi/jplxgr6k0uhxvx2aC x4CYSA3HDYUiE31YJdykzqemsQIJDJRCyksnF+8NTcxX5cNNlB/No9gLb3hI9AG+7XJ6Ij TtP6aUz/83wSTkhW/p/s2Vh4YIsP6lo+r4wGAYbRXaUpf8T80MJQ8pvY7DptXilbfGzTWr sKeWUqn4k489bJHls7Kmo/Tq5M2o1KB6AofPt4bdiHQ+w3fmv1ChpSXjUigKYUD5keahCf WfDnSiwTncwPAfgWDHwasWK8hWfX+ZuzrkxXzqv3Y3PIqwkFf/9K/EqqPGpLTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXmw1Z9jzW4k; Sun, 1 Sep 2024 13:29: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 481DTq9w031291; Sun, 1 Sep 2024 13:29:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DTqTr031288; Sun, 1 Sep 2024 13:29:52 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:29:52 GMT Message-Id: <202409011329.481DTqTr031288@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: b8aeb7101724 - stable/14 - mixer(8) tests: Fix cleanup routine List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b8aeb7101724a0489509b3385571759014268e71 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b8aeb7101724a0489509b3385571759014268e71 commit b8aeb7101724a0489509b3385571759014268e71 Author: Olivier Cochard-Labbé AuthorDate: 2024-08-30 17:23:29 +0000 Commit: Christos Margiolis CommitDate: 2024-09-01 13:29:40 +0000 mixer(8) tests: Fix cleanup routine The tests correctly skip if no snd_dummy neither mixer is found, but the cleanup is still called with the skip condition, which fails if there is no mixer. MFC after: 2 days Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D46491 (cherry picked from commit 080c85127e3fba2c8cfb78cb75f7b306aee4028d) --- usr.sbin/mixer/tests/mixer_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/mixer/tests/mixer_test.sh b/usr.sbin/mixer/tests/mixer_test.sh index e1321ad9ee13..45003251c460 100755 --- a/usr.sbin/mixer/tests/mixer_test.sh +++ b/usr.sbin/mixer/tests/mixer_test.sh @@ -66,7 +66,8 @@ set_default() restore_default() { - test -r "test_mixer_deflt_unit" && mixer -d $(cat test_mixer_deflt_unit) + test -r "test_mixer_deflt_unit" && + mixer -d $(cat test_mixer_deflt_unit) || true } atf_test_case o_flag cleanup From nobody Sun Sep 1 17:55:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxfgn3cQjz5MhKJ; Sun, 01 Sep 2024 17:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wxfgn34tZz4rnH; Sun, 1 Sep 2024 17:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725213349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6l1wwf0bI6bHxH7gs+Zwm/KO8QpUk/wJ1f/hNX+AmA=; b=hvqVzM1BC9xkn1U7tIkRbWsmUOdN4sRV9o09Zrz+VHCmfdHOLbgJKtMC4SGmPM0vxm9ll+ DMlfFUakm+OkaahIbvvd6e/LNlmkjqtJKsqRRX0SHvUhxxgP1dzUDnuUsj3EZtIjCP0uMx kL9QJ9bAXOaCcjb7AbtOBwe+Tdnk/l1WoAV1MlM3MqHZdPzGdgwjvVyxDl63jSCp0ADcne BMxkKOuGNCf/621/Gt3oygsuOku2OBygZrj3qCBTAOlrkpM+Lw6rtjIcS5/J4aqbWnw/Pe 5Aw3IYcLJu1AslgwVyEBd3QBSZKd4oh3zhx1PlIrgtahkHcjBLEh0Q4VB6M7nQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725213349; a=rsa-sha256; cv=none; b=SZfa55J3s0acJDsqp9DJ6b+Vt6FvgLY9rqkWGUjfZQ5FD/zeW91clZWFEZ+8vAZsMvJKSB VCvejKVRuC9jnvkkTkv3RX+AUTP2RENREbV6S0Xt9Du7sbQ+GE5KRpxsnS9HVCCCBhb6Ya ViU/R+kZIXbxEXN1SHUwXuFq4Pz9xzN+KPRBiccMUN5g7uNu63v9Mx5WdwGeenQI+OGnF0 FLb/pxsZXE/l9vq1+3wsrWYZVN7CUk1fw+hk1ASZdi2/sxuudlHQMF1ijVC+gUSM7s8BhU 6EOC1leiTs6Wyt5zXbxQv9DIxf4IA7yDDmdz+Nvipkn4yVDjxyvL2iK0u1vi9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725213349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6l1wwf0bI6bHxH7gs+Zwm/KO8QpUk/wJ1f/hNX+AmA=; b=L3kbkkLpYJJhIgXyPX80QIi/0uryJshV5D2C1sCgfScL8rIPoyvsm84/6nDjJ0uzzcsEOa sCETPcM2ghY1m02kEzD1uAAC7c0B+j8z+66z5eH1zM/Rr4A+Ywa1NeARxHUs3P794/xvBv Hz1N8HXhOhz2kZNfQUtl3Bc2Ojif1tI2rEsjhhms2OXGc/zpf2jjzeEkSDbo/y28aBzkbG IxiG/jQswViypfAedQCmuLS8BLTU9AFMRDBamfYGsIusRC8pdpfFBefgcc2KdPYCLgabNM fhv3kRLXj8hol1cY9Sd2dLaI/FqZPf8ygcCkcDu82kIaFq7GXi3lh/aY4Nocuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wxfgn2hFWzdh7; Sun, 1 Sep 2024 17:55: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 481Htn3E091423; Sun, 1 Sep 2024 17:55:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481Htn7k091420; Sun, 1 Sep 2024 17:55:49 GMT (envelope-from git) Date: Sun, 1 Sep 2024 17:55:49 GMT Message-Id: <202409011755.481Htn7k091420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 574f00950dd0 - stable/13 - libnetmap: remove interface name validation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 574f00950dd00137f4218d01ed9a2d7d4b733772 Auto-Submitted: auto-generated The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=574f00950dd00137f4218d01ed9a2d7d4b733772 commit 574f00950dd00137f4218d01ed9a2d7d4b733772 Author: Vincenzo Maffione AuthorDate: 2023-12-21 14:43:57 +0000 Commit: Vincenzo Maffione CommitDate: 2024-09-01 17:54:48 +0000 libnetmap: remove interface name validation When trying to use a VLAN device (e.g. "em0.123") with a dot the library fails to parse the interface correctly. The former pattern is much too restrictive given that almost all characters can be coerced into a device name via ifconfig. Remove the particularly restrictive validation. Some characters still cannot be used as an interface name as they are used as delimiters in the syntax, but this allows to be able to use most of them without an issue. Submitted by: franco@opnsense.org Differential Revision: https://reviews.freebsd.org/D42485 Reviewed by: vmaffione (cherry picked from commit ad874544d9f018bf8eef4053b5ca7b856c4674cb) --- lib/libnetmap/nmreq.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/libnetmap/nmreq.c b/lib/libnetmap/nmreq.c index fd6a9d47039a..56fbe3ad40b2 100644 --- a/lib/libnetmap/nmreq.c +++ b/lib/libnetmap/nmreq.c @@ -156,11 +156,6 @@ nmreq_header_decode(const char **pifname, struct nmreq_header *h, struct nmctx * for (pipesep = vpname; pipesep != scan && !index("{}", *pipesep); pipesep++) ; - if (!nm_is_identifier(vpname, pipesep)) { - nmctx_ferror(ctx, "%s: invalid port name '%.*s'", *pifname, - pipesep - vpname, vpname); - goto fail; - } if (pipesep != scan) { pipesep++; if (*pipesep == '\0') { From nobody Sun Sep 1 17:57:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxfjb1sB1z5MhQY; Sun, 01 Sep 2024 17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wxfjb1LQWz4sW8; Sun, 1 Sep 2024 17: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=1725213443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=39hwvT0ozqiva19QKxOcY784Fjfh4CtOfmD9U9OlRlQ=; b=DD9b4yH2DOtmrjlXE0KdICLyMPvoMmb+bZUunY4+OSb/2aLPLcsqqc7ME/A5bi3wbvEKKt hJafj+P0+L8mRNpXCvSC/s+VKnYqp+r3V7kK7aY3KRi5DM7yW5zAKpDIFCsRtBvj9Flkdk 1HHM16veLfaDPYz2zu+j9O72BiUKXAE61/f13mfMijp9MnMxIa15kiDXCSJsD8tSC5+oTl qxLADjuuHc0NInQGGmoJqMzwUtXuoPvbKDdfwEIsw7TM5XG7/Ogoj1CsNBTsKEEYANlyf0 D5YFVkw3l0UEqoXYBX027GoWuxnQiZzkyWC3CX/BNI8RJmdzsOdFDpggwqncmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725213443; a=rsa-sha256; cv=none; b=iDG2klyz7jY43lfA0kDhhofC6EQ6k+eqDP16u+XwL3X1zhpxrt5htvRUk8MYxgxshxmTm7 HmCwbmt4bcJY5dx4MEztLOjHVia1kPygyVGimsCqJ82rMJaXW+AssrKmQTI8cVOEwdYnvT k1Hmf3KdUyDHIKNRHxrCsHmsFpjIfBPslv+Xihz8h+iLtOpElOAoy0n9ChON8bvXl1LsR5 bfZ/N5WPz8VET/CZCtiZzgQ1Zq43/pf50ZKJPjCnSPa5u8jfQgWkND3GWb8qtFd1nRn/Ck dVDDDboeCu2DsDoMxNuKE3MmDZv+aJ5WQCxvxwKb1jDKj6t8bk/giVn7kxqG2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725213443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=39hwvT0ozqiva19QKxOcY784Fjfh4CtOfmD9U9OlRlQ=; b=HQ72ngUMSRVxcCyPK1lg24hnz9xWxZCUn/KQ0GIeTUSiJuwqb61B/WLTpI/85L5Ux/odmT t/I5RX+ZHigmyC0YvAiuRxYIvOGV01a1wyckXQ2cKCAKB1fkvPR46zK6ZkLdgNmRXVR9QW 7Q9lPTHlRufJWT2k1E/RZlFm5SOL+T3ItZ3DUgJx2rZnzYP3HD1ylV224Q76svjpspEm0l nitTQIPD7p2NzOucyjZx3pd84hK4TFg7Upk3Yj68TJueIaW4LNW0/SV6eCju0Hgh2KDZwS klZabhseN+bGA0gviVPlGYvAgwb75mDsqheOrBVbXSC3i5C2zwpOHwP2sEfzRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wxfjb0x1vzdh8; Sun, 1 Sep 2024 17: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 481HvNCL091786; Sun, 1 Sep 2024 17: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 481HvNRB091783; Sun, 1 Sep 2024 17:57:23 GMT (envelope-from git) Date: Sun, 1 Sep 2024 17:57:23 GMT Message-Id: <202409011757.481HvNRB091783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 20a2a59f3990 - stable/14 - libnetmap: remove interface name validation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 20a2a59f3990778a82bccf0e69ce8f9d7f6a904a Auto-Submitted: auto-generated The branch stable/14 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=20a2a59f3990778a82bccf0e69ce8f9d7f6a904a commit 20a2a59f3990778a82bccf0e69ce8f9d7f6a904a Author: Vincenzo Maffione AuthorDate: 2023-12-21 14:43:57 +0000 Commit: Vincenzo Maffione CommitDate: 2024-09-01 17:56:17 +0000 libnetmap: remove interface name validation When trying to use a VLAN device (e.g. "em0.123") with a dot the library fails to parse the interface correctly. The former pattern is much too restrictive given that almost all characters can be coerced into a device name via ifconfig. Remove the particularly restrictive validation. Some characters still cannot be used as an interface name as they are used as delimiters in the syntax, but this allows to be able to use most of them without an issue. Submitted by: franco@opnsense.org Differential Revision: https://reviews.freebsd.org/D42485 Reviewed by: vmaffione --- lib/libnetmap/nmreq.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/libnetmap/nmreq.c b/lib/libnetmap/nmreq.c index 645f01abc130..2477337d8791 100644 --- a/lib/libnetmap/nmreq.c +++ b/lib/libnetmap/nmreq.c @@ -156,11 +156,6 @@ nmreq_header_decode(const char **pifname, struct nmreq_header *h, struct nmctx * for (pipesep = vpname; pipesep != scan && !index("{}", *pipesep); pipesep++) ; - if (!nm_is_identifier(vpname, pipesep)) { - nmctx_ferror(ctx, "%s: invalid port name '%.*s'", *pifname, - pipesep - vpname, vpname); - goto fail; - } if (pipesep != scan) { pipesep++; if (*pipesep == '\0') {