I don't see why the guest needs to know about an implementation detail of the 
host hardware.

If the host hardware is failing, that's something to be fixed on the host. The 
guest should never realize that something was broken.

Just my opinion.


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, 18 March 2020 04:05, Wanpeng Qian <wanpengq...@gmail.com> wrote:

> Hello all.
>
> I have an idea about provide SMART of nvme controller.
>
> Currently bhyve's nvme controller didn't provide any SMART information.
> if we provide fake SMART, that is meaningless.
>
> I am thinking we can read the host nvme controller SMART and provide
> that to guest.
>
> such as
>
> nvme,disk1.img,maxq=16,qsz=8,ioslots=1,sectsz=512,ser=QNVME778,smart=nvme0
>
> I have done some draft code. and it work.
> here is the output of nvmecontrol identify and logpage.
>
> root@smart:~ # nvmecontrol identify nvme0
> Controller Capabilities/Features
>
> ========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
>
> Vendor ID: fb5d
> Subsystem Vendor ID: 0000
> Serial Number: QNVME778
> Model Number: bhyve-NVMe
> Firmware Version: 1.0
> Recommended Arb Burst: 4
> IEEE OUI Identifier: 58 9c fc
> Multi-Path I/O Capabilities: Not Supported
> Max Data Transfer Size: 2097152 bytes
> Controller ID: 0x0000
> Version: 1.3.0
>
> Admin Command Set Attributes
>
> ============================================================================================================================================================================================================================================================================================================================
>
> Security Send/Receive: Not Supported
> Format NVM: Supported
> Firmware Activate/Download: Not Supported
> Namespace Managment: Not Supported
> Device Self-test: Not Supported
> Directives: Not Supported
> NVMe-MI Send/Receive: Not Supported
> Virtualization Management: Not Supported
> Doorbell Buffer Config: Not Supported
> Get LBA Status: Not Supported
> Sanitize: Not Supported
> Abort Command Limit: 3
> Async Event Request Limit: 5
> Number of Firmware Slots: N/A
> Firmware Slot 1 Read-Only: N/A
> Per-Namespace SMART Log: No
> Error Log Page Entries: 1
> Number of Power States: 2
> Total NVM Capacity: 0 bytes
> Unallocated NVM Capacity: 0 bytes
>
> NVM Command Set Attributes
>
> ======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
>
> Submission Queue Entry Size
> Max: 64
> Min: 64
> Completion Queue Entry Size
> Max: 16
> Min: 16
> Number of Namespaces: 1
> Compare Command: Not Supported
> Write Uncorrectable Command: Not Supported
> Dataset Management Command: Not Supported
> Write Zeroes Command: Not Supported
> Save Features: Not Supported
> Reservations: Not Supported
> Timestamp feature: Not Supported
> Verify feature: Not Supported
> Fused Operation Support: Not Supported
> Format NVM Attributes: All-NVM Erase, All-NVM Format
> Volatile Write Cache: Not Present
>
> NVM Subsystem Name:
> root@smart:~ # nvmecontrol logpage -p 2 nvme0
> SMART/Health Information Log
>
> ==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
>
> Critical Warning State: 0x00
> Available spare: 0
> Temperature: 0
> Device reliability: 0
> Read only: 0
> Volatile memory backup: 0
> Temperature: 309 K, 35.85 C, 96.53 F
> Available spare: 100
> Available spare threshold: 10
> Percentage used: 0
> Data units (512,000 byte) read: 173065
> Data units written: 9381970
> Host read commands: 4123220
> Host write commands: 846568092
> Controller busy time (minutes): 948
> Power cycles: 918
> Power on hours: 2631
> Unsafe shutdowns: 812
> Media errors: 0
> No. error info log entries: 2546
> Warning Temp Composite Time: 75
> Error Temp Composite Time: 58
> Temperature 1 Transition Count: 0
> Temperature 2 Transition Count: 0
> Total Time For Temperature 1: 0
> Total Time For Temperature 2: 0
>
> But currently bhyve has Capsicum capability, I cannot
> open /dev/nvme0 within pci_nvme.c without extra code.
> (currently I just disable the Capsicum capability)
>
> any feedback?
>
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to 
> "freebsd-virtualization-unsubscr...@freebsd.org"


_______________________________________________
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

Reply via email to