Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144365033
D32688.id97537.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32688.id97537.diff
View Options
Index: usr.sbin/bhyve/pci_nvme.c
===================================================================
--- usr.sbin/bhyve/pci_nvme.c
+++ usr.sbin/bhyve/pci_nvme.c
@@ -351,6 +351,10 @@
struct nvme_feature_obj *,
struct nvme_command *,
struct nvme_completion *);
+static void nvme_feature_temperature_threshold(struct pci_nvme_softc *,
+ struct nvme_feature_obj *,
+ struct nvme_command *,
+ struct nvme_completion *);
static void nvme_feature_num_queues(struct pci_nvme_softc *,
struct nvme_feature_obj *,
struct nvme_command *,
@@ -619,6 +623,8 @@
sc->feat[0].get = nvme_feature_invalid_cb;
sc->feat[NVME_FEAT_LBA_RANGE_TYPE].namespace_specific = true;
+ sc->feat[NVME_FEAT_TEMPERATURE_THRESHOLD].get =
+ nvme_feature_temperature_threshold;
sc->feat[NVME_FEAT_ERROR_RECOVERY].namespace_specific = true;
sc->feat[NVME_FEAT_NUMBER_OF_QUEUES].set = nvme_feature_num_queues;
sc->feat[NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION].set =
@@ -1326,6 +1332,27 @@
}
+static void
+nvme_feature_temperature_threshold(struct pci_nvme_softc *sc,
+ struct nvme_feature_obj *feat,
+ struct nvme_command *command,
+ struct nvme_completion *compl)
+{
+ uint8_t thsel; /* Threshold Type Select */
+
+ thsel = (command->cdw11 >> 20) & 0x03;
+
+ switch (thsel) {
+ case 0x00: /* Over Temperature Threshold */
+ feat->cdw11 = sc->ctrldata.wctemp;
+ break;
+ case 0x01: /* Under Temperature Threshold */
+ feat->cdw11 = sc->ctrldata.wctemp - 100;
+ break;
+ default:
+ pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD);
+ }
+}
static void
nvme_feature_num_queues(struct pci_nvme_softc *sc,
struct nvme_feature_obj *feat,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 1:45 AM (1 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28523047
Default Alt Text
D32688.id97537.diff (1 KB)
Attached To
Mode
D32688: bhyve: implement Temperature Threshold set/get feature for NVMe controller
Attached
Detach File
Event Timeline
Log In to Comment