nvd register a callback function when namespace changed async event
happened. this will call disk_resize() properly.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 42827 Build 39715: arc lint + arc unit
Event Timeline
| sys/dev/nvd/nvd.c | ||
|---|---|---|
| 163 | But we do the following: } else if (aer->log_page_id == NVME_LOG_CHANGED_NAMESPACE &&
!nvme_use_nvd) {
nsl = (struct nvme_ns_list *)aer->log_page_buffer;
for (i = 0; i < nitems(nsl->ns) && nsl->ns[i] != 0; i++) {
if (nsl->ns[i] > NVME_MAX_NAMESPACES)
break;
nvme_notify_ns(aer->ctrlr, nsl->ns[i]);
}
}so nvd should use this and we should remove the !nvme_use_nvd which is there because we know that nvd doesn't do things right in new_disk. nvd needs some additional work to support name space arrival, though. Plus the async call is for much much more than just namespace as well... | |
| 538 | At the very least, we need to filter out all the non NMVE_LOG_CHANGED_NAMESPACE page notifications, but maybe it would be better to adapt the nvd_new_disk cope better, mostly because I want to remove the nvd hack that's in the nvme driver right now. | |
| sys/dev/nvd/nvd.c | ||
|---|---|---|
| 163 | You are right. when I test this, I remove the !nvme_use_nvd make sure async event will let nvd knows. nvme_ctrlr_cmd_identify_namespace(ctrlr, id, &ns->data,
nvme_completion_poll_cb, &status);
nvme_completion_poll(&status);
if (nvme_completion_is_error(&status.cpl)) {
nvme_printf(ctrlr, "nvme_identify_namespace failed\n");
return (ENXIO);
}I am not idea why it happens. | |
| 538 | Yes, we should have a switch here. | |
| sys/dev/nvd/nvd.c | ||
|---|---|---|
| 163 | if nvd & nda implement nvme_constroller_async() callback, do we need this here? it will call nvd_new_disk() for nvd, nvme_sim_ns_change() for nda. } else if (aer->log_page_id == NVME_LOG_CHANGED_NAMESPACE &&
!nvme_use_nvd) {
nsl = (struct nvme_ns_list *)aer->log_page_buffer;
for (i = 0; i < nitems(nsl->ns) && nsl->ns[i] != 0; i++) {
if (nsl->ns[i] > NVME_MAX_NAMESPACES)
break;
nvme_notify_ns(aer->ctrlr, nsl->ns[i]);
}
} | |