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

Go to the source code of this file.

Data Structures

struct  eth_rxq_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_rxq */
 
#define MAX_PKT_SIZE   1600 /* Max packet size to set for eth_rxq */
 
#define BUFS_NUM   1 /* Number of DOCA buffers */
 
#define TASKS_NUM   1 /* Tasks number */
 
#define RECV_TASK_USER_DATA   0x43210 /* User data for receive task */
 

Functions

 DOCA_LOG_REGISTER (ETH_RXQ_REGULAR_RECEIVE)
 
static void task_recv_common_cb (struct doca_eth_rxq_task_recv *task_recv, union doca_data task_user_data, union doca_data ctx_user_data)
 
static doca_error_t destroy_eth_rxq_ctx (struct eth_rxq_sample_objects *state)
 
static doca_error_t destroy_eth_rxq_packet_buffers (struct eth_rxq_sample_objects *state)
 
static void destroy_eth_rxq_tasks (struct eth_rxq_sample_objects *state)
 
static void retrieve_rxq_recv_tasks (struct eth_rxq_sample_objects *state)
 
static doca_error_t create_eth_rxq_ctx (struct eth_rxq_sample_objects *state)
 
static doca_error_t submit_eth_rxq_tasks (struct eth_rxq_sample_objects *state)
 
static doca_error_t create_eth_rxq_tasks (struct eth_rxq_sample_objects *state)
 
static doca_error_t create_eth_rxq_packet_buffer (struct eth_rxq_sample_objects *state)
 
static void eth_rxq_cleanup (struct eth_rxq_sample_objects *state)
 
static doca_error_t check_device (struct doca_devinfo *devinfo)
 
doca_error_t eth_rxq_regular_receive (const char *ib_dev_name, bool timestamp_enable)
 

Macro Definition Documentation

◆ BUFS_NUM

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

Definition at line 47 of file eth_rxq_regular_receive_sample.c.

◆ MAX_BURST_SIZE

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

Definition at line 45 of file eth_rxq_regular_receive_sample.c.

◆ MAX_PKT_SIZE

#define MAX_PKT_SIZE   1600 /* Max packet size to set for eth_rxq */

Definition at line 46 of file eth_rxq_regular_receive_sample.c.

◆ RECV_TASK_USER_DATA

#define RECV_TASK_USER_DATA   0x43210 /* User data for receive task */

Definition at line 49 of file eth_rxq_regular_receive_sample.c.

◆ SLEEP_IN_NANOS

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

Definition at line 44 of file eth_rxq_regular_receive_sample.c.

◆ TASKS_NUM

#define TASKS_NUM   1 /* Tasks number */

Definition at line 48 of file eth_rxq_regular_receive_sample.c.

Function Documentation

◆ check_device()

static doca_error_t check_device ( struct doca_devinfo *  devinfo)
static

Definition at line 446 of file eth_rxq_regular_receive_sample.c.

◆ create_eth_rxq_ctx()

static doca_error_t create_eth_rxq_ctx ( struct eth_rxq_sample_objects state)
static

Definition at line 235 of file eth_rxq_regular_receive_sample.c.

◆ create_eth_rxq_packet_buffer()

static doca_error_t create_eth_rxq_packet_buffer ( struct eth_rxq_sample_objects state)
static

Definition at line 383 of file eth_rxq_regular_receive_sample.c.

◆ create_eth_rxq_tasks()

static doca_error_t create_eth_rxq_tasks ( struct eth_rxq_sample_objects state)
static

Definition at line 361 of file eth_rxq_regular_receive_sample.c.

◆ destroy_eth_rxq_ctx()

static doca_error_t destroy_eth_rxq_ctx ( struct eth_rxq_sample_objects state)
static

Definition at line 143 of file eth_rxq_regular_receive_sample.c.

◆ destroy_eth_rxq_packet_buffers()

static doca_error_t destroy_eth_rxq_packet_buffers ( struct eth_rxq_sample_objects state)
static

Definition at line 188 of file eth_rxq_regular_receive_sample.c.

◆ destroy_eth_rxq_tasks()

static void destroy_eth_rxq_tasks ( struct eth_rxq_sample_objects state)
static

Definition at line 206 of file eth_rxq_regular_receive_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( ETH_RXQ_REGULAR_RECEIVE  )

◆ eth_rxq_cleanup()

static void eth_rxq_cleanup ( struct eth_rxq_sample_objects state)
static

Definition at line 405 of file eth_rxq_regular_receive_sample.c.

◆ eth_rxq_regular_receive()

doca_error_t eth_rxq_regular_receive ( const char *  ib_dev_name,
bool  timestamp_enable 
)

Definition at line 487 of file eth_rxq_regular_receive_sample.c.

◆ retrieve_rxq_recv_tasks()

static void retrieve_rxq_recv_tasks ( struct eth_rxq_sample_objects state)
static

Definition at line 216 of file eth_rxq_regular_receive_sample.c.

◆ submit_eth_rxq_tasks()

static doca_error_t submit_eth_rxq_tasks ( struct eth_rxq_sample_objects state)
static

Definition at line 340 of file eth_rxq_regular_receive_sample.c.

◆ task_recv_common_cb()

static void task_recv_common_cb ( struct doca_eth_rxq_task_recv *  task_recv,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)
static

Definition at line 69 of file eth_rxq_regular_receive_sample.c.