NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_buf_array.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_BUF_ARRAY_H_
26 #define DOCA_BUF_ARRAY_H_
27 
28 #include <stddef.h>
29 #include <stdint.h>
30 
31 #include <doca_compat.h>
32 #include <doca_error.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*******************************************************************************
39  * DOCA Buf Array
40  ******************************************************************************/
41 
42 struct doca_gpu;
43 struct doca_dpa;
44 struct doca_mmap;
45 
49 struct doca_buf_arr;
50 struct doca_gpu_buf_arr;
51 
53 typedef uint64_t doca_dpa_dev_buf_arr_t;
54 
70 doca_error_t doca_buf_arr_create(size_t num_elem, struct doca_buf_arr **buf_arr);
71 
87 doca_error_t doca_buf_arr_set_target_gpu(struct doca_buf_arr *buf_arr, struct doca_gpu *gpu_handler);
88 
104 doca_error_t doca_buf_arr_set_target_dpa(struct doca_buf_arr *buf_arr, struct doca_dpa *dpa_handler);
105 
125 doca_error_t doca_buf_arr_set_params(struct doca_buf_arr *buf_arr,
126  struct doca_mmap *mmap,
127  size_t elem_size,
128  uint64_t start_offset);
129 
151 doca_error_t doca_buf_arr_start(struct doca_buf_arr *buf_arr);
152 
167 doca_error_t doca_buf_arr_stop(struct doca_buf_arr *buf_arr);
168 
183 doca_error_t doca_buf_arr_destroy(struct doca_buf_arr *buf_arr);
184 
200 doca_error_t doca_buf_arr_get_gpu_handle(const struct doca_buf_arr *buf_arr, struct doca_gpu_buf_arr **gpu_buf_arr);
201 
217 doca_error_t doca_buf_arr_get_dpa_handle(const struct doca_buf_arr *buf_arr, doca_dpa_dev_buf_arr_t *dpa_buf_arr);
218 
219 #ifdef __cplusplus
220 }
221 #endif
222 
225 #endif /* DOCA_BUF_ARRAY_H_ */
doca_dpa_dev_mmap_t mmap
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_destroy(struct doca_buf_arr *buf_arr)
Destroys a doca buf array instance.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_set_params(struct doca_buf_arr *buf_arr, struct doca_mmap *mmap, size_t elem_size, uint64_t start_offset)
Sets the buf array params.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_set_target_dpa(struct doca_buf_arr *buf_arr, struct doca_dpa *dpa_handler)
Configures the buf array to be created on the dpa device.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_stop(struct doca_buf_arr *buf_arr)
Stops a started doca buf array.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_set_target_gpu(struct doca_buf_arr *buf_arr, struct doca_gpu *gpu_handler)
Configures the buf array to be created on the gpu device.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_get_gpu_handle(const struct doca_buf_arr *buf_arr, struct doca_gpu_buf_arr **gpu_buf_arr)
Retrieves the handle in the gpu memory space of a doca_buf_arr.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_create(size_t num_elem, struct doca_buf_arr **buf_arr)
Allocates a doca_buf_arr.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_start(struct doca_buf_arr *buf_arr)
This method enables the allocation of doca_bufs.
DOCA_EXPERIMENTAL doca_error_t doca_buf_arr_get_dpa_handle(const struct doca_buf_arr *buf_arr, doca_dpa_dev_buf_arr_t *dpa_buf_arr)
Retrieves the handle in the dpa memory space of a doca_buf_arr.
uint64_t doca_dpa_dev_buf_arr_t
Type representing a doca_buf_arr handle on the DPA.
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
enum doca_error doca_error_t
DOCA API return codes.