Page MenuHomeFreeBSD

nvme: nvd/nda call disk_resize() when namespace changed async event happened
Needs ReviewPublic

Authored by wanpengqian_gmail.com on Nov 17 2021, 9:03 AM.

Details

Reviewers
imp
chuck
jhb
Group Reviewers
cam
Summary

Take D32963 and make nvd/nda resize after namespace changed async event trigger.

create a new thread and this thread will update namespace data when needed.

nvd can now call resize_disk() and update the disk size properly.

for nda, after NVME_PROBE_IDENTIFY_NS is finish, fire a AC_GETDEV_CHANGED event,
and it will call resize_disk() to adjust disk size.

Test Plan

When bhyve vm resize disk, verify diskinfo output inside guest, both nvd and nda.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 42838
Build 39726: arc lint + arc unit

Event Timeline

imp requested changes to this revision.Nov 17 2021, 4:04 PM

Like I said before, we shouldn't be basing this off the async callback, but instead the namespace change stuff.
Namespaces can arrive and depart, and this doesn't cope with that aspect of things, just the size change.

sys/cam/nvme/nvme_da.c
719

You can't do this in the kernel. the stack is too small.

955

I think this should be after we set the other parameters.

sys/dev/nvme/nvme.c
281

No. Like I said before, we do not want to parse the NVME log pages in the clients. This change is wrong.

sys/dev/nvme/nvme_ctrlr.c
760

I think this is wrong on many levels.

sys/dev/nvme/nvme_sim.c
361

this is also wrong. It doesn't handle the multiple name spaces arriving or departing. It only handles the size change.

This revision now requires changes to proceed.Nov 17 2021, 4:04 PM
wanpengqian_gmail.com retitled this revision from nvme: nda call disk_resize() when namespace changed async event happened to nvme: nvd/nda call disk_resize() when namespace changed async event happened.Dec 1 2021, 8:38 AM
wanpengqian_gmail.com edited the summary of this revision. (Show Details)
wanpengqian_gmail.com added inline comments.
sys/cam/nvme/nvme_da.c
719

OK, remove this output.

955

Yes, I did not match the original sequence.

sys/dev/nvme/nvme_ctrlr.c
760

since notify_ns will query the namespace, that will cause kernel panic. here we post a query request to queue. other thread will query and construct_ns and call notify_ns after that.

sys/dev/nvme/nvme_sim.c
361

I will not use async callback this time.

wanpengqian_gmail.com marked an inline comment as done.

after NVME_PROBE_IDENTIFY_NS is done, fire a AC_GETDEV_CHANGED async event.

wanpengqian_gmail.com edited the test plan for this revision. (Show Details)