bhyve: return FEATURE_NOT_CHANGEABLE for unimplemented feature of NVMe controller

Set Feature is a feature specified function. Currently only some
features have the set procedure. For features that are not handled by
the controller, we should return a FEATURE_NOT_CHANGEABLE error message.

Approved by:		manu (mentor)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D32802
This commit is contained in:
Wanpeng Qian 2022-11-14 14:06:34 +01:00 committed by Corvin Köhne
parent 8ab99dbea1
commit 05a21658eb
No known key found for this signature in database
GPG Key ID: D854DA56315E026A

View File

@ -1885,6 +1885,11 @@ nvme_opc_set_features(struct pci_nvme_softc *sc, struct nvme_command *command,
if (feat->set)
feat->set(sc, feat, command, compl);
else {
pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC,
NVME_SC_FEATURE_NOT_CHANGEABLE);
return (1);
}
DPRINTF("%s: status=%#x cdw11=%#x", __func__, compl->status, command->cdw11);
if (compl->status == NVME_SC_SUCCESS) {