Page MenuHomeFreeBSD

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

Authored by wanpengqian_gmail.com on Wed, Nov 17, 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.

nda part still no luck, since cam part has an namespace data copy, without update this data copy,
disk_resize() still use the old size. by now I have no idea how to make it happen.

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 43079
Build 39967: arc lint + arc unit

Event Timeline

imp requested changes to this revision.Wed, Nov 17, 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
716

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

938

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

sys/dev/nvme/nvme.c
281 ↗(On Diff #98635)

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
380

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.Wed, Nov 17, 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.Wed, Dec 1, 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
716

OK, remove this output.

938

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
380

I will not use async callback this time.