OpenSSD Cosmos+ Platform Firmware
0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
|
Go to the source code of this file.
Data Structures | |
struct | _REQ_POOL |
The request entries pool for both NVMe and NAND requests. More... | |
Macros | |
#define | AVAILABLE_OUNTSTANDING_REQ_COUNT ((USER_DIES)*128) |
#define | REQ_SLOT_TAG_NONE 0xffff |
#define | REQ_SLOT_TAG_FAIL 0xffff |
#define | REQ_ENTRY(iEntry) (&reqPoolPtr->reqPool[(iEntry)]) |
Get the request entry by entry index. More... | |
#define | REQ_BUF(iEntry) (REQ_ENTRY((iEntry))->dataBufInfo.entry) |
#define | REQ_LSA(iEntry) (REQ_ENTRY((iEntry))->logicalSliceAddr) |
#define | REQ_VSA(iEntry) (REQ_ENTRY((iEntry))->nandInfo.virtualSliceAddr) |
#define | REQ_CODE_IS(idx, code) (REQ_ENTRY((idx))->reqCode == (code)) |
Check the request code of the given request pool entry index. More... | |
#define | REQ_TYPE_IS(idx, type) (REQ_ENTRY((idx))->reqType == (type)) |
Check the request type of the given request pool entry index. More... | |
#define | REQ_QUEUE_TYPE_IS(idx, qType) (REQ_ENTRY((idx))->reqQueueType == (qType)) |
Check the request queue type of the given request pool entry index. More... | |
Typedefs | |
typedef struct _REQ_POOL | REQ_POOL |
The request entries pool for both NVMe and NAND requests. More... | |
typedef struct _REQ_POOL * | P_REQ_POOL |
Functions | |
void | InitReqPool () |
Initialize the request pool and the request queues. More... | |
void | PutToFreeReqQ (unsigned int reqSlotTag) |
Add the given request to the free request queue. More... | |
unsigned int | GetFromFreeReqQ () |
Get a free request from the free request queue. More... | |
void | PutToSliceReqQ (unsigned int reqSlotTag) |
Add the given request to the slice request queue. More... | |
unsigned int | GetFromSliceReqQ () |
Get a slice request from the slice request queue. More... | |
void | PutToBlockedByBufDepReqQ (unsigned int reqSlotTag) |
Add the given request to blockedByBufDepReqQ . More... | |
void | SelectiveGetFromBlockedByBufDepReqQ (unsigned int reqSlotTag) |
Remove the given request from the blockedByBufDepReqQ . More... | |
void | PutToBlockedByRowAddrDepReqQ (unsigned int reqSlotTag, unsigned int chNo, unsigned int wayNo) |
Add the given request to blockedByRowAddrDepReqQ . More... | |
void | SelectiveGetFromBlockedByRowAddrDepReqQ (unsigned int reqSlotTag, unsigned int chNo, unsigned int wayNo) |
Remove the given request from the blockedByRowAddrDepReqQ . More... | |
void | PutToNvmeDmaReqQ (unsigned int reqSlotTag) |
Add the given request to the NVMe DMA request queue and update its status. More... | |
void | SelectiveGetFromNvmeDmaReqQ (unsigned int regSlotTag) |
Move the specified entry from the nvmeDmaReqQ to the freeReqQ . More... | |
void | PutToNandReqQ (unsigned int reqSlotTag, unsigned chNo, unsigned wayNo) |
Add the given request to nandReqQ of the specified die. More... | |
void | GetFromNandReqQ (unsigned int chNo, unsigned int wayNo, unsigned int reqStatus, unsigned int reqCode) |
Move the head request of the specified nandReqQ queue to freeReqQ . More... | |
#define AVAILABLE_OUNTSTANDING_REQ_COUNT ((USER_DIES)*128) |
Definition at line 57 of file request_allocation.h.
#define REQ_BUF | ( | iEntry | ) | (REQ_ENTRY((iEntry))->dataBufInfo.entry) |
Definition at line 119 of file request_allocation.h.
#define REQ_CODE_IS | ( | idx, | |
code | |||
) | (REQ_ENTRY((idx))->reqCode == (code)) |
Check the request code of the given request pool entry index.
idx | the request pool entry index of the request to be checked |
code | the supposed request code of this request |
reqType
== type
, otherwise false Definition at line 130 of file request_allocation.h.
#define REQ_ENTRY | ( | iEntry | ) | (&reqPoolPtr->reqPool[(iEntry)]) |
Get the request entry by entry index.
index | Index of request pool entry. |
Definition at line 118 of file request_allocation.h.
#define REQ_LSA | ( | iEntry | ) | (REQ_ENTRY((iEntry))->logicalSliceAddr) |
Definition at line 120 of file request_allocation.h.
#define REQ_QUEUE_TYPE_IS | ( | idx, | |
qType | |||
) | (REQ_ENTRY((idx))->reqQueueType == (qType)) |
Check the request queue type of the given request pool entry index.
idx | the request pool entry index of the request to be checked |
qType | the supposed queue type of this request |
reqType
== type
, otherwise false Definition at line 148 of file request_allocation.h.
#define REQ_SLOT_TAG_FAIL 0xffff |
Definition at line 60 of file request_allocation.h.
#define REQ_SLOT_TAG_NONE 0xffff |
Definition at line 59 of file request_allocation.h.
#define REQ_TYPE_IS | ( | idx, | |
type | |||
) | (REQ_ENTRY((idx))->reqType == (type)) |
Check the request type of the given request pool entry index.
idx | the request pool entry index of the request to be checked |
type | the supposed type of this request |
reqType
== type
, otherwise false Definition at line 139 of file request_allocation.h.
#define REQ_VSA | ( | iEntry | ) | (REQ_ENTRY((iEntry))->nandInfo.virtualSliceAddr) |
Definition at line 121 of file request_allocation.h.
typedef struct _REQ_POOL * P_REQ_POOL |
The request entries pool for both NVMe and NAND requests.
A 1D fixed-sized array used for managing the request info and relation between requests. Each entry in the pool is represented in the structure SSD_REQ_FORMAT
.
Unlike the schematic in the paper, this queue is shared by both host and flash operations, so the structure of SSD_REQ_FORMAT
contains some members for distinguishing which type is the request.
unsigned int GetFromFreeReqQ | ( | ) |
Get a free request from the free request queue.
Try to get the first entry (FIFO) from the free queue. If the freeReqQ
is empty, use the function SyncAvailFreeReq()
to release some requests and recycle the request pool entries occupied by them.
Definition at line 172 of file request_allocation.c.
void GetFromNandReqQ | ( | unsigned int | chNo, |
unsigned int | wayNo, | ||
unsigned int | reqStatus, | ||
unsigned int | reqCode | ||
) |
Move the head request of the specified nandReqQ
queue to freeReqQ
.
Similar to GetFromSliceReqQ()
and SelectiveGetFromNvmeDmaReqQ()
.
reqStatus
and reqCode
not usedchNo | the target channel |
wayNo | the target way |
reqStatus | the status of the previous request executed on the specified die. |
reqCode | the command code of the request attempt to execute on the specified die. |
Definition at line 548 of file request_allocation.c.
unsigned int GetFromSliceReqQ | ( | ) |
Get a slice request from the slice request queue.
Try to pop the first request of the slice request queue.
REQ_SLOT_TAG_FAIL
if the slice request queue is empty. Definition at line 241 of file request_allocation.c.
void InitReqPool | ( | ) |
Initialize the request pool and the request queues.
At the beginning, all the requests are stored in the freeReqQ
, therefore the size of freeReqQ
should equal to the size of request pool, and the others request queue will be initialized to be empty.
After all the queues are initialized, we next have to initialize the request pool:
freeReqQ
by defaultprevBlockingReq
and nextBlockingReq
should be NONE Definition at line 77 of file request_allocation.c.
void PutToBlockedByBufDepReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to blockedByBufDepReqQ
.
Similar to PutToFreeReqQ()
.
blockedReqCnt
should also be increased.reqSlotTag | the request pool entry index of the request to be added |
Definition at line 277 of file request_allocation.c.
void PutToBlockedByRowAddrDepReqQ | ( | unsigned int | reqSlotTag, |
unsigned int | chNo, | ||
unsigned int | wayNo | ||
) |
Add the given request to blockedByRowAddrDepReqQ
.
Similar to PutToBlockedByBufDepReqQ()
.
blockedReqCnt
thus should also be increased.reqSlotTag | the request pool entry index of the request to be added. |
chNo | the channel number of the specified queue. |
wayNo | the die number of the specified queue. |
Definition at line 357 of file request_allocation.c.
void PutToFreeReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to the free request queue.
Insert the given request into the tail of the free queue and update the corresponding field of the given request.
prevReq
of the next request in the original request queue. That is, the prev request entry index of the original next request may still be reqSlotTag
.prevBlockingReq
and nextBlockingReq
of the original request.reqSlotTag | the request pool entry index of the request to be added. |
Definition at line 142 of file request_allocation.c.
void PutToNandReqQ | ( | unsigned int | reqSlotTag, |
unsigned | chNo, | ||
unsigned | wayNo | ||
) |
Add the given request to nandReqQ
of the specified die.
Similar to PutToFreeReqQ()
.
reqSlotTag | the request pool entry index of the request to be added. |
chNo | the channel number of the specified queue. |
wayNo | the die number of the specified queue. |
Definition at line 512 of file request_allocation.c.
void PutToNvmeDmaReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to the NVMe DMA request queue and update its status.
Similar to PutToFreeReqQ()
.
reqSlotTag | the request pool entry index of the request to be added |
Definition at line 431 of file request_allocation.c.
void PutToSliceReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to the slice request queue.
Similar to PutToFreeReqQ()
.
reqSlotTag | the request pool entry index of the request to be added |
Definition at line 210 of file request_allocation.c.
void SelectiveGetFromBlockedByBufDepReqQ | ( | unsigned int | reqSlotTag | ) |
Remove the given request from the blockedByBufDepReqQ
.
Similar to GetFromSliceReqQ()
, but the entry to be removed is specified by the param reqSlotTag
.
blockedReqCnt
reqSlotTag | the request pool entry index of the request to be removed |
Definition at line 309 of file request_allocation.c.
void SelectiveGetFromBlockedByRowAddrDepReqQ | ( | unsigned int | reqSlotTag, |
unsigned int | chNo, | ||
unsigned int | wayNo | ||
) |
Remove the given request from the blockedByRowAddrDepReqQ
.
Similar to SelectiveGetFromBlockedByBufDepReqQ()
.
reqSlotTag | the request pool entry index of the request to be removed. |
chNo | the channel number of the specified queue. |
wayNo | the die number of the specified queue. |
Definition at line 388 of file request_allocation.c.
void SelectiveGetFromNvmeDmaReqQ | ( | unsigned int | reqSlotTag | ) |
Move the specified entry from the nvmeDmaReqQ
to the freeReqQ
.
Remove the given request entry from the NVMe DMA request queue, and then insert into the free request queue.
PutToFreeReqQ()
and its friends won't modify the prevBlockingReq
and the nextBlockingReq
of the specified request entry, therefore after request being added to free request queue, we should also try to remove the specified request from the blocking request by calling the function ReleaseBlockedByBufDepReq()
. // FIXMEreqSlotTag | the request pool entry index of the request to be removed |
Definition at line 465 of file request_allocation.c.
|
extern |
Definition at line 53 of file request_allocation.c.
|
extern |
Definition at line 54 of file request_allocation.c.
|
extern |
Definition at line 59 of file request_allocation.c.
|
extern |
Definition at line 51 of file request_allocation.c.
|
extern |
Definition at line 56 of file request_allocation.c.
|
extern |
Definition at line 58 of file request_allocation.c.
|
extern |
Definition at line 55 of file request_allocation.c.
|
extern |
Definition at line 50 of file request_allocation.c.
|
extern |
Definition at line 52 of file request_allocation.c.