bhyve: initial PowerCycles value

Currently PowerCycles field of Log Page is 0 and it is an invalid value.
This patch will initial the PowerCycles data to 1.

MFC after:		1 week
Approved by:		manu (mentor)
Reviewed By:		grehan (older version), chuck, corvink
Differential Revision:	https://reviews.freebsd.org/D32558
This commit is contained in:
Wanpeng Qian 2022-11-04 08:48:00 +01:00 committed by Corvin Köhne
parent d0b5e4a30a
commit b631954ff0
No known key found for this signature in database
GPG Key ID: D854DA56315E026A

View File

@ -688,6 +688,7 @@ pci_nvme_init_nsdata(struct pci_nvme_softc *sc,
static void
pci_nvme_init_logpages(struct pci_nvme_softc *sc)
{
__uint128_t power_cycles = 1;
memset(&sc->err_log, 0, sizeof(sc->err_log));
memset(&sc->health_log, 0, sizeof(sc->health_log));
@ -707,6 +708,9 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc)
sc->fw_log.afi = (1 << NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT);
memcpy(&sc->fw_log.revision[0], sc->ctrldata.fr,
sizeof(sc->fw_log.revision[0]));
memcpy(&sc->health_log.power_cycles, &power_cycles,
sizeof(sc->health_log.power_cycles));
}
static void