NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_dpa_dev.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 
24 #ifndef DOCA_DPA_DEV_H_
25 #define DOCA_DPA_DEV_H_
26 
32 #define DOCA_DPA_DEVICE
33 
34 #include <stdint.h>
35 #include <stddef.h>
37 #include <doca_compat.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
53 
57 __dpa_global__ typedef uint64_t doca_dpa_dev_t;
58 
63 
68 
73 
78 
83 
88 
92 __dpa_global__ typedef enum {
100 
124 };
125 
129 #ifndef __forceinline
130 #define __forceinline static inline __attribute__((always_inline))
131 #endif /* __forceinline */
132 
147 
162 unsigned int doca_dpa_dev_thread_rank(void);
163 
175 unsigned int doca_dpa_dev_num_threads(void);
176 
192 
205 
218 
231 
247 
263  __attribute__((format(printf, 2, 3)));
264 
271 #define DOCA_DPA_DEV_LOG_ERR(...) doca_dpa_dev_log(DOCA_DPA_DEV_LOG_LEVEL_ERROR, __VA_ARGS__)
272 
279 #define DOCA_DPA_DEV_LOG_WARN(...) doca_dpa_dev_log(DOCA_DPA_DEV_LOG_LEVEL_WARNING, __VA_ARGS__)
280 
287 #define DOCA_DPA_DEV_LOG_INFO(...) doca_dpa_dev_log(DOCA_DPA_DEV_LOG_LEVEL_INFO, __VA_ARGS__)
288 
295 #define DOCA_DPA_DEV_LOG_DBG(...) doca_dpa_dev_log(DOCA_DPA_DEV_LOG_LEVEL_DEBUG, __VA_ARGS__)
296 
312 void doca_dpa_dev_trace(uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5);
313 
325 
336 void doca_dpa_dev_hash_table_add(doca_dpa_dev_hash_table_t ht_handle, uint32_t key, uint64_t value);
337 
346 
358 int doca_dpa_dev_hash_table_find(doca_dpa_dev_hash_table_t ht_handle, uint32_t key, uint64_t *value);
359 
374  doca_dpa_dev_completion_element_t *comp_element);
375 
386 
404 
421 
433 
445 
446 #ifdef __cplusplus
447 }
448 #endif
449 
450 #endif /* DOCA_DPA_DEV_H_ */
451 
struct dpa_thread_arg __dpa_global__
#define __attribute__(_x_)
To allow compiling functions and structs that are using GCC attributes using attribute() in compilers...
Definition: doca_compat.h:81
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
DOCA_EXPERIMENTAL unsigned int doca_dpa_dev_num_threads(void)
Obtains the number of threads running the kernel.
DOCA_EXPERIMENTAL void doca_dpa_dev_completion_request_notification(doca_dpa_dev_completion_t dpa_comp_handle)
Request notification on the DPA completion.
DOCA_EXPERIMENTAL void doca_dpa_dev_thread_reschedule(void)
Reschedule a DPA thread.
DOCA_EXPERIMENTAL int doca_dpa_dev_hash_table_find(doca_dpa_dev_hash_table_t ht_handle, uint32_t key, uint64_t *value)
Returns the value to which the specified key is mapped in the hash table.
DOCA_EXPERIMENTAL void doca_dpa_dev_device_set(doca_dpa_dev_t dpa_handle)
Set a DPA device.
__dpa_global__ enum doca_dpa_dev_log_level doca_dpa_dev_log_level_t
DOCA DPA device log levels, sorted by verbosity from high to low.
DOCA_EXPERIMENTAL void doca_dpa_dev_thread_finish(void)
Finish a DPA thread.
DOCA_EXPERIMENTAL void doca_dpa_dev_log(doca_dpa_dev_log_level_t log_level, const char *format,...) __attribute__((format(printf
Print logs to Host.
DOCA_EXPERIMENTAL void doca_dpa_dev_thread_notify(doca_dpa_dev_notification_completion_t comp_handle)
Notify the completion handle and trigger the attached thread.
DOCA_EXPERIMENTAL void doca_dpa_dev_yield(void)
Yield a DPA thread.
DOCA_EXPERIMENTAL void doca_dpa_dev_hash_table_remove(doca_dpa_dev_hash_table_t ht_handle, uint32_t key)
Remove the key and its corresponding value from the hash table.
DOCA_EXPERIMENTAL unsigned int doca_dpa_dev_thread_rank(void)
Obtains the thread rank.
DOCA_EXPERIMENTAL uint32_t doca_dpa_dev_get_completion_user_data(doca_dpa_dev_completion_element_t comp_element)
Get completion element user data.
DOCA_EXPERIMENTAL void doca_dpa_dev_trace(uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5)
Creates trace message entry with arguments.
__dpa_global__ typedef uint64_t doca_dpa_dev_notification_completion_t
DPA notification completion handle type definition.
Definition: doca_dpa_dev.h:87
DOCA_EXPERIMENTAL void doca_dpa_dev_completion_ack(doca_dpa_dev_completion_t dpa_comp_handle, uint64_t num_comp)
Acknowledge that the completions have been read on the completion context.
__dpa_global__ typedef uint64_t doca_dpa_dev_async_ops_t
DPA asynchronous ops handle type definition.
Definition: doca_dpa_dev.h:82
__dpa_global__ typedef uint64_t doca_dpa_dev_completion_element_t
DPA completion element handle type definition.
Definition: doca_dpa_dev.h:77
doca_dpa_dev_submit_flag
DPA submit flag type.
Definition: doca_dpa_dev.h:104
DOCA_EXPERIMENTAL doca_dpa_dev_completion_type_t doca_dpa_dev_get_completion_type(doca_dpa_dev_completion_element_t comp_element)
Get completion element type.
__dpa_global__ typedef uint64_t doca_dpa_dev_uintptr_t
DPA pointer type definition.
Definition: doca_dpa_dev.h:62
DOCA_EXPERIMENTAL int doca_dpa_dev_get_completion(doca_dpa_dev_completion_t dpa_comp_handle, doca_dpa_dev_completion_element_t *comp_element)
Get DPA completion element.
DOCA_EXPERIMENTAL void doca_dpa_dev_trace_flush(void)
Flush the trace message buffer to Host.
DOCA_EXPERIMENTAL void doca_dpa_dev_hash_table_add(doca_dpa_dev_hash_table_t ht_handle, uint32_t key, uint64_t value)
Map a specific key to the specified value in the hash table.
DOCA_EXPERIMENTAL doca_dpa_dev_uintptr_t doca_dpa_dev_thread_get_local_storage(void)
Get DPA thread local storage.
DOCA_EXPERIMENTAL uint32_t doca_dpa_dev_get_completion_immediate(doca_dpa_dev_completion_element_t comp_element)
Get completion element immediate data.
__dpa_global__ typedef uint64_t doca_dpa_dev_hash_table_t
DPA hash table handle type definition.
Definition: doca_dpa_dev.h:67
__dpa_global__ typedef uint64_t doca_dpa_dev_completion_t
DPA completion handle type definition.
Definition: doca_dpa_dev.h:72
__dpa_global__ typedef uint64_t doca_dpa_dev_t
DPA context handle type definition.
Definition: doca_dpa_dev.h:57
doca_dpa_dev_completion_type_t
DPA completion type.
Definition: doca_dpa_dev.h:92
@ DOCA_DPA_DEV_LOG_LEVEL_ERROR
Definition: doca_dpa_dev.h:48
@ DOCA_DPA_DEV_LOG_LEVEL_DISABLE
Definition: doca_dpa_dev.h:47
@ DOCA_DPA_DEV_LOG_LEVEL_DEBUG
Definition: doca_dpa_dev.h:51
@ DOCA_DPA_DEV_LOG_LEVEL_WARNING
Definition: doca_dpa_dev.h:49
@ DOCA_DPA_DEV_LOG_LEVEL_INFO
Definition: doca_dpa_dev.h:50
@ DOCA_DPA_DEV_SUBMIT_FLAG_NONE
Definition: doca_dpa_dev.h:105
@ DOCA_DPA_DEV_SUBMIT_FLAG_OPTIMIZE_REPORTS
Definition: doca_dpa_dev.h:113
@ DOCA_DPA_DEV_SUBMIT_FLAG_FLUSH
Definition: doca_dpa_dev.h:106
@ DOCA_DPA_DEV_COMP_SEND_ERR
Definition: doca_dpa_dev.h:97
@ DOCA_DPA_DEV_COMP_RECV_SEND
Definition: doca_dpa_dev.h:95
@ DOCA_DPA_DEV_COMP_SEND
Definition: doca_dpa_dev.h:93
@ DOCA_DPA_DEV_COMP_RECV_RDMA_WRITE_IMM
Definition: doca_dpa_dev.h:94
@ DOCA_DPA_DEV_COMP_RECV_ERR
Definition: doca_dpa_dev.h:98
@ DOCA_DPA_DEV_COMP_RECV_SEND_IMM
Definition: doca_dpa_dev.h:96
uint64_t doca_dpa_dev_hash_table_t
DPA hash table handle type definition.
Definition: doca_dpa.h:83
doca_dpa_dev_log_level
DOCA DPA device log levels, sorted by verbosity from high to low.
Definition: doca_dpa.h:62
uint64_t doca_dpa_dev_t
DPA context handle type definition.
Definition: doca_dpa.h:73
enum doca_dpa_dev_log_level doca_dpa_dev_log_level_t
DOCA DPA device log levels, sorted by verbosity from high to low.
uint64_t doca_dpa_dev_completion_t
DPA completion handle type definition.
Definition: doca_dpa.h:88
uint64_t doca_dpa_dev_uintptr_t
DPA pointer type definition.
Definition: doca_dpa.h:78
uint64_t doca_dpa_dev_notification_completion_t
DPA notification completion handle type definition.
Definition: doca_dpa.h:98
type value
int log_level
Definition: pcc.c:40