Use sysctl + CTLRWTUN for hw.nvme.verbose_cmd_dump.

Also convert it to a bool. While the rest of the driver isn't yet bool clean,
this will help.

Reviewed by: cem@
Differential Revision: https://reviews.freebsd.org/D20988
This commit is contained in:
Warner Losh 2019-07-19 00:32:56 +00:00
parent 000a2e7040
commit 1071b50a65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350120
3 changed files with 5 additions and 3 deletions

View file

@ -54,9 +54,7 @@ struct nvme_consumer nvme_consumer[NVME_MAX_CONSUMERS];
uma_zone_t nvme_request_zone;
int32_t nvme_retry_count;
int nvme_verbose_cmd_dump;
TUNABLE_INT("hw.nvme.verbose_cmd_dump", &nvme_verbose_cmd_dump);
MALLOC_DEFINE(M_NVME, "nvme", "nvme(4) memory allocations");

View file

@ -114,7 +114,7 @@ MALLOC_DECLARE(M_NVME);
extern uma_zone_t nvme_request_zone;
extern int32_t nvme_retry_count;
extern int32_t nvme_verbose_cmd_dump;
extern bool nvme_verbose_cmd_dump;
struct nvme_completion_poll_status {

View file

@ -42,10 +42,14 @@ __FBSDID("$FreeBSD$");
#endif
int nvme_use_nvd = NVME_USE_NVD;
bool nvme_verbose_cmd_dump = false;
SYSCTL_NODE(_hw, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVMe sysctl tunables");
SYSCTL_INT(_hw_nvme, OID_AUTO, use_nvd, CTLFLAG_RDTUN,
&nvme_use_nvd, 1, "1 = Create NVD devices, 0 = Create NDA devices");
SYSCTL_BOOL(_hw_nvme, OID_AUTO, verbose_cmd_dump, CTLFLAG_RWTUN,
&nvme_verbose_cmd_dump, 0,
"enable verbose command printting when a command fails");
/*
* CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these