NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
dpa_nvqual_common_defs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 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 DPA_NVQUAL_COMMON_DEFS_H_
27 #define DPA_NVQUAL_COMMON_DEFS_H_
28 
29 #include <stdbool.h>
30 
31 #include <doca_sync_event.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
40 extern struct doca_dpa_app *dpa_sample_app;
41 
45 #define DPA_NVQUAL_DPA_FREQ (1800.00f)
46 
50 #define DPA_NVQUAL_COPY_BYTE_LATENCY_USEC (0.08f)
51 
55 #define DPA_NVQUAL_WATCHDOG_TIME_SEC (2 * 60)
56 
60 #define DPA_NVQUAL_SEC_TO_USEC (1000000)
61 
65 #define DPA_NVQUAL_SEC_IN_HOUR (3600)
66 
70 #define DPA_NVQUAL_SEC_IN_MINUTE (60)
71 
75 #define DPA_NVQUAL_FACTOR (0.75f)
76 
80 #define DPA_NVQUAL_ITERATION_DURATION_SEC (DPA_NVQUAL_WATCHDOG_TIME_SEC * DPA_NVQUAL_FACTOR)
81 
85 #define DPA_NVQUAL_ALLOCATED_DPA_HEAP_SIZE (268435456)
86 
90 #define DPA_NVQUAL_MAX_EUS (256)
91 
95 #define DPA_NVQUAL_PRINT_BUFFER_SIZE (2048)
96 
100 #define DPA_NVQUAL_MAX_INPUT_EXCLUDED_EUS_SIZE (1024)
101 
105 #define DPA_NVQUAL_DOCA_DEVINFO_IBDEV_NAME_SIZE 64
106 
110 #define DPA_NVQUAL_SYNC_EVENT_MASK (0xffffffffffffffff)
111 
117  unsigned int excluded_eus_size;
118  const char *dev_name;
122 };
123 
129  unsigned int available_eus_size;
131  unsigned int total_num_eus;
132 };
133 
138  unsigned int eu;
142  size_t buffers_size;
143  uint64_t num_ops;
145 };
146 
151  unsigned int eu;
152  uint64_t val;
153 };
154 
158 struct dpa_nvqual {
159  struct doca_devinfo **dev_list;
160  struct doca_dev *dev;
161  struct doca_dpa *dpa;
162  struct doca_dpa_eu_affinity *affinity;
165  struct doca_dpa_thread *threads[DPA_NVQUAL_MAX_EUS];
167  struct doca_dpa_notification_completion *notification_completions[DPA_NVQUAL_MAX_EUS];
169  uint64_t num_threads;
170  struct doca_sync_event *se;
173  unsigned int available_eus_size;
174  unsigned int total_num_eus;
175  size_t buffers_size;
176  uint64_t num_ops;
179  uint32_t avg_latency_single_op; // float
180  uint64_t data_size;
181 };
182 
189  uint32_t user_factor; // float
191  unsigned int excluded_eus_size;
192 };
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif /* DPA_NVQUAL_COMMON_DEFS_H_ */
#define DPA_NVQUAL_MAX_EUS
#define DPA_NVQUAL_DOCA_DEVINFO_IBDEV_NAME_SIZE
struct doca_dpa_app * dpa_sample_app
uint64_t doca_dpa_dev_uintptr_t
DPA pointer type definition.
Definition: doca_dpa.h:78
uint64_t doca_dpa_dev_sync_event_t
DOCA Sync Event DPA handle.
char dev_name[DPA_NVQUAL_DOCA_DEVINFO_IBDEV_NAME_SIZE]
bool excluded_eus[DPA_NVQUAL_MAX_EUS]
bool excluded_eus[DPA_NVQUAL_MAX_EUS]
bool available_eus[DPA_NVQUAL_MAX_EUS]
doca_dpa_dev_uintptr_t dst_buf
doca_dpa_dev_uintptr_t src_buf
doca_dpa_dev_sync_event_t dev_se
doca_dpa_dev_uintptr_t thread_ret
struct doca_dpa_thread * threads[DPA_NVQUAL_MAX_EUS]
struct doca_dpa_eu_affinity * affinity
struct doca_dpa * dpa
doca_dpa_dev_uintptr_t thread_rets
doca_dpa_dev_uintptr_t dev_tlss[DPA_NVQUAL_MAX_EUS]
uint32_t avg_latency_single_op
unsigned int total_num_eus
doca_dpa_dev_uintptr_t dev_notification_completions
bool available_eus[DPA_NVQUAL_MAX_EUS]
struct doca_dpa_notification_completion * notification_completions[DPA_NVQUAL_MAX_EUS]
struct doca_sync_event * se
struct doca_devinfo ** dev_list
unsigned int available_eus_size
struct doca_dev * dev
struct dpa_nvqual_flow_config flow_cfg
doca_dpa_dev_sync_event_t dev_se
struct dpa_nvqual_tls tlss[DPA_NVQUAL_MAX_EUS]
uint64_t total_dpa_run_time_usec