Lines Matching +full:sr +full:- +full:idle +full:- +full:ns
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (C) 2012-2013 Intel Corporation
48 /* NB: Fabrics-specific ioctls defined in nvmf.h start at 200. */
279 /** Controller Multi-path I/O and Namespace Sharing Capabilities */
286 /* SR-IOV Virtual Function */
293 /** OAES - Optional Asynchronous Events Supported */
322 /** CTRATT - Controller Attributes */
323 /* supports 128-bit Host Identifier */
326 /* supports Non-Operational Power State Permissive Mode */
354 /** OACS - optional admin command support */
367 /* supports Device Self-test command */
373 /* supports NVMe-MI Send/Receive */
387 /* first slot is read-only */
420 /** AVSCC - admin vendor specific command configuration */
440 /* No-Deallocate Inhibited */
443 /* No-Deallocate Modifies Media After Sanitize */
553 /** end-to-end data protection capabilities */
570 /** end-to-end data protection type settings */
579 /** Namespace Multi-path I/O and Namespace Sharing Capabilities */
597 /* supports the Exclusive Access - Registrants Only */
603 /* supports the Exclusive Access - All Registrants */
763 uint8_t reserved3[3476]; /* 6Ch - DFFh */
771 uint8_t reserved4[484]; /* E1Ch - FFFh */
821 /* dword 2-3 */
825 /* dword 4-5 */
828 /* dword 6-9 */
837 /* dword 10-15 */
838 uint32_t cdw10; /* command-specific */
839 uint32_t cdw11; /* command-specific */
840 uint32_t cdw12; /* command-specific */
841 uint32_t cdw13; /* command-specific */
842 uint32_t cdw14; /* command-specific */
843 uint32_t cdw15; /* command-specific */
850 uint32_t cdw0; /* command-specific */
883 /* 0x3-0x6 - reserved */
912 /* 0x17 - reserved */
938 /* 0x04 - reserved */
957 /* 0x17 - reserved */
1006 /* 0x03 - reserved */
1010 /* 0x07 - reserved */
1014 /* 0x0b - reserved */
1017 /* 0x0e-0x0f - reserved */
1020 /* 0x12-0x13 - reserved */
1023 /* 0x16-0x17 - reserved */
1027 /* 0x1b - reserved */
1031 /* 0x1f - reserved */
1033 /* 0x21-0x23 - reserved */
1035 /* 0x25-0x7b - reserved */
1037 /* 0x7d-0x7e - reserved */
1043 /* 0x83 - reserved */
1045 /* 0x85 - reserved */
1054 /* 0x03 - reserved */
1057 /* 0x06-0x07 - reserved */
1060 /* 0x0a-0x0b - reserved */
1064 /* 0x0f-0x10 - reserved */
1066 /* 0x12-0x14 - reserved */
1068 /* 0x16-0x18 - reserved */
1073 /* 0x00 - reserved */
1098 /* 0x19-0x77 - reserved */
1099 /* 0x78-0x7f - NVMe Management Interface */
1105 /* 0x85-0xBF - command set specific (reserved) */
1106 /* 0xC0-0xFF - vendor specific */
1125 uint8_t mps_nops; /* Max Power Scale, Non-Operational State */
1135 uint16_t idlp; /* Idle Power */
1136 uint8_t ips; /* Idle Power Scale */
1151 /* bytes 0-255: controller capabilities and features */
1174 /** multi-interface capabilities */
1220 /* bytes 256-511: admin command set attributes */
1274 /** Extended Device Self-test Time */
1277 /** Device Self-test Options */
1326 /* bytes 512-703: nvm command set attributes */
1374 /* bytes 540-767: Reserved */
1380 /* bytes 1024-1791: Reserved */
1383 /* bytes 1792-2047: NVMe over Fabrics specification */
1392 /* bytes 2048-3071: power state descriptors */
1395 /* bytes 3072-4095: vendor specific */
1423 /** end-to-end data protection capabilities */
1426 /** end-to-end data protection type settings */
1429 /** Namespace Multi-path I/O and Namespace Sharing Capabilities */
1480 /* bytes 74-91: Reserved */
1486 /* bytes 96-98: Reserved */
1515 /* 0x00 - reserved */
1532 /* 0x06-0x7F - reserved */
1533 /* 0x80-0xBF - I/O command set specific */
1536 /* 0x82-0xBF - reserved */
1537 /* 0xC0-0xFF - vendor specific */
1583 * Note that the following are 128-bit values, but are
1584 * defined as an array of 2 64-bit values.
1586 /* Data Units Read is always in 512-byte units. */
1588 /* Data Units Written is always in 512-byte units. */
1628 uint32_t ns[1024]; member
1845 * * nsid (namespace id) - for admin commands only
1846 * * cdw10-cdw15
1902 (NVME_STATUS_GET_SC((cpl)->status) != 0 || NVME_STATUS_GET_SCT((cpl)->status) != 0)
1956 int nvme_ns_cmd_write(struct nvme_namespace *ns, void *payload,
1959 int nvme_ns_cmd_write_bio(struct nvme_namespace *ns, struct bio *bp,
1961 int nvme_ns_cmd_read(struct nvme_namespace *ns, void *payload,
1964 int nvme_ns_cmd_read_bio(struct nvme_namespace *ns, struct bio *bp,
1966 int nvme_ns_cmd_deallocate(struct nvme_namespace *ns, void *payload,
1969 int nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn,
1971 int nvme_ns_dump(struct nvme_namespace *ns, void *virt, off_t offset,
1989 return (NVMEV(NVME_CTRLR_DATA_ONCS_DSM, cd->oncs) != 0); in nvme_ctrlr_has_dataset_mgmt()
1993 uint32_t nvme_ns_get_max_io_xfer_size(struct nvme_namespace *ns);
1994 uint32_t nvme_ns_get_sector_size(struct nvme_namespace *ns);
1995 uint64_t nvme_ns_get_num_sectors(struct nvme_namespace *ns);
1996 uint64_t nvme_ns_get_size(struct nvme_namespace *ns);
1997 uint32_t nvme_ns_get_flags(struct nvme_namespace *ns);
1998 const char * nvme_ns_get_serial_number(struct nvme_namespace *ns);
1999 const char * nvme_ns_get_model_number(struct nvme_namespace *ns);
2001 nvme_ns_get_data(struct nvme_namespace *ns);
2002 uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns);
2004 int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp,
2006 int nvme_ns_ioctl_process(struct nvme_namespace *ns, u_long cmd,
2010 * Command building helper functions -- shared with CAM
2019 cmd->opc = NVME_OPC_FLUSH; in nvme_ns_flush_cmd()
2020 cmd->nsid = htole32(nsid); in nvme_ns_flush_cmd()
2027 cmd->opc = rwcmd; in nvme_ns_rw_cmd()
2028 cmd->nsid = htole32(nsid); in nvme_ns_rw_cmd()
2029 cmd->cdw10 = htole32(lba & 0xffffffffu); in nvme_ns_rw_cmd()
2030 cmd->cdw11 = htole32(lba >> 32); in nvme_ns_rw_cmd()
2031 cmd->cdw12 = htole32(count-1); in nvme_ns_rw_cmd()
2052 cmd->opc = NVME_OPC_DATASET_MANAGEMENT; in nvme_ns_trim_cmd()
2053 cmd->nsid = htole32(nsid); in nvme_ns_trim_cmd()
2054 cmd->cdw10 = htole32(num_ranges - 1); in nvme_ns_trim_cmd()
2055 cmd->cdw11 = htole32(NVME_DSM_ATTR_DEALLOCATE); in nvme_ns_trim_cmd()
2068 s->cdw0 = le32toh(s->cdw0); in nvme_completion_swapbytes()
2070 s->sqhd = le16toh(s->sqhd); in nvme_completion_swapbytes()
2071 s->sqid = le16toh(s->sqid); in nvme_completion_swapbytes()
2073 s->status = le16toh(s->status); in nvme_completion_swapbytes()
2082 s->mp = le16toh(s->mp); in nvme_power_state_swapbytes()
2083 s->enlat = le32toh(s->enlat); in nvme_power_state_swapbytes()
2084 s->exlat = le32toh(s->exlat); in nvme_power_state_swapbytes()
2085 s->idlp = le16toh(s->idlp); in nvme_power_state_swapbytes()
2086 s->actp = le16toh(s->actp); in nvme_power_state_swapbytes()
2096 s->vid = le16toh(s->vid); in nvme_controller_data_swapbytes()
2097 s->ssvid = le16toh(s->ssvid); in nvme_controller_data_swapbytes()
2098 s->ctrlr_id = le16toh(s->ctrlr_id); in nvme_controller_data_swapbytes()
2099 s->ver = le32toh(s->ver); in nvme_controller_data_swapbytes()
2100 s->rtd3r = le32toh(s->rtd3r); in nvme_controller_data_swapbytes()
2101 s->rtd3e = le32toh(s->rtd3e); in nvme_controller_data_swapbytes()
2102 s->oaes = le32toh(s->oaes); in nvme_controller_data_swapbytes()
2103 s->ctratt = le32toh(s->ctratt); in nvme_controller_data_swapbytes()
2104 s->rrls = le16toh(s->rrls); in nvme_controller_data_swapbytes()
2105 s->crdt1 = le16toh(s->crdt1); in nvme_controller_data_swapbytes()
2106 s->crdt2 = le16toh(s->crdt2); in nvme_controller_data_swapbytes()
2107 s->crdt3 = le16toh(s->crdt3); in nvme_controller_data_swapbytes()
2108 s->oacs = le16toh(s->oacs); in nvme_controller_data_swapbytes()
2109 s->wctemp = le16toh(s->wctemp); in nvme_controller_data_swapbytes()
2110 s->cctemp = le16toh(s->cctemp); in nvme_controller_data_swapbytes()
2111 s->mtfa = le16toh(s->mtfa); in nvme_controller_data_swapbytes()
2112 s->hmpre = le32toh(s->hmpre); in nvme_controller_data_swapbytes()
2113 s->hmmin = le32toh(s->hmmin); in nvme_controller_data_swapbytes()
2114 s->rpmbs = le32toh(s->rpmbs); in nvme_controller_data_swapbytes()
2115 s->edstt = le16toh(s->edstt); in nvme_controller_data_swapbytes()
2116 s->kas = le16toh(s->kas); in nvme_controller_data_swapbytes()
2117 s->hctma = le16toh(s->hctma); in nvme_controller_data_swapbytes()
2118 s->mntmt = le16toh(s->mntmt); in nvme_controller_data_swapbytes()
2119 s->mxtmt = le16toh(s->mxtmt); in nvme_controller_data_swapbytes()
2120 s->sanicap = le32toh(s->sanicap); in nvme_controller_data_swapbytes()
2121 s->hmminds = le32toh(s->hmminds); in nvme_controller_data_swapbytes()
2122 s->hmmaxd = le16toh(s->hmmaxd); in nvme_controller_data_swapbytes()
2123 s->nsetidmax = le16toh(s->nsetidmax); in nvme_controller_data_swapbytes()
2124 s->endgidmax = le16toh(s->endgidmax); in nvme_controller_data_swapbytes()
2125 s->anagrpmax = le32toh(s->anagrpmax); in nvme_controller_data_swapbytes()
2126 s->nanagrpid = le32toh(s->nanagrpid); in nvme_controller_data_swapbytes()
2127 s->pels = le32toh(s->pels); in nvme_controller_data_swapbytes()
2128 s->maxcmd = le16toh(s->maxcmd); in nvme_controller_data_swapbytes()
2129 s->nn = le32toh(s->nn); in nvme_controller_data_swapbytes()
2130 s->oncs = le16toh(s->oncs); in nvme_controller_data_swapbytes()
2131 s->fuses = le16toh(s->fuses); in nvme_controller_data_swapbytes()
2132 s->awun = le16toh(s->awun); in nvme_controller_data_swapbytes()
2133 s->awupf = le16toh(s->awupf); in nvme_controller_data_swapbytes()
2134 s->acwu = le16toh(s->acwu); in nvme_controller_data_swapbytes()
2135 s->sgls = le32toh(s->sgls); in nvme_controller_data_swapbytes()
2136 s->mnan = le32toh(s->mnan); in nvme_controller_data_swapbytes()
2137 s->ioccsz = le32toh(s->ioccsz); in nvme_controller_data_swapbytes()
2138 s->iorcsz = le32toh(s->iorcsz); in nvme_controller_data_swapbytes()
2139 s->icdoff = le16toh(s->icdoff); in nvme_controller_data_swapbytes()
2140 s->ofcs = le16toh(s->ofcs); in nvme_controller_data_swapbytes()
2142 nvme_power_state_swapbytes(&s->power_state[i]); in nvme_controller_data_swapbytes()
2152 s->nsze = le64toh(s->nsze); in nvme_namespace_data_swapbytes()
2153 s->ncap = le64toh(s->ncap); in nvme_namespace_data_swapbytes()
2154 s->nuse = le64toh(s->nuse); in nvme_namespace_data_swapbytes()
2155 s->nawun = le16toh(s->nawun); in nvme_namespace_data_swapbytes()
2156 s->nawupf = le16toh(s->nawupf); in nvme_namespace_data_swapbytes()
2157 s->nacwu = le16toh(s->nacwu); in nvme_namespace_data_swapbytes()
2158 s->nabsn = le16toh(s->nabsn); in nvme_namespace_data_swapbytes()
2159 s->nabo = le16toh(s->nabo); in nvme_namespace_data_swapbytes()
2160 s->nabspf = le16toh(s->nabspf); in nvme_namespace_data_swapbytes()
2161 s->noiob = le16toh(s->noiob); in nvme_namespace_data_swapbytes()
2162 s->npwg = le16toh(s->npwg); in nvme_namespace_data_swapbytes()
2163 s->npwa = le16toh(s->npwa); in nvme_namespace_data_swapbytes()
2164 s->npdg = le16toh(s->npdg); in nvme_namespace_data_swapbytes()
2165 s->npda = le16toh(s->npda); in nvme_namespace_data_swapbytes()
2166 s->nows = le16toh(s->nows); in nvme_namespace_data_swapbytes()
2167 s->anagrpid = le32toh(s->anagrpid); in nvme_namespace_data_swapbytes()
2168 s->nvmsetid = le16toh(s->nvmsetid); in nvme_namespace_data_swapbytes()
2169 s->endgid = le16toh(s->endgid); in nvme_namespace_data_swapbytes()
2171 s->lbaf[i] = le32toh(s->lbaf[i]); in nvme_namespace_data_swapbytes()
2181 s->error_count = le64toh(s->error_count); in nvme_error_information_entry_swapbytes()
2182 s->sqid = le16toh(s->sqid); in nvme_error_information_entry_swapbytes()
2183 s->cid = le16toh(s->cid); in nvme_error_information_entry_swapbytes()
2184 s->status = le16toh(s->status); in nvme_error_information_entry_swapbytes()
2185 s->error_location = le16toh(s->error_location); in nvme_error_information_entry_swapbytes()
2186 s->lba = le64toh(s->lba); in nvme_error_information_entry_swapbytes()
2187 s->nsid = le32toh(s->nsid); in nvme_error_information_entry_swapbytes()
2188 s->csi = le64toh(s->csi); in nvme_error_information_entry_swapbytes()
2189 s->ttsi = le16toh(s->ttsi); in nvme_error_information_entry_swapbytes()
2203 tmp[i] = tmp[15-i]; in nvme_le128toh()
2204 tmp[15-i] = b; in nvme_le128toh()
2216 s->temperature = le16toh(s->temperature); in nvme_health_information_page_swapbytes()
2217 nvme_le128toh((void *)s->data_units_read); in nvme_health_information_page_swapbytes()
2218 nvme_le128toh((void *)s->data_units_written); in nvme_health_information_page_swapbytes()
2219 nvme_le128toh((void *)s->host_read_commands); in nvme_health_information_page_swapbytes()
2220 nvme_le128toh((void *)s->host_write_commands); in nvme_health_information_page_swapbytes()
2221 nvme_le128toh((void *)s->controller_busy_time); in nvme_health_information_page_swapbytes()
2222 nvme_le128toh((void *)s->power_cycles); in nvme_health_information_page_swapbytes()
2223 nvme_le128toh((void *)s->power_on_hours); in nvme_health_information_page_swapbytes()
2224 nvme_le128toh((void *)s->unsafe_shutdowns); in nvme_health_information_page_swapbytes()
2225 nvme_le128toh((void *)s->media_errors); in nvme_health_information_page_swapbytes()
2226 nvme_le128toh((void *)s->num_error_info_log_entries); in nvme_health_information_page_swapbytes()
2227 s->warning_temp_time = le32toh(s->warning_temp_time); in nvme_health_information_page_swapbytes()
2228 s->error_temp_time = le32toh(s->error_temp_time); in nvme_health_information_page_swapbytes()
2230 s->temp_sensor[i] = le16toh(s->temp_sensor[i]); in nvme_health_information_page_swapbytes()
2231 s->tmt1tc = le32toh(s->tmt1tc); in nvme_health_information_page_swapbytes()
2232 s->tmt2tc = le32toh(s->tmt2tc); in nvme_health_information_page_swapbytes()
2233 s->ttftmt1 = le32toh(s->ttftmt1); in nvme_health_information_page_swapbytes()
2234 s->ttftmt2 = le32toh(s->ttftmt2); in nvme_health_information_page_swapbytes()
2245 s->ns[i] = le32toh(s->ns[i]); in nvme_ns_list_swapbytes()
2257 s->acs[i] = le32toh(s->acs[i]); in nvme_command_effects_page_swapbytes()
2259 s->iocs[i] = le32toh(s->iocs[i]); in nvme_command_effects_page_swapbytes()
2268 s->log_page_count = le64toh(s->log_page_count); in nvme_res_notification_page_swapbytes()
2269 s->nsid = le32toh(s->nsid); in nvme_res_notification_page_swapbytes()
2278 s->sprog = le16toh(s->sprog); in nvme_sanitize_status_page_swapbytes()
2279 s->sstat = le16toh(s->sstat); in nvme_sanitize_status_page_swapbytes()
2280 s->scdw10 = le32toh(s->scdw10); in nvme_sanitize_status_page_swapbytes()
2281 s->etfo = le32toh(s->etfo); in nvme_sanitize_status_page_swapbytes()
2282 s->etfbe = le32toh(s->etfbe); in nvme_sanitize_status_page_swapbytes()
2283 s->etfce = le32toh(s->etfce); in nvme_sanitize_status_page_swapbytes()
2284 s->etfownd = le32toh(s->etfownd); in nvme_sanitize_status_page_swapbytes()
2285 s->etfbewnd = le32toh(s->etfbewnd); in nvme_sanitize_status_page_swapbytes()
2286 s->etfcewnd = le32toh(s->etfcewnd); in nvme_sanitize_status_page_swapbytes()
2297 s->gen = le32toh(s->gen); in nvme_resv_status_swapbytes()
2298 n = (s->regctl[1] << 8) | s->regctl[0]; in nvme_resv_status_swapbytes()
2299 n = MIN(n, (size - sizeof(s)) / sizeof(s->ctrlr[0])); in nvme_resv_status_swapbytes()
2301 s->ctrlr[i].ctrlr_id = le16toh(s->ctrlr[i].ctrlr_id); in nvme_resv_status_swapbytes()
2302 s->ctrlr[i].hostid = le64toh(s->ctrlr[i].hostid); in nvme_resv_status_swapbytes()
2303 s->ctrlr[i].rkey = le64toh(s->ctrlr[i].rkey); in nvme_resv_status_swapbytes()
2315 s->gen = le32toh(s->gen); in nvme_resv_status_ext_swapbytes()
2316 n = (s->regctl[1] << 8) | s->regctl[0]; in nvme_resv_status_ext_swapbytes()
2317 n = MIN(n, (size - sizeof(s)) / sizeof(s->ctrlr[0])); in nvme_resv_status_ext_swapbytes()
2319 s->ctrlr[i].ctrlr_id = le16toh(s->ctrlr[i].ctrlr_id); in nvme_resv_status_ext_swapbytes()
2320 s->ctrlr[i].rkey = le64toh(s->ctrlr[i].rkey); in nvme_resv_status_ext_swapbytes()
2321 nvme_le128toh((void *)s->ctrlr[i].hostid); in nvme_resv_status_ext_swapbytes()
2335 s->result[r].poh = le64toh(s->result[r].poh); in nvme_device_self_test_swapbytes()
2336 s->result[r].nsid = le32toh(s->result[r].nsid); in nvme_device_self_test_swapbytes()
2337 /* Unaligned 64-bit loads fail on some architectures */ in nvme_device_self_test_swapbytes()
2338 tmp = s->result[r].failing_lba; in nvme_device_self_test_swapbytes()
2341 tmp[i] = tmp[7-i]; in nvme_device_self_test_swapbytes()
2342 tmp[7-i] = b; in nvme_device_self_test_swapbytes()
2352 s->portid = le16toh(s->portid); in nvme_discovery_log_entry_swapbytes()
2353 s->cntlid = le16toh(s->cntlid); in nvme_discovery_log_entry_swapbytes()
2354 s->aqsz = le16toh(s->aqsz); in nvme_discovery_log_entry_swapbytes()
2355 if (s->trtype == 0x01 /* RDMA */) { in nvme_discovery_log_entry_swapbytes()
2356 s->tsas.rdma.rdma_pkey = le16toh(s->tsas.rdma.rdma_pkey); in nvme_discovery_log_entry_swapbytes()
2365 s->genctr = le64toh(s->genctr); in nvme_discovery_log_swapbytes()
2366 s->numrec = le64toh(s->numrec); in nvme_discovery_log_swapbytes()
2367 s->recfmt = le16toh(s->recfmt); in nvme_discovery_log_swapbytes()