bhyve nvme: Fix Namespace Specific Set Features

Return an error if the feature specified in Set Features is Namespace
specific but the Namespace ID uses the Global Namespace tag.

Fixes UNH Test 1.2.7

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33566
This commit is contained in:
Chuck Tuffli 2022-01-29 23:06:23 -08:00
parent cf76cdd4bf
commit 62d47feceb

View File

@ -1660,6 +1660,11 @@ nvme_opc_set_features(struct pci_nvme_softc *sc, struct nvme_command *command,
}
feat = &sc->feat[fid];
if (feat->namespace_specific && (nsid == NVME_GLOBAL_NAMESPACE_TAG)) {
pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD);
return (1);
}
if (!feat->namespace_specific &&
!((nsid == 0) || (nsid == NVME_GLOBAL_NAMESPACE_TAG))) {
pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC,