aboutsummaryrefslogtreecommitdiff
path: root/sbin/nvmecontrol
Commit message (Collapse)AuthorAgeFilesLines
* nvmecontrol: Display additional Fabrics-related fields for cdataJohn Baldwin2024-03-231-0/+51
| | | | | | | | | | | Some of these fields are specific to Fabrics controllers (such as the size of capsules) while other fields are shared with PCI-e controllers, but are more relevant for Fabrics controllers (such as KeepAlive timer properties). Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44449
* nvmecontrol: Update the test for a valid firmare revision slotJohn Baldwin2024-03-151-1/+1
| | | | | | Reported by: Coverity Scan CID: 1539214 Fixes: 7485926e09a0 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings
* nvme: Firmware revisions in the firmware slot info logpage are ASCII stringsJohn Baldwin2024-03-011-11/+2
| | | | | | | | | In particular, don't try to byteswap the values as 64-bit integers and always print a non-empty version as a string. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44121
* nvmecontrol.8: Fix the SYNOPSIS sectionStefan Schlosser2024-02-281-2/+2
| | | | | | | | | | | | | | | | | | | The manpage of nvmecontrol(8) has the following SYNOPSIS: nvmecontrol format [-f fmt] [-m mset] [-o pi] [-l pil] [-E] [-C] <device-id | namespace-id> The correct switch for the pi option is -p according to sbin/nvmecontrol/format.c: OPT("pi", 'p', arg_uint32, opt, pi, "Protective information") So correct the SYNOPSIS section accordingly. PR: 276554 Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D44099
* nvmecontrol(8): Fix typo in ns.cYu-Sheng Ma2024-02-131-1/+1
| | | | | | | `Insufficient` was spelled wrongly on line 537. Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/997
* nvmecontrol: Use NVMEF macro to construct fieldsJohn Baldwin2024-01-291-14/+9
| | | | | | Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43606
* nvmecontrol: Use the NVMEV macro instead of expanded versionsJohn Baldwin2024-01-2910-262/+167
| | | | | | Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43597
* sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-2720-20/+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$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-169-9/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1621-42/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* nvmecontrol: fix typosAndrius V2023-08-032-2/+2
| | | | | PR: 261911 Reviewed by: kp
* nvmecontrol.8: Fix a few formatting nits.John Baldwin2023-07-141-1/+2
|
* nvmecontrol: Fix typosElyes Haouas2023-06-022-2/+2
| | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/653
* nvmecontrol: Fix power subcommand output.Alexander Motin2023-05-151-2/+3
| | | | | | The returned value consists of two fields. Report them separately. MFC after: 2 weeks
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1223-23/+23
| | | | | | | | | 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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+1
|
* nvmecontrol(8): fix resv register -i synopsisYuri Pankov2023-03-271-2/+2
| | | | | | | -i is "ignore existing key" and does not take argument Reviewed by: pauamma (manpages) Differential Revision: https://reviews.freebsd.org/D37709
* nvme: fix resv commands with nda deviceYuri Pankov2023-03-271-0/+4
| | | | | | | | | - passing I/O commands through nda requires nsid field to be set (it was unused when going through nvme_ns_ioctl()) - ccb's status can be OR'ed with the flags, use CAM_STATUS_MASK Reviewed by: imp (cam) Differential Revision: https://reviews.freebsd.org/D37696
* nvmecontrol: Fix default ns create parameters.Alexander Motin2023-03-091-19/+37
| | | | | | | Instead of passing 0xff's for all unset parameters, prefer reasonable defaults. It is much easier to use it this was without specs in hand. MFC after: 1 week
* nvmecontrol: Fix IEEE OUI Identifier outputWanpeng Qian2022-11-201-1/+1
| | | | | | | | | | | | Current sequence of IEEE OUI Identifier output is wrong. For Intel, current output is e4 d2 5c, specification is 5CD2E4h For Samsung, current output is 38 25 00, specification is 002538h also check with Linux nvme-cli. Reviewed by: imp, chuck MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D33856
* nvmecontrol: Fix condition when print number of Firmware Slots and Firmware ↵Wanpeng Qian2022-11-151-10/+2
| | | | | | | | | | | | | Slot1 Readonly. The Number of Firmware Slots should never be zero. So, a Firmware Slot 1 should always exist. For that reason, always print the Number of Firmware Slots and the Firmware Slot 1 Read-Only value. Reviewed by: imp Approved by: manu (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34700
* nvmecontrol: fix wrong temperature unit for INTEL SSDs.Wanpeng Qian2022-11-114-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-262-2/+2
| | | | | | | | 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: use uintmax_t for a sizeWarner Losh2022-10-081-1/+1
| | | | | | | | Use uintmax_t cast to print the size of the device for the non-humanize case to avoid issues with 32-bit longs. Fixes: 9c1bec9c21a2 Sponsored by: Netflix
* nvmecontrol: improve namespace size unit of devlist command outputWanpeng Qian2022-10-072-6/+39
| | | | | | | | | Add an option of -h --human to output human readable size unit instead of the fixed unit (MB). Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: imp, bcr Differential Revision: https://reviews.freebsd.org/D32957
* 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-064-2/+175
| | | | | | | | | | 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
* Correct a typo in a string literal.Jens Schweikhardt2022-06-071-1/+1
|
* nvmecontrol(8): Fix a typo in an error messageGordon Bergling2022-06-041-1/+1
| | | | | | - s/insufficent/insufficient/ MFC after: 3 days
* nvme: fix spelling of NamespaceChuck Tuffli2022-02-211-1/+1
| | | | | | | Fix spelling of a macro definition. Reviewed by: mav, imp Differential Revision: https://reviews.freebsd.org/D34330
* nvmecontrol: Display Metadata and Sanitize capabilities of the deviceAllan Jude2021-09-212-1/+43
| | | | | | | | | | | | | | | | Determine if a device supports "Extended" or "Separate" metadata, and what the current metadata setting is (None, Extended, Separate) Also determine if the device supports: - Sanitize Crypto Erase - Sanitize Block Erase - Sanitize Overwrite Reviewed by: chuck Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #49 Differential Revision: https://reviews.freebsd.org/D31067
* Partially revert previous commit.Alexander Motin2021-07-141-3/+3
| | | | | | | ns identify does not allow nsid of 0xffffffff. Only general identify allows it. MFC after: 1 week
* For ns identify/delete allow nsid of 0xffffffff.Alexander Motin2021-07-141-6/+6
| | | | | | | The first should report common parameters, the second should delete all namespaces. MFC after: 1 week
* Filter out LBA formats with LBA Data Size of 0.Alexander Motin2021-07-141-0/+2
| | | | | | | According to the spec: "If the value reported is 0h, then LBA format is not supported / used or is not currently available". MFC after: 1 week
* nvmecontrol: document power commandWarner Losh2021-07-101-1/+32
| | | | | | | | | | The description of the power command is missing. While the synopsis is present, there's no explanation. Add one. Reviewed by: mav, chuck PR: 237866 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31122
* nvmecontrol: fix typo (s/Managment/Management/)Edward Tomasz Napierala2021-05-071-1/+1
| | | | Reported By: pstef
* nvmecontrol: update copyright on passthru commandWarner Losh2021-05-061-2/+1
| | | | | | | I wrote this code, not Intel, so put my copyright on this. I mistakenly copied it for the initial commit. Sponsored by: Netflix
* nvmecontrol: Report status from passthru commandsWarner Losh2021-05-061-1/+2
| | | | | | | | Report status from dword0 for passthru commands. Many commands report some status or information here, so reporting it can help know what's going on. Sponsored by: Netflix
* Fix 32-bit build post 6733401935f83754b4b2744bc3d33ef84b1271e0Dimitry Andric2021-01-081-1/+1
| | | | | | The general style in sbin/nvmecontrol apppears to print uint64_t types using %j, so I'm using that instead of the more general (but admittedly ugly) PRIu64.
* nvmecontrol: add device self-test op and log pageChuck Tuffli2021-01-084-1/+263
| | | | | | | | | | Add decoding of the Device Self-test log page and the ability to start or abort a test. Reviewed by: imp, mav Tested by: Muhammad Ahmad <muhammad.ahmad@seagate.com> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27517
* nvmecontrol(8): Fix a few mandoc related issues and add a SEE ALSO sectionGordon Bergling2020-12-191-5/+9
| | | | | | | | | | | | | | | - inserting missing end of block: Ss breaks Bl - skipping paragraph macro: Pp before Ss - referenced manual not found: Xr nvme 4 (2 times) - unknown standard specifier: St The The macro .St can only be used for standards known by mdoc(7). So add a SEE ALSO section and add a reference to the NVM Express Base Specification. MFC after: 2 weeks Notes: svn path=/head/; revision=368802
* Make use of the getlocalbase() function for run-time adjustment of theStefan Eßer2020-11-182-2/+5
| | | | | | | | | | | | | | | | | | local software base directory, as committed in SVN rev. 367813. The pkg and mailwrapper programs used the LOCALBASE environment variable for this purpose and this functionality is preserved by getlocalbase(). After this change, the value of the user.localbase sysctl variable is used if present (and not overridden in the environment). The nvmecontrol program gains support of a dynamic path to its plugin directory with this update. Differential Revision: https://reviews.freebsd.org/D27237 Notes: svn path=/head/; revision=367816
* [nvmecontrol] Fix type signedness warning-to-error on gcc-6.4Adrian Chadd2020-11-171-4/+4
| | | | | | | | | | | | This fixes a type signedness comparison warning-to-error on gcc-6.4. The ternary operation casts it right but the actual assignment doesn't. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26791 Notes: svn path=/head/; revision=367771
* Stop using NVME_MAX_XFER_SIZE constant.Alexander Motin2020-11-172-10/+14
| | | | | | | | | | 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
* Revert the whole getlocalbase() set of changes while a different design isScott Long2020-11-153-11/+4
| | | | | | | hashed out. Notes: svn path=/head/; revision=367711