NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_devemu_vfs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 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_H_
26 #define DOCA_DEVEMU_VFS_H_
27 
28 #include <stdint.h>
29 
30 #include <linux/fuse.h>
31 
32 #include <doca_buf.h>
33 #include <doca_error.h>
34 #include <doca_dev.h>
35 #include <doca_devemu_pci.h>
36 #include <doca_devemu_virtio.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
46 struct doca_devemu_vfs_cfg;
47 
53 struct doca_devemu_vfs_dev;
54 
60 struct doca_devemu_vfs_type;
61 
67 struct doca_devemu_vfs_io;
68 
73 struct doca_devemu_vfs_req;
74 
79 struct doca_devemu_vfs_notification_req;
80 
88 #define DOCA_VFS_TAG_SIZE 21
89 
90 /*********************************************************************************************************************
91  * DOCA devemu Virtio FS configuration API
92  *********************************************************************************************************************/
93 
108 doca_error_t doca_devemu_vfs_init(struct doca_devemu_vfs_cfg *cfg);
109 
122 
134 doca_error_t doca_devemu_vfs_cfg_create(struct doca_devemu_vfs_cfg **cfg);
135 
146 doca_error_t doca_devemu_vfs_cfg_destroy(struct doca_devemu_vfs_cfg *cfg);
147 
165  uint32_t *req_user_data_size);
166 
184  uint32_t req_user_data_size);
185 
202  uint32_t *req_user_data_size);
203 
220  uint32_t req_user_data_size);
221 
222 /*********************************************************************************************************************
223  * DOCA devemu Virtio FS device API
224  *********************************************************************************************************************/
225 
243 doca_error_t doca_devemu_vfs_dev_create(struct doca_devemu_vfs_type *vfs_type, struct doca_dev_rep *dev_rep,
244  struct doca_pe *progress_engine, struct doca_devemu_vfs_dev **vfs_dev);
245 
259 doca_error_t doca_devemu_vfs_dev_destroy(struct doca_devemu_vfs_dev *vfs_dev);
260 
278 doca_error_t doca_devemu_vfs_dev_get_tag(const struct doca_devemu_vfs_dev *vfs_dev, char tag[DOCA_VFS_TAG_SIZE]);
279 
299 doca_error_t doca_devemu_vfs_dev_set_tag(struct doca_devemu_vfs_dev *vfs_dev, const char tag[DOCA_VFS_TAG_SIZE]);
300 
315 doca_error_t doca_devemu_vfs_dev_get_num_request_queues(const struct doca_devemu_vfs_dev *vfs_dev, uint32_t *num_request_queues);
316 
332 doca_error_t doca_devemu_vfs_dev_set_num_request_queues(struct doca_devemu_vfs_dev *vfs_dev, uint32_t num_request_queues);
333 
351 doca_error_t doca_devemu_vfs_dev_get_notify_buf_size(const struct doca_devemu_vfs_dev *vfs_dev, uint32_t *notify_buf_size);
352 
374 doca_error_t doca_devemu_vfs_dev_set_notify_buf_size(struct doca_devemu_vfs_dev *vfs_dev, uint32_t notify_buf_size);
375 
406 doca_error_t doca_devemu_vfs_dev_get_req_src_domain_id_range(const struct doca_devemu_vfs_dev *vfs_dev,
407  uint16_t *min_src_domain_id, uint16_t *max_src_domain_id);
408 
419 struct doca_ctx *doca_devemu_vfs_dev_as_ctx(struct doca_devemu_vfs_dev *vfs_dev);
420 
431 struct doca_devemu_virtio_dev *doca_devemu_vfs_dev_as_virtio_dev(struct doca_devemu_vfs_dev *vfs_dev);
432 
443 struct doca_devemu_pci_dev *doca_devemu_vfs_dev_as_pci_dev(struct doca_devemu_vfs_dev *vfs_dev);
444 
445 #ifdef __cplusplus
446 }
447 #endif
448 
451 #endif /* DOCA_DEVEMU_VFS_H_ */
static const char tag[DOCA_VFS_TAG_SIZE+1]
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
#define DOCA_VFS_TAG_SIZE
Size, in bytes, of the virtio FS tag in DOCA. According to the specification this is the name associa...
DOCA_EXPERIMENTAL struct doca_devemu_pci_dev * doca_devemu_vfs_dev_as_pci_dev(struct doca_devemu_vfs_dev *vfs_dev)
Convert DOCA Virtio FS device instance into DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_teardown(void)
Teardown the DOCA devemu Virtio FS.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_get_req_src_domain_id_range(const struct doca_devemu_vfs_dev *vfs_dev, uint16_t *min_src_domain_id, uint16_t *max_src_domain_id)
Get the range of source domain identifiers for requests associated with a DOCA VIRTIO FS device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_set_num_request_queues(struct doca_devemu_vfs_dev *vfs_dev, uint32_t num_request_queues)
Set the value of the VIRTIO FS Device num_request_queues register.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_get_tag(const struct doca_devemu_vfs_dev *vfs_dev, char tag[DOCA_VFS_TAG_SIZE])
Get the value of the Virtio FS device tag. According to the specification the tag is encoded in UTF-8...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_set_tag(struct doca_devemu_vfs_dev *vfs_dev, const char tag[DOCA_VFS_TAG_SIZE])
Set the value of the Virtio FS device tag. According to the specification the tag is encoded in UTF-8...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_destroy(struct doca_devemu_vfs_dev *vfs_dev)
Free a DOCA Virtio FS device object.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_set_notify_buf_size(struct doca_devemu_vfs_dev *vfs_dev, uint32_t notify_buf_size)
Set the value of the VIRTIO FS Device notify_buf_size register.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_cfg_get_vfs_req_user_data_size(const struct doca_devemu_vfs_cfg *cfg, uint32_t *req_user_data_size)
Get the size of the user data buffer that will be allocated for each doca_devemu_vfs_req on behalf of...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_cfg_get_notification_req_user_data_size(const struct doca_devemu_vfs_cfg *cfg, uint32_t *req_user_data_size)
Get the size of the user data buffer that will be allocated for each doca_devemu_vfs_notification_req...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_cfg_create(struct doca_devemu_vfs_cfg **cfg)
Create DOCA devemu Virtio FS configuration structure. The new structure is populated with the default...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_get_num_request_queues(const struct doca_devemu_vfs_dev *vfs_dev, uint32_t *num_request_queues)
Get the value of the VIRTIO FS Device num_request_queues register.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_create(struct doca_devemu_vfs_type *vfs_type, struct doca_dev_rep *dev_rep, struct doca_pe *progress_engine, struct doca_devemu_vfs_dev **vfs_dev)
Allocate DOCA Virtio FS device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_init(struct doca_devemu_vfs_cfg *cfg)
Initialize the DOCA devemu Virtio FS.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_cfg_set_notification_req_user_data_size(struct doca_devemu_vfs_cfg *cfg, uint32_t req_user_data_size)
Set the size of the user data buffer that will be allocated for each doca_devemu_vfs_notification_req...
DOCA_EXPERIMENTAL struct doca_devemu_virtio_dev * doca_devemu_vfs_dev_as_virtio_dev(struct doca_devemu_vfs_dev *vfs_dev)
Convert DOCA Virtio FS device instance into DOCA Virtio device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_cfg_destroy(struct doca_devemu_vfs_cfg *cfg)
Destroy DOCA devemu Virtio FS configuration structure.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_dev_get_notify_buf_size(const struct doca_devemu_vfs_dev *vfs_dev, uint32_t *notify_buf_size)
Get the value of the VIRTIO FS Device notify_buf_size register.
DOCA_EXPERIMENTAL struct doca_ctx * doca_devemu_vfs_dev_as_ctx(struct doca_devemu_vfs_dev *vfs_dev)
Convert DOCA Virtio FS device instance into DOCA context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_cfg_set_vfs_req_user_data_size(struct doca_devemu_vfs_cfg *cfg, uint32_t req_user_data_size)
Set the size of the user data buffer that will be allocated for each doca_devemu_vfs_req on behalf of...
enum doca_error doca_error_t
DOCA API return codes.
const struct ip_frag_config * cfg
Definition: ip_frag_dp.c:0