Date: Wed, 10 Dec 2025 22:53:49 +0000 From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: e5c770dc7ff3 - main - nvme: Nvme controller generated events Message-ID: <6939f9fd.b10f.169825a4@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e5c770dc7ff3fa71189addcafd30c333ff496de1 commit e5c770dc7ff3fa71189addcafd30c333ff496de1 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2025-12-10 22:52:10 +0000 Commit: Warner Losh <imp@FreeBSD.org> 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 */ +};
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6939f9fd.b10f.169825a4>
