From nobody Mon Aug 07 22:45:38 2023 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 4RKWcg2YF0z4mT0c; Mon, 7 Aug 2023 22:45:39 +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 4RKWcg1Mjxz4Nqf; Mon, 7 Aug 2023 22:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691448339; 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=oIDRkzHI4wmHypdO4JZpYkASnkJR0ZsNds7QTRbTpwU=; b=fti2HLXBROg90rN1sn5uwUHKJ1RmPUUCIKWO2KUerUFINgiApHf+lKcRpKf1UNbo+Jfj9K 1B0nQx4zxpAVFm4Yl/Iil3rI4JIgIZ4PDw+WNU6dnh/1Yb0/JNL01bgX/8MIPY6XIsNYqo 1q5T+BazYWRQ1weMyr6P9PsL3QlHnfSAKa0zQD3ZhEJT03aFYuTf+CngJAK7qwxnf60JVE zAOUSf5DxVIsnmwwpc3NQ7TLmhlqxKPjzlyiyZOEFmifWlz4eTRiUXJHSCsSDTD0MTEKwp kFNv5mtBAHIdp6fZq977+OLmAvIp306stt3iG9ldkvvwMceLGM7PebQVuUcU4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691448339; 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=oIDRkzHI4wmHypdO4JZpYkASnkJR0ZsNds7QTRbTpwU=; b=IX7P4ZW/oPUPbhVJdoRw4o699fktBrsdOO5jtinWlzzp5X+GhjKpyxRS7h6z7uHtjISfp/ PrdQ/Ken4rojZf4e+/PTFEchcuYnVvhvi83VYAljIhW+SQXEYZF/cK007DT9sSrdk+la+L ofT0uvWV5gVkbNXyRXilhkHIaR1XjCEpZ2E4P+sVvmNCvcRcqePMGNQc/H66Vu4c64qhUL EycBCa9CAURFiKB7ya4XSnLrp/WvPDCHZXd4M5LAdkb3wd7IEepRdJ02ziQ43yx320I8yD OFJPqteeBr8Kk1QhxEEz5kAdiVpeCpY20HXn8Z6OxY8BW3DONuSyhChqG6+PRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691448339; a=rsa-sha256; cv=none; b=YsRUbI2NQSmkGgQs+nwj2txR6wmfCKLjT1jc4kdZoZ6Ae6hzJ0fVMTJcyxEi9pq86HQ1S+ 5qScL7b13re9xxew5XoGpqrRN+KyDAL8haSJpbKGBMsu8sNBz4MO+zwhdxWBrlRYrCEBog bK+5IvhP/K5vXb5WiXfxD4IsMJp45jaQVIarWm/Szm4VjyjxKv8kqd8Q89ldnEeGXADJwn 8uE9au/3g6DnO6WnNgN0RmUZu4bMxwsNUmwwpREpZfya0m6vbGta877jFklQoAOFFkWF7U kr4bD4ayhPSYUO9X6GxLcO5RbHymhpe+ORr7LKHTgcDtWBoHwbrA0jODQA9P8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RKWcf70lGz18jC; Mon, 7 Aug 2023 22:45:38 +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 377Mjc5u058611; Mon, 7 Aug 2023 22:45:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 377MjcuC058610; Mon, 7 Aug 2023 22:45:38 GMT (envelope-from git) Date: Mon, 7 Aug 2023 22:45:38 GMT Message-Id: <202308072245.377MjcuC058610@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: 7be0b0688538 - main - nvme: Remove duplicate command printing routine 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 7be0b0688538ced679254703076b34c4e9eb507c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7be0b0688538ced679254703076b34c4e9eb507c commit 7be0b0688538ced679254703076b34c4e9eb507c Author: Warner Losh AuthorDate: 2023-08-07 22:34:54 +0000 Commit: Warner Losh CommitDate: 2023-08-07 22:44:30 +0000 nvme: Remove duplicate command printing routine Both nvme_dump_command and nvme_qpair_print_command print nvme commands. The former latter better. Recode the one call to nvme_dump_command to use nvme_qpair_print_command and delete the former. No sense having two nearly identical routines. A future commit will convert to sbuf. Sponsored by: Netflix Reviewed by: chuck, mav, jhb Differential Revision: https://reviews.freebsd.org/D41309 --- sys/dev/nvme/nvme.c | 13 ------------- sys/dev/nvme/nvme_private.h | 3 ++- sys/dev/nvme/nvme_qpair.c | 2 +- sys/dev/nvme/nvme_sysctl.c | 2 +- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/sys/dev/nvme/nvme.c b/sys/dev/nvme/nvme.c index 22d197dc9367..1b06e674551c 100644 --- a/sys/dev/nvme/nvme.c +++ b/sys/dev/nvme/nvme.c @@ -82,19 +82,6 @@ nvme_shutdown(device_t dev) return (0); } -void -nvme_dump_command(struct nvme_command *cmd) -{ - - printf( -"opc:%x f:%x cid:%x nsid:%x r2:%x r3:%x mptr:%jx prp1:%jx prp2:%jx cdw:%x %x %x %x %x %x\n", - cmd->opc, cmd->fuse, cmd->cid, le32toh(cmd->nsid), - cmd->rsvd2, cmd->rsvd3, - (uintmax_t)le64toh(cmd->mptr), (uintmax_t)le64toh(cmd->prp1), (uintmax_t)le64toh(cmd->prp2), - le32toh(cmd->cdw10), le32toh(cmd->cdw11), le32toh(cmd->cdw12), - le32toh(cmd->cdw13), le32toh(cmd->cdw14), le32toh(cmd->cdw15)); -} - int nvme_attach(device_t dev) { diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 95915902642e..9d82c8fba69c 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -443,7 +443,8 @@ void nvme_ns_destruct(struct nvme_namespace *ns); void nvme_sysctl_initialize_ctrlr(struct nvme_controller *ctrlr); -void nvme_dump_command(struct nvme_command *cmd); +void nvme_qpair_print_command(struct nvme_qpair *qpair, + struct nvme_command *cmd); void nvme_qpair_print_completion(struct nvme_qpair *qpair, struct nvme_completion *cpl); diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index a09be6bba7d9..40c9f6053b95 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -174,7 +174,7 @@ nvme_io_qpair_print_command(struct nvme_qpair *qpair, } } -static void +void nvme_qpair_print_command(struct nvme_qpair *qpair, struct nvme_command *cmd) { if (qpair->id == 0) diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c index a48dad04d90f..24c397973fbc 100644 --- a/sys/dev/nvme/nvme_sysctl.c +++ b/sys/dev/nvme/nvme_sysctl.c @@ -72,7 +72,7 @@ nvme_dump_queue(struct nvme_qpair *qpair) for (i = 0; i < qpair->num_entries; i++) { cmd = &qpair->cmd[i]; printf("%05d: ", i); - nvme_dump_command(cmd); + nvme_qpair_print_command(qpair, cmd); } }