From nobody Wed Apr 17 03:33:52 2024 X-Original-To: dev-commits-src-main@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 4VK62S50S0z5HjYM; Wed, 17 Apr 2024 03:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VK62S2Q93z4R3f; Wed, 17 Apr 2024 03:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713324832; 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=JM5MPER8lJru5ZOhACBInwkK27F759ZWMqUS3HlX1ZU=; b=EIDpUZXcxgC9SM8hqUt7hzv42OQBQauyCULpNT8JaxdE56nx3BSiNIrtuObCGwnIpXvQju +x5NhUD0a4v9J1+C2Fr3kOdvDbPAnZQYslPOgPDvl8I/yT2Dyq++o5N/sv7tFJyh01FuWC rKgZcqRhkslBEok0knTxSmu1ZvkTj1VRSznkYkJ/ONkFYV6jkAoK8xulSG704InbJFdwi6 39OLeK+/B96EU50OHOLgdCBLw8VSDdZBxXDlbOUlRVJh9fV9I1wyIcdScLCXKNnahEU5bn 5FY2K1a/JvOl1Pxb8cWgauk8UbkoCR6sjKlJiCiKtZ7EMGPx3R4xBChJrK/Khw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713324832; a=rsa-sha256; cv=none; b=RTxYQlP3K6zOusXpo7B1UHkvNvqHNFHXJuTei+6Y2zpq4hMNjyvKWxzJ/eU37bnG2aDWpD C2Rzl7cuo54PPqeeblx89QHr2prh6vF9ik9RorjXbNAhhVd4J1vCvZUwBrRM/Lam5tzIy7 2dgkUQEnxNOR48V/ZsH/wZoysTh79wIo7VGCXSg0QSWjCk0LAn2ek+DodauweXq15wNER0 v6H3Fn5AaUaRIqLiJjn1gku7Yk8MG/rW11mmgxyNJO0yo4DcOiTPnKBqd3BtAqxUzU4Wmo WAbccidpxu+hocXDHxOFZwsO6I+fybB8xC5o5XqSnuOKAef+EDbqmeIFWP4hWQ== 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=1713324832; 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=JM5MPER8lJru5ZOhACBInwkK27F759ZWMqUS3HlX1ZU=; b=YbY4T22NNhSTfKQz5SfAZj3qkA4hL+9Nvby4hlSMxSywux4s02DlcwqT1Fy/yLOYhVdWV8 FGb3agzSMjQbhUu2ZxBW1kqg5CxH5lA/EmkpKlq70Nn2UPydseI3tuG2Bc56Fyn5LcZTeR 5bcX9mXynThnSFsarV2DlpxcmwMZMOME3MTiN+asZte8bTsHyvxi/NAga9DTVX004QPb6B 3X2+pwDj0KOiNWDS6FfQAoxgU8iOBIZ8ovc+kUFMs9zy/ln415x6TDV//LVAVYgRfqm8oO DfU2I+V9V3mWQhcUc47lIE70FAMonVSJTbNTC+7JZNQRhXI5zz7G+CfGctvFwA== 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 4VK62S1zt3z19FG; Wed, 17 Apr 2024 03:33:52 +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 43H3XqW4087170; Wed, 17 Apr 2024 03:33:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43H3XqFQ087167; Wed, 17 Apr 2024 03:33:52 GMT (envelope-from git) Date: Wed, 17 Apr 2024 03:33:52 GMT Message-Id: <202404170333.43H3XqFQ087167@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: f0f7e9616da0 - main - nvmecontrol: Move intel temperature page printing to little endian orderinng List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f0f7e9616da052e3d77b6e41301ccd655ae434fa Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f0f7e9616da052e3d77b6e41301ccd655ae434fa commit f0f7e9616da052e3d77b6e41301ccd655ae434fa Author: Warner Losh AuthorDate: 2024-04-16 22:36:41 +0000 Commit: Warner Losh CommitDate: 2024-04-17 03:30:18 +0000 nvmecontrol: Move intel temperature page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44658 --- 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 ede4ff82946d..dfc35f1eb788 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -217,16 +217,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 725111cd92ab..c94fdb356608 100644 --- a/sbin/nvmecontrol/modules/intel/intel.c +++ b/sbin/nvmecontrol/modules/intel/intel.c @@ -61,18 +61,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)); } /*