NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
eth_txq_send_ethernet_frames_sample.c
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 #include <time.h>
27 #include <unistd.h>
28 
29 #include <doca_buf.h>
30 #include <doca_buf_inventory.h>
31 #include <doca_ctx.h>
32 #include <doca_eth_txq.h>
34 #include <doca_error.h>
35 #include <doca_log.h>
36 
37 #include "common.h"
38 #include "eth_common.h"
39 
40 DOCA_LOG_REGISTER(ETH_TXQ_SEND_ETHERNET_FRAMES);
41 
42 #define SLEEP_IN_NANOS (10 * 1000) /* sample the task every 10 microseconds */
43 #define MAX_BURST_SIZE 256 /* Max burst size to set for eth_txq */
44 #define MAX_LIST_LENGTH 1 /* Max number of elements in a doca_buf */
45 #define BUFS_NUM 1 /* Number of DOCA buffers */
46 #define TASKS_NUM 1 /* Tasks number */
47 #define REGULAR_PKT_SIZE 1500 /* Size of the packet in doca_eth_txq_task_send task */
48 #define SEND_TASK_USER_DATA 0x43210 /* User data for send task */
49 #define ETHER_TYPE_IPV4 0x0800 /* IPV4 type */
50 
52  struct eth_core_resources core_resources; /* A struct to hold ETH core resources */
53  struct doca_eth_txq *eth_txq; /* DOCA ETH TXQ context */
54  struct doca_buf *eth_frame_buf; /* DOCA buffer to contain regular ethernet frame */
55  struct doca_eth_txq_task_send *send_task; /* Regular send task */
56  uint8_t src_mac_addr[DOCA_DEVINFO_MAC_ADDR_SIZE]; /* Device MAC address */
57  uint32_t inflight_tasks; /* In flight tasks */
58 };
59 
60 /*
61  * ETH TXQ send task common callback
62  *
63  * @task_send [in]: Completed task
64  * @task_user_data [in]: User provided data, used for identifying the task
65  * @ctx_user_data [in]: User provided data, used to store sample state
66  */
67 static void task_send_common_cb(struct doca_eth_txq_task_send *task_send,
68  union doca_data task_user_data,
69  union doca_data ctx_user_data)
70 {
71  doca_error_t status, task_status;
72  struct doca_buf *pkt;
73  size_t packet_size;
74  uint32_t *inflight_tasks;
75 
76  inflight_tasks = ctx_user_data.ptr;
77  (*inflight_tasks)--;
78  DOCA_LOG_INFO("Send task user data is 0x%lx", task_user_data.u64);
79 
80  status = doca_eth_txq_task_send_get_pkt(task_send, &pkt);
81  if (status != DOCA_SUCCESS) {
82  DOCA_LOG_ERR("Failed to get packet of a send task, err: %s", doca_error_get_name(status));
84  return;
85  }
86 
88 
89  status = doca_buf_get_data_len(pkt, &packet_size);
90  if (status != DOCA_SUCCESS) {
91  DOCA_LOG_ERR("Failed to get send packet size, err: %s", doca_error_get_name(status));
92  } else {
93  if (task_status == DOCA_SUCCESS)
94  DOCA_LOG_INFO("Sent a regular packet of size %lu successfully", packet_size);
95  else
96  DOCA_LOG_ERR("Failed to send a regular packet of size %lu, err: %s",
97  packet_size,
98  doca_error_get_name(task_status));
99  }
100 
101  status = doca_buf_dec_refcount(pkt, NULL);
102  if (status != DOCA_SUCCESS)
103  DOCA_LOG_ERR("Failed to free packet buf, err: %s", doca_error_get_name(status));
104 
106 }
107 
108 /*
109  * Destroy ETH TXQ context related resources
110  *
111  * @state [in]: eth_txq_sample_objects struct to destroy its ETH TXQ context
112  * @return: DOCA_SUCCESS on success, DOCA_ERROR otherwise
113  */
115 {
116  doca_error_t status;
117  enum doca_ctx_states ctx_state;
118  struct timespec ts = {
119  .tv_sec = 0,
120  .tv_nsec = SLEEP_IN_NANOS,
121  };
122 
123  status = doca_ctx_stop(state->core_resources.core_objs.ctx);
124  if (status == DOCA_ERROR_IN_PROGRESS) {
125  while (state->inflight_tasks != 0) {
127  nanosleep(&ts, &ts);
128  }
129 
130  status = doca_ctx_get_state(state->core_resources.core_objs.ctx, &ctx_state);
131  if (status != DOCA_SUCCESS) {
132  DOCA_LOG_ERR("Failed get status of context, err: %s", doca_error_get_name(status));
133  return status;
134  }
135 
136  status = ctx_state == DOCA_CTX_STATE_IDLE ? DOCA_SUCCESS : DOCA_ERROR_BAD_STATE;
137  }
138 
139  if (status != DOCA_SUCCESS) {
140  DOCA_LOG_ERR("Failed to stop DOCA context, err: %s", doca_error_get_name(status));
141  return status;
142  }
143 
144  status = doca_eth_txq_destroy(state->eth_txq);
145  if (status != DOCA_SUCCESS) {
146  DOCA_LOG_ERR("Failed to destroy DOCA ETH TXQ context, err: %s", doca_error_get_name(status));
147  return status;
148  }
149 
150  return DOCA_SUCCESS;
151 }
152 
153 /*
154  * Destroy DOCA buffers for the packets
155  *
156  * @state [in]: eth_txq_sample_objects struct to destroy its packet DOCA buffers
157  * @return: DOCA_SUCCESS on success, DOCA_ERROR otherwise
158  */
160 {
161  doca_error_t status;
162 
163  status = doca_buf_dec_refcount(state->eth_frame_buf, NULL);
164  if (status != DOCA_SUCCESS) {
165  DOCA_LOG_ERR("Failed to destroy eth_frame_buf buffer, err: %s", doca_error_get_name(status));
166  return status;
167  }
168 
169  return DOCA_SUCCESS;
170 }
171 
172 /*
173  * Destroy ETH TXQ tasks
174  *
175  * @state [in]: eth_txq_sample_objects struct to destroy its tasks
176  */
178 {
180 }
181 
182 /*
183  * Retrieve ETH TXQ tasks
184  *
185  * @state [in]: eth_txq_sample_objects struct to retrieve its tasks
186  */
188 {
189  struct timespec ts = {
190  .tv_sec = 0,
191  .tv_nsec = SLEEP_IN_NANOS,
192  };
193 
194  while (state->inflight_tasks != 0) {
196  nanosleep(&ts, &ts);
197  }
198 }
199 
200 /*
201  * Submit ETH TXQ tasks
202  *
203  * @state [in]: eth_txq_sample_objects struct to submit its tasks
204  * @return: DOCA_SUCCESS on success, DOCA_ERROR otherwise
205  */
207 {
208  doca_error_t status;
209 
211  if (status != DOCA_SUCCESS) {
212  DOCA_LOG_ERR("Failed to submit send task, err: %s", doca_error_get_name(status));
213  return status;
214  }
215 
216  state->inflight_tasks++;
217 
218  return DOCA_SUCCESS;
219 }
220 
221 /*
222  * Create ETH TXQ tasks
223  *
224  * @state [in/out]: eth_txq_sample_objects struct to create tasks with its ETH TXQ context
225  * @return: DOCA_SUCCESS on success, DOCA_ERROR otherwise
226  */
228 {
229  doca_error_t status;
230  union doca_data user_data;
231 
232  user_data.u64 = SEND_TASK_USER_DATA;
234  state->eth_frame_buf,
235  user_data,
236  &(state->send_task));
237  if (status != DOCA_SUCCESS) {
238  DOCA_LOG_ERR("Failed to allocate send task, err: %s", doca_error_get_name(status));
239  return status;
240  }
241 
242  return DOCA_SUCCESS;
243 }
244 
245 /*
246  * Create DOCA buffers for the packets
247  *
248  * @dest_mac_addr [in]: Destination MAC address to set in ethernet header
249  * @state [in/out]: eth_txq_sample_objects struct to create its packet DOCA buffers
250  * @return: DOCA_SUCCESS on success, DOCA_ERROR otherwise
251  */
252 static doca_error_t create_eth_txq_packet_buffers(uint8_t *dest_mac_addr, struct eth_txq_sample_objects *state)
253 {
254  doca_error_t status;
255  struct ether_hdr *eth_hdr;
256  uint8_t *payload;
257 
260  state->core_resources.mmap_addr,
262  &(state->eth_frame_buf));
263  if (status != DOCA_SUCCESS) {
264  DOCA_LOG_ERR("Failed to create DOCA buffer for regular ethernet frame, err: %s",
265  doca_error_get_name(status));
266  return status;
267  }
268 
269  /* Create regular packet header + payload */
270  eth_hdr = (struct ether_hdr *)state->core_resources.mmap_addr;
271  payload = (uint8_t *)(eth_hdr + 1);
272  memcpy(&(eth_hdr->src_addr), state->src_mac_addr, DOCA_DEVINFO_MAC_ADDR_SIZE);
273  memcpy(&(eth_hdr->dst_addr), dest_mac_addr, DOCA_DEVINFO_MAC_ADDR_SIZE);
274  eth_hdr->ether_type = htobe16(ETHER_TYPE_IPV4);
275  memset(payload, 0x11, REGULAR_PKT_SIZE - sizeof(struct ether_hdr));
276 
277  return DOCA_SUCCESS;
278 }
279 
280 /*
281  * Create ETH TXQ context related resources
282  *
283  * @state [in/out]: eth_txq_sample_objects struct to create its ETH TXQ context
284  * @return: DOCA_SUCCESS on success, DOCA_ERROR otherwise
285  */
287 {
288  doca_error_t status, clean_status;
289  union doca_data user_data;
290 
292  if (status != DOCA_SUCCESS) {
293  DOCA_LOG_ERR("Failed to create ETH TXQ context, err: %s", doca_error_get_name(status));
294  return status;
295  }
296 
298  if (status != DOCA_SUCCESS) {
299  DOCA_LOG_ERR("Failed to set type, err: %s", doca_error_get_name(status));
300  goto destroy_eth_txq;
301  }
302 
304  if (status != DOCA_SUCCESS) {
305  DOCA_LOG_ERR("Failed to configure task_send, err: %s", doca_error_get_name(status));
306  goto destroy_eth_txq;
307  }
308 
310  if (state->core_resources.core_objs.ctx == NULL) {
311  DOCA_LOG_ERR("Failed to retrieve DOCA ETH TXQ context as DOCA context, err: %s",
312  doca_error_get_name(status));
313  goto destroy_eth_txq;
314  }
315 
317  if (status != DOCA_SUCCESS) {
318  DOCA_LOG_ERR("Failed to connect PE, err: %s", doca_error_get_name(status));
319  goto destroy_eth_txq;
320  }
321 
322  user_data.ptr = &(state->inflight_tasks);
323  status = doca_ctx_set_user_data(state->core_resources.core_objs.ctx, user_data);
324  if (status != DOCA_SUCCESS) {
325  DOCA_LOG_ERR("Failed to set user data for DOCA context, err: %s", doca_error_get_name(status));
326  goto destroy_eth_txq;
327  }
328 
329  status = doca_ctx_start(state->core_resources.core_objs.ctx);
330  if (status != DOCA_SUCCESS) {
331  DOCA_LOG_ERR("Failed to start DOCA context, err: %s", doca_error_get_name(status));
332  goto destroy_eth_txq;
333  }
334 
335  return DOCA_SUCCESS;
336 destroy_eth_txq:
337  clean_status = doca_eth_txq_destroy(state->eth_txq);
338  state->eth_txq = NULL;
339 
340  if (clean_status != DOCA_SUCCESS)
341  return clean_status;
342 
343  return status;
344 }
345 
346 /*
347  * Clean sample resources
348  *
349  * @state [in]: eth_txq_sample_objects struct to clean
350  */
351 static void eth_txq_cleanup(struct eth_txq_sample_objects *state)
352 {
353  doca_error_t status;
354 
355  if (state->eth_txq != NULL) {
356  status = destroy_eth_txq_ctx(state);
357  if (status != DOCA_SUCCESS) {
358  DOCA_LOG_ERR("Failed to destroy eth_txq_ctx, err: %s", doca_error_get_name(status));
359  return;
360  }
361  }
362 
363  if (state->core_resources.core_objs.dev != NULL) {
364  status = destroy_eth_core_resources(&(state->core_resources));
365  if (status != DOCA_SUCCESS) {
366  DOCA_LOG_ERR("Failed to destroy core_resources, err: %s", doca_error_get_name(status));
367  return;
368  }
369  }
370 }
371 
372 /*
373  * Check if device supports needed capabilities
374  *
375  * @devinfo [in]: Device info for device to check
376  * @return: DOCA_SUCCESS in case the device supports needed capabilities and DOCA_ERROR otherwise
377  */
378 static doca_error_t check_device(struct doca_devinfo *devinfo)
379 {
380  doca_error_t status;
381  uint32_t max_supported_burst_size;
382 
383  status = doca_eth_txq_cap_get_max_burst_size(devinfo, MAX_LIST_LENGTH, 0, &max_supported_burst_size);
384  if (status != DOCA_SUCCESS) {
385  DOCA_LOG_ERR("Failed to get supported max burst size, err: %s", doca_error_get_name(status));
386  return status;
387  }
388 
389  if (max_supported_burst_size < MAX_BURST_SIZE)
391 
392  status =
394  if (status != DOCA_SUCCESS && status != DOCA_ERROR_NOT_SUPPORTED) {
395  DOCA_LOG_ERR("Failed to check supported type, err: %s", doca_error_get_name(status));
396  return status;
397  }
398 
399  return status;
400 }
401 
402 /*
403  * Run ETH TXQ send ethernet frames
404  *
405  * @ib_dev_name [in]: IB device name of a doca device
406  * @dest_mac_addr [in]: destination MAC address to associate with the ethernet frames
407  * @return: DOCA_SUCCESS on success, DOCA_ERROR otherwise
408  */
409 doca_error_t eth_txq_send_ethernet_frames(const char *ib_dev_name, uint8_t *dest_mac_addr)
410 {
411  doca_error_t status, clean_status;
412  struct eth_txq_sample_objects state;
413  struct eth_core_config cfg = {.mmap_size = REGULAR_PKT_SIZE * BUFS_NUM,
414  .inventory_num_elements = BUFS_NUM,
415  .check_device = check_device,
416  .ibdev_name = ib_dev_name};
417 
418  memset(&state, 0, sizeof(struct eth_txq_sample_objects));
419  status = allocate_eth_core_resources(&cfg, &(state.core_resources));
420  if (status != DOCA_SUCCESS) {
421  DOCA_LOG_ERR("Failed allocate core resources, err: %s", doca_error_get_name(status));
422  return status;
423  }
424 
426  state.src_mac_addr,
428  if (status != DOCA_SUCCESS) {
429  DOCA_LOG_ERR("Failed to get device MAC address, err: %s", doca_error_get_name(status));
430  goto txq_cleanup;
431  }
432 
433  status = create_eth_txq_ctx(&state);
434  if (status != DOCA_SUCCESS) {
435  DOCA_LOG_ERR("Failed to create/start ETH TXQ context, err: %s", doca_error_get_name(status));
436  goto txq_cleanup;
437  }
438 
439  status = create_eth_txq_packet_buffers(dest_mac_addr, &state);
440  if (status != DOCA_SUCCESS) {
441  DOCA_LOG_ERR("Failed to create packet buffers, err: %s", doca_error_get_name(status));
442  goto txq_cleanup;
443  }
444 
445  status = create_eth_txq_tasks(&state);
446  if (status != DOCA_SUCCESS) {
447  DOCA_LOG_ERR("Failed to create tasks, err: %s", doca_error_get_name(status));
448  goto destroy_packet_buffers;
449  }
450 
451  status = submit_eth_txq_tasks(&state);
452  if (status != DOCA_SUCCESS) {
453  DOCA_LOG_ERR("Failed to submit tasks, err: %s", doca_error_get_name(status));
454  goto destroy_txq_tasks;
455  }
456 
457  retrieve_eth_txq_tasks(&state);
458 
459  goto txq_cleanup;
460 
461 destroy_txq_tasks:
462  destroy_eth_txq_tasks(&state);
463 destroy_packet_buffers:
464  clean_status = destroy_eth_txq_packet_buffers(&state);
465  if (clean_status != DOCA_SUCCESS)
466  return clean_status;
467 txq_cleanup:
468  eth_txq_cleanup(&state);
469 
470  return status;
471 }
#define NULL
Definition: __stddef_null.h:26
doca_error_t destroy_eth_core_resources(struct eth_core_resources *resources)
Definition: eth_common.c:98
doca_error_t allocate_eth_core_resources(struct eth_core_config *cfg, struct eth_core_resources *resources)
Definition: eth_common.c:38
static doca_error_t create_eth_txq_packet_buffers(uint8_t *dest_mac_addr, struct eth_txq_sample_objects *state)
static void destroy_eth_txq_tasks(struct eth_txq_sample_objects *state)
static void retrieve_eth_txq_tasks(struct eth_txq_sample_objects *state)
doca_error_t eth_txq_send_ethernet_frames(const char *ib_dev_name, uint8_t *dest_mac_addr)
static doca_error_t create_eth_txq_ctx(struct eth_txq_sample_objects *state)
static doca_error_t destroy_eth_txq_ctx(struct eth_txq_sample_objects *state)
DOCA_LOG_REGISTER(ETH_TXQ_SEND_ETHERNET_FRAMES)
static void eth_txq_cleanup(struct eth_txq_sample_objects *state)
static doca_error_t create_eth_txq_tasks(struct eth_txq_sample_objects *state)
static doca_error_t submit_eth_txq_tasks(struct eth_txq_sample_objects *state)
static void task_send_common_cb(struct doca_eth_txq_task_send *task_send, union doca_data task_user_data, union doca_data ctx_user_data)
static doca_error_t check_device(struct doca_devinfo *devinfo)
static doca_error_t destroy_eth_txq_packet_buffers(struct eth_txq_sample_objects *state)
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_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_len(const struct doca_buf *buf, size_t *data_len)
Get buffer's data length.
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_get_state(const struct doca_ctx *ctx, enum doca_ctx_states *state)
Get context state.
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_IDLE
Definition: doca_ctx.h:88
#define DOCA_DEVINFO_MAC_ADDR_SIZE
Length of MAC address.
Definition: doca_dev.h:301
DOCA_STABLE doca_error_t doca_devinfo_get_mac_addr(const struct doca_devinfo *devinfo, uint8_t *mac_addr, uint32_t size)
Get the MAC address of a DOCA devinfo.
DOCA_STABLE struct doca_devinfo * doca_dev_as_devinfo(const struct doca_dev *dev)
Get local device info from device. This should be useful when wanting to query information about devi...
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_name(doca_error_t error)
Returns the string representation of an error code name.
@ DOCA_ERROR_BAD_STATE
Definition: doca_error.h:56
@ DOCA_ERROR_NOT_SUPPORTED
Definition: doca_error.h:42
@ DOCA_SUCCESS
Definition: doca_error.h:38
@ DOCA_ERROR_IN_PROGRESS
Definition: doca_error.h:64
DOCA_EXPERIMENTAL struct doca_task * doca_eth_txq_task_send_as_doca_task(struct doca_eth_txq_task_send *task_send)
This method converts a doca_eth_txq_task_send task to doca_task.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_task_send_allocate_init(struct doca_eth_txq *eth_txq, struct doca_buf *pkt, union doca_data user_data, struct doca_eth_txq_task_send **task_send)
This method allocates and initializes a doca_eth_txq_task_send task.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_task_send_get_pkt(const struct doca_eth_txq_task_send *task_send, struct doca_buf **pkt)
This method gets packet buffer from doca_eth_txq_task_send task.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_task_send_set_conf(struct doca_eth_txq *eth_txq, doca_eth_txq_task_send_completion_cb_t task_completion_cb, doca_eth_txq_task_send_completion_cb_t task_error_cb, uint32_t task_send_num)
This method sets the doca_eth_txq_task_send tasks configuration.
DOCA_EXPERIMENTAL struct doca_ctx * doca_eth_txq_as_doca_ctx(struct doca_eth_txq *eth_txq)
Convert doca_eth_txq instance into a generalized context for use with doca core objects.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_get_max_burst_size(const struct doca_devinfo *devinfo, uint32_t max_send_buf_list_len, uint16_t max_lso_header_size, uint32_t *max_burst_size)
Get the maximum burst size supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_create(struct doca_dev *dev, uint32_t max_burst_size, struct doca_eth_txq **eth_txq)
Create a DOCA ETH TXQ instance.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_destroy(struct doca_eth_txq *eth_txq)
Destroy a DOCA ETH TXQ instance.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_type(struct doca_eth_txq *eth_txq, enum doca_eth_txq_type type)
Set TX queue type property for doca_eth_txq. can only be called before calling doca_ctx_start().
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_is_type_supported(const struct doca_devinfo *devinfo, enum doca_eth_txq_type type, enum doca_eth_txq_data_path_type data_path_type)
Check if TX queue type is supported.
@ DOCA_ETH_TXQ_DATA_PATH_TYPE_CPU
Definition: doca_eth_txq.h:72
@ DOCA_ETH_TXQ_TYPE_REGULAR
Definition: doca_eth_txq.h:65
#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_pe_connect_ctx(struct doca_pe *pe, struct doca_ctx *ctx)
This method connects a context to a progress engine.
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.
const struct ip_frag_config * cfg
Definition: ip_frag_dp.c:0
#define htobe16
Definition: os_utils.hpp:39
struct program_core_objects core_objs
Definition: eth_common.h:40
struct eth_core_resources core_resources
struct doca_eth_txq_task_send * send_task
uint8_t src_mac_addr[DOCA_DEVINFO_MAC_ADDR_SIZE]
uint8_t dst_addr[DOCA_DEVINFO_MAC_ADDR_SIZE]
Definition: eth_common.h:54
uint16_t ether_type
Definition: packets.h:63
uint8_t src_addr[DOCA_DEVINFO_MAC_ADDR_SIZE]
Definition: eth_common.h:55
struct doca_pe * pe
Definition: common.h:51
struct doca_mmap * src_mmap
Definition: common.h:47
struct doca_buf_inventory * buf_inv
Definition: common.h:49
struct doca_dev * dev
Definition: common.h:46
struct doca_ctx * ctx
Definition: common.h:50
Convenience type for representing opaque data.
Definition: doca_types.h:56
uint64_t u64
Definition: doca_types.h:58
void * ptr
Definition: doca_types.h:57