NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
eth_txq_lso_send_ethernet_frames_sample.c File Reference
#include <time.h>
#include <unistd.h>
#include <doca_buf.h>
#include <doca_buf_inventory.h>
#include <doca_ctx.h>
#include <doca_eth_txq.h>
#include <doca_eth_txq_cpu_data_path.h>
#include <doca_error.h>
#include <doca_log.h>
#include "common.h"
#include "eth_common.h"
Include dependency graph for eth_txq_lso_send_ethernet_frames_sample.c:

Go to the source code of this file.

Data Structures

struct  eth_txq_lso_sample_objects
 

Macros

#define SLEEP_IN_NANOS   (10 * 1000) /* sample the task every 10 microseconds */
 
#define MAX_BURST_SIZE   256 /* Max burst size to set for eth_txq */
 
#define MAX_LSO_HEADER_SIZE   64 /* Max header size in LRO packet to set for eth_txq */
 
#define MAX_LIST_LENGTH   1 /* Max number of elements in a doca_buf */
 
#define MSS   1500 /* Max Segment Size in LSO tasks to set for eth_txq */
 
#define BUFS_NUM   1 /* Number of DOCA buffers */
 
#define TASKS_NUM   1 /* Tasks number */
 
#define LSO_PKT_SIZE   4000 /* Size of the packet in doca_eth_txq_task_lso_send task */
 
#define LSO_SEND_TASK_USER_DATA   0x56789 /* User data for LSO send task */
 
#define ETHER_TYPE_IPV4   0x0800 /* IPV4 type */
 

Functions

 DOCA_LOG_REGISTER (ETH_TXQ_LSO_SEND_ETHERNET_FRAMES)
 
static void task_lso_send_common_cb (struct doca_eth_txq_task_lso_send *task_lso_send, union doca_data task_user_data, union doca_data ctx_user_data)
 
static doca_error_t destroy_eth_txq_ctx (struct eth_txq_lso_sample_objects *state)
 
static doca_error_t destroy_eth_txq_packet_buffers (struct eth_txq_lso_sample_objects *state)
 
static void destroy_eth_txq_tasks (struct eth_txq_lso_sample_objects *state)
 
static void retrieve_eth_txq_tasks (struct eth_txq_lso_sample_objects *state)
 
static doca_error_t submit_eth_txq_tasks (struct eth_txq_lso_sample_objects *state)
 
static doca_error_t create_eth_txq_tasks (struct eth_txq_lso_sample_objects *state)
 
static doca_error_t create_eth_txq_lso_packet_buffers (uint8_t *dest_mac_addr, struct eth_txq_lso_sample_objects *state)
 
static doca_error_t create_eth_txq_ctx (struct eth_txq_lso_sample_objects *state)
 
static void eth_txq_lso_cleanup (struct eth_txq_lso_sample_objects *state)
 
static doca_error_t check_device (struct doca_devinfo *devinfo)
 
doca_error_t eth_txq_lso_send_ethernet_frames (const char *ib_dev_name, uint8_t *dest_mac_addr)
 

Macro Definition Documentation

◆ BUFS_NUM

#define BUFS_NUM   1 /* Number of DOCA buffers */

Definition at line 47 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ ETHER_TYPE_IPV4

#define ETHER_TYPE_IPV4   0x0800 /* IPV4 type */

Definition at line 51 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ LSO_PKT_SIZE

#define LSO_PKT_SIZE   4000 /* Size of the packet in doca_eth_txq_task_lso_send task */

Definition at line 49 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ LSO_SEND_TASK_USER_DATA

#define LSO_SEND_TASK_USER_DATA   0x56789 /* User data for LSO send task */

Definition at line 50 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ MAX_BURST_SIZE

#define MAX_BURST_SIZE   256 /* Max burst size to set for eth_txq */

Definition at line 43 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ MAX_LIST_LENGTH

#define MAX_LIST_LENGTH   1 /* Max number of elements in a doca_buf */

Definition at line 45 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ MAX_LSO_HEADER_SIZE

#define MAX_LSO_HEADER_SIZE   64 /* Max header size in LRO packet to set for eth_txq */

Definition at line 44 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ MSS

#define MSS   1500 /* Max Segment Size in LSO tasks to set for eth_txq */

Definition at line 46 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ SLEEP_IN_NANOS

#define SLEEP_IN_NANOS   (10 * 1000) /* sample the task every 10 microseconds */

Definition at line 42 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ TASKS_NUM

#define TASKS_NUM   1 /* Tasks number */

Definition at line 48 of file eth_txq_lso_send_ethernet_frames_sample.c.

Function Documentation

◆ check_device()

static doca_error_t check_device ( struct doca_devinfo *  devinfo)
static

Definition at line 408 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ create_eth_txq_ctx()

static doca_error_t create_eth_txq_ctx ( struct eth_txq_lso_sample_objects state)
static

Definition at line 295 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ create_eth_txq_lso_packet_buffers()

static doca_error_t create_eth_txq_lso_packet_buffers ( uint8_t *  dest_mac_addr,
struct eth_txq_lso_sample_objects state 
)
static

Definition at line 257 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ create_eth_txq_tasks()

static doca_error_t create_eth_txq_tasks ( struct eth_txq_lso_sample_objects state)
static

Definition at line 231 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ destroy_eth_txq_ctx()

static doca_error_t destroy_eth_txq_ctx ( struct eth_txq_lso_sample_objects state)
static

Definition at line 118 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ destroy_eth_txq_packet_buffers()

static doca_error_t destroy_eth_txq_packet_buffers ( struct eth_txq_lso_sample_objects state)
static

Definition at line 163 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ destroy_eth_txq_tasks()

static void destroy_eth_txq_tasks ( struct eth_txq_lso_sample_objects state)
static

Definition at line 181 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( ETH_TXQ_LSO_SEND_ETHERNET_FRAMES  )

◆ eth_txq_lso_cleanup()

static void eth_txq_lso_cleanup ( struct eth_txq_lso_sample_objects state)
static

Definition at line 375 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ eth_txq_lso_send_ethernet_frames()

doca_error_t eth_txq_lso_send_ethernet_frames ( const char *  ib_dev_name,
uint8_t *  dest_mac_addr 
)

Definition at line 452 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ retrieve_eth_txq_tasks()

static void retrieve_eth_txq_tasks ( struct eth_txq_lso_sample_objects state)
static

Definition at line 191 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ submit_eth_txq_tasks()

static doca_error_t submit_eth_txq_tasks ( struct eth_txq_lso_sample_objects state)
static

Definition at line 210 of file eth_txq_lso_send_ethernet_frames_sample.c.

◆ task_lso_send_common_cb()

static void task_lso_send_common_cb ( struct doca_eth_txq_task_lso_send *  task_lso_send,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)
static

Definition at line 71 of file eth_txq_lso_send_ethernet_frames_sample.c.