git: 824530a5c4fd - main - nda: Assume all cases in ndaasync can sleep
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 03 Mar 2026 18:01:17 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=824530a5c4fd59427cda0eae0a4ac85212814958
commit 824530a5c4fd59427cda0eae0a4ac85212814958
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2026-03-03 18:00:15 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-03-03 18:00:15 +0000
nda: Assume all cases in ndaasync can sleep
The error recovery is nicer if we can wait for the tiny memory we need
to send the messages when the physpath changes. Since we've moved the
async handler into a sleepable context, we can wait for the allocation
to complete since async events are rare enough and it's not an
indefinite wait.
Also add a comment about the scope of AC_ADVINFO_CHANGED for nvme
drives. We could use it for broadcasting INDENTIFY changes in nvme
drives. However, the underlying mechanisms in NVMe don't really allow
for that (they are more fine-grained). So for namespace changes, for
example, we'll send AC_GETDEV_CHANGED instead of a AC_ADVINFO_CHANGED.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D55523
---
sys/cam/nvme/nvme_da.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index a1114ffe8a44..be578bae5da5 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -782,11 +782,19 @@ ndaasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
{
uintptr_t buftype;
+ /*
+ * Note: In theory, we could send CDAI_TYPE_NVME_* events here,
+ * but instead the rescan code only sends more specific
+ * AC_GETDEV_CHANGED. There's no way to generically get
+ * notifications of changes to these structures from the drive
+ * (though we could notice with memcmp). The automation in NVME
+ * is at a much more granular level, so we leverage that.
+ */
softc = periph->softc;
buftype = (uintptr_t)arg;
if (buftype == CDAI_TYPE_PHYS_PATH) {
disk_attr_changed(softc->disk, "GEOM::physpath",
- M_NOWAIT);
+ M_WAITOK);
}
break;
}