FEMU  原版 master 7e238cc
FEMU: Accurate, Scalable and Extensible NVMe SSD Emulator (FAST'18)
pqueue.h
浏览该文件的文档.
1 /*
2  * Copyright (c) 2014, Volkan Yazıcı <volkan.yazici@gmail.com>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice, this
9  * list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 
35 #ifndef PQUEUE_H
36 #define PQUEUE_H
37 
39 typedef unsigned long long pqueue_pri_t;
40 
42 typedef pqueue_pri_t (*pqueue_get_pri_f)(void *a);
43 typedef void (*pqueue_set_pri_f)(void *a, pqueue_pri_t pri);
44 typedef int (*pqueue_cmp_pri_f)(pqueue_pri_t next, pqueue_pri_t curr);
45 
47 typedef size_t (*pqueue_get_pos_f)(void *a);
48 typedef void (*pqueue_set_pos_f)(void *a, size_t pos);
49 
51 typedef void (*pqueue_print_entry_f)(FILE *out, void *a);
52 
54 typedef struct pqueue_t
55 {
56  size_t size;
57  size_t avail;
58  size_t step;
64  void **d;
65 } pqueue_t;
66 
82 pqueue_t *pqueue_init(size_t n, pqueue_cmp_pri_f cmppri, pqueue_get_pri_f getpri,
83  pqueue_set_pri_f setpri, pqueue_get_pos_f getpos, pqueue_set_pos_f setpos);
84 
89 void pqueue_free(pqueue_t *q);
90 
95 size_t pqueue_size(pqueue_t *q);
96 
103 int pqueue_insert(pqueue_t *q, void *d);
104 
111 void
112 pqueue_change_priority(pqueue_t *q, pqueue_pri_t new_pri, void *d);
113 
119 void *pqueue_pop(pqueue_t *q);
120 
127 int pqueue_remove(pqueue_t *q, void *d);
128 
134 void *pqueue_peek(pqueue_t *q);
135 
144 void pqueue_print(pqueue_t *q, FILE *out, pqueue_print_entry_f print);
145 
154 void pqueue_dump(pqueue_t *q, FILE *out, pqueue_print_entry_f print);
155 
162 int pqueue_is_valid(pqueue_t *q);
163 
164 #endif /* PQUEUE_H */
165 
dma_write_prp
uint16_t dma_write_prp(FemuCtrl *n, uint8_t *ptr, uint32_t len, uint64_t prp1, uint64_t prp2)
Definition: dma.c:112
NVME_CMBLOC_BIR
#define NVME_CMBLOC_BIR(cmbloc)
Definition: nvme.h:219
NvmeCQueue
Definition: nvme.h:1034
nvme_isr_notify_io
void nvme_isr_notify_io(void *opaque)
中断通知上层取cq
Definition: intr.c:202
pqueue_cmp_pri_f
int(* pqueue_cmp_pri_f)(pqueue_pri_t next, pqueue_pri_t curr)
Definition: pqueue.h:44
NvmeIdNs::nuse
uint64_t nuse
Definition: nvme.h:866
FemuCtrl::cmbloc
uint32_t cmbloc
Definition: nvme.h:1269
NvmeNamespace::id
uint32_t id
Definition: nvme.h:1071
FemuCtrl::mpsmax
uint8_t mpsmax
Definition: nvme.h:1255
NvmeIdCtrl::cqes
uint8_t cqes
Definition: nvme.h:738
FemuCtrl::elpe
uint8_t elpe
Definition: nvme.h:1239
nvme_clear_ctrl
static void nvme_clear_ctrl(FemuCtrl *n, bool shutdown)
Definition: femu.c:8
FemuCtrl
femu相关控制参数和数据成员
Definition: nvme.h:1184
NvmeIdNs::npda
uint16_t npda
Definition: nvme.h:888
FemuCtrl::cmbsz
uint32_t cmbsz
Definition: nvme.h:1268
FemuCtrl::sq
NvmeSQueue ** sq
sq队列列表(io)
Definition: nvme.h:1280
NvmeSQueue::db_addr
uint64_t db_addr
Definition: nvme.h:1027
pqueue_pop
void * pqueue_pop(pqueue_t *q)
Definition: pqueue.c:172
FemuCtrl::ext_ops
FemuExtCtrlOps ext_ops
nvme到各模式ssd接口
Definition: nvme.h:1220
pqueue_free
void pqueue_free(pqueue_t *q)
Definition: pqueue.c:62
NvmeIdNs
Definition: nvme.h:863
NVME_CAP_SET_AMS
#define NVME_CAP_SET_AMS(cap, val)
Definition: nvme.h:107
pqueue_print
void pqueue_print(pqueue_t *q, FILE *out, pqueue_print_entry_f print)
Definition: pqueue.c:221
NvmeIdNs::nlbaf
uint8_t nlbaf
Definition: nvme.h:868
NVME_CAP_SET_MPSMAX
#define NVME_CAP_SET_MPSMAX(cap, val)
Definition: nvme.h:121
FemuCtrl::reg_size
uint32_t reg_size
Definition: nvme.h:1231
FemuCtrl::serial
char * serial
Definition: nvme.h:1276
BBSSD
static bool BBSSD(FemuCtrl *n)
Definition: nvme.h:1381
FemuCtrl::mpsmin
uint8_t mpsmin
Definition: nvme.h:1254
NvmeNamespace::uncorrectable
unsigned long * uncorrectable
Definition: nvme.h:1070
pqueue_change_priority
void pqueue_change_priority(pqueue_t *q, pqueue_pri_t new_pri, void *d)
Definition: pqueue.c:147
pqueue_remove
int pqueue_remove(pqueue_t *q, void *d)
Definition: pqueue.c:160
NvmeBar::cmbsz
uint32_t cmbsz
Definition: nvme.h:52
FemuCtrl::vwc
uint8_t vwc
Definition: nvme.h:1247
FemuCtrl::page_bits
uint16_t page_bits
Definition: nvme.h:1225
NvmeCQueue::tail
uint32_t tail
Definition: nvme.h:1041
femu_register_types
static void femu_register_types(void)
Definition: femu.c:706
FemuCtrl::aer_reqs
NvmeRequest ** aer_reqs
Definition: nvme.h:1278
nvme_check_size
static void nvme_check_size(void)
Definition: nvme.h:939
NvmeFeatureVal::write_atomicity
uint32_t write_atomicity
Definition: nvme.h:800
NVME_ID_NS_MC_EXTENDED
#define NVME_ID_NS_MC_EXTENDED(mc)
Definition: nvme.h:922
pqueue_t::step
size_t step
Definition: pqueue.h:58
NvmeBar::cc
uint32_t cc
Definition: nvme.h:44
NVME_CTRL_SQES_MIN
#define NVME_CTRL_SQES_MIN(sqes)
Definition: nvme.h:786
NvmeFeatureVal::arbitration
uint32_t arbitration
Definition: nvme.h:792
NVME_CSTS_FAILED
@ NVME_CSTS_FAILED
Definition: nvme.h:184
femu_debug
#define femu_debug(fmt,...)
Definition: nvme.h:1507
FemuCtrl::cqr
uint8_t cqr
Definition: nvme.h:1243
nvme_start_ctrl
static int nvme_start_ctrl(FemuCtrl *n)
Definition: femu.c:44
FemuCtrl::vid
uint16_t vid
Definition: nvme.h:1265
NVME_SUCCESS
@ NVME_SUCCESS
Definition: nvme.h:526
pqueue_dump
void pqueue_dump(pqueue_t *q, FILE *out, pqueue_print_entry_f print)
Definition: pqueue.c:196
FemuCtrl::bar
NvmeBar bar
Definition: nvme.h:1188
FemuCtrl::num_poller
uint32_t num_poller
nvme poller个数(前提是multupoller_enabled开启)
Definition: nvme.h:1337
NvmeNamespace::util
unsigned long * util
Definition: nvme.h:1069
pqueue_pri_t
unsigned long long pqueue_pri_t
Definition: pqueue.h:39
FemuCtrl::sqe_size
uint16_t sqe_size
Definition: nvme.h:1228
NVME_MAX_NUM_NAMESPACES
#define NVME_MAX_NUM_NAMESPACES
Definition: nvme.h:84
OCSSD12
@ OCSSD12
Definition: nvme.h:1367
NVME_LPA_NS_SMART
@ NVME_LPA_NS_SMART
Definition: nvme.h:781
NvmeBar::csts
uint32_t csts
Definition: nvme.h:46
FemuCtrl::poller
QemuThread * poller
Definition: nvme.h:1272
FemuExtCtrlOps::exit
void(* exit)(struct FemuCtrl *)
Definition: nvme.h:1172
NVME_CAP_MPSMIN
#define NVME_CAP_MPSMIN(cap)
Definition: nvme.h:100
FemuCtrl::dbs_addr_hva
uint64_t dbs_addr_hva
Definition: nvme.h:1293
NvmeIdNs::npdg
uint16_t npdg
Definition: nvme.h:887
FemuCtrl::db_stride
uint8_t db_stride
Definition: nvme.h:1236
NVME_CAP_SET_CQR
#define NVME_CAP_SET_CQR(cap, val)
Definition: nvme.h:105
FemuCtrl::max_sqes
uint8_t max_sqes
Definition: nvme.h:1244
FemuCtrl::dbs_addr
uint64_t dbs_addr
Definition: nvme.h:1291
NvmeCQueue::size
uint32_t size
Definition: nvme.h:1044
nvme_process_db_admin
static void nvme_process_db_admin(FemuCtrl *n, hwaddr addr, int val)
Definition: femu.c:146
FemuCtrl::features
NvmeFeatureVal features
Definition: nvme.h:1284
DPS_FIRST_EIGHT
@ DPS_FIRST_EIGHT
Definition: nvme.h:936
NvmeFeatureVal::temp_thresh
uint32_t temp_thresh
Definition: nvme.h:794
dma_read_prp
uint16_t dma_read_prp(FemuCtrl *n, uint8_t *ptr, uint32_t len, uint64_t prp1, uint64_t prp2)
Definition: dma.c:137
pqueue_t::size
size_t size
Definition: pqueue.h:56
NvmeNamespace
Definition: nvme.h:1065
nvme_clear_virq
int nvme_clear_virq(FemuCtrl *n)
Definition: intr.c:246
NvmeNamespace::start_block
uint64_t start_block
Definition: nvme.h:1074
NVME_OACS_DBBUF
@ NVME_OACS_DBBUF
Definition: nvme.h:764
NVME_DNR
@ NVME_DNR
Definition: nvme.h:581
OCSSD20
@ OCSSD20
Definition: nvme.h:1368
nvme_check_cqid
int nvme_check_cqid(FemuCtrl *n, uint16_t cqid)
Definition: nvme-util.c:14
NvmeBar::intms
uint32_t intms
Definition: nvme.h:42
NVME_ID_NS_DPC_LAST_EIGHT
#define NVME_ID_NS_DPC_LAST_EIGHT(dpc)
Definition: nvme.h:923
nvme_register_extensions
static int nvme_register_extensions(FemuCtrl *n)
注册NOSSD/BBSSD/ZNSSD/OCSSD
Definition: femu.c:499
pqueue_set_pos_f
void(* pqueue_set_pos_f)(void *a, size_t pos)
Definition: pqueue.h:48
NVME_ONCS_WRITE_UNCORR
@ NVME_ONCS_WRITE_UNCORR
Definition: nvme.h:769
NVME_CSI_NVM
@ NVME_CSI_NVM
Definition: nvme.h:124
FemuCtrl
struct FemuCtrl FemuCtrl
femu相关控制参数和数据成员
pqueue_init
pqueue_t * pqueue_init(size_t n, pqueue_cmp_pri_f cmppri, pqueue_get_pri_f getpri, pqueue_set_pri_f setpri, pqueue_get_pos_f getpos, pqueue_set_pos_f setpos)
Definition: pqueue.c:37
femu_props
static Property femu_props[]
Definition: femu.c:615
NvmeFeatureVal::async_config
uint32_t async_config
Definition: nvme.h:801
NvmeSQueue
Definition: nvme.h:1009
NvmeIdNs::ncap
uint64_t ncap
Definition: nvme.h:865
rte_ring::size
uint32_t size
Definition: rte_ring.h:136
NvmeNamespace::ctrl
struct FemuCtrl * ctrl
Definition: nvme.h:1066
FemuCtrl::admin_sq
NvmeSQueue admin_sq
sq队列(admin)
Definition: nvme.h:1282
femu_info
static const TypeInfo femu_info
Definition: femu.c:695
pqueue_t::getpos
pqueue_get_pos_f getpos
Definition: pqueue.h:62
FemuCtrl::intc
uint8_t intc
Definition: nvme.h:1258
nvme_register_ocssd12
int nvme_register_ocssd12(FemuCtrl *n)
Definition: oc12.c:1084
pqueue_t::avail
size_t avail
Definition: pqueue.h:57
NvmeNamespace::id_ns
NvmeIdNs id_ns
Definition: nvme.h:1067
NvmeBar::cap
uint64_t cap
Definition: nvme.h:40
nvme_cmb_ops
static const MemoryRegionOps nvme_cmb_ops
Definition: femu.c:266
pqueue_t::cmppri
pqueue_cmp_pri_f cmppri
Definition: pqueue.h:59
NVME_ID_NS_DPC_FIRST_EIGHT
#define NVME_ID_NS_DPC_FIRST_EIGHT(dpc)
Definition: nvme.h:924
FemuCtrl::mdts
uint8_t mdts
Definition: nvme.h:1242
FemuCtrl::start_time
time_t start_time
Definition: nvme.h:1222
NVME_CAP_SET_MPSMIN
#define NVME_CAP_SET_MPSMIN(cap, val)
Definition: nvme.h:119
FemuCtrl::completed
int completed
Definition: nvme.h:1323
FemuCtrl::should_isr
bool * should_isr
是否中断通知上层来取cq
Definition: nvme.h:1329
pqueue_insert
int pqueue_insert(pqueue_t *q, void *d)
Definition: pqueue.c:122
nvme_init_cmb
static void nvme_init_cmb(FemuCtrl *n)
Definition: femu.c:455
nvme_addr_read
void nvme_addr_read(FemuCtrl *n, hwaddr addr, void *buf, int size)
Definition: dma.c:3
NVME_ONCS_WRITE_ZEROS
@ NVME_ONCS_WRITE_ZEROS
Definition: nvme.h:771
SsdDramBackend::femu_mode
int femu_mode
Definition: dram.h:21
NVME_CAP_SET_TO
#define NVME_CAP_SET_TO(cap, val)
Definition: nvme.h:109
NVME_CAP_SET_MQES
#define NVME_CAP_SET_MQES(cap, val)
Definition: nvme.h:103
FemuCtrl::extended
uint8_t extended
Definition: nvme.h:1252
pqueue_t
struct pqueue_t pqueue_t
NVME_CAP_CSS_CSI_SUPP
@ NVME_CAP_CSS_CSI_SUPP
Definition: nvme.h:130
NvmeCQueue::db_addr
uint64_t db_addr
Definition: nvme.h:1052
NvmeBar::acq
uint64_t acq
Definition: nvme.h:50
FemuCtrl::eis_addr
uint64_t eis_addr
Definition: nvme.h:1292
DPS_TYPE_MASK
@ DPS_TYPE_MASK
Definition: nvme.h:935
nvme_init_ctrl
static void nvme_init_ctrl(FemuCtrl *n)
Definition: femu.c:381
NVME_CAP_SET_NSSRS
#define NVME_CAP_SET_NSSRS(cap, val)
Definition: nvme.h:113
FemuCtrl::cqe_size
uint16_t cqe_size
Definition: nvme.h:1227
FemuCtrl::meta
uint8_t meta
Definition: nvme.h:1246
FemuCtrl::num_io_queues
uint32_t num_io_queues
sq(cq)个数
Definition: nvme.h:1233
OCSSD
static bool OCSSD(FemuCtrl *n)
Definition: nvme.h:1376
nvme_free_sq
void nvme_free_sq(NvmeSQueue *sq, FemuCtrl *n)
Definition: nvme-util.c:152
NVME_CAP_SET_DSTRD
#define NVME_CAP_SET_DSTRD(cap, val)
Definition: nvme.h:111
FemuCtrl::max_cqes
uint8_t max_cqes
Definition: nvme.h:1245
NvmeBar::asq
uint64_t asq
Definition: nvme.h:49
FemuCtrl::aerl
uint8_t aerl
Definition: nvme.h:1237
NVME_CC_SHN
#define NVME_CC_SHN(cc)
Definition: nvme.h:158
FemuCtrl::max_q_ents
uint32_t max_q_ents
Definition: nvme.h:1234
FemuCtrl::temperature
uint16_t temperature
Definition: nvme.h:1223
nvme_register_bbssd
int nvme_register_bbssd(FemuCtrl *n)
注册blackbox相关函数
Definition: bb.c:145
nvme_addr_write
void nvme_addr_write(FemuCtrl *n, hwaddr addr, void *buf, int size)
Definition: dma.c:13
FemuCtrl::ns_size
uint64_t ns_size
Definition: nvme.h:1235
FemuCtrl::femu_mode
uint8_t femu_mode
Definition: nvme.h:1296
NvmeCQueue::head
uint32_t head
Definition: nvme.h:1040
pqueue_t
Definition: pqueue.h:54
pqueue_set_pri_f
void(* pqueue_set_pri_f)(void *a, pqueue_pri_t pri)
Definition: pqueue.h:43
NVME_CC_IOCQES
#define NVME_CC_IOCQES(cc)
Definition: nvme.h:160
FEMU
#define FEMU(obj)
Definition: nvme.h:1093
FemuCtrl::id_ctrl
NvmeIdCtrl id_ctrl
Definition: nvme.h:1285
nvme_register_znssd
int nvme_register_znssd(FemuCtrl *n)
Definition: zns.c:1312
NvmeIdCtrl::subnqn
uint8_t subnqn[256]
Definition: nvme.h:753
femu_realize
static void femu_realize(PCIDevice *pci_dev, Error **errp)
femu初始化,分配空间
Definition: femu.c:530
FemuCtrl::eis_addr_hva
uint64_t eis_addr_hva
Definition: nvme.h:1294
nvme_isr_notify_admin
void nvme_isr_notify_admin(void *opaque)
通知上层admin命令已完成
Definition: intr.c:192
NOSSD
static bool NOSSD(FemuCtrl *n)
Definition: nvme.h:1386
femu_ring_free
void femu_ring_free(struct rte_ring *ring)
Definition: rte_ring.c:213
FemuCtrl::dps
uint8_t dps
Definition: nvme.h:1250
FemuCtrl::mc
uint8_t mc
Definition: nvme.h:1248
NVME_ONCS_COMPARE
@ NVME_ONCS_COMPARE
Definition: nvme.h:768
FemuCtrl::intc_thresh
uint8_t intc_thresh
Definition: nvme.h:1259
NVME_OACS_FORMAT
@ NVME_OACS_FORMAT
Definition: nvme.h:761
pqueue_t::d
void ** d
Definition: pqueue.h:64
NVME_ONCS_DSM
@ NVME_ONCS_DSM
Definition: nvme.h:770
pqueue_get_pri_f
pqueue_pri_t(* pqueue_get_pri_f)(void *a)
Definition: pqueue.h:42
NvmeIdNs::nsfeat
uint8_t nsfeat
Definition: nvme.h:867
FemuCtrl::pq
pqueue_t ** pq
pqueue,暂存req的队列
Definition: nvme.h:1328
FemuCtrl::cq
NvmeCQueue ** cq
cq队列列表(io)
Definition: nvme.h:1281
NvmeIdCtrl::sqes
uint8_t sqes
Definition: nvme.h:737
NvmeIdNs::nsze
uint64_t nsze
Definition: nvme.h:864
nvme_register_nossd
int nvme_register_nossd(FemuCtrl *n)
Definition: nop.c:29
NvmeIdNs::dlfeat
uint8_t dlfeat
Definition: nvme.h:876
NVME_CAP_SET_CSS
#define NVME_CAP_SET_CSS(cap, val)
Definition: nvme.h:115
nvme_init_namespace
static int nvme_init_namespace(FemuCtrl *n, NvmeNamespace *ns, Error **errp)
Definition: femu.c:341
nvme_mmio_read
static uint64_t nvme_mmio_read(void *opaque, hwaddr addr, unsigned size)
Definition: femu.c:133
nvme_init_cq
uint16_t nvme_init_cq(NvmeCQueue *cq, FemuCtrl *n, uint64_t dma_addr, uint16_t cqid, uint16_t vector, uint16_t size, uint16_t irq_enabled, int contig)
Definition: nvme-util.c:237
FemuCtrl::iomem
MemoryRegion iomem
Definition: nvme.h:1186
nvme_cmb_read
static uint64_t nvme_cmb_read(void *opaque, hwaddr addr, unsigned size)
Definition: femu.c:256
FemuCtrl::csi
uint8_t csi
Definition: nvme.h:1203
FemuCtrl::memsz
uint32_t memsz
Definition: nvme.h:1298
NVME_CSTS_READY
@ NVME_CSTS_READY
Definition: nvme.h:183
nvme_init_pci
static void nvme_init_pci(FemuCtrl *n)
Definition: femu.c:467
NvmeBar::cmbloc
uint32_t cmbloc
Definition: nvme.h:51
NVME_CTRL_SQES_MAX
#define NVME_CTRL_SQES_MAX(sqes)
Definition: nvme.h:787
nvme_process_sq_admin
void nvme_process_sq_admin(void *opaque)
处理admin命令的sq队列
Definition: nvme-admin.c:1036
NvmeIdNs::mc
uint8_t mc
Definition: nvme.h:870
free_dram_backend
void free_dram_backend(SsdDramBackend *b)
Definition: dram.c:29
FemuCtrl::intc_time
uint8_t intc_time
Definition: nvme.h:1260
NvmeLBAF::ms
uint16_t ms
Definition: nvme.h:856
NvmeBar::intmc
uint32_t intmc
Definition: nvme.h:43
NVME_MAX_STRIDE
#define NVME_MAX_STRIDE
Definition: nvme.h:83
pqueue_get_pos_f
size_t(* pqueue_get_pos_f)(void *a)
Definition: pqueue.h:47
NvmeIdNs::lbaf
NvmeLBAF lbaf[16]
Definition: nvme.h:893
NVME_CTRL_CQES_MAX
#define NVME_CTRL_CQES_MAX(cqes)
Definition: nvme.h:789
nvme_cmb_write
static void nvme_cmb_write(void *opaque, hwaddr addr, uint64_t data, unsigned size)
Definition: femu.c:249
FemuCtrl::lver
uint8_t lver
femu模式,包括blackbox,ocssd,...
Definition: nvme.h:1297
FemuCtrl::temp_warn_issued
uint8_t temp_warn_issued
Definition: nvme.h:1262
nvme_write_bar
static void nvme_write_bar(FemuCtrl *n, hwaddr offset, uint64_t data, unsigned size)
Definition: femu.c:81
nvme_mmio_write
static void nvme_mmio_write(void *opaque, hwaddr addr, uint64_t data, unsigned size)
Definition: femu.c:237
nvme.h
nvme相关数据声明
FemuCtrl::admin_cq
NvmeCQueue admin_cq
cq队列(admin)
Definition: nvme.h:1283
nvme_process_db_io
static void nvme_process_db_io(FemuCtrl *n, hwaddr addr, int val)
Definition: femu.c:186
FemuCtrl::oncs
uint16_t oncs
Definition: nvme.h:1230
NvmeFeatureVal::int_vector_config
uint32_t * int_vector_config
Definition: nvme.h:799
NvmeIdNs::dpc
uint8_t dpc
Definition: nvme.h:871
NVME_CTRL_CQES_MIN
#define NVME_CTRL_CQES_MIN(cqes)
Definition: nvme.h:788
FemuCtrl::oacs
uint16_t oacs
Definition: nvme.h:1229
NVME_MIN_CQUEUE_ES
#define NVME_MIN_CQUEUE_ES
Definition: nvme.h:86
FemuCtrl::to_ftl
struct rte_ring ** to_ftl
生产者:nvme poller;消费者:ftl
Definition: nvme.h:1326
NVME_CSTS_SHST_COMPLETE
@ NVME_CSTS_SHST_COMPLETE
Definition: nvme.h:187
nvme_map_prp
uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t prp1, uint64_t prp2, uint32_t len, FemuCtrl *n)
Definition: dma.c:23
MLC
@ MLC
Definition: nand.h:85
pqueue_peek
void * pqueue_peek(pqueue_t *q)
Definition: pqueue.c:186
nvme_check_constraints
static int nvme_check_constraints(FemuCtrl *n)
Definition: femu.c:286
ZNSSD
static bool ZNSSD(FemuCtrl *n)
Definition: nvme.h:1391
NVME_Q_PRIO_HIGH
@ NVME_Q_PRIO_HIGH
Definition: nvme.h:401
NVME_ID_NS_DPC_TYPE_MASK
#define NVME_ID_NS_DPC_TYPE_MASK
Definition: nvme.h:928
NvmeNamespace::size
uint64_t size
Definition: nvme.h:1072
nvme_register_ocssd20
int nvme_register_ocssd20(FemuCtrl *n)
Definition: oc20.c:1363
NVME_CAP_CSS_ADMIN_ONLY
@ NVME_CAP_CSS_ADMIN_ONLY
Definition: nvme.h:131
NVME_LPA_EXTENDED
@ NVME_LPA_EXTENDED
Definition: nvme.h:783
NvmeIdNs::flbas
uint8_t flbas
Definition: nvme.h:869
NVME_AQA_ACQS
#define NVME_AQA_ACQS(aqa)
Definition: nvme.h:207
nvme_ns_init_identify
static void nvme_ns_init_identify(FemuCtrl *n, NvmeIdNs *id_ns)
Definition: femu.c:317
NVME_MIN_SQUEUE_ES
#define NVME_MIN_SQUEUE_ES
Definition: nvme.h:87
NVME_MAX_QS
#define NVME_MAX_QS
Definition: nvme.h:81
nvme_init_sq
uint16_t nvme_init_sq(NvmeSQueue *sq, FemuCtrl *n, uint64_t dma_addr, uint16_t sqid, uint16_t cqid, uint16_t size, enum NvmeQueueFlags prio, int contig)
初始化sq队列,预分配空间
Definition: nvme-util.c:169
FemuCtrl::to_poller
struct rte_ring ** to_poller
生产者:ftl;消费者:nvme poller
Definition: nvme.h:1327
femu_vmstate
static const VMStateDescription femu_vmstate
Definition: femu.c:666
NvmeLBAF::lbads
uint8_t lbads
Definition: nvme.h:857
FemuExtCtrlOps::init
void(* init)(struct FemuCtrl *, Error **)
Definition: nvme.h:1171
nvme_init_namespaces
static int nvme_init_namespaces(FemuCtrl *n, Error **errp)
Definition: femu.c:362
pqueue_is_valid
int pqueue_is_valid(pqueue_t *q)
Definition: pqueue.c:258
nvme_mmio_ops
static const MemoryRegionOps nvme_mmio_ops
Definition: femu.c:276
NVME_MAX_QUEUE_ES
#define NVME_MAX_QUEUE_ES
Definition: nvme.h:85
FemuCtrl::num_namespaces
uint32_t num_namespaces
Definition: nvme.h:1232
NvmeFeatureVal::int_coalescing
uint32_t int_coalescing
Definition: nvme.h:798
NvmeSQueue::tail
uint32_t tail
Definition: nvme.h:1016
FemuCtrl::max_prp_ents
uint16_t max_prp_ents
Definition: nvme.h:1226
FemuCtrl::mbe
SsdDramBackend * mbe
femu后端内存(实际数据)
Definition: nvme.h:1322
NVME_LPA_CSE
@ NVME_LPA_CSE
Definition: nvme.h:782
pqueue_t::setpri
pqueue_set_pri_f setpri
Definition: pqueue.h:61
NVME_CC_EN
#define NVME_CC_EN(cc)
Definition: nvme.h:154
nvme_check_sqid
int nvme_check_sqid(FemuCtrl *n, uint16_t sqid)
Definition: nvme-util.c:9
NVME_CAP_MPSMAX
#define NVME_CAP_MPSMAX(cap)
Definition: nvme.h:101
FemuCtrl::parent_obj
PCIDevice parent_obj
Definition: nvme.h:1185
NVME_AQA_ASQS
#define NVME_AQA_ASQS(aqa)
Definition: nvme.h:206
FemuCtrl::ctrl_mem
MemoryRegion ctrl_mem
Definition: nvme.h:1187
NVME_ID_NS_MC_SEPARATE
#define NVME_ID_NS_MC_SEPARATE(mc)
Definition: nvme.h:921
FemuCtrl::nlbaf
uint8_t nlbaf
Definition: nvme.h:1251
NvmeBar::aqa
uint32_t aqa
Definition: nvme.h:48
NvmeSQueue::size
uint32_t size
Definition: nvme.h:1017
NvmeFeatureVal::sw_prog_marker
uint32_t sw_prog_marker
Definition: nvme.h:802
pqueue_t::setpos
pqueue_set_pos_f setpos
Definition: pqueue.h:63
NvmeIdNs::dps
uint8_t dps
Definition: nvme.h:872
FemuExtCtrlOps::start_ctrl
int(* start_ctrl)(struct FemuCtrl *)
Definition: nvme.h:1174
NVME_CMBSZ_GETSIZE
#define NVME_CMBSZ_GETSIZE(cmbsz)
Definition: nvme.h:269
pqueue_size
size_t pqueue_size(pqueue_t *q)
Definition: pqueue.c:68
NVME_SPEC_VER
#define NVME_SPEC_VER
Definition: femu.c:6
NVME_TEMPERATURE
#define NVME_TEMPERATURE
Definition: nvme.h:89
FemuCtrl::namespaces
NvmeNamespace * namespaces
Definition: nvme.h:1279
FemuCtrl::did
uint16_t did
Definition: nvme.h:1266
ns_blks
static uint64_t ns_blks(NvmeNamespace *ns, uint8_t lba_idx)
Definition: nvme.h:1457
NvmeFeatureVal::volatile_wc
uint32_t volatile_wc
Definition: nvme.h:796
FemuCtrl::elpes
NvmeErrorLog * elpes
Definition: nvme.h:1277
FemuCtrl::dpc
uint8_t dpc
Definition: nvme.h:1249
FemuCtrl::dataplane_started
bool dataplane_started
Definition: nvme.h:1273
nvme_free_cq
void nvme_free_cq(NvmeCQueue *cq, FemuCtrl *n)
Definition: nvme-util.c:282
FemuCtrl::lba_index
uint8_t lba_index
Definition: nvme.h:1253
NvmeFeatureVal::num_io_queues
uint32_t num_io_queues
Definition: nvme.h:797
NvmeIdCtrl
Definition: nvme.h:692
femu_class_init
static void femu_class_init(ObjectClass *oc, void *data)
femu启动
Definition: femu.c:677
pqueue_t::getpri
pqueue_get_pri_f getpri
Definition: pqueue.h:60
init_dram_backend
int init_dram_backend(SsdDramBackend **mbe, int64_t nbytes)
Definition: dram.c:13
NVME_CC_IOSQES
#define NVME_CC_IOSQES(cc)
Definition: nvme.h:159
NvmeNamespace::ns_blks
uint64_t ns_blks
Definition: nvme.h:1073
FemuCtrl::page_size
uint16_t page_size
Definition: nvme.h:1224
NvmeFeatureVal::power_mgmt
uint32_t power_mgmt
Definition: nvme.h:793
FEMU_NOSSD_MODE
@ FEMU_NOSSD_MODE
Definition: nvme.h:1360
NVME_INVALID_FIELD
@ NVME_INVALID_FIELD
Definition: nvme.h:528
nvme_destroy_poller
static void nvme_destroy_poller(FemuCtrl *n)
Definition: femu.c:571
NVME_ID_NS_FLBAS_INDEX
#define NVME_ID_NS_FLBAS_INDEX(flbas)
Definition: nvme.h:920
FemuCtrl::acl
uint8_t acl
Definition: nvme.h:1238
NVME_CC_MPS
#define NVME_CC_MPS(cc)
Definition: nvme.h:156
FemuCtrl::cmbuf
uint8_t * cmbuf
Definition: nvme.h:1270
NvmeFeatureVal::err_rec
uint32_t err_rec
Definition: nvme.h:795
pqueue_print_entry_f
void(* pqueue_print_entry_f)(FILE *out, void *a)
Definition: pqueue.h:51
NvmeBar::vs
uint32_t vs
Definition: nvme.h:41
femu_exit
static void femu_exit(PCIDevice *pci_dev)
Definition: femu.c:588