NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
rdma_multi_conn_send_sample.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 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 #include <doca_error.h>
27 #include <doca_log.h>
28 #include <doca_buf_inventory.h>
29 #include <doca_buf.h>
30 #include <doca_ctx.h>
31 
32 #include "rdma_common.h"
33 
34 #define MAX_BUFF_SIZE (256) /* Maximum DOCA buffer size */
35 
36 DOCA_LOG_REGISTER(RDMA_MULI_CONN_SEND::SAMPLE);
37 
38 /*
39  * Write the connection details for the receiver to read, and read the connection details of the receiver
40  * To differentiate each local and remote connection details, we append the connection_id so the file-name
41  * follows the syntax <local/remote>_connection_desc_path.txt-<connection_id>
42  *
43  * @cfg [in]: Configuration parameters
44  * @resources [in/out]: RDMA resources
45  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
46  */
48  struct rdma_resources *resources,
49  uint32_t connection_id)
50 {
52  char tmp_file_path[MAX_ARG_SIZE * 2];
53 
54  /* Write the RDMA connection details */
55  memset(tmp_file_path, 0, MAX_ARG_SIZE + 4);
56  sprintf(tmp_file_path, "%s-%04u", cfg->local_connection_desc_path, connection_id);
57  result = write_file(tmp_file_path,
60  if (result != DOCA_SUCCESS) {
61  DOCA_LOG_ERR("Failed to write the RDMA connection details: %s", doca_error_get_descr(result));
62  return result;
63  }
64 
65  DOCA_LOG_INFO("You can now copy %s to the receiver", tmp_file_path);
66 
67  memset(tmp_file_path, 0, MAX_ARG_SIZE + 4);
68  sprintf(tmp_file_path, "%s-%04u", cfg->remote_connection_desc_path, connection_id);
69  DOCA_LOG_INFO("Please copy %s from the receiver and then press enter after pressing enter in the receiver side",
70  tmp_file_path);
71 
72  /* Wait for enter */
74 
75  /* Read the remote RDMA connection details */
76  result = read_file(tmp_file_path,
79  if (result != DOCA_SUCCESS)
80  DOCA_LOG_ERR("Failed to read the remote RDMA connection details: %s", doca_error_get_descr(result));
81 
82  return result;
83 }
84 
85 /*
86  * RDMA send task completed callback
87  *
88  * @rdma_send_task [in]: Completed task
89  * @task_user_data [in]: doca_data from the task
90  * @ctx_user_data [in]: doca_data from the context
91  */
92 static void rdma_multi_conn_send_completed_callback(struct doca_rdma_task_send *rdma_send_task,
93  union doca_data task_user_data,
94  union doca_data ctx_user_data)
95 {
96  struct rdma_resources *resources = (struct rdma_resources *)ctx_user_data.ptr;
98  struct doca_buf *src_buf = NULL;
99  doca_error_t result = DOCA_SUCCESS, tmp_result;
100 
101  DOCA_LOG_INFO("RDMA send task was done successfully");
102 
103  src_buf = (struct doca_buf *)doca_rdma_task_send_get_src_buf(rdma_send_task);
104  tmp_result = doca_buf_dec_refcount(src_buf, NULL);
105  if (tmp_result != DOCA_SUCCESS) {
106  DOCA_LOG_ERR("Failed to decrease src_buf count: %s", doca_error_get_descr(tmp_result));
107  DOCA_ERROR_PROPAGATE(result, tmp_result);
108  }
110 
111  /* Update that an error was encountered, if any */
112  DOCA_ERROR_PROPAGATE(*first_encountered_error, tmp_result);
113 
115  /* Stop context once all tasks are completed */
116  if (resources->num_remaining_tasks == 0)
118 }
119 
120 /*
121  * RDMA send task error callback
122  *
123  * @rdma_send_task [in]: failed task
124  * @task_user_data [in]: doca_data from the task
125  * @ctx_user_data [in]: doca_data from the context
126  */
127 static void rdma_multi_conn_send_error_callback(struct doca_rdma_task_send *rdma_send_task,
128  union doca_data task_user_data,
129  union doca_data ctx_user_data)
130 {
131  struct rdma_resources *resources = (struct rdma_resources *)ctx_user_data.ptr;
132  struct doca_task *task = doca_rdma_task_send_as_task(rdma_send_task);
135 
136  /* Update that an error was encountered */
139  DOCA_LOG_ERR("RDMA send task failed: %s", doca_error_get_descr(result));
140 
141  doca_task_free(task);
143  if (result != DOCA_SUCCESS)
144  DOCA_LOG_ERR("Failed to decrease src_buf count: %s", doca_error_get_descr(result));
145 
147  /* Stop context once all tasks are completed */
148  if (resources->num_remaining_tasks == 0)
150 }
151 
152 /*
153  * Export and receive connection details, and connect to the remote RDMA
154  *
155  * @resources [in]: RDMA resources
156  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
157  */
159 {
161  uint32_t i = 0;
162 
163  if (resources->cfg->use_rdma_cm == true)
164  return rdma_cm_connect(resources);
165 
166  /* 1-by-1 to setup all the connections */
167  for (i = 0; i < resources->cfg->num_connections; i++) {
168  DOCA_LOG_INFO("Start to establish RDMA connection [%d]", i);
169  /* Export RDMA connection details */
173  &(resources->connections[i]));
174  if (result != DOCA_SUCCESS) {
175  DOCA_LOG_ERR("Failed to export RDMA: %s", doca_error_get_descr(result));
176  return result;
177  }
178 
179  /* Write and read connection details to the receiver */
181  if (result != DOCA_SUCCESS) {
182  DOCA_LOG_ERR("Failed to write and read connection details from receiver: %s",
184  return result;
185  }
186 
187  /* Connect RDMA */
191  resources->connections[i]);
192  if (result != DOCA_SUCCESS)
193  DOCA_LOG_ERR("Failed to connect the sender's RDMA to the receiver's RDMA: %s",
195 
196  /* Free remote connection descriptor */
199 
200  DOCA_LOG_INFO("RDMA connection [%d] is establshed", i);
201  }
202  DOCA_LOG_INFO("All [%d] RDMA connections have been establshed", resources->cfg->num_connections);
203 
204  return result;
205 }
206 
207 /*
208  * Prepare and submit RDMA send task
209  *
210  * @resources [in]: RDMA resources
211  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
212  */
214 {
215  struct doca_rdma_task_send *rdma_send_tasks[MAX_NUM_CONNECTIONS] = {0};
216  union doca_data task_user_data = {0};
217  void *src_buf_data;
218  struct doca_buf *src_bufs[MAX_NUM_CONNECTIONS] = {0};
219  doca_error_t result, tmp_result;
220  uint32_t i = 0;
221 
223  "Please press enter after all the receive tasks have been successfully submitted in the receiver side");
224 
225  /* Wait for enter */
226  wait_for_enter();
227 
228  for (i = 0; i < resources->cfg->num_connections; i++) {
229  /* Add src buffer to DOCA buffer inventory */
231  resources->mmap,
234  &src_bufs[i]);
235  if (result != DOCA_SUCCESS) {
236  DOCA_LOG_ERR("Failed to allocate DOCA buffer [%d] to DOCA buffer inventory: %s",
237  i,
239  return result;
240  }
241 
242  /* Set data of src buffer */
243  result = doca_buf_get_data(src_bufs[i], &src_buf_data);
244  if (result != DOCA_SUCCESS) {
245  DOCA_LOG_ERR("Failed to get source buffer [%d] data: %s", i, doca_error_get_descr(result));
246  goto destroy_src_buf;
247  }
248  strncpy(src_buf_data, resources->cfg->send_string, MAX_BUFF_SIZE + 1);
249 
250  /* Include first_encountered_error in user data of task to be used in the callbacks */
251  task_user_data.ptr = &(resources->first_encountered_error);
252  /* Allocate and construct RDMA send task */
255  src_bufs[i],
256  task_user_data,
257  &rdma_send_tasks[i]);
258  if (result != DOCA_SUCCESS) {
259  DOCA_LOG_ERR("Failed to allocate RDMA send task [%d]: %s", i, doca_error_get_descr(result));
260  goto destroy_src_buf;
261  }
262 
263  /* Submit RDMA send task */
265  "Submitting RDMA send task [%d] that sends \"%s\" to receiver, sender's rdma_connection address [%p]",
266  i,
268  resources->connections[i]);
270  result = doca_task_submit(doca_rdma_task_send_as_task(rdma_send_tasks[i]));
271  if (result != DOCA_SUCCESS) {
272  DOCA_LOG_ERR("Failed to submit RDMA send task [%d]: %s", i, doca_error_get_descr(result));
273  goto free_task;
274  }
275  }
276 
277  return result;
278 
279 free_task:
280  doca_task_free(doca_rdma_task_send_as_task(rdma_send_tasks[i]));
281 destroy_src_buf:
282  tmp_result = doca_buf_dec_refcount(src_bufs[i], NULL);
283  if (tmp_result != DOCA_SUCCESS) {
284  DOCA_LOG_ERR("Failed to decrease src_buf count: %s", doca_error_get_descr(tmp_result));
285  DOCA_ERROR_PROPAGATE(result, tmp_result);
286  }
287  return result;
288 }
289 
290 /*
291  * RDMA send state change callback
292  * This function represents the state machine for this RDMA program
293  *
294  * @user_data [in]: doca_data from the context
295  * @ctx [in]: DOCA context
296  * @prev_state [in]: Previous DOCA context state
297  * @next_state [in]: Next DOCA context state
298  */
299 static void rdma_multi_conn_send_state_change_callback(const union doca_data user_data,
300  struct doca_ctx *ctx,
301  enum doca_ctx_states prev_state,
302  enum doca_ctx_states next_state)
303 {
304  struct rdma_resources *resources = (struct rdma_resources *)user_data.ptr;
305  struct rdma_config *cfg = resources->cfg;
307  (void)prev_state;
308  (void)ctx;
309 
310  switch (next_state) {
312  DOCA_LOG_INFO("RDMA context entered starting state");
313  break;
315  DOCA_LOG_INFO("RDMA context is running");
316 
318  if (result != DOCA_SUCCESS) {
319  DOCA_LOG_ERR("rdma_multi_conn_send_export_and_connect() failed: %s",
321  break;
322  } else
323  DOCA_LOG_INFO("RDMA context finished initialization");
324 
325  if (cfg->use_rdma_cm == true)
326  break;
327 
329  if (result != DOCA_SUCCESS)
330  DOCA_LOG_ERR("rdma_send_prepare_and_submit_task() failed: %s", doca_error_get_descr(result));
331  break;
340  DOCA_LOG_INFO("RDMA context entered into stopping state. Any inflight tasks will be flushed");
341 
342  if (resources->cfg->use_rdma_cm == true)
344  break;
345  case DOCA_CTX_STATE_IDLE:
346  DOCA_LOG_INFO("RDMA context has been stopped");
347 
348  /* We can stop progressing the PE */
349  resources->run_pe_progress = false;
350  break;
351  default:
352  break;
353  }
354 
355  /* If something failed - update that an error was encountered and stop the ctx */
356  if (result != DOCA_SUCCESS) {
358  (void)doca_ctx_stop(ctx);
359  }
360 }
361 
362 /*
363  * Send a message to the receiver
364  *
365  * @cfg [in]: Configuration parameters
366  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
367  */
369 {
370  struct rdma_resources resources = {0};
371  union doca_data ctx_user_data = {0};
372  const uint32_t mmap_permissions = DOCA_ACCESS_FLAG_LOCAL_READ_WRITE;
373  const uint32_t rdma_permissions = DOCA_ACCESS_FLAG_LOCAL_READ_WRITE;
374  struct timespec ts = {
375  .tv_sec = 0,
376  .tv_nsec = SLEEP_IN_NANOS,
377  };
378  doca_error_t result, tmp_result;
379 
380  /* Allocating resources */
382  mmap_permissions,
383  rdma_permissions,
385  &resources);
386  if (result != DOCA_SUCCESS) {
387  DOCA_LOG_ERR("Failed to allocate RDMA Resources: %s", doca_error_get_descr(result));
388  return result;
389  }
390 
394  NUM_RDMA_TASKS * cfg->num_connections);
395  if (result != DOCA_SUCCESS) {
396  DOCA_LOG_ERR("Unable to set configurations for RDMA send task: %s", doca_error_get_descr(result));
397  goto destroy_resources;
398  }
399 
401  if (result != DOCA_SUCCESS) {
402  DOCA_LOG_ERR("Unable to set state change callback for RDMA context: %s", doca_error_get_descr(result));
403  goto destroy_resources;
404  }
405 
406  /* Include the program's resources in user data of context to be used in callbacks */
407  ctx_user_data.ptr = &(resources);
409  if (result != DOCA_SUCCESS) {
410  DOCA_LOG_ERR("Failed to set context user data: %s", doca_error_get_descr(result));
411  goto destroy_resources;
412  }
413 
414  /* Create DOCA buffer inventory */
417  if (result != DOCA_SUCCESS) {
418  DOCA_LOG_ERR("Failed to create DOCA buffer inventory: %s", doca_error_get_descr(result));
419  goto destroy_resources;
420  }
421 
422  /* Start DOCA buffer inventory */
424  if (result != DOCA_SUCCESS) {
425  DOCA_LOG_ERR("Failed to start DOCA buffer inventory: %s", doca_error_get_descr(result));
426  goto destroy_buf_inventory;
427  }
428 
429  if (cfg->use_rdma_cm == true) {
430  /* Set rdma cm connection configuration callbacks */
434  /* need_send_mmap_info */ false,
435  /* need_recv_mmap_info */ false);
436  if (result != DOCA_SUCCESS) {
437  DOCA_LOG_ERR("Failed to config RDMA CM callbacks and negotiation functions: %s",
439  goto destroy_buf_inventory;
440  }
441  }
442 
443  /* Start RDMA context */
445  if (result != DOCA_SUCCESS) {
446  DOCA_LOG_ERR("Failed to start RDMA context: %s", doca_error_get_descr(result));
447  goto stop_buf_inventory;
448  }
449 
450  /*
451  * Run the progress engine which will run the state machine defined in rdma_send_state_change_callback()
452  * When the context moves to idle, the context change callback call will signal to stop running the progress
453  * engine.
454  */
455  while (resources.run_pe_progress) {
456  if (doca_pe_progress(resources.pe) == 0)
457  nanosleep(&ts, &ts);
458  }
459 
460  /* Assign the result we update in the callbacks */
462 
463 stop_buf_inventory:
465  if (tmp_result != DOCA_SUCCESS) {
466  DOCA_LOG_ERR("Failed to stop DOCA buffer inventory: %s", doca_error_get_descr(tmp_result));
467  DOCA_ERROR_PROPAGATE(result, tmp_result);
468  }
469 destroy_buf_inventory:
471  if (tmp_result != DOCA_SUCCESS) {
472  DOCA_LOG_ERR("Failed to destroy DOCA buffer inventory: %s", doca_error_get_descr(tmp_result));
473  DOCA_ERROR_PROPAGATE(result, tmp_result);
474  }
475 destroy_resources:
476  tmp_result = destroy_rdma_resources(&resources, cfg);
477  if (tmp_result != DOCA_SUCCESS) {
478  DOCA_LOG_ERR("Failed to destroy DOCA RDMA resources: %s", doca_error_get_descr(tmp_result));
479  DOCA_ERROR_PROPAGATE(result, tmp_result);
480  }
481  return result;
482 }
#define NULL
Definition: __stddef_null.h:26
int32_t result
#define SLEEP_IN_NANOS
Definition: comch_utils.c:40
#define MAX_ARG_SIZE
Definition: dma_copy_core.h:39
doca_error_t destroy_rdma_resources(struct rdma_resources *resources)
Definition: rdma_common.c:470
void wait_for_enter(void)
Definition: rdma_common.c:1771
doca_error_t write_file(const char *file_path, const char *string, size_t string_len)
Definition: rdma_common.c:1087
doca_error_t rdma_cm_connect(struct rdma_resources *resources)
Definition: rdma_common.c:1172
doca_error_t allocate_rdma_resources(struct rdma_config *cfg, const uint32_t mmap_permissions, const uint32_t rdma_permissions, task_check func, struct rdma_resources *resources)
Definition: rdma_common.c:758
doca_error_t config_rdma_cm_callback_and_negotiation_task(struct rdma_resources *resources, bool need_send_task, bool need_recv_task)
Definition: rdma_common.c:1720
doca_error_t rdma_cm_disconnect(struct rdma_resources *resources)
Definition: rdma_common.c:1244
#define MAX_NUM_CONNECTIONS
Definition: rdma_common.h:67
#define INVENTORY_NUM_INITIAL_ELEMENTS
Definition: rdma_common.h:47
#define NUM_RDMA_TASKS
Definition: rdma_common.h:57
struct rdma_resources resources
DOCA_STABLE doca_error_t doca_buf_inventory_destroy(struct doca_buf_inventory *inventory)
Destroy buffer inventory structure.
static doca_error_t doca_buf_inventory_buf_get_by_data(struct doca_buf_inventory *inventory, struct doca_mmap *mmap, void *data, size_t data_len, struct doca_buf **buf)
Allocate single element from buffer inventory and point it to the buffer defined by data & data_len a...
DOCA_STABLE doca_error_t doca_buf_inventory_start(struct doca_buf_inventory *inventory)
Start element retrieval from inventory.
DOCA_STABLE doca_error_t doca_buf_inventory_create(size_t num_elements, struct doca_buf_inventory **inventory)
Allocates buffer inventory with default/unset attributes.
DOCA_STABLE doca_error_t doca_buf_inventory_stop(struct doca_buf_inventory *inventory)
Stop element retrieval from inventory.
DOCA_STABLE doca_error_t doca_buf_dec_refcount(struct doca_buf *buf, uint16_t *refcount)
Decrease the object reference count by 1, if 0 reached, return the element back to the inventory.
DOCA_STABLE doca_error_t doca_buf_get_data(const struct doca_buf *buf, void **data)
Get the buffer's data.
DOCA_STABLE doca_error_t doca_ctx_start(struct doca_ctx *ctx)
Finalizes all configurations, and starts the DOCA CTX.
DOCA_STABLE doca_error_t doca_ctx_set_state_changed_cb(struct doca_ctx *ctx, doca_ctx_state_changed_callback_t cb)
Set state changed callback.
DOCA_STABLE doca_error_t doca_ctx_set_user_data(struct doca_ctx *ctx, union doca_data user_data)
set user data to context
DOCA_STABLE doca_error_t doca_ctx_stop(struct doca_ctx *ctx)
Stops the context allowing reconfiguration.
doca_ctx_states
This enum defines the states of a context.
Definition: doca_ctx.h:83
@ DOCA_CTX_STATE_STARTING
Definition: doca_ctx.h:93
@ DOCA_CTX_STATE_STOPPING
Definition: doca_ctx.h:106
@ DOCA_CTX_STATE_IDLE
Definition: doca_ctx.h:88
@ DOCA_CTX_STATE_RUNNING
Definition: doca_ctx.h:98
#define DOCA_ERROR_PROPAGATE(r, t)
Save the first encountered doca_error_t.
Definition: doca_error.h:83
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_SUCCESS
Definition: doca_error.h:38
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
Definition: doca_log.h:466
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
Definition: doca_log.h:486
DOCA_STABLE doca_error_t doca_task_get_status(const struct doca_task *task)
Get task status.
DOCA_STABLE doca_error_t doca_task_submit(struct doca_task *task)
Submit a task to a progress engine.
DOCA_STABLE uint8_t doca_pe_progress(struct doca_pe *pe)
Run the progress engine.
DOCA_STABLE void doca_task_free(struct doca_task *task)
Free a task back to where it was allocated from.
DOCA_EXPERIMENTAL doca_error_t doca_rdma_task_send_set_conf(struct doca_rdma *rdma, doca_rdma_task_send_completion_cb_t successful_task_completion_cb, doca_rdma_task_send_completion_cb_t error_task_completion_cb, uint32_t num_tasks)
This method sets the send tasks configuration.
DOCA_EXPERIMENTAL const struct doca_buf * doca_rdma_task_send_get_src_buf(const struct doca_rdma_task_send *task)
This method gets the source buffer of a send task.
DOCA_EXPERIMENTAL struct doca_task * doca_rdma_task_send_as_task(struct doca_rdma_task_send *task)
This method converts a send task to a doca_task.
DOCA_EXPERIMENTAL doca_error_t doca_rdma_export(struct doca_rdma *rdma, const void **local_rdma_conn_details, size_t *local_rdma_conn_details_size, struct doca_rdma_connection **rdma_connection)
Export doca_rdma connection details object The doca_rdma_conn_details are used in doca_rdma_connect()...
DOCA_EXPERIMENTAL doca_error_t doca_rdma_task_send_allocate_init(struct doca_rdma *rdma, struct doca_rdma_connection *rdma_connection, const struct doca_buf *src_buf, union doca_data user_data, struct doca_rdma_task_send **task)
This method allocates and initializes a send task.
DOCA_EXPERIMENTAL doca_error_t doca_rdma_connect(struct doca_rdma *rdma, const void *remote_rdma_conn_details, size_t remote_rdma_conn_details_size, struct doca_rdma_connection *rdma_connection)
Connect to remote doca_rdma peer. Can only be called when the ctx is in DOCA_CTX_STATE_STARTING state...
DOCA_EXPERIMENTAL doca_error_t doca_rdma_cap_task_send_is_supported(const struct doca_devinfo *devinfo)
@ DOCA_ACCESS_FLAG_LOCAL_READ_WRITE
Definition: doca_types.h:83
const struct ip_frag_config * cfg
Definition: ip_frag_dp.c:0
static void rdma_multi_conn_send_error_callback(struct doca_rdma_task_send *rdma_send_task, union doca_data task_user_data, union doca_data ctx_user_data)
#define MAX_BUFF_SIZE
DOCA_LOG_REGISTER(RDMA_MULI_CONN_SEND::SAMPLE)
static void rdma_multi_conn_send_state_change_callback(const union doca_data user_data, struct doca_ctx *ctx, enum doca_ctx_states prev_state, enum doca_ctx_states next_state)
doca_error_t rdma_multi_conn_send(struct rdma_config *cfg)
static doca_error_t rdma_multi_conn_send_prepare_and_submit_task(struct rdma_resources *resources)
static void rdma_multi_conn_send_completed_callback(struct doca_rdma_task_send *rdma_send_task, union doca_data task_user_data, union doca_data ctx_user_data)
static doca_error_t write_read_connection(struct rdma_config *cfg, struct rdma_resources *resources, uint32_t connection_id)
static doca_error_t rdma_multi_conn_send_export_and_connect(struct rdma_resources *resources)
uint32_t num_connections
Definition: rdma_common.h:88
char send_string[MAX_ARG_SIZE]
Definition: rdma_common.h:80
bool use_rdma_cm
Definition: rdma_common.h:71
size_t remote_rdma_conn_descriptor_size
Definition: rdma_common.h:127
doca_error_t first_encountered_error
Definition: rdma_common.h:132
bool require_remote_mmap
Definition: rdma_common.h:152
struct doca_ctx * rdma_ctx
Definition: rdma_common.h:85
size_t num_remaining_tasks
Definition: rdma_common.h:134
prepare_and_submit_task_fn task_fn
Definition: rdma_common.h:150
const void * rdma_conn_descriptor
Definition: rdma_common.h:124
void * remote_rdma_conn_descriptor
Definition: rdma_common.h:126
struct doca_rdma_connection * connections[MAX_NUM_CONNECTIONS]
Definition: rdma_common.h:138
struct rdma_config * cfg
Definition: rdma_common.h:80
struct doca_rdma * rdma
Definition: rdma_common.h:83
struct doca_pe * pe
Definition: rdma_common.h:86
struct doca_mmap * mmap
Definition: rdma_common.h:112
bool run_pe_progress
Definition: rdma_common.h:133
struct doca_buf * src_buf
Definition: rdma_common.h:122
struct doca_buf_inventory * buf_inventory
Definition: rdma_common.h:117
size_t rdma_conn_descriptor_size
Definition: rdma_common.h:125
char * mmap_memrange
Definition: rdma_common.h:116
Convenience type for representing opaque data.
Definition: doca_types.h:56
void * ptr
Definition: doca_types.h:57
struct upf_accel_ctx * ctx
doca_error_t read_file(char const *path, char **out_bytes, size_t *out_bytes_len)
Definition: utils.c:56