NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA Device Emulation - Virtio FS IO Context
Collaboration diagram for DOCA Device Emulation - Virtio FS IO Context:

Typedefs

typedef void(* doca_devemu_vfs_io_event_vfs_req_notice_handler_cb_t) (struct doca_devemu_vfs_req *req, void *req_user_data, union doca_data event_user_data)
 Function to be executed on vfs_req_notice event occurrence. The Ownership of the doca_devemu_vfs_req and the req_user_data moves from doca_devemu_vfs_io ctx to the user. More...
 
typedef void(* doca_devemu_vfs_io_event_vfs_notification_req_notice_handler_cb_t) (struct doca_devemu_vfs_notification_req *req, void *req_user_data, union doca_data event_user_data)
 Function to be executed on vfs_notification_req_notice event occurrence. The Ownership of the doca_devemu_vfs_notification_req and the req_user_data moves from doca_devemu_vfs_io ctx to the user. More...
 

Functions

DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_create (struct doca_devemu_vfs_dev *vfs_dev, struct doca_pe *progress_engine, struct doca_devemu_vfs_io **io)
 Allocate Virtio FS device IO context for a DOCA Virtio FS device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_destroy (struct doca_devemu_vfs_io *io)
 Free a Virtio FS device IO context. More...
 
DOCA_EXPERIMENTAL struct doca_ctx * doca_devemu_vfs_io_as_ctx (struct doca_devemu_vfs_io *io)
 Convert DOCA Virtio FS device IO context instance into DOCA context. More...
 
DOCA_EXPERIMENTAL struct doca_devemu_virtio_io * doca_devemu_vfs_io_as_virtio_io (struct doca_devemu_vfs_io *io)
 Convert DOCA Virtio FS device IO context instance into DOCA Virtio device IO context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_event_vfs_req_notice_register (struct doca_devemu_vfs_io *io, doca_devemu_vfs_io_event_vfs_req_notice_handler_cb_t handler, union doca_data user_data)
 Register to Virtio FS request notifications. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_event_vfs_notification_req_notice_register (struct doca_devemu_vfs_io *io, doca_devemu_vfs_io_event_vfs_notification_req_notice_handler_cb_t handler, union doca_data user_data)
 Register to Virtio FS notification_request notifications. More...
 
DOCA_EXPERIMENTAL void doca_devemu_vfs_req_complete (struct doca_devemu_vfs_req *req, uint32_t len)
 Complete the Virtio FS request. The Request ownership (including the associated datain, dataout and req_user_data) moves from the user back to the associated IO context. The associated IO context will complete the request towards the device driver according to the virtio fs specification. More...
 
DOCA_EXPERIMENTAL struct doca_buf * doca_devemu_vfs_req_get_datain (struct doca_devemu_vfs_req *req)
 Get the doca buffer associated with the device-readable part of the Virtio FS request. More...
 
DOCA_EXPERIMENTAL struct doca_buf * doca_devemu_vfs_req_get_dataout (struct doca_devemu_vfs_req *req)
 Get the doca buffer associated with the device-writable part of the Virtio FS request. More...
 
DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_datain_list_len (struct doca_devemu_vfs_req *req)
 Get the number of elements in the original doca buffer linked list associated with the device-readable part of the Virtio FS request returned by doca_devemu_vfs_req_get_datain(). More...
 
DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_datain_data_len (struct doca_devemu_vfs_req *req)
 Get the total data length of the original doca buffer linked list associated with the device-readable part of the Virtio FS request returned by doca_devemu_vfs_req_get_datain(). More...
 
DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_dataout_list_len (struct doca_devemu_vfs_req *req)
 Get the number of elements in the original doca buffer linked list associated with the device-writable part of the Virtio FS request returned by doca_devemu_vfs_req_get_dataout(). More...
 
DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_dataout_data_len (struct doca_devemu_vfs_req *req)
 Get the total data length of the original doca buffer linked list associated with the device-writable part of the Virtio FS request returned by doca_devemu_vfs_req_get_dataout(). More...
 
DOCA_EXPERIMENTAL uint64_t doca_devemu_vfs_req_get_id (struct doca_devemu_vfs_req *req)
 Get the request identifier. DOCA journal recovery guarantees to (re)play all the commands that were in flight in the eyes of the host at the point of crash with the original req id. More...
 
DOCA_EXPERIMENTAL uint16_t doca_devemu_vfs_req_get_src_domain_id (struct doca_devemu_vfs_req *req)
 Get the source domain identifier for the request. DOCA journal recovery guarantees to (re)play all the commands that were in flight in the eyes of the host at the point of crash with the original domain id. More...
 
DOCA_EXPERIMENTAL void doca_devemu_vfs_notification_req_complete (struct doca_devemu_vfs_notification_req *req, uint32_t len)
 Complete the Virtio FS notification_request. The Request ownership (including the associated dataout and req_user_data) moves from the user back to the associated IO context. The associated IO context will complete the request towards the device driver according to the virtio fs specification. More...
 
DOCA_EXPERIMENTAL struct doca_buf * doca_devemu_vfs_notification_req_get_dataout (struct doca_devemu_vfs_notification_req *req)
 Get the doca buffer associated with the device-writable part of the Virtio FS notification request. More...
 
DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_notification_req_get_dataout_list_len (struct doca_devemu_vfs_notification_req *req)
 Get the number of elements in the original doca buffer linked list associated with the device-writable part of the Virtio FS notification request returned by doca_devemu_vfs_notification_req_get_dataout(). More...
 
DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_notification_req_get_dataout_data_len (struct doca_devemu_vfs_notification_req *req)
 Get the total data length of the original doca buffer linked list associated with the device-writable part of the Virtio FS notification request returned by doca_devemu_vfs_notification_req_get_dataout(). More...
 
DOCA_EXPERIMENTAL uint64_t doca_devemu_vfs_notification_req_get_id (struct doca_devemu_vfs_notification_req *req)
 Get the notification request identifier. More...
 
DOCA_EXPERIMENTAL uint16_t doca_devemu_vfs_notification_req_get_src_domain_id (struct doca_devemu_vfs_notification_req *req)
 Get the source domain identifier for the notification request. More...
 

Detailed Description

DOCA Virtio FS IO context

Typedef Documentation

◆ doca_devemu_vfs_io_event_vfs_notification_req_notice_handler_cb_t

typedef void(* doca_devemu_vfs_io_event_vfs_notification_req_notice_handler_cb_t) (struct doca_devemu_vfs_notification_req *req, void *req_user_data, union doca_data event_user_data)

Function to be executed on vfs_notification_req_notice event occurrence. The Ownership of the doca_devemu_vfs_notification_req and the req_user_data moves from doca_devemu_vfs_io ctx to the user.

Parameters
[in]reqThe arrived request.
[in]req_user_dataThe user data associated to the request.
[in]event_user_dataSame user data that was provided in doca_devemu_vfs_io_event_vfs_notification_req_notice_register().

Definition at line 164 of file doca_devemu_vfs_io.h.

◆ doca_devemu_vfs_io_event_vfs_req_notice_handler_cb_t

typedef void(* doca_devemu_vfs_io_event_vfs_req_notice_handler_cb_t) (struct doca_devemu_vfs_req *req, void *req_user_data, union doca_data event_user_data)

Function to be executed on vfs_req_notice event occurrence. The Ownership of the doca_devemu_vfs_req and the req_user_data moves from doca_devemu_vfs_io ctx to the user.

Parameters
[in]reqThe arrived request.
[in]req_user_dataThe user data associated to the request.
[in]event_user_dataSame user data that was provided in doca_devemu_vfs_io_event_vfs_req_notice_register().

