NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
worker_graph.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 NVIDIA CORPORATION AND AFFILIATES. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are permitted
5  * provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright notice, this list of
9  * conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * * Neither the name of the NVIDIA CORPORATION nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21  * STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  */
25 
26 #ifndef WORKER_GRAPH_H_
27 #define WORKER_GRAPH_H_
28 
29 #include "ucp/api/ucp.h"
30 
31 #include <doca_urom.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /*
38  * Loopback task callback function, will be called once the loopback task is finished
39  *
40  * @result [in]: task result
41  * @cookie [in]: user cookie
42  * @data [in]: loopback data
43  */
44 typedef void (*urom_graph_loopback_finished)(doca_error_t result, union doca_data cookie, uint64_t data);
45 
46 /*
47  * Creates send graph tag task
48  *
49  * @worker_ctx [in]: DOCA UROM worker context
50  * @cookie [in]: user cookie
51  * @data [in]: loopback data
52  * @cb [in]: program callback to call once the task is finished
53  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
54  */
55 doca_error_t urom_graph_task_loopback(struct doca_urom_worker *worker_ctx,
56  union doca_data cookie,
57  uint64_t data,
59 
60 /*
61  *
62  * This method inits graph plugin.
63  *
64  * @plugin_id [in]: plugin id
65  * @version [in]: plugin version on DPU side
66  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
67  */
68 doca_error_t urom_graph_init(uint64_t plugin_id, uint64_t version);
69 
70 #ifdef __cplusplus
71 } /* extern "C" */
72 #endif
73 
74 #endif /* WORKER_GRAPH_H_ */
int32_t result
uint64_t cookie
enum doca_error doca_error_t
DOCA API return codes.
Convenience type for representing opaque data.
Definition: doca_types.h:56
doca_error_t urom_graph_init(uint64_t plugin_id, uint64_t version)
Definition: worker_graph.c:194
void(* urom_graph_loopback_finished)(doca_error_t result, union doca_data cookie, uint64_t data)
Definition: worker_graph.h:44
doca_error_t urom_graph_task_loopback(struct doca_urom_worker *worker_ctx, union doca_data cookie, uint64_t data, urom_graph_loopback_finished cb)
Definition: worker_graph.c:135