From nobody Thu Oct 12 23:48:29 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 4S65tj5Z1nz4x5cb; Thu, 12 Oct 2023 23:48:29 +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 4S65tj53Zgz4T25; Thu, 12 Oct 2023 23:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697154509; 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=o85CXNxCGqo1vCtNv4uxS2FzhqSYAv8E/jwGfcxmplg=; b=G9CK4slta4XdzJr2xVQ9CJzE9qZKp+/aAKpfI4xXjcB5iXlOlMQnrYGygunBu8nIRO5BJI rN5S4yO5NGvu9BkpQErQoyuULlV/4cQTfxJ6hzsrHi5esn4/p/Ube1nj0aRva/m5EPno+1 ZMsdHSXWZUKbu78dUj+I0fv07wgkfb8I/lnjH1MoVuSxmicU3bvjV8wQ7kIOHxx3eXAXjT if1C5NsEJx0McVySwlTWl9WqodckuJ0U3Hco0s5aNJL1Nw5U3nbjLcNUOq1z8yLhr5QfWc I9Gn35XXmV8rIWlIMC/JUraDuEkah786zi2Is98NM2Mpa/7LT61LvImORSHp5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697154509; a=rsa-sha256; cv=none; b=rnvgGtKQKqPA0BOWX4I3KptetEqic8tLvUAJ7RUgqZF1r9OO1Qbe67NXaREAM/546sT2dn c4KJQ7e0fXa3JpvS22JpZig1bFLhfaIiISJsO6KfB1Na/cR95qjxfaAUVvVX9SQCScBBa9 8YK4ivc/Xda11YJ6EHpT8URpIWEdWuZIE8DrnZ6mTcbDLAvetq1iJPsGaNXoy2kWSis5I9 imRVcgZdIzPZFjRvVuHMbEl5QKU6M2+nAWyM/gTlUgby2eGL8WCvG6lTs90f6itrJ0dSvW FpSZ4R0tfvPKNSDWwfLMoClBXbKa5Z5USlGaLCEUFA6YEGXlGxOhE2A+Lr3PIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697154509; 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=o85CXNxCGqo1vCtNv4uxS2FzhqSYAv8E/jwGfcxmplg=; b=sSitQz00oTql/5X4Albziwrdwj2DIo2HJ/9FSpnMGsQcvcNUtVDhroTuUCEIKdbPAlXgKz zEycPafbUixAGwO21U2vNrd2JRPvMsD/odKzYx+r1tS7KVEhf4EqIQZ8oSaH9CDBhp+hZ/ S/pT17+1NxWNy8V/ujhsT4B+UhuB6zR3ItdPng236rXpepRseh5J+8RQFEQ2xZjruuVy0q yRegs17hpSWJ18/zlJxVEP0AqLLvKyb0DXyDiuvmwMaS2EWhlIPQHku11E7DMUdLwG+3Yc eF7G6LZk6lNUU9rT+BHxIFrozjCaGVgHxc0C7PTttZJeL/VVKRqhjKXzQj46nA== 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 4S65tj461Qz9Sb; Thu, 12 Oct 2023 23:48:29 +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 39CNmTmJ022249; Thu, 12 Oct 2023 23:48:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39CNmT9Q022246; Thu, 12 Oct 2023 23:48:29 GMT (envelope-from git) Date: Thu, 12 Oct 2023 23:48:29 GMT Message-Id: <202310122348.39CNmT9Q022246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chuck Tuffli Subject: git: 32557d16e2c3 - main - bhyve nvme: Add NQN value 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: chuck X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32557d16e2c3c24c04eccfafd895e1514dc65b35 Auto-Submitted: auto-generated The branch main has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=32557d16e2c3c24c04eccfafd895e1514dc65b35 commit 32557d16e2c3c24c04eccfafd895e1514dc65b35 Author: Chuck Tuffli AuthorDate: 2023-10-12 22:04:17 +0000 Commit: Chuck Tuffli CommitDate: 2023-10-12 22:08:05 +0000 bhyve nvme: Add NQN value Add a NVMe Qualified Name (NQN) to the Controller Data structure using the "first format" (i.e., "... used by any organization that owns a domain name" Section 7.9 NVM-Express 1.4c 2021.06.28 Ratified). This avoids a Linux kernel warning about a missing or invalid NQN. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42058 --- usr.sbin/bhyve/pci_nvme.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index d1b15d6f3a3c..2fd49a84c768 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -514,6 +514,7 @@ static void pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) { struct nvme_controller_data *cd = &sc->ctrldata; + int ret; cd->vid = 0xFB5D; cd->ssvid = 0x0000; @@ -583,6 +584,13 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT; cd->vwc = NVME_CTRLR_DATA_VWC_ALL_NO << NVME_CTRLR_DATA_VWC_ALL_SHIFT; + + ret = snprintf(cd->subnqn, sizeof(cd->subnqn), + "nqn.2013-12.org.freebsd:bhyve-%s-%u-%u-%u", + get_config_value("name"), sc->nsc_pi->pi_bus, + sc->nsc_pi->pi_slot, sc->nsc_pi->pi_func); + if ((ret < 0) || ((unsigned)ret > sizeof(cd->subnqn))) + EPRINTLN("%s: error setting subnqn (%d)", __func__, ret); } static void @@ -3309,7 +3317,6 @@ pci_nvme_init(struct pci_devinst *pi, nvlist_t *nvl) pci_nvme_aen_init(sc); pci_nvme_reset(sc); - done: return (error); }