From nobody Wed Apr 17 03:33: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 4VK62R41gxz5HjSp; Wed, 17 Apr 2024 03:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VK62R1cMmz4Qw1; Wed, 17 Apr 2024 03:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713324831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+ssxVhImLPV4k6S8kZ+qCLkoiFm867nDRSOb66L6Ng=; b=YoUNlTTiOVzenp6eHv3NYV285i//cuaiSkrsbOLOnQrW28TrBIJ9fGxIlOsNqfO6AuePRO mUClgPnSBPGbgvOA1vt80X2Ff6/OrEu2Dvn7fHT56pAX1hjEKHx7tw01WYMh6HB65pCJ4b Gfs8EVetlSyyvxLit2YsM4VxEfFHtIOCTJGcrHjULkKVnEVtrBuzs2L7QdnQ7r+rd6DZFR jlcqpw376b9c9XsKrJFWJj5hlaC0muB5qXPxH5XV+x91JTJliH0NAdcuGo4f1qNGkCTPvk KxrcouEZPNvnsGl0YirYa6OFHbaGN3Y5uCSNP+ktgV5+Utiu+8fDlmvxUfceIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713324831; a=rsa-sha256; cv=none; b=eUEguR7VTqdNFh4cwKfdPZCrT0A3Sv5roJ6MT6PLV6ywqaUAa3JAS7XiApjjyLt99UA53Q WGstLga/rh3HhZvh3JSdWv85/HZCV0MXx0SmN9H2x0L7hDRt6k7AD1Mv4x2I3rfC+JCqw1 TU4i39h1iEC2r+M5Yuhyv15+7gPU68IYqbp/W88PjCQpOUJMGeJGQe5pIeBG0trRFLAY/M I09++rgyedsdJ8IR4glEfinmzBs4hnvFeEdwuEPCky/NMHg/iP5zcedS1XIXl0JlXhQen3 2cl6xaJgPZnCzfoeTHZrjzW/NZ97f33PINatZlB4/Ym1MH3Puwmi18sy1vihDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713324831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+ssxVhImLPV4k6S8kZ+qCLkoiFm867nDRSOb66L6Ng=; b=nujYJ/PrIrt6x1YmXC5EOljivh46iIy5LoyFzlv08UhieKEGWsjqf9rGhkysgIPYuVmEoA bCdLCcJ7pqqxV6oxL7GDCUa2hp/5fqF+boXvDJ2CBLIpPw3JmqC/7B+kmkzOV6oGytWX82 H9e4+ENpJHmU8d2DIEYSO84K8NCbf3ZIEBCdTDqYwlJ3I5QcnnrxGkiqG/YUT321lXTsuz sHybh5JetgJTZpHpmeCMBVaQC0HZJ2Q/QBKIpdsbGy1Pwwx5Fx4HOEd4fKlx+163FPDUnn x58iLKcNPbBhQVdKLdPiGO3Mu9LHOvTeQj0IdrmDdZgzyrjkdUXD0SVEaLjt6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VK62R19dsz18vM; Wed, 17 Apr 2024 03:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43H3XpPE087113; Wed, 17 Apr 2024 03:33:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43H3XpPN087110; Wed, 17 Apr 2024 03:33:51 GMT (envelope-from git) Date: Wed, 17 Apr 2024 03:33:51 GMT Message-Id: <202404170333.43H3XpPN087110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 55a1679ece1f - main - 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55a1679ece1f56beda5f68e929a6b2fc553fb501 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=55a1679ece1f56beda5f68e929a6b2fc553fb501 commit 55a1679ece1f56beda5f68e929a6b2fc553fb501 Author: Warner Losh AuthorDate: 2024-04-16 22:36:36 +0000 Commit: Warner Losh CommitDate: 2024-04-17 03:30:18 +0000 nvmecontrol: Move sanitize status page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44657 --- 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 2ab97294e976..ede4ff82946d 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -219,10 +219,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); @@ -498,15 +494,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; @@ -523,22 +522,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 *