NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_devemu_vfs_io.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
25 #ifndef DOCA_DEVEMU_VFS_IO_H_
26 #define DOCA_DEVEMU_VFS_IO_H_
27 
28 #include <stdint.h>
29 
30 #include <doca_buf.h>
31 #include <doca_error.h>
32 #include <doca_dev.h>
33 #include <doca_devemu_pci.h>
34 #include <doca_devemu_virtio.h>
35 #include <doca_devemu_virtio_io.h>
36 #include <doca_devemu_vfs.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*********************************************************************************************************************
43  * DOCA devemu Virtio FS IO context API
44  *********************************************************************************************************************/
45 
66 doca_error_t doca_devemu_vfs_io_create(struct doca_devemu_vfs_dev *vfs_dev,
67  struct doca_pe *progress_engine, struct doca_devemu_vfs_io **io);
68 
82 doca_error_t doca_devemu_vfs_io_destroy(struct doca_devemu_vfs_io *io);
83 
94 struct doca_ctx *doca_devemu_vfs_io_as_ctx(struct doca_devemu_vfs_io *io);
95 
107 struct doca_devemu_virtio_io *doca_devemu_vfs_io_as_virtio_io(struct doca_devemu_vfs_io *io);
108 
109 /*********************************************************************************************************************
110  * DOCA devemu Virtio FS IO context events API
111  *********************************************************************************************************************/
112 
125 typedef void (*doca_devemu_vfs_io_event_vfs_req_notice_handler_cb_t)(struct doca_devemu_vfs_req *req,
126  void *req_user_data, union doca_data event_user_data);
127 
150  union doca_data user_data);
151 
165  struct doca_devemu_vfs_notification_req *req,
166  void *req_user_data, union doca_data event_user_data);
167 
190  union doca_data user_data);
191 
192 /*********************************************************************************************************************
193  * DOCA devemu Virtio FS request API
194  *********************************************************************************************************************/
195 
208 void doca_devemu_vfs_req_complete(struct doca_devemu_vfs_req *req, uint32_t len);
209 
224 struct doca_buf *doca_devemu_vfs_req_get_datain(struct doca_devemu_vfs_req *req);
225 
240 struct doca_buf *doca_devemu_vfs_req_get_dataout(struct doca_devemu_vfs_req *req);
241 
253 uint32_t doca_devemu_vfs_req_get_datain_list_len(struct doca_devemu_vfs_req *req);
254 
266 uint32_t doca_devemu_vfs_req_get_datain_data_len(struct doca_devemu_vfs_req *req);
267 
279 uint32_t doca_devemu_vfs_req_get_dataout_list_len(struct doca_devemu_vfs_req *req);
280 
292 uint32_t doca_devemu_vfs_req_get_dataout_data_len(struct doca_devemu_vfs_req *req);
293 
306 uint64_t doca_devemu_vfs_req_get_id(struct doca_devemu_vfs_req *req);
307 
320 uint16_t doca_devemu_vfs_req_get_src_domain_id(struct doca_devemu_vfs_req *req);
321 
322 /*********************************************************************************************************************
323  * DOCA devemu Virtio FS notification_request API
324  *********************************************************************************************************************/
325 
338 void doca_devemu_vfs_notification_req_complete(struct doca_devemu_vfs_notification_req *req, uint32_t len);
339 
354 struct doca_buf *doca_devemu_vfs_notification_req_get_dataout(struct doca_devemu_vfs_notification_req *req);
355 
367 uint32_t doca_devemu_vfs_notification_req_get_dataout_list_len(struct doca_devemu_vfs_notification_req *req);
368 
380 uint32_t doca_devemu_vfs_notification_req_get_dataout_data_len(struct doca_devemu_vfs_notification_req *req);
381 
392 uint64_t doca_devemu_vfs_notification_req_get_id(struct doca_devemu_vfs_notification_req *req);
393 
405 uint16_t doca_devemu_vfs_notification_req_get_src_domain_id(struct doca_devemu_vfs_notification_req *req);
406 
407 
408 #ifdef __cplusplus
409 }
410 #endif
411 
414 #endif /* DOCA_DEVEMU_VFS_IO_H_ */
uint64_t len
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
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,...
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 th...
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-readabl...
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-writabl...
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.
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 ...
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...
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 ...
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.
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.
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.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_io_destroy(struct doca_devemu_vfs_io *io)
Free a Virtio FS device IO context.
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...
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.
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.
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 i...
DOCA_EXPERIMENTAL uint64_t doca_devemu_vfs_notification_req_get_id(struct doca_devemu_vfs_notification_req *req)
Get the notification request identifier.
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.
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.
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...
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.
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-writabl...
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_de...
enum doca_error doca_error_t
DOCA API return codes.
Convenience type for representing opaque data.
Definition: doca_types.h:56