From nobody Sun Jan 28 23:54:25 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 4TNSvj48gWz57Zdn; Sun, 28 Jan 2024 23:54:25 +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 4TNSvj3h7mz4jjK; Sun, 28 Jan 2024 23:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706486065; 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=0VMwb8pLXF/rQ28bYOW5j+ORPl65lyAcoCAjfDs6SPA=; b=epLjZKXVbs8nhcE0jm7tTcHWwSj3D3jDFy4RSOgd2Bx+V0/HUKWwIL2dGCMuLC9WdDQ4sw J33oIsj6L5//0Y5OazUZ6HxdTmQKs7LUYLj0zv1djg6gW7EN1EhUX3LiLkLTC1Tj4vkvbG ML9p7WBp/WpZnFlnAO63y5lv8PfBFTViMuRjOxZ/TVMEawpA4+ye9TD9Aa5OomK+DJvQCp HwG056dVgq2LpKV7uAng/4vwvhqyr2WlQt2/ot9MiydYigo+mnR4/+XgKDVUbaAD7ClT2Z FrQvsEMkwiMswxtPDz4BA90NK2i3FMYtZ1x4H/4vjfRJcwMIXt2Ecl7QXwaaOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706486065; 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=0VMwb8pLXF/rQ28bYOW5j+ORPl65lyAcoCAjfDs6SPA=; b=BYOmJONqrqS1Plegbn4ep2McBRkwwiU+sShDIqN8rrbUdNLPLzovxI2OzwlppcYL3lY+IG CcOVkMC3E6jHMQCx5bWXlz0qFzyfspMrKHVVX/M3FmINKppDg/i4k9jLYqJnluZbCIY6NF Amio50oz57W3xs9xi11G9soOnDRItBgozxjNWOX9XjKSppPE67m3rD6h5sX8VfB+mrz8FV 6ncT0FP/S+sCONLmT7g8Mk7GOE/VWmc88kOcyk86oC+rq5gXSlIBXUxXNg2+5r39VtICay 5K2X1cCdwknxtyTZyyduh+jewwN9wj6b2EMRPk9iFuHUMch+LwN9T2kuknqJdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706486065; a=rsa-sha256; cv=none; b=Uo6fQmhvBLuobGEp0/Fo6esCmusvnKuL2AUTAVbmLkKcKgPlmDIaR47V4pe/D/1WXU9YGp WwfaDCblQQCtRZg2SIId7v5hqJoQYHZwUvTyA8uiYk0FcKdv1XnCDgjFgpb5oiX5QaB+B7 UmLds2oZ2A/HS015Uzr7vc9vOCxpxePPE8VEJzN16EpwmmIAeobIzMHep5sr6epJyObHs+ oFac/RqzFWf57/SHii+uD6uSPW5G+S94V2xs4psZBwA7rl9qd8u5/BypjVGdnniSk30vHZ rFZbvM51pz9LPGUVMtWRlQb4bAGDAWQrFEanme/otHZhvFlNMzTmUknqhTFvMg== 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 4TNSvj2kQSzSBM; Sun, 28 Jan 2024 23:54:25 +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 40SNsPBv020250; Sun, 28 Jan 2024 23:54:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40SNsPjF020247; Sun, 28 Jan 2024 23:54:25 GMT (envelope-from git) Date: Sun, 28 Jan 2024 23:54:25 GMT Message-Id: <202401282354.40SNsPjF020247@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: dca696965fda - 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: dca696965fdaee80f91d44cc210bae380ce6b56b Auto-Submitted: auto-generated The branch stable/14 has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=dca696965fdaee80f91d44cc210bae380ce6b56b commit dca696965fdaee80f91d44cc210bae380ce6b56b Author: Chuck Tuffli AuthorDate: 2023-10-12 22:04:17 +0000 Commit: Chuck Tuffli CommitDate: 2024-01-29 05:19:00 +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); }