From nobody Tue Aug 27 01:06:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 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");