bhyve nvme: Support minimal Controller list

Controllers must support the Identify Controller list if they support
Namespace Management. But the UNH NVMe tests use this command regardless
of whether the device under test supports Namespace Management.

This implementation returns an empty Controller list (i.e., Number of
Identifiers is zero).

Fixes UNH Test 1.1.2

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36193
This commit is contained in:
Chuck Tuffli 2022-08-16 09:15:53 -07:00
parent ec0efe34dd
commit 715f82e4f5

View File

@ -1569,6 +1569,15 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nvme_command* command,
((uint8_t *)dest)[1] = sizeof(uint64_t);
bcopy(sc->nsdata.eui64, ((uint8_t *)dest) + 4, sizeof(uint64_t));
break;
case 0x13:
/*
* Controller list is optional but used by UNH tests. Return
* a valid but empty list.
*/
dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1,
sizeof(uint16_t) * 2048);
memset(dest, 0, sizeof(uint16_t) * 2048);
break;
default:
DPRINTF("%s unsupported identify command requested 0x%x",
__func__, command->cdw10 & 0xFF);