FEMU
原版 master 7e238cc
FEMU: Accurate, Scalable and Extensible NVMe SSD Emulator (FAST'18)
|
|
浏览该文件的文档.
6 #define OC20_VID (0x1d1d)
7 #define OC20_DID (0x1f1f)
8 #define OC20_MAGIC ('L' << 24 | 'N' << 16 | 'V' << 8 | 'M')
9 #define OC20_CMD_MAX_LBAS (64)
11 #define OC20_NS_LOGPAGE_CHUNK_INFO_BLK_OFFSET(ns) \
12 ((ns)->blk.begin + sizeof(Oc20NamespaceGeometry))
14 #define OC20_LBA_GET_SECTR(lbaf, lba) \
15 ((lba & (lbaf)->sec_mask) \
16 >> (lbaf)->sec_offset)
18 #define OC20_LBA_GET_CHUNK(lbaf, lba) \
19 ((lba & (lbaf)->chk_mask) \
20 >> (lbaf)->chk_offset)
22 #define OC20_LBA_GET_PUNIT(lbaf, lba) \
23 ((lba & (lbaf)->lun_mask) \
24 >> (lbaf)->lun_offset)
26 #define OC20_LBA_GET_GROUP(lbaf, lba) \
27 (lba >> (lbaf)->grp_offset)
29 #define OC20_LBA(lbaf, group, punit, chunk, sectr) \
30 (sectr << (lbaf)->sec_offset \
31 | chunk << (lbaf)->chk_offset \
32 | punit << (lbaf)->lun_offset \
33 | group << (lbaf)->grp_offset)
35 #define OC20_GROUP_FROM_CHUNK_INDEX(lns, idx) \
36 (idx / (lns)->chks_per_grp)
38 #define OC20_PUNIT_FROM_CHUNK_INDEX(lns, idx) \
39 (idx % (lns)->chks_per_grp / (lns)->chks_per_lun)
41 #define OC20_CHUNK_FROM_CHUNK_INDEX(lns, idx) \
42 (idx % (lns)->chks_per_lun)
44 #define OC20_LBA_FROM_CHUNK_INDEX(lns, idx) \
45 (OC20_GROUP_FROM_CHUNK_INDEX(lns, idx) \
46 << (lns)->lbaf.grp_offset \
47 | OC20_PUNIT_FROM_CHUNK_INDEX(lns, idx) \
48 << (lns)->lbaf.lun_offset \
49 | OC20_CHUNK_FROM_CHUNK_INDEX(lns, idx) \
50 << (lns)->lbaf.chk_offset)
52 #define OC20_LBA_FORMAT_TEMPLATE \
53 "lba 0xffffffffffffffff pugrp 255 punit 255 chunk 65535 sectr 4294967295"
55 #define OC20_CHUNK_RESETABLE \
56 (OC20_CHUNK_FREE | OC20_CHUNK_CLOSED | OC20_CHUNK_OPEN)
252 QEMU_BUILD_BUG_ON(
sizeof(
Oc20IdGeo) != 64);
253 QEMU_BUILD_BUG_ON(
sizeof(
Oc20IdWrt) != 64);
255 QEMU_BUILD_BUG_ON(
sizeof(
Oc20RwCmd) != 64);
256 QEMU_BUILD_BUG_ON(
sizeof(
Oc20DmCmd) != 64);
258 QEMU_BUILD_BUG_ON(
sizeof(
Oc20CS) != 32);
uint16_t dma_write_prp(FemuCtrl *n, uint8_t *ptr, uint32_t len, uint64_t prp1, uint64_t prp2)
Definition: dma.c:112
uint32_t secs_per_grp
Definition: oc20.h:230
Oc20AddrF lbaf
Definition: oc20.h:219
@ OC20_SEC_UNKNOWN
Definition: oc20.h:65
Oc20IdLBAF lbaf
Definition: oc20.h:192
uint32_t tprm
Definition: oc20.h:162
uint8_t num_ch
Definition: nvme.h:1158
uint64_t rsvd4
Definition: oc20.h:116
@ OC20_CMD_VECT_ERASE
Definition: oc20.h:59
static int oc20_writefail_load(FemuCtrl *n, NvmeNamespace *ns, Error **errp)
Definition: oc20.c:656
Oc20StatusCodes
Definition: oc20.h:83
uint32_t cdw11
Definition: nvme.h:307
struct Oc20AddrBucket Oc20AddrBucket
uint8_t rsvd[44]
Definition: oc20.h:155
uint32_t rsvd1[8]
Definition: oc20.h:124
pthread_spinlock_t chnl_locks[FEMU_MAX_NUM_CHNLS]
Definition: nvme.h:1305
uint8_t lun_len
Definition: oc20.h:170
uint8_t rsvd[5]
Definition: oc20.h:96
uint64_t nuse
Definition: nvme.h:866
uint32_t id
Definition: nvme.h:1071
uint8_t rsvd1[6]
Definition: oc20.h:191
uint8_t rsvd3[31]
Definition: oc20.h:196
uint32_t secs_total
Definition: oc20.h:231
uint8_t type
Definition: oc20.h:94
femu相关控制参数和数据成员
Definition: nvme.h:1184
uint32_t ws_min
Definition: oc20.h:150
struct Oc20NamespaceGeometry::@19 ver
struct Oc20IdGeo Oc20IdGeo
static void oc20_init(FemuCtrl *n, Error **errp)
Definition: oc20.c:1344
@ OC20_CHUNK_CLOSED
Definition: oc20.h:72
FemuExtCtrlOps ext_ops
nvme到各模式ssd接口
Definition: nvme.h:1220
#define unlikely(x)
Definition: rte_branch_prediction.h:38
QEMUSGList qsg
dma用
Definition: nvme.h:984
struct Oc20IdPerf Oc20IdPerf
uint8_t nlbaf
Definition: nvme.h:868
#define OC20_MAGIC
Definition: oc20.h:8
static void oc20_nvme_ns_init_identify(FemuCtrl *n, NvmeIdNs *id_ns)
Definition: oc20.c:967
@ OC20_INVALID_RESET
Definition: oc20.h:89
uint16_t control
Definition: oc20.h:114
struct Oc20AddrF Oc20AddrF
#define femu_log(fmt,...)
Definition: nvme.h:1514
@ OC20_WRITE_NEXT_UNIT
Definition: oc20.h:85
uint32_t num_chk
Definition: oc20.h:144
static uint16_t oc20_rw_check_write_req(FemuCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
Definition: oc20.c:300
static int oc20_resetfail_load(FemuCtrl *n, NvmeNamespace *ns, Error **errp)
Definition: oc20.c:629
uint64_t mptr
Definition: nvme.h:304
struct FemuExtCtrlOps FemuExtCtrlOps
扩展操作接口,具体实现在各模式ssd中
static void nvme_ns_init_predef(FemuCtrl *n, NvmeNamespace *ns)
Definition: oc20.c:1002
uint8_t ms_max
Definition: nvme.h:1257
uint32_t tbem
Definition: oc20.h:164
uint32_t ws_opt
Definition: nvme.h:1100
static int oc20_init_misc(FemuCtrl *n)
Definition: oc20.c:1319
@ OC20_CHUNK_OPEN
Definition: oc20.h:73
uint64_t meta
Definition: nvme.h:1086
uint8_t page_type
Definition: oc20.h:242
static int oc20_init_namespaces(FemuCtrl *n, Error **errp)
Definition: oc20.c:1268
@ OC20_CHUNK_INFO
Definition: oc20.h:210
NvmeCmdDptr dptr
Definition: oc20.h:111
int backend_rw(SsdDramBackend *b, QEMUSGList *qsg, uint64_t *lbal, bool is_write)
Definition: dram.c:37
uint64_t lba
Definition: oc12.h:2
static uint16_t oc20_advance_wp(FemuCtrl *n, NvmeNamespace *ns, uint64_t lba, uint16_t nlb, NvmeRequest *req)
Definition: oc20.c:96
uint32_t cdw13
Definition: nvme.h:309
#define femu_debug(fmt,...)
Definition: nvme.h:1507
@ NVME_SUCCESS
Definition: nvme.h:526
NvmeBar bar
Definition: nvme.h:1188
int64_t advance_chip_timestamp(FemuCtrl *n, int lunid, uint64_t now, int opcode, uint8_t page_type)
Definition: timing.c:72
@ NVME_ADM_CMD_GET_LOG_PAGE
Definition: nvme.h:320
uint8_t * writefail
Definition: oc20.h:223
static uint16_t oc20_rw_check_chunk_read(FemuCtrl *n, NvmeCmd *cmd, NvmeRequest *req, uint64_t lba)
Definition: oc20.c:343
uint8_t grp_offset
Definition: oc20.h:135
static int oc20_lba_valid(FemuCtrl *n, NvmeNamespace *ns, uint64_t lba)
Definition: oc20.h:277
char * resetfail_fname
Definition: nvme.h:1108
static void oc20_set_ctrl_str(FemuCtrl *n)
Definition: oc20.c:1295
uint32_t ws_min
Definition: nvme.h:1099
volatile int64_t chip_next_avail_time[FEMU_MAX_NUM_CHIPS]
Definition: nvme.h:1302
#define NVME_ERR_REC_DULBE(err_rec)
Definition: nvme.h:813
uint8_t ms
Definition: nvme.h:1134
uint32_t nsid
Definition: oc20.h:108
static uint16_t oc20_rw_check_vector_req(FemuCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
Definition: oc20.c:411
uint16_t nlb
逻辑块个数
Definition: nvme.h:974
static uint16_t oc20_rw_check_chunk_write(FemuCtrl *n, NvmeCmd *cmd, uint64_t lba, uint32_t ws, NvmeRequest *req)
Definition: oc20.c:249
NvmeFeatureVal features
Definition: nvme.h:1284
uint16_t dma_read_prp(FemuCtrl *n, uint8_t *ptr, uint32_t len, uint64_t prp1, uint64_t prp2)
Definition: dma.c:137
struct Oc20Header Oc20Header
uint64_t begin
Definition: nvme.h:1083
struct Oc20IdWrt Oc20IdWrt
@ NVME_CMD_WRITE
Definition: nvme.h:340
@ NVME_DNR
Definition: nvme.h:581
uint64_t spba
Definition: oc20.h:125
@ OC20_CHUNK_EARLY_CLOSE
Definition: oc20.h:86
static void oc20_release_locks(FemuCtrl *n)
Definition: oc20.c:1304
static int set_writefail_sector(FemuCtrl *n, NvmeNamespace *ns, char *secinfo)
Definition: oc20.c:595
static uint64_t oc20_lba_to_sector_index(FemuCtrl *n, NvmeNamespace *ns, uint64_t lba)
Definition: oc20.h:301
uint32_t nsid
Definition: nvme.h:302
uint32_t rsvd3
Definition: oc20.h:115
uint16_t pgs_per_blk
Definition: nvme.h:1156
static uint16_t oc20_get_log(FemuCtrl *n, NvmeCmd *cmd)
Definition: oc20.c:863
#define OC20_LBA(lbaf, group, punit, chunk, sectr)
Definition: oc20.h:29
Oc20IdWrt wrt
Definition: oc20.h:198
static uint16_t oc20_rw(FemuCtrl *n, NvmeCmd *cmd, NvmeRequest *req, bool vector)
Definition: oc20.c:699
static uint16_t oc20_dma_write(FemuCtrl *n, uint8_t *ptr, uint32_t len, NvmeCmd *cmd)
Definition: oc20.c:18
static uint16_t oc20_io_cmd(FemuCtrl *n, NvmeNamespace *ns, NvmeCmd *cmd, NvmeRequest *req)
Definition: oc20.c:938
#define NVME_ID_NS_LBADS_BYTES(ns)
Definition: nvme.h:29
uint64_t wp
Definition: oc20.h:99
static bool is_oc20_admin_cmd(uint8_t opcode)
Definition: oc20.c:3
uint32_t trdt
Definition: oc20.h:159
QEMUIOVector iov
Definition: nvme.h:985
uint64_t predef
Definition: nvme.h:1084
static Oc20CS * oc20_chunk_get_state(FemuCtrl *n, NvmeNamespace *ns, uint64_t lba)
Definition: oc20.c:85
uint64_t ncap
Definition: nvme.h:865
static uint64_t oc20_lba_to_chunk_index(FemuCtrl *n, NvmeNamespace *ns, uint64_t lba)
Definition: oc20.h:289
uint8_t minor
Definition: oc20.h:189
uint8_t sec_offset
Definition: oc20.h:138
#define OC20_CHUNK_RESETABLE
Definition: oc20.h:55
int nvme_register_ocssd20(FemuCtrl *n)
Definition: oc20.c:1363
int64_t stime
io开始时间
Definition: nvme.h:987
uint8_t num_lun
Definition: nvme.h:1159
NvmeIdNs id_ns
Definition: nvme.h:1067
Oc20ChunkStates
Definition: oc20.h:70
uint64_t cap
Definition: nvme.h:40
static void femu_oc20_init_id_ctrl(FemuCtrl *n, NvmeNamespace *ns, Oc20NamespaceGeometry *ln)
Definition: oc20.c:1019
static uint16_t oc20_chunk_info(FemuCtrl *n, NvmeCmd *cmd, uint32_t buf_len, uint64_t off)
Definition: oc20.c:821
uint16_t cid
Definition: oc20.h:107
uint8_t rsvd[52]
Definition: oc20.h:146
struct NvmeNamespace * ns
Definition: nvme.h:970
uint8_t flags
Definition: oc20.h:121
void nvme_set_ctrl_name(FemuCtrl *n, const char *mn, const char *sn, int *dev_id)
Definition: nvme-util.c:294
uint8_t vs[3712]
Definition: nvme.h:895
uint8_t state
Definition: oc20.h:93
static uint16_t oc20_dma_read(FemuCtrl *n, uint8_t *ptr, uint32_t len, NvmeCmd *cmd)
Definition: oc20.c:9
@ OC20_ADM_CMD_SET_LOG_PAGE
Definition: nvme.h:1373
uint16_t opcode
Definition: oc20.h:103
@ OC20_SEC_ERASED
Definition: oc20.h:67
int ch
Definition: oc20.h:239
uint64_t grp_mask
Definition: oc20.h:131
static uint16_t oc20_admin_cmd(FemuCtrl *n, NvmeCmd *cmd)
Definition: oc20.c:916
uint16_t cid
Definition: oc20.h:122
uint32_t max_open_punits
Definition: oc20.h:154
uint8_t rsvd4[3840]
Definition: oc20.h:200
static uint16_t oc20_chunk_set_free(FemuCtrl *n, NvmeNamespace *ns, uint64_t lba, hwaddr mptr, NvmeRequest *req)
Definition: oc20.c:421
@ OC20_CMD_VECT_WRITE
Definition: oc20.h:60
static uint16_t oc20_erase(FemuCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
Definition: oc20.c:784
void nvme_addr_read(FemuCtrl *n, hwaddr addr, void *buf, int size)
Definition: dma.c:3
uint32_t secs_per_lun
Definition: oc20.h:229
uint8_t grp_len
Definition: oc20.h:169
#define OC20_CMD_MAX_LBAS
Definition: oc20.h:9
uint32_t cdw12
Definition: nvme.h:308
@ OC20_OFFLINE_CHUNK
Definition: oc20.h:88
uint8_t sec_len
Definition: oc20.h:172
struct Oc20Namespace Oc20Namespace
uint64_t slba
Definition: oc20.h:97
static uint16_t oc20_set_log(FemuCtrl *n, NvmeCmd *cmd)
Definition: oc20.c:889
Oc20IdPerf perf
Definition: oc20.h:199
uint8_t major
Definition: oc20.h:188
NvmeParams params
Definition: nvme.h:1219
uint8_t rsvd2[12]
Definition: oc20.h:194
uint64_t predef
Definition: nvme.h:993
@ NVME_INTERNAL_DEV_ERROR
Definition: nvme.h:532
@ OC20_CHUNK_FREE
Definition: oc20.h:71
static int nvme_rw_is_write(NvmeRequest *req)
Definition: oc20.h:261
uint8_t extended
Definition: nvme.h:1131
struct Oc20DmCmd Oc20DmCmd
pthread_spinlock_t chip_locks[FEMU_MAX_NUM_CHIPS]
Definition: nvme.h:1303
static int oc20_init_namespace(FemuCtrl *n, NvmeNamespace *ns, Error **errp)
Definition: oc20.c:1157
struct Oc20IdLBAF Oc20IdLBAF
@ OC20_CHUNK_OFFLINE
Definition: oc20.h:74
uint8_t wit
Definition: oc20.h:195
uint32_t tbet
Definition: oc20.h:163
Oc20IdGeo geo
Definition: oc20.h:197
#define NVME_ID_NS_LBADS(ns)
Definition: nvme.h:26
static void oc20_exit(FemuCtrl *n)
Definition: oc20.c:1353
Oc20ParamsMccap
Definition: oc20.h:203
uint16_t is_write
是否为写操作
Definition: nvme.h:973
struct Oc20RwCmd Oc20RwCmd
void nvme_addr_write(FemuCtrl *n, hwaddr addr, void *buf, int size)
Definition: dma.c:13
#define NVME_ID_NS_MS(ns)
Definition: nvme.h:31
uint64_t data
Definition: nvme.h:1085
uint64_t ns_size
Definition: nvme.h:1235
uint32_t ws_opt
Definition: oc20.h:151
@ OC20_CHUNK_TYPE_RAN
Definition: oc20.h:79
@ OC20_PARAMS_MCCAP_EARLY_RESET
Definition: oc20.h:206
uint8_t chk_offset
Definition: oc20.h:137
@ OC20_OUT_OF_ORDER_WRITE
Definition: oc20.h:87
NvmeIdCtrl id_ctrl
Definition: nvme.h:1285
uint16_t nlb
Definition: oc20.h:113
#define FEMU_MAX_NUM_CHIPS
Definition: nvme.h:1151
Oc20ChunkTypes
Definition: oc20.h:77
#define OC20_LBA_GET_PUNIT(lbaf, lba)
Definition: oc20.h:22
uint32_t state
Definition: oc12.h:2
@ NVME_INVALID_LOG_ID
Definition: nvme.h:553
uint32_t trdm
Definition: oc20.h:160
NvmeCmdDptr dptr
Definition: nvme.h:305
@ NVME_INVALID_OPCODE
Definition: nvme.h:527
uint8_t nsfeat
Definition: nvme.h:867
Oc20Params oc20
Definition: nvme.h:1146
Oc20CS * chunk_info
Definition: oc20.h:235
line
Definition: ftl.h:198
uint64_t nsze
Definition: nvme.h:864
int cnt
Definition: oc20.h:243
uint32_t mw_cunits
Definition: oc20.h:152
uint64_t prp1
Definition: nvme.h:283
#define OC20_LBA_GET_GROUP(lbaf, lba)
Definition: oc20.h:26
uint8_t secs_per_pg
Definition: nvme.h:1155
uint64_t chunkinfo_size
Definition: oc20.h:234
uint16_t sqid
Definition: nvme.h:1013
static uint16_t oc20_init_chunk_info(Oc20Namespace *lns)
Definition: oc20.c:63
uint16_t ms
Definition: nvme.h:856
static int get_ch_lun_chk(char *chunkinfo, unsigned int *grp, unsigned int *lun, unsigned int *chk)
Definition: oc20.c:527
void set_latency(FemuCtrl *n)
Definition: timing.c:3
uint32_t secs_per_chk
Definition: oc20.h:228
uint32_t max_open_chks
Definition: oc20.h:153
NvmeLBAF lbaf[16]
Definition: nvme.h:893
#define OC20_LBA_GET_SECTR(lbaf, lba)
Definition: oc20.h:14
char * writefail_fname
Definition: nvme.h:1109
uint32_t cdw10
Definition: nvme.h:306
uint8_t rsvd[4]
Definition: oc20.h:173
uint32_t nsid
Definition: oc20.h:123
@ OC20_LBAL_SGL_LENGTH_INVALID
Definition: oc20.h:84
uint64_t chk_mask
Definition: oc20.h:133
uint16_t opcode
Definition: nvme.h:297
static uint64_t nvme_ns_calc_blks(FemuCtrl *n, NvmeNamespace *ns)
Definition: oc20.c:997
uint8_t chk_len
Definition: oc20.h:171
static void _oc20_check_size(void)
Definition: oc20.h:249
@ OC20_CHUNK_TYPE_SEQ
Definition: oc20.h:78
uint32_t nlb
Definition: oc20.h:126
@ OC20_PARAMS_MCCAP_MULTIPLE_RESETS
Definition: oc20.h:204
uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t prp1, uint64_t prp2, uint32_t len, FemuCtrl *n)
Definition: dma.c:23
struct NvmeNamespace::@18 blk
Oc20IoCommands
Definition: oc20.h:58
uint64_t cnlb
Definition: oc20.h:98
uint64_t sec_mask
Definition: oc20.h:134
uint8_t rsvd[40]
Definition: oc20.h:165
NvmeCqe cqe
Definition: nvme.h:982
uint64_t lun_mask
Definition: oc20.h:132
void * state
Definition: nvme.h:1089
uint64_t rsvd2
Definition: oc20.h:109
uint8_t flbas
Definition: nvme.h:869
uint8_t early_reset
Definition: nvme.h:1104
uint32_t mccap
Definition: nvme.h:1098
uint64_t lbal
Definition: oc20.h:112
@ OC20_CMD_VECT_READ
Definition: oc20.h:61
static void oc20_free_namespace(FemuCtrl *n, NvmeNamespace *ns)
Definition: oc20.c:959
uint8_t num_pln
Definition: nvme.h:1160
uint32_t chks_per_grp
Definition: oc20.h:226
uint8_t lbads
Definition: nvme.h:857
int64_t advance_channel_timestamp(FemuCtrl *n, int ch, uint64_t now, int opcode)
Definition: timing.c:38
int64_t expire_time
io应该结束的时间
Definition: nvme.h:990
static int oc20_rw_is_write(NvmeRequest *req)
Definition: oc20.h:266
struct NvmeSQueue * sq
Definition: nvme.h:968
volatile int64_t chnl_next_avail_time[FEMU_MAX_NUM_CHNLS]
Definition: nvme.h:1304
uint32_t num_namespaces
Definition: nvme.h:1232
static int get_chunk_meta_index(FemuCtrl *n, NvmeNamespace *ns, unsigned int grp, unsigned int lun, unsigned int chk)
Definition: oc20.c:545
@ OC20_SEC_WRITTEN
Definition: oc20.h:66
static Oc20Namespace * cmd_lns(FemuCtrl *n, NvmeCmd *cmd)
Definition: oc20.c:683
static void oc20_parse_lba_list(FemuCtrl *n, NvmeNamespace *ns, NvmeCmd *cmd, NvmeRequest *req, Oc20AddrBucket *bucket, int *nr)
Definition: oc20.c:133
static NvmeNamespace * cmd_ns(FemuCtrl *n, NvmeCmd *cmd)
Definition: oc20.c:691
SsdDramBackend * mbe
femu后端内存(实际数据)
Definition: nvme.h:1322
uint8_t cmd_opcode
Definition: nvme.h:983
uint32_t chks_total
Definition: oc20.h:227
int lun
Definition: oc20.h:240
@ NVME_DULB
Definition: nvme.h:579
uint64_t metadata
Definition: oc20.h:110
uint32_t rsvd2[3]
Definition: oc20.h:127
static uint16_t oc20_identify(FemuCtrl *n, NvmeCmd *cmd)
Definition: oc20.c:769
uint16_t num_lun
Definition: oc20.h:143
void * state
Definition: nvme.h:1170
uint32_t tprt
Definition: oc20.h:161
uint32_t mw_cunits
Definition: nvme.h:1101
uint8_t dlfeat
Definition: nvme.h:1139
uint32_t clba
Definition: oc20.h:145
@ NVME_CMD_READ
Definition: nvme.h:341
@ OC20_ADM_CMD_IDENTIFY
Definition: nvme.h:1372
int pg
Definition: oc20.h:241
static uint16_t oc20_rw_check_read_req(FemuCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
Definition: oc20.c:391
uint64_t slba
开始lba
Definition: nvme.h:972
uint8_t wear_index
Definition: oc20.h:95
Oc20LogPage
Definition: oc20.h:209
uint16_t rsvd1
Definition: oc20.h:105
void nvme_set_error_page(FemuCtrl *n, uint16_t sqid, uint16_t cid, uint16_t status, uint16_t location, uint64_t lba, uint32_t nsid)
Definition: nvme-util.c:96
#define NVME_CAP_SET_OC(cap, val)
Definition: nvme.h:117
@ NVME_INVALID_NSID
Definition: nvme.h:537
uint64_t prp2
Definition: nvme.h:284
struct Oc20NamespaceGeometry Oc20NamespaceGeometry
NvmeNamespace * namespaces
Definition: nvme.h:1279
uint8_t * resetfail
Definition: oc20.h:222
uint16_t fuse
Definition: oc20.h:104
static unsigned get_unsigned(char *string, const char *key, unsigned int *value)
Definition: oc20.c:518
static int oc20_advance_status(FemuCtrl *n, NvmeNamespace *ns, NvmeCmd *cmd, NvmeRequest *req)
Definition: oc20.c:168
static uint16_t oc20_rw_check_req(FemuCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
Definition: oc20.c:475
OcCtrlParams oc_params
Definition: nvme.h:1299
uint32_t mccap
Definition: oc20.h:193
uint64_t ns_blks
Definition: nvme.h:1073
Oc20NamespaceGeometry id_ctrl
Definition: oc20.h:218
#define OC20_LBA_GET_CHUNK(lbaf, lba)
Definition: oc20.h:18
@ NVME_WRITE_FAULT
Definition: nvme.h:572
Oc20Header blk_hdr
Definition: oc20.h:214
static int set_resetfail_chunk(FemuCtrl *n, NvmeNamespace *ns, char *chunkinfo)
Definition: oc20.c:567
struct Oc20ChunkState Oc20CS
@ NVME_INVALID_FIELD
Definition: nvme.h:528
#define FEMU_MAX_NUM_CHNLS
Definition: nvme.h:1150
Oc20MetaStates
Definition: oc20.h:64
uint16_t psdt
Definition: oc20.h:106
uint16_t cid
cmd id
Definition: nvme.h:521
@ OC20_CHUNK_TYPE_SRK
Definition: oc20.h:80
uint8_t lun_offset
Definition: oc20.h:136
uint32_t err_rec
Definition: nvme.h:795
#define femu_err(fmt,...)
Definition: nvme.h:1511
static uint64_t nvme_lba_to_sector_index(FemuCtrl *n, NvmeNamespace *ns, uint64_t lba)
Definition: oc20.h:271
uint8_t opcode
Definition: oc20.h:120
uint16_t num_grp
Definition: oc20.h:142