dax_poll - poll for command completion
cc [ flag... ] file... -ldax [ library...] #include <dax.h> int dax_poll(dax_queue_t *queue, dax_poll_t res[], int nres, int64_t timeout);
This function polls for the completion of up to nres requests posted to the queue. Returns the status of the completed requests in the res array.
The behavior of this function for various values of the timeout parameter is as follows:
If timeout < 0, waits indefinitely for the nres requests to complete.
If timeout == 0, returns immediately with the results of at most nres completed requests.
If timeout > 0, waits for timeout nanoseconds to elapse, or for nres requests to complete, whichever is first.
The members of the dax_poll_t structure are:
The udata value for the operation that completed, as passed to the corresponding post function.
The completion status. Possible values are the return values in the dax_result_t status field for the corresponding non-poll function, plus:
The current request piped its output to another request, and the other request completed with status != DAX_SUCCESS or another request piped its output to the current request, and the other request completed with status != DAX_SUCCESS.
Result count. Possible values are the return values in the dax_result_t count field for the corresponding non-poll function.
No requests completed
The number of requests completed
No requests are pending
nres is 0 or negative
The calling thread did not create the queue
See attributes(7) for descriptions of the following attributes:
|
libdax(3LIB), dax_queue_create(3DAX), dax_post(3DAX)
This function moves the requests that are yet to start from the software dax_queue_t queue to the DAX hardware queue as and when space is available in the DAX hardware. Therefore, to guarantee forward progress, periodic calls to the dax_poll() function are necessary.