From nobody Tue Aug 27 01:06:46 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 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: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 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 *