From nobody Wed Dec 10 22:53:49 2025 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 4dRWH15KKXz6Jq9Q for ; Wed, 10 Dec 2025 22:53:49 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dRWH134c4z3PV5 for ; Wed, 10 Dec 2025 22:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765407229; 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=Yi4mU1kMx2A/AhwM2qKnBUMcmrAuiG6nXw7oQ7RAXGU=; b=vay2+llj/GIzkHpklY/r3nRn0Gzpr6d72PQeOZ90havxryb/sp2DP3lgEOb2tFU4qbd2Pn qtTAFtxz4FvzLwqzaT64d8bfrc+dV3KKoirDveKbIR8qtpSPMvaFRnKsaYt9anf68BaPTR XHGaAiQTGVwpOw6FWcZYFU/BhmVQniQEuP9bOJdovryio9CLkW7hUVuI/wuf5CsGcdTP/L Y0j1IFGnB26FulwzMjF0HeFsK2PmpjxOy6kEITHjlVk9Rw5CmsPdJ4/o3Vrmw712FodlUo EO1/EiskFsCIQaratZr9GBteczhpdj1fVa7Ezl39pyymqyGKzYuZGeWc4Ven6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765407229; 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=Yi4mU1kMx2A/AhwM2qKnBUMcmrAuiG6nXw7oQ7RAXGU=; b=NNKhl4gShtRcu1PY3fZiYxVvsnhj6wqth7AxHjBqz4Y98yGIuj59QjLYvWrcrAz8tt8iRh WOhzxfI7uZqYCtxUtwgJoJLsUmnbjVgwaPZhBLVWJP5WtJSS8wa5v7wvV48H0kEBfLQDIR D1hTVyApYpfLTZjNEb9MDiWsZN/tqOgovxBQ8GTvwIdpA7wmvZ4DUhVXaBvGLqc3XrkIEb rwGoOPyNc6iefK8YTE6feuxv5wA+sUdU0+m54MAzn6kl9f+AjYmVZcY5gxqA/OSSy6QUng bozayo9sIAY27ATZIke+sNDCq5leelSfbxB2CjDIwu27ws7300QH9Q37ybIrrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765407229; a=rsa-sha256; cv=none; b=KKH9g4U3k+Tkt4Kly/sYB/aNTtX4WdIDQR0BplOP8xcCICcLGAYyHEQFpYe1SkKMX2traj tZCg1az/D6Yw0l0E8/VvyewItkYBCk6OWvYg/ZMOJtkAJNXYVDEOiv2Qj4aga9Lw3bFISF M9YQ8iwybI/KeMLlAOYIyhk2L0RXUch9kIygbkDzUSBQtB+fho00G0J4xQBcnSbrJLgSg6 PZbq7rPdqO+uLdyE1k6F/5Ik6cqG8njmK6v2isKGMWysDykcUJ+nBgjExBjG/SMOCWKLpf l8jmgUYm/uN6o2gfqa+E9ty/vMSq58xaQG501lcqeLj8YB0dHpLrdPBCkTLwjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dRWH12P6Lz14bn for ; Wed, 10 Dec 2025 22:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b10f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 10 Dec 2025 22:53:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e5c770dc7ff3 - main - nvme: Nvme controller generated events 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: e5c770dc7ff3fa71189addcafd30c333ff496de1 Auto-Submitted: auto-generated Date: Wed, 10 Dec 2025 22:53:49 +0000 Message-Id: <6939f9fd.b10f.169825a4@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e5c770dc7ff3fa71189addcafd30c333ff496de1 commit e5c770dc7ff3fa71189addcafd30c333ff496de1 Author: Warner Losh AuthorDate: 2025-12-10 22:52:10 +0000 Commit: Warner Losh CommitDate: 2025-12-10 22:52:10 +0000 nvme: Nvme controller generated events Interface for the nvme driver notifying its children of different events: async notifications, namespace events and device failure. These aren't yet connected. Sponsored by: Netflix Reviewed by: dab Differential Revision: https://reviews.freebsd.org/D51386 --- sys/conf/files | 1 + sys/dev/nvme/nvme_if.m | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/sys/conf/files b/sys/conf/files index 3314274b47a8..9c5220c7befa 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2571,6 +2571,7 @@ dev/nvme/nvme_sim.c optional nvme scbus dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme | scbus +dev/nvme/nvme_if.m optional nvme dev/nvmem/nvmem.c optional nvmem fdt dev/nvmem/nvmem_if.m optional nvmem dev/nvmf/controller/ctl_frontend_nvmf.c optional nvmft diff --git a/sys/dev/nvme/nvme_if.m b/sys/dev/nvme/nvme_if.m new file mode 100644 index 000000000000..a89381d165f7 --- /dev/null +++ b/sys/dev/nvme/nvme_if.m @@ -0,0 +1,55 @@ +# Copyright (c) 2025 Netlix, Inc +# +# SPDX-License-Identifier: BSD-2-Clause +# + +# Interface from the NVME controller to its children to notify it of certain +# interesting events. + +INTERFACE nvme; + +HEADER { + #include "dev/nvme/nvme_private.h" +}; + +# +# A new namespace is now available +# +METHOD int ns_added { + device_t dev; /* nvme device */ + struct nvme_namespace *ns; /* information about the namespace */ +}; + +# +# A namespace has been removed +# +METHOD int ns_removed { + device_t dev; /* nvme device */ + struct nvme_namespace *ns; /* information about the namespace */ +}; + +# +# A namespace has been changed somehow +# +METHOD int ns_changed { + device_t dev; /* nvme device */ + struct nvme_namespace *ns; /* information about the namespace */ +}; + +# +# The controller has failed +# +METHOD int controller_failed { + device_t dev; /* nvme device */ +}; + +# +# Async completion +# +METHOD int handle_aen { + device_t dev; /* nvme device */ + const struct nvme_completion *cpl; /* Completion for this async event */ + uint32_t pg_nr; /* Page number reported by async event */ + void *page; /* Contents of the page */ + uint32_t page_len; /* Length of the page */ +};