From nobody Sun Jan 28 01:25:52 2024 X-Original-To: dev-commits-src-all@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 4TMtzh391Vz57Mdr; Sun, 28 Jan 2024 01:25:52 +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 4TMtzh2dkDz4cnN; Sun, 28 Jan 2024 01:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706405152; 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=Xu5GE1qeSg3Zxovw/SDoQe0H9mdnkqaQ1PhpwhbpsqI=; b=qhbUD1zJajjXNwVwboshcqp2dis61BmH64EkYX7wQLSC6NKou4guISKegbLSn7YWNUwxQQ 3LVw8t3wP460SjwX1mKBmUyYosHs/9RbjuVuyfbbUvr+wYDq9YZv2NVPHzHgME626/xDHR sAdy48pckmyHuCZwhqp1OP1w90+mTSHZf4SMYteO5NuZmaVegrQwRiPavQ7Br5bB9lnnna Yw7D3ViLu4R9lUA1F2vWgPLVDNVfAarp7jIHgrX7QnZVYZy6HlYqO9e+xDARziNeq3ah1B H3F1bJofzREPD+QOsOuNJLzMFhWF0fasfNGH9zey9hmebDyUW8Z42mtcVg6wtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706405152; 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=Xu5GE1qeSg3Zxovw/SDoQe0H9mdnkqaQ1PhpwhbpsqI=; b=vLTNqBzRPSxBI7I9RBkj3sZrahtr2+L98YTZYzo/34pC71bU32lhMJKvn5nM2q6SAFFUUO mNAhgWBJUk7hQz3P6xVM5Mt8ZToOMsfuVaG/A4Zw60MTTwPs1XtqjaVvX+RhdwRe6fw/pn jGvXeFS/X0hhUoQPz0vYJsPXP4ztXSpOSusk4V+CEIrRJnyDsq7/85iQi7Qd2ydrE4qlsZ 4Ddbt9FV9dVyllrhsA9rFxl3/h4UxsE/cubNJRLHW3eDYusXSX+1h1jMxGPjXUK9jJVJJd BhG0G518eQpyKJWDUoojBQBYFxuG2Ejewn4U61n/Tq/pdbgywWbsepqDw24WqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706405152; a=rsa-sha256; cv=none; b=dpcoIgbGgyUOkcrtjSao6jwU0ig9uYpsrqTE+nVfkMQ6PmAqGcXN1/VE2BmUBa7472xW3/ tB00kUMTRVtiiFKIf1Ud9c2XTGbbyg1MWhMwl8NLsMJMwr9AQgdxbKjGw8bUWFDIKPQagO hZTRoGQ+yVOLA9Ch5LmL3BNmJJyrz/b5xi98/W0MO1n1Tghh1cijYLA/+cI46/8DXoVTjo V/n8LuIFH7NqKhXdIlFiuNw2DFxnLJd+cjSVxc7W0BJYOx/OfTeqX0GXErpaObLc3LSWeK ZqTu6yZAFldXlfI081pFKx2M7NuAdUngxGkDY/EGMDYoamSoVhqddWfeXCqiwA== 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 4TMtzh1gfrznhW; Sun, 28 Jan 2024 01:25:52 +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 40S1PqMZ046148; Sun, 28 Jan 2024 01:25:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40S1PqGF046145; Sun, 28 Jan 2024 01:25:52 GMT (envelope-from git) Date: Sun, 28 Jan 2024 01:25:52 GMT Message-Id: <202401280125.40S1PqGF046145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chuck Tuffli Subject: git: 4bd4942ea70b - stable/14 - bhyve nvme: Add NQN value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4bd4942ea70becc583246597b658f3dcdbffafde Auto-Submitted: auto-generated The branch stable/14 has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=4bd4942ea70becc583246597b658f3dcdbffafde commit 4bd4942ea70becc583246597b658f3dcdbffafde Author: Chuck Tuffli AuthorDate: 2023-10-12 22:04:17 +0000 Commit: Chuck Tuffli CommitDate: 2024-01-28 01:24:31 +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. (cherry picked from commit 32557d16e2c3c24c04eccfafd895e1514dc65b35) --- 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); }