From owner-svn-src-all@freebsd.org Fri Jul 19 00:32:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ECA6B5716; Fri, 19 Jul 2019 00:32:57 +0000 (UTC) (envelope-from imp@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A98780B72; Fri, 19 Jul 2019 00:32:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 556F7187F9; Fri, 19 Jul 2019 00:32:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6J0Wv3h035580; Fri, 19 Jul 2019 00:32:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6J0Wu1P035577; Fri, 19 Jul 2019 00:32:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907190032.x6J0Wu1P035577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 00:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350120 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 350120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A98780B72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 00:32:57 -0000 Author: imp Date: Fri Jul 19 00:32:56 2019 New Revision: 350120 URL: https://svnweb.freebsd.org/changeset/base/350120 Log: 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 Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Fri Jul 19 00:15:25 2019 (r350119) +++ head/sys/dev/nvme/nvme.c Fri Jul 19 00:32:56 2019 (r350120) @@ -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"); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Jul 19 00:15:25 2019 (r350119) +++ head/sys/dev/nvme/nvme_private.h Fri Jul 19 00:32:56 2019 (r350120) @@ -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 { Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 00:15:25 2019 (r350119) +++ head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 00:32:56 2019 (r350120) @@ -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