NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
eth_txq_batch_lso_send_ethernet_frames_sample.c File Reference
#include <time.h>
#include <stdint.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_batch_lso_send_ethernet_frames_sample.c:

Go to the source code of this file.

Data Structures

struct  eth_txq_batch_lso_send_sample_objects
 

Macros

#define SLEEP_IN_NANOS   (10 * 1000) /* sample the task batch 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 TASKS_IN_TASK_BATCH   32 /* Number of tasks associated with task batch */
 
#define BUFS_NUM   TASKS_IN_TASK_BATCH /* Number of DOCA buffers */
 
#define GATHER_LISTS_NUM   TASKS_IN_TASK_BATCH /* Number of DOCA gather_lists */
 
#define TASK_BATCHES_NUM   1 /* Task batches number */
 
#define LSO_PKT_SIZE   4000 /* Size of the packets in LSO send task batch */
 
#define LSO_SEND_TASK_USER_DATA   0x56789 /* User data for LSO send task batch */
 
#define ETHER_TYPE_IPV4   0x0800 /* IPV4 type */
 

Functions

 DOCA_LOG_REGISTER (ETH_TXQ_BATCH_LSO_SEND_ETHERNET_FRAMES)
 
static void task_batch_lso_send_common_cb (struct doca_task_batch *task_batch, uint16_t tasks_num, union doca_data ctx_user_data, union doca_data task_batch_user_data, union doca_data *task_user_data_array, struct doca_buf **pkt_payload_array, struct doca_gather_list **headers_array, doca_error_t *status_array)
 
static doca_error_t destroy_eth_txq_ctx (struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t destroy_eth_txq_packet_headers_gather_lists (struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t destroy_eth_txq_packet_payload_buffers (struct eth_txq_batch_lso_send_sample_objects *state)
 
static void destroy_eth_txq_task_batch (struct eth_txq_batch_lso_send_sample_objects *state)
 
static void retrieve_eth_txq_task_batch (struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t submit_eth_txq_task_batch (struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t create_eth_txq_task_batch (struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t create_eth_txq_packet_headers_gather_lists (struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t create_eth_txq_lso_packet_payload_buffers (uint8_t *dest_mac_addr, struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t create_eth_txq_ctx (struct eth_txq_batch_lso_send_sample_objects *state)
 
static void eth_txq_lso_cleanup (struct eth_txq_batch_lso_send_sample_objects *state)
 
static doca_error_t check_device (struct doca_devinfo *devinfo)
 
doca_error_t eth_txq_batch_lso_send_ethernet_frames (const char *ib_dev_name, uint8_t *dest_mac_addr)
 

Macro Definition Documentation

◆ BUFS_NUM

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

◆ ETHER_TYPE_IPV4

#define ETHER_TYPE_IPV4   0x0800 /* IPV4 type */

◆ GATHER_LISTS_NUM

#define GATHER_LISTS_NUM   TASKS_IN_TASK_BATCH /* Number of DOCA gather_lists */

◆ LSO_PKT_SIZE

#define LSO_PKT_SIZE   4000 /* Size of the packets in LSO send task batch */

◆ LSO_SEND_TASK_USER_DATA

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

◆ MAX_BURST_SIZE

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

◆ MAX_LIST_LENGTH

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

◆ MAX_LSO_HEADER_SIZE

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

◆ MSS

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

◆ SLEEP_IN_NANOS

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

◆ TASK_BATCHES_NUM

#define TASK_BATCHES_NUM   1 /* Task batches number */

◆ TASKS_IN_TASK_BATCH

#define TASKS_IN_TASK_BATCH   32 /* Number of tasks associated with task batch */

Function Documentation

◆ check_device()

static doca_error_t check_device ( struct doca_devinfo *  devinfo)
static

◆ create_eth_txq_ctx()

static doca_error_t create_eth_txq_ctx ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ create_eth_txq_lso_packet_payload_buffers()

static doca_error_t create_eth_txq_lso_packet_payload_buffers ( uint8_t *  dest_mac_addr,
struct eth_txq_batch_lso_send_sample_objects state 
)
static

◆ create_eth_txq_packet_headers_gather_lists()

static doca_error_t create_eth_txq_packet_headers_gather_lists ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ create_eth_txq_task_batch()

static doca_error_t create_eth_txq_task_batch ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ destroy_eth_txq_ctx()

static doca_error_t destroy_eth_txq_ctx ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ destroy_eth_txq_packet_headers_gather_lists()

static doca_error_t destroy_eth_txq_packet_headers_gather_lists ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ destroy_eth_txq_packet_payload_buffers()

static doca_error_t destroy_eth_txq_packet_payload_buffers ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ destroy_eth_txq_task_batch()

static void destroy_eth_txq_task_batch ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( ETH_TXQ_BATCH_LSO_SEND_ETHERNET_FRAMES  )

◆ eth_txq_batch_lso_send_ethernet_frames()

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

◆ eth_txq_lso_cleanup()

static void eth_txq_lso_cleanup ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ retrieve_eth_txq_task_batch()

static void retrieve_eth_txq_task_batch ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ submit_eth_txq_task_batch()

static doca_error_t submit_eth_txq_task_batch ( struct eth_txq_batch_lso_send_sample_objects state)
static

◆ task_batch_lso_send_common_cb()

static void task_batch_lso_send_common_cb ( struct doca_task_batch *  task_batch,
uint16_t  tasks_num,
union doca_data  ctx_user_data,
union doca_data  task_batch_user_data,
union doca_data task_user_data_array,
struct doca_buf **  pkt_payload_array,
struct doca_gather_list **  headers_array,
doca_error_t status_array 
)
static