From nobody Wed Apr 17 03:33:49 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 4VK62Q3TGXz5HjWg; Wed, 17 Apr 2024 03:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VK62Q0cl3z4QhQ; Wed, 17 Apr 2024 03:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713324830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/4wZOwYcMPX+CUJn62msfxrAuUn5efMAnhMNhglhddI=; b=wi3Zytl3o9Dn3hnminpFTr3ExyPvt90Csw4g6kFzbmL+44wli4Yqz8wunt2Ncwwm6ZN6dp xFEvWcN7Em/oaLf89S8ZoH8Jy6RrYO0ufR5inG0PGmRj1WdI/6swNId3JcCYeyScrTCD7p dA8hhfS7bmCS5+V3brtSPu+BA+xs81h3+mDrs5CoiHsYg51avU7iR5PpAQTq4t9UOpWFIj F3osFx1L4h7FmrTKmWjKDnTIvIBv3DO+vCtSTfnvkrJeF44HAMuUM50PHcV2TBi3aAeaSX 4KeFn5MTI4gT7oa5RiDxFRiaWUFwsIq4rXtQd6fvdSIVGKbQqo1va51noU1k+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713324830; a=rsa-sha256; cv=none; b=IXwkcQaa/Qy8czfBlEVlcDu9d1KUBPYEWmd+Wqj3fyOMWdFgtJVC+LwMyQ4CMKKlh/olXb TamDnBdN0qVhfK3fjUd8PLmz/cs/fjEHiS8rKzf/EJwu1IQWGeQ/WUgheMlyldSbc1uI/9 euqtL7OJt6ZKn/0APLwGgCXyS6ZE8Fu+4JLYGmNeK/TYOlWvNsqxIL3N0pTO3RDpo4eBoJ IZP8dkfgXkWAflbMWiLoeNdsOMsy+tzPcV85j0jygCqCK9rXCfEi0wl+W2fOzYp5hFZedq PLWCAYBwRlYFkyIBXRAX0QdmCIHl3t0LMYSoapc3m0qPIW9NVZvnvjPfcg8Heg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713324830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/4wZOwYcMPX+CUJn62msfxrAuUn5efMAnhMNhglhddI=; b=IeS7ER6OM7ieDDiLN+PJOHLN/jOCvQSOvuYjgVTNTXv2v1fJ9QyT7qm5dmwaB8i/6yO4D7 jyU4bUY59HZlSz8LeYkRn9H6EtkszZPPUmNLnamnlyRcQOxfRcIjf8aZpL4Dwo4pDejdi6 UZNmzmayS4U7l3GsSfJSTox8tR+xSAp8tlablf1yQUQnFP8JozVcshJvZZfFgnXvJWWGNz DruE3JD+iOvjqHb6mIhQxxSMAepevhCmBXltdTxlt7UCFKXQyZAyR3W3OBWC3aTyDKgKWa n/PX2b0vRUG7RT8BW8kvub3HBbvIsRZtI8Fn3EJ9sYmWECEFt8oUoZb5Iw2Mxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VK62Q0DJSz19Yh; Wed, 17 Apr 2024 03:33:50 +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 43H3XnLW087054; Wed, 17 Apr 2024 03:33:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43H3XnsQ087051; Wed, 17 Apr 2024 03:33:49 GMT (envelope-from git) Date: Wed, 17 Apr 2024 03:33:49 GMT Message-Id: <202404170333.43H3XnsQ087051@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: 3d28a9c608a3 - main - nvmecontrol: Move reservation notifcation 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: 3d28a9c608a382af669e22e9e8eda7fd0bc02cad Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3d28a9c608a382af669e22e9e8eda7fd0bc02cad commit 3d28a9c608a382af669e22e9e8eda7fd0bc02cad Author: Warner Losh AuthorDate: 2024-04-16 22:36:31 +0000 Commit: Warner Losh CommitDate: 2024-04-17 03:30:18 +0000 nvmecontrol: Move reservation notifcation page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44656 --- 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 bdabc1078166..2ab97294e976 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_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); @@ -472,9 +468,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; @@ -488,11 +485,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