Page MenuHomeFreeBSD

bhyve: implement NVMe Format NVM command
ClosedPublic

Authored by chuck on May 18 2020, 3:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 11:32 AM
Unknown Object (File)
Wed, Mar 27, 10:57 PM
Unknown Object (File)
Jan 26 2024, 8:48 AM
Unknown Object (File)
Jan 12 2024, 6:38 PM
Unknown Object (File)
Dec 22 2023, 11:56 PM
Unknown Object (File)
Dec 19 2023, 11:10 PM
Unknown Object (File)
Oct 19 2023, 3:46 AM
Unknown Object (File)
Sep 30 2023, 3:42 AM

Details

Summary

The Format NVM command mainly allows the host to specify the block size
and protection information used for the Namespace. As the bhyve
implementation simply maps the capabilities of the backing storage
through to the guest, there isn't anything to implement. But a side
effect of the format is the NVMe Controller shall not return any data
previously written (i.e. erase previously written data). This patch
implements this later behavior to provide a compliant implementation.

Fixes UNH Test 1.6

Test Plan

Run UNH IOL INTERACT tests

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

chuck requested review of this revision.May 18 2020, 3:52 PM
wanpengqian_gmail.com added inline comments.
usr.sbin/bhyve/pci_nvme.c
1293 ↗(On Diff #71937)

Can we zero all the memory instead of free and calloc again? calloc may not success in some situcation.

usr.sbin/bhyve/pci_nvme.c
1293 ↗(On Diff #71937)

This is a fair question and one I've gone back and forth on several times. I found some commentary that the calloc implementation could determine which previously zeroed pages were unwritten and thus still zeroed. The intent of this approach was to allow the memory allocator to use its knowledge of "dirty" pages to only zero out pages that had been written.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 29 2020, 12:32 AM
This revision was automatically updated to reflect the committed changes.