Definition at line 125 of file doca_devemu_vfs_io.h.

Function Documentation

◆ doca_devemu_vfs_io_as_ctx()

DOCA_EXPERIMENTAL struct doca_ctx* doca_devemu_vfs_io_as_ctx ( struct doca_devemu_vfs_io *  io)

Convert DOCA Virtio FS device IO context instance into DOCA context.

Parameters
[in]ioDOCA Virtio FS device IO context instance. This must remain valid until after the DOCA context is no longer required.
Returns
doca ctx upon success, NULL otherwise.

◆ doca_devemu_vfs_io_as_virtio_io()

DOCA_EXPERIMENTAL struct doca_devemu_virtio_io* doca_devemu_vfs_io_as_virtio_io ( struct doca_devemu_vfs_io *  io)

Convert DOCA Virtio FS device IO context instance into DOCA Virtio device IO context.

Parameters
[in]ioDOCA Virtio FS device IO context instance. This must remain valid until after the DOCA Virtio device IO context is no longer required.
Returns
doca devemu virtio device io context upon success, NULL otherwise.

◆ doca_devemu_vfs_io_create()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_create ( struct doca_devemu_vfs_dev *  vfs_dev,
struct doca_pe *  progress_engine,
struct doca_devemu_vfs_io **  io 
)

Allocate Virtio FS device IO context for a DOCA Virtio FS device.

The responsibility of the Virtio FS IO context is to relay the requests arriving from the device driver towards the Virtio FS services and applications. Additionally, it is responsible for relaying the completions arriving from the Virtio FS services and applications towards the device driver. Each Virtio FS device IO context is associated with a single DOCA Virtio FS device.

Parameters
[in]vfs_devDOCA Virtio FS device.
[in]progress_engineThe progress engine that will be used to progress the new context.
[out]ioThe created DOCA Virtio FS device IO context.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_vfs_io_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_destroy ( struct doca_devemu_vfs_io *  io)

Free a Virtio FS device IO context.

Parameters
[in]ioThe DOCA Virtio FS device IO context to release. Must be idle.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'io' is NULL
  • DOCA_ERROR_BAD_STATE - device IO context is not idle. Use doca_ctx_stop() to stop it

◆ doca_devemu_vfs_io_event_vfs_notification_req_notice_register()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_event_vfs_notification_req_notice_register ( struct doca_devemu_vfs_io *  io,
doca_devemu_vfs_io_event_vfs_notification_req_notice_handler_cb_t  handler,
union doca_data  user_data 
)

Register to Virtio FS notification_request notifications.

Registration can be done only while IO ctx is idle. If called multiple times then only the last call will take effect.

Parameters
[in]ioThe DOCA Virtio FS device IO context to be associated with the event. Must be idle.
[in]handlerMethod that is invoked once event is triggered.
[in]user_dataUser data that will be provided to the handler once invoked.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'io' or 'handler' are NULL
  • DOCA_ERROR_BAD_STATE - IO is not idle

◆ doca_devemu_vfs_io_event_vfs_req_notice_register()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_event_vfs_req_notice_register ( struct doca_devemu_vfs_io *  io,
doca_devemu_vfs_io_event_vfs_req_notice_handler_cb_t  handler,
union doca_data  user_data 
)

Register to Virtio FS request notifications.

Registration can be done only while IO ctx is idle. If called multiple times then only the last call will take effect.

Parameters
[in]ioThe DOCA Virtio FS device IO context to be associated with the event. Must be idle.
[in]handlerMethod that is invoked once event is triggered.
[in]user_dataUser data that will be provided to the handler once invoked.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'io' or 'handler' are NULL
  • DOCA_ERROR_BAD_STATE - IO is not idle

◆ doca_devemu_vfs_notification_req_complete()

DOCA_EXPERIMENTAL void doca_devemu_vfs_notification_req_complete ( struct doca_devemu_vfs_notification_req *  req,
uint32_t  len 
)

