Member-only story

Async Host Transfer, Buffer Resource Limitation, and more firmware concepts— SSD Firmware Development — Part 17

Lan D. Phan
5 min readJan 20, 2020

--

In this part, we will discuss changes to the SsdSim code in order to support asynchronous host data transfer and add the ability to handle the case when we are unable to obtain a buffer resource. It would actually make more sense to cover this along with Part 14, but the code can change quite a bit and I’d like to keep it in step-by-step, minimal change progression, as much as possible.

To support asynchronous host data transfer, we can start by looking at our own example with the NandHal. The NandHal currently supports asynchronous operations by having these characteristics:

  1. Implements an asynchronous interface to queue command or operation requests
  2. Executes on a separate thread (to simulate hardware running asynchronously)
  3. Implements interfaces to query and retrieve completions

We’ll start by renaming the CustomProtocolInterface to CustomProtocolHal so that it’s analogous to the NandHal and make it a derived class of the FrameworkThread class. We’ll add the mechanisms to handle command submission and completion handling as below:

struct TransferCommandDesc;
class TransferCommandListener
{
public:
virtual void HandleCommandCompleted(const TransferCommandDesc& command) = 0;
};
struct TransferCommandDesc
{
enum class Direction
{
In,
Out
};

--

--

No responses yet