Page MenuHomeFreeBSD

bhyve NVMe controller will accept model/rev config.
AbandonedPublic

Authored by wanpengqian_gmail.com on Jun 22 2020, 8:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 19 2024, 11:02 PM
Unknown Object (File)
Dec 20 2023, 8:55 PM
Unknown Object (File)
Dec 8 2023, 4:13 AM
Unknown Object (File)
Sep 30 2023, 8:07 PM
Unknown Object (File)
Jun 30 2023, 5:55 PM
Unknown Object (File)
May 8 2023, 4:13 PM
Unknown Object (File)
Mar 22 2023, 7:36 AM
Unknown Object (File)
Mar 4 2023, 11:08 AM
Subscribers

Details

Reviewers
grehan
jhb
chuck
Group Reviewers
bhyve
Summary

Currently bhyve NVMe controller has hard coded information of Firmware Revision and Model Number.

This patch will let NVMe controller accept such values.

Test Plan

Boot to Windows/Linux/FreeBSD guests.
check the setting value is correct or not.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31911
Build 29462: arc lint + arc unit

Event Timeline

jhb added inline comments.
usr.sbin/bhyve/pci_nvme.c
2034

Please place the variable declaration at the start of the function.

This revision is now accepted and ready to land.Jun 22 2020, 10:11 PM
This revision now requires review to proceed.Jun 23 2020, 1:22 AM
chuck requested changes to this revision.Jun 23 2020, 1:47 PM

Overall, I like these changes but would prefer to keep the Controller Data initialization together.

usr.sbin/bhyve/pci_nvme.c
347

I think it would be better to keep all of the Controller Data initialization in this function instead of splitting it between here and pci_nvme_parse_opts

2035

It might be useful to use the __FreeBSD_version value here to convey information about the host/hypervisor and help in debug.

This revision now requires changes to proceed.Jun 23 2020, 1:47 PM
usr.sbin/bhyve/pci_nvme.c
347

In function pci_nvme_init(), pci_nvme_parse_opts() is called first than this function. If keep all the initialization here. we have to know whether user specify these values before or not. it will require extra judgement.
further more, pci_nvme_parse_opts() also have some sc initialization code,
such as:

	sc->max_queues = NVME_QUEUES;
	sc->max_qentries = NVME_MAX_QENTRIES;
	sc->ioslots = NVME_IOSLOTS;
	sc->num_squeues = sc->max_queues;
	sc->num_cqueues = sc->max_queues;
	sc->dataset_management = NVME_DATASET_MANAGEMENT_AUTO;

Or we can move pci_nvme_parse_opts after this function called.

  • Set default Firmware Revision to __FreeBSD_version
usr.sbin/bhyve/pci_nvme.c
347

I don't mind the other soft-context initialization here, and I suspect changing the calling order of pci_nvme_parse_opts() will break other parts of initialization.

Nevertheless, it would be good to keep all of the Identify Controller initialization together. Perhaps you could add file-scope variables for each of the options and use those to save the user specified values (if any) during pci_nvme_parse_opts(). And if the user doesn't specify values, use the current values as defaults.

Normally Controller SN/MODEL/REV are the one set informations to identify the device by human.
Currently initial the SN in pci_nvme_parse_opts already.

I have moved the initial code below SN, It can be more clearly than put them in pci_nvme_init_ctrldata function as before.
while latter will require extra code for flags and extra judgement.