Complete the Virtio FS notification_request. The Request ownership (including the associated dataout and req_user_data) moves from the user back to the associated IO context. The associated IO context will complete the request towards the device driver according to the virtio fs specification.

Parameters
[in]reqThe Virtio FS notification_request to complete.
[in]lenThe number of bytes written into the device writable portion of the buffer described by the req.

◆ doca_devemu_vfs_notification_req_get_dataout()

DOCA_EXPERIMENTAL struct doca_buf* doca_devemu_vfs_notification_req_get_dataout ( struct doca_devemu_vfs_notification_req *  req)

Get the doca buffer associated with the device-writable part of the Virtio FS notification request.

This function should be issued during scheduling the request towards the execution context that will be writing to the doca buffer.

Parameters
[in]reqThe Virtio FS notification request to query.
Returns
The doca buffer representing the host memory for the device-writable part, virtio_fs_notify::(out_hdr + outarg), according to the virtio specification, associated to the notification request on success. NULL otherwise.

◆ doca_devemu_vfs_notification_req_get_dataout_data_len()

DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_notification_req_get_dataout_data_len ( struct doca_devemu_vfs_notification_req *  req)

Get the total data length of the original doca buffer linked list associated with the device-writable part of the Virtio FS notification request returned by doca_devemu_vfs_notification_req_get_dataout().

Parameters
[in]reqThe Virtio FS notification request to query. Must not be NULL.
Returns
The total data length (in bytes) of all elements in the original dataout DOCA buffer linked list. Valid only if the request is in the ownership of the user.

◆ doca_devemu_vfs_notification_req_get_dataout_list_len()

DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_notification_req_get_dataout_list_len ( struct doca_devemu_vfs_notification_req *  req)

Get the number of elements in the original doca buffer linked list associated with the device-writable part of the Virtio FS notification request returned by doca_devemu_vfs_notification_req_get_dataout().

Parameters
[in]reqThe Virtio FS notification request to query. Must not be NULL.
Returns
Number of elements in the original dataout doca buffer linked list. Valid only if the request is in the ownership of the user.

◆ doca_devemu_vfs_notification_req_get_id()

DOCA_EXPERIMENTAL uint64_t doca_devemu_vfs_notification_req_get_id ( struct doca_devemu_vfs_notification_req *  req)

Get the notification request identifier.

Parameters
[in]reqThe Virtio FS notification request to query. Must not be NULL.
Returns
The notification request identifier. Valid only if the notification request is in the ownership of the user.

◆ doca_devemu_vfs_notification_req_get_src_domain_id()

DOCA_EXPERIMENTAL uint16_t doca_devemu_vfs_notification_req_get_src_domain_id ( struct doca_devemu_vfs_notification_req *  req)

Get the source domain identifier for the notification request.

Parameters
[in]reqThe Virtio FS notification request to query. Must not be NULL.
Returns
The source domain identifier of the notification request. Valid only if the notification request is in the ownership of the user.

◆ doca_devemu_vfs_req_complete()

DOCA_EXPERIMENTAL void doca_devemu_vfs_req_complete ( struct doca_devemu_vfs_req *  req,
uint32_t  len 
)

Complete the Virtio FS request. The Request ownership (including the associated datain, dataout and req_user_data) moves from the user back to the associated IO context. The associated IO context will complete the request towards the device driver according to the virtio fs specification.

Parameters
[in]reqThe Virtio FS request to complete.
[in]lenThe number of bytes written into the device writable portion of the buffer described by the req.

◆ doca_devemu_vfs_req_get_datain()

DOCA_EXPERIMENTAL struct doca_buf* doca_devemu_vfs_req_get_datain ( struct doca_devemu_vfs_req *  req)

Get the doca buffer associated with the device-readable part of the Virtio FS request.

This function should be issued during scheduling the request towards the execution context that will be reading from the doca buffer.

Parameters
[in]reqThe Virtio FS request to query.
Returns
The doca buffer representing the host memory for the device-readable part, virtio_fs_req::(in + datain), according to the virtio specification, associated to the request on success. NULL otherwise.

◆ doca_devemu_vfs_req_get_datain_data_len()

DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_datain_data_len ( struct doca_devemu_vfs_req *  req)

Get the total data length of the original doca buffer linked list associated with the device-readable part of the Virtio FS request returned by doca_devemu_vfs_req_get_datain().

Parameters
[in]reqThe Virtio FS request to query. Must not be NULL.
Returns
The total data length (in bytes) of all elements in the original datain DOCA buffer linked list. Valid only if the request is in the ownership of the user.

◆ doca_devemu_vfs_req_get_datain_list_len()

DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_datain_list_len ( struct doca_devemu_vfs_req *  req)

Get the number of elements in the original doca buffer linked list associated with the device-readable part of the Virtio FS request returned by doca_devemu_vfs_req_get_datain().

Parameters
[in]reqThe Virtio FS request to query. Must not be NULL.
Returns
Number of elements in the original datain doca buffer linked list. Valid only if the request is in the ownership of the user.

◆ doca_devemu_vfs_req_get_dataout()

DOCA_EXPERIMENTAL struct doca_buf* doca_devemu_vfs_req_get_dataout ( struct doca_devemu_vfs_req *  req)

Get the doca buffer associated with the device-writable part of the Virtio FS request.

This function should be issued during scheduling the request towards the execution context that will be writing to the doca buffer.

Parameters
[in]reqThe Virtio FS request to query.
Returns
The doca buffer representing the host memory for the device-writable part, virtio_fs_req::(out + dataout), according to the virtio specification, associated to the request on success. NULL otherwise.

◆ doca_devemu_vfs_req_get_dataout_data_len()

DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_dataout_data_len ( struct doca_devemu_vfs_req *  req)

Get the total data length of the original doca buffer linked list associated with the device-writable part of the Virtio FS request returned by doca_devemu_vfs_req_get_dataout().

Parameters
[in]reqThe Virtio FS request to query. Must not be NULL.
Returns
The total data length (in bytes) of all elements in the original dataout DOCA buffer linked list. Valid only if the request is in the ownership of the user.

◆ doca_devemu_vfs_req_get_dataout_list_len()

DOCA_EXPERIMENTAL uint32_t doca_devemu_vfs_req_get_dataout_list_len ( struct doca_devemu_vfs_req *  req)

Get the number of elements in the original doca buffer linked list associated with the device-writable part of the Virtio FS request returned by doca_devemu_vfs_req_get_dataout().

Parameters
[in]reqThe Virtio FS request to query. Must not be NULL.
Returns
Number of elements in the original dataout doca buffer linked list. Valid only if the request is in the ownership of the user.

◆ doca_devemu_vfs_req_get_id()

DOCA_EXPERIMENTAL uint64_t doca_devemu_vfs_req_get_id ( struct doca_devemu_vfs_req *  req)

Get the request identifier. DOCA journal recovery guarantees to (re)play all the commands that were in flight in the eyes of the host at the point of crash with the original req id.

Parameters
[in]reqThe Virtio FS request to query. Must not be NULL.
Returns
The request identifier. Valid only if the request is in the ownership of the user.

◆ doca_devemu_vfs_req_get_src_domain_id()

DOCA_EXPERIMENTAL uint16_t doca_devemu_vfs_req_get_src_domain_id ( struct doca_devemu_vfs_req *  req)

Get the source domain identifier for the request. DOCA journal recovery guarantees to (re)play all the commands that were in flight in the eyes of the host at the point of crash with the original domain id.

Parameters
[in]reqThe Virtio FS request to query. Must not be NULL.
Returns
The source domain identifier of the request. Valid only if the request is in the ownership of the user.