aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2026-03-03 18:00:15 +0000
committerWarner Losh <imp@FreeBSD.org>2026-03-03 18:00:15 +0000
commit824530a5c4fd59427cda0eae0a4ac85212814958 (patch)
tree25efdb6dd646e4494a8d7356d14b26a2f9daf78c
parent244ae85eb97548fd81783f079ee26e0aa9f4b984 (diff)
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
-rw-r--r--sys/cam/nvme/nvme_da.c10
1 files changed, 9 insertions, 1 deletions
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;
}