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.
Functions | |
void | InitDataBuf () |
Initialization process of the Data buffer. More... | |
unsigned int | CheckDataBufHit (unsigned int reqSlotTag) |
Get the data buffer entry index of the given request. More... | |
unsigned int | AllocateDataBuf () |
Retrieve a LRU data buffer entry from the LRU list. More... | |
void | UpdateDataBufEntryInfoBlockingReq (unsigned int bufEntry, unsigned int reqSlotTag) |
Append the request to the blocking queue of the specified data buffer entry. More... | |
unsigned int | AllocateTempDataBuf (unsigned int dieNo) |
Retrieve the index of temp buffer entry of the target die. More... | |
void | UpdateTempDataBufEntryInfoBlockingReq (unsigned int bufEntry, unsigned int reqSlotTag) |
Append the request to the blocking queue specified by given temp buffer entry. More... | |
void | PutToDataBufHashList (unsigned int bufEntry) |
Insert the given data buffer entry into the hash table. More... | |
void | SelectiveGetFromDataBufHashList (unsigned int bufEntry) |
Remove the given data buffer entry from the hash table. More... | |
Variables | |
P_DATA_BUF_MAP | dataBufMapPtr |
DATA_BUF_LRU_LIST | dataBufLruList |
P_DATA_BUF_HASH_TABLE | dataBufHashTablePtr |
P_TEMPORARY_DATA_BUF_MAP | tempDataBufMapPtr |
unsigned int AllocateDataBuf | ( | ) |
Retrieve a LRU data buffer entry from the LRU list.
Choose the LRU data buffer entry from the LRU list, and return it's index.
If the evictedEntry
is DATA_BUF_NONE
, that's an error or the dataBufLruList
is empty.
If the evictedEntry
, namely the last entry of LRU list, exists and:
it's also the head of LRU list:
this means that there is only entry in the LRU list, therefore we don't need to modify the prev/next entry of evictedEntry
.
it's the body of LRU list:
we have to make the prev entry be the new tail of LRU list, and make the evicted entry be the new head of the LRU list.
After the evicted entry being moved from the tail of LRU entry to head, we have to call the function SelectiveGetFromDataBufHashList
to remove the evictedEntry
from its bucket of hash table.
Definition at line 220 of file data_buffer.c.
unsigned int AllocateTempDataBuf | ( | unsigned int | dieNo | ) |
Retrieve the index of temp buffer entry of the target die.
By default, there is only NUM_DIES
entries in the tempDataBuf
, so we can just use the serial number of each die to determine which temp entry should be used.
dieNo | an unique number of the specified die |
Definition at line 288 of file data_buffer.c.
unsigned int CheckDataBufHit | ( | unsigned int | reqSlotTag | ) |
Get the data buffer entry index of the given request.
Try to find the data buffer entry of the given request (with same logicalSliceAddr
) by traversing the correspoding bucket of the given request.
If the request found, the corresponding data buffer entry become the Most Recently Used entry and should be moved to the head of LRU list.
reqSlotTag | the request pool entry index of the request to be check |
Definition at line 127 of file data_buffer.c.
void InitDataBuf | ( | ) |
Initialization process of the Data buffer.
Three buffer related lists will be initialized in this function
There are 16 x NUM_DIES
entries in the dataBuf
, and all the elements of dataBuf
will be initialized to:
dataBuf
array (except for head)dataBuf
array (except for tail)There are 16 x NUM_DIES
entries in the dataBufHashTable
, and all the elements will be initialized to empty bucket, so:
There are NUM_DIES
entries in the tempDataBuf
, and all the elements of it will be initialized to:
And the head/tail of dataBufLruList
points to the first/last entry of dataBuf
, this means the initial dataBufLruList
contains all the data buffer entries, therefore the data buffer should be allocated from the last element of dataBuf
array.
Definition at line 85 of file data_buffer.c.
void PutToDataBufHashList | ( | unsigned int | bufEntry | ) |
Insert the given data buffer entry into the hash table.
Insert the given data buffer entry into the tail of hash table bucket specified by the logicalSliceAddr
of the given entry, and modify the tail (head as well, if needed) of target hash table bucket.
bufEntry | the index of the data buffer entry to be inserted |
Definition at line 319 of file data_buffer.c.
void SelectiveGetFromDataBufHashList | ( | unsigned int | bufEntry | ) |
Remove the given data buffer entry from the hash table.
We may need to modify the head/tail index of corresponding bucket specified by the logicalSliceAddr
of the given data buffer entry.
bufEntry | the index of the data buffer entry to be removed |
Definition at line 349 of file data_buffer.c.
void UpdateDataBufEntryInfoBlockingReq | ( | unsigned int | bufEntry, |
unsigned int | reqSlotTag | ||
) |
Append the request to the blocking queue of the specified data buffer entry.
In current fw implementation, a slice request may be split into several sub-requests, and these sub-requests can share the same data buffer since they must be executed in correct order.
However, since the scheduler may reorder the requests base on the priority, the fw must make sure these sub-requests are executed in the correct order. To do this, each data buffer entry maintains a blocking request queue (DATA_BUF_ENTRY::blockingReqTail
). Whenever a new request is created, its request entry index will be appended to the blocking queue of the data buffer allocated for it.
ReqTransSliceToLowLevel()
, CheckBufDep()
, SelectLowLevelReqQ()
and DATA_BUF_ENTRY
.byfEntry | The data buffer entry index of the newly created request. |
reqSlotTag | The request pool entry index of the newly created request. |
Definition at line 268 of file data_buffer.c.
void UpdateTempDataBufEntryInfoBlockingReq | ( | unsigned int | bufEntry, |
unsigned int | reqSlotTag | ||
) |
Append the request to the blocking queue specified by given temp buffer entry.
Similar to UpdateDataBufEntryInfoBlockingReq()
, but the data buffer is temp buffer.
byfEntry | the temp data buffer entry index of the specified request |
reqSlotTag | the request pool entry index of the request to be |
Definition at line 298 of file data_buffer.c.
P_DATA_BUF_HASH_TABLE dataBufHashTablePtr |
Definition at line 52 of file data_buffer.c.
DATA_BUF_LRU_LIST dataBufLruList |
Definition at line 51 of file data_buffer.c.
P_DATA_BUF_MAP dataBufMapPtr |
Definition at line 50 of file data_buffer.c.
P_TEMPORARY_DATA_BUF_MAP tempDataBufMapPtr |
Definition at line 53 of file data_buffer.c.