aboutsummaryrefslogtreecommitdiff
path: root/sbin/nvmecontrol/modules
Commit message (Collapse)AuthorAgeFilesLines
* nvmecontrol: Add SPDX-License-Identifier tagsTuukka Pasanen2026-02-181-0/+2
| | | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55275
* nvmecontrol: Add Intel Drive Marketing Name Log support (0xdd)Wanpeng Qian2025-08-101-0/+15
| | | | | | | | | | Add Intel Drive Marketing Name Log support (0xdd) Specification here: https://www.intel.com/content/dam/support/us/en/documents/ssdc/hpssd/sb/Intel_SSD_DC_P3600_Series_PCIe_Product_Specification-004.pdf Reviewed by: imp Differential Revsion: https://reviews.freebsd.org/D33819
* nvmecontrol: Add Micron Vendor Unique SMART logpage supportWanpeng Qian2025-08-103-1/+139
| | | | | | | | | | | | Micron 9200 SSD has a 0xca logpage. It is different from other vendors this patch tested on 9200 SSD and works as expected. Product Datasheet can be found here: https://www.micron.com/-/media/client/global/documents/products/data-sheet/ssd/9200_u_2_pcie_ssd.pdf Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: imp Differential Revsion: https://reviews.freebsd.org/D33866
* nvmecontrol: Add more keys for CA page (Additional smart data)Warner Losh2025-02-221-2/+16
| | | | | | | | | | | | | | | | Micron and Samsung also use this standard, though Micron is known to use a few different keys. Add the ones that public information say are the same among those the drives that have them. There's others, but either they aren't publicly documented in datasheets or nvme-cli code, or they vary betwen models and our code needs a fair amount of rework needed. Also print hex value for unknown keys. This allows scripts to more easily pick bytes out for those keys who have values that are encoded by packing multiple values into the 48-bit field. Sponsored by: Netflix
* Retire MK_PROFILE infrastructureEd Maste2024-11-121-1/+0
| | | | | | | | | | It was disabled by default in fe52b7f60ef4. We planned to (but did not) remove the option before FreeBSD 14. Remove it now, for FreeBSD 15. Relnotes: Yes Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31558
* Remove residual blank line at start of MakefileWarner Losh2024-07-155-5/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* nvmecontrol: Move intel temperature page printing to little endian orderinngWarner Losh2024-04-171-8/+11
| | | | | | Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44658
* sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-165-5/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* nvmecontrol: fix typosAndrius V2023-08-031-1/+1
| | | | | PR: 261911 Reviewed by: kp
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* nvmecontrol: fix wrong temperature unit for INTEL SSDs.Wanpeng Qian2022-11-112-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although intel's specification did not tell which unit for Temperature Statistics (Log Identifier C5h), I believe it is based on Celsius instead of Kelvin. here is my P3700 SSDs result(before): Intel Temperature Log ===================== Current: 30 K, -243.15 C, -405.67 F Overtemp Last Flags 0 Overtemp Lifetime Flags 0 Max Temperature 53 K, -220.15 C, -364.27 F Min Temperature 17 K, -256.15 C, -429.07 F Max Operating Temperature 63 K, -210.15 C, -346.27 F Min Operating Temperature 0 K, -273.15 C, -459.67 F Estimated Temperature Offset: 0 C/K after apply the patch, result is Intel Temperature Log ===================== Current: 303.15 K, 30 C, 86.00 F Overtemp Last Flags 0 Overtemp Lifetime Flags 0 Max Temperature 326.15 K, 53 C, 127.40 F Min Temperature 290.15 K, 17 C, 62.60 F Max Operating Temperature 336.15 K, 63 C, 145.40 F Min Operating Temperature 273.15 K, 0 C, 32.00 F Estimated Temperature Offset: 0 C/K I also compare to smartctl's report. it match very well. also tested on Intel P3600, it fixed the problem. Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: imp (added tweak to samsung.c so it still compiles) Differential Revision: https://reviews.freebsd.org/D32845
* pkgbase: Put nvmecontrol in its own packageEmmanuel Vadot2022-10-261-1/+1
| | | | | | | | It doesn't really make sense to have it in runtime and let's not bloat utilities more. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D36221
* nvmecontrol: Apply castCy Schubert2022-10-061-2/+2
| | | | | | | The proper fix also casts to uintmax_t. Reported by: imp Fixes: a7b568109ec7
* nvmecontrol: Fix i386 buildCy Schubert2022-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Fix: --- all_subdir_sbin --- /opt/src/git-src/sbin/nvmecontrol/modules/samsung/samsung.c:149:64: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] printf(" Read Reclaim Count : %lu\n", le64dec(&temp->rrc)); ~~~ ^~~~~~~~~~~~~~~~~~~ %llu /opt/src/git-src/sbin/nvmecontrol/modules/samsung/samsung.c:150:64: error: forma t specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] printf(" Lifetime Uncorrectable ECC Count : %lu\n", le64dec(&temp->lueccc)); ~~~ ^~~~~~~~~~~~~~~~~~~~~~ %llu 2 errors generated. Fixes: 84e86788705c176cc195e4a9831c0be08dcece31
* nvmecontrol: Add Samsung Extended SMART Information logpage supportWanpeng Qian2022-10-063-1/+172
| | | | | | | | | | Samsung PM983 SSD has a 0xca logpage. It has more information compared to Intel's this patch tested on PM983 M2 SSD and works as expected. Reviewed by: imp@ Approved by: kp@ Event: Aberdeen Hackathon 2022 Differential revision: https://reviews.freebsd.org/D33749
* nvmecontrol wdc: Don't pass a bogus pointer to free().John Baldwin2022-10-031-3/+3
| | | | | | | | | | wdc_get_dui_log_size allocates a buffer and then advances the returned pointer. Passing this advanced pointer to free() is UB, so save the original pointer to pass to free() instead. Reviewed by: imp Reported by: GCC 12 -Wfree-nonheap-object Differential Revision: https://reviews.freebsd.org/D36827
* nvmecontrol wdc: Remove unused but set variable.John Baldwin2022-10-031-3/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36812
* Stop using NVME_MAX_XFER_SIZE constant.Alexander Motin2020-11-171-5/+11
| | | | | | | | | | This constant depends on MAXPHYS and does not respect device capabilities. Use proper dynamic ioctl(NVME_GET_MAX_XFER_SIZE) instead. MFC after: 1 month Notes: svn path=/head/; revision=367768
* Improve nvmecontrol error reporting.Alexander Motin2020-11-131-20/+22
| | | | | | | | MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=367630
* Use intmax_t to print uint64_t values.Warner Losh2020-10-071-2/+2
| | | | | | | This fixes the 32-bit build where the types are different. Notes: svn path=/head/; revision=366511
* nvmecontrol: Update wdc module for newer WDC NVMe productsWarner Losh2020-10-071-19/+206
| | | | | | | | | | | | Update the to log fetch operation for latest WDC NVMe products. Tested on HGST SN100 (a few years old) and WDC SN720 (more recent). Submitted by: Akhilesh Rn <Akhilesh.RN@wdc.com> (minor style tweak by me) Github PR: 435 Notes: svn path=/head/; revision=366506
* Fix various Coverity-detected errors in nvmecontrolDavid Bright2020-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | This fixes several Coverity-detected errors in nvmecontrol. While in here, a couple additional errors with shift/mask confusion that were not diagnosed by Coverity are also fixed. CIDs addressed: 1040299, 1040300, 1403972, 1403973, 1403985, 1403988, 1403990, 1404374, 1404427, 1404469, 1404510, 1404534, 1418118 CID 1403657 (resource leak of shared library handle) was marked "intentional" in the Coverity scan database. Reviewed by: vangyzen, robert.herndon_dell.com Reviewed by: daniel.william.ryan_gmail.com (earlier version) Reviewed by: rramsden_isilon.com (earlier version), imp MFC after: 5 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24203 Notes: svn path=/head/; revision=359562
* Create generic command / arg parsing routinesWarner Losh2019-07-161-31/+59
| | | | | | | | | | | | | | | | | | | | | Create a set of routines and structures to hold the data for the args for a command. Use them to generate help and to parse args. Convert all the current commands over to the new format. "comnd" is a hat-tip to the TOPS-20 %COMND JSYS that (very) loosely inspired much of the subsequent command line notions in the industry, but this is far simpler (the %COMND man page is longer than this code) and not in the kernel... Also, it implements today's de-facto command [verb]+ [opts]* [args]* format rather than the old, archaic TOPS-20 command format :) This is a snapshot of a work in progress to get the nvme passthru stuff committed. In time it will become a private library and used by some other programs in the tree that conform to the above pattern. Differential Revision: https://reviews.freebsd.org/D19296 Notes: svn path=/head/; revision=350057
* Regularize the Netflix copyrightWarner Losh2019-02-041-2/+1
| | | | | | | | | | | | | | | Use recent best practices for Copyright form at the top of the license: 1. Remove all the All Rights Reserved clauses on our stuff. Where we piggybacked others, use a separate line to make things clear. 2. Use "Netflix, Inc." everywhere. 3. Use a single line for the copyright for grep friendliness. 4. Use date ranges in all places for our stuff. Approved by: Netflix Legal (who gave me the form), adrian@ (pmc files) Notes: svn path=/head/; revision=343755
* It's useful to have this be a global function.Warner Losh2018-12-061-1/+1
| | | | | | | | | | Other vendors base their additional smart info pages on what Intel did plus some other bits. So it's convenient to have this be global. Sponsored by: Netflix Notes: svn path=/head/; revision=341661
* This is not a samsung standard, so remove that alias.Warner Losh2018-12-061-4/+1
| | | | | | | | | | | This was never documented, and isn't needed, so it's best removed to avoid confusion. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18460 Notes: svn path=/head/; revision=341660
* Move intel and wdc files to their own modulesWarner Losh2018-12-066-0/+824
Move the intel and wdc vendor specific stuff to their own modules. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18460 Notes: svn path=/head/; revision=341659