NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
eth_rxq_managed_mempool_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_managed_mempool_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 RATE   10000 /* Traffic max rate in [MB/s] */
 
#define LOG_MAX_LRO_PKT_SIZE   15 /* Log of max LRO packet size */
 
#define PKT_MAX_TIME   10 /* Max time in [μs] to process a packet */
 
#define COUNTERS_NUM   (1 << 19) /* Number of counters to configure for DOCA flow*/
 
#define SAMPLE_RUNS_TIME   30 /* Sample total run-time in [s] */
 

Functions

 DOCA_LOG_REGISTER (ETH_RXQ_MANAGED_MEMPOOL_RECEIVE)
 
static void event_managed_rcv_success_cb (struct doca_eth_rxq_event_managed_recv *event_managed_recv, struct doca_buf *pkt, union doca_data event_user_data)
 
static void event_managed_rcv_error_cb (struct doca_eth_rxq_event_managed_recv *event_managed_recv, struct doca_buf *pkt, union doca_data event_user_data)
 
static doca_error_t destroy_eth_rxq_ctx (struct eth_rxq_sample_objects *state)
 
static void retrieve_rxq_managed_recv_event (struct eth_rxq_sample_objects *state)
 
static doca_error_t create_eth_rxq_ctx (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_managed_mempool_receive (const char *ib_dev_name, bool timestamp_enable, uint16_t headroom_size, uint16_t tailroom_size)
 

Macro Definition Documentation

◆ COUNTERS_NUM

#define COUNTERS_NUM   (1 << 19) /* Number of counters to configure for DOCA flow*/

Definition at line 50 of file eth_rxq_managed_mempool_receive_sample.c.

◆ LOG_MAX_LRO_PKT_SIZE

#define LOG_MAX_LRO_PKT_SIZE   15 /* Log of max LRO packet size */

Definition at line 48 of file eth_rxq_managed_mempool_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_managed_mempool_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_managed_mempool_receive_sample.c.

◆ PKT_MAX_TIME

#define PKT_MAX_TIME   10 /* Max time in [μs] to process a packet */

Definition at line 49 of file eth_rxq_managed_mempool_receive_sample.c.

◆ RATE

#define RATE   10000 /* Traffic max rate in [MB/s] */

Definition at line 47 of file eth_rxq_managed_mempool_receive_sample.c.

◆ SAMPLE_RUNS_TIME

#define SAMPLE_RUNS_TIME   30 /* Sample total run-time in [s] */

Definition at line 51 of file eth_rxq_managed_mempool_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_managed_mempool_receive_sample.c.

Function Documentation

◆ check_device()

static doca_error_t check_device ( struct doca_devinfo *  devinfo)
static

Definition at line 395 of file eth_rxq_managed_mempool_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 232 of file eth_rxq_managed_mempool_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 179 of file eth_rxq_managed_mempool_receive_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( ETH_RXQ_MANAGED_MEMPOOL_RECEIVE  )

◆ eth_rxq_cleanup()

static void eth_rxq_cleanup ( struct eth_rxq_sample_objects state)
static

Definition at line 354 of file eth_rxq_managed_mempool_receive_sample.c.

◆ eth_rxq_managed_mempool_receive()

doca_error_t eth_rxq_managed_mempool_receive ( const char *  ib_dev_name,
bool  timestamp_enable,
uint16_t  headroom_size,
uint16_t  tailroom_size 
)

Definition at line 437 of file eth_rxq_managed_mempool_receive_sample.c.

◆ event_managed_rcv_error_cb()

static void event_managed_rcv_error_cb ( struct doca_eth_rxq_event_managed_recv *  event_managed_recv,
struct doca_buf *  pkt,
union doca_data  event_user_data 
)
static

Definition at line 156 of file eth_rxq_managed_mempool_receive_sample.c.

◆ event_managed_rcv_success_cb()

static void event_managed_rcv_success_cb ( struct doca_eth_rxq_event_managed_recv *  event_managed_recv,
struct doca_buf *  pkt,
union doca_data  event_user_data 
)
static

Definition at line 72 of file eth_rxq_managed_mempool_receive_sample.c.

◆ retrieve_rxq_managed_recv_event()

static void retrieve_rxq_managed_recv_event ( struct eth_rxq_sample_objects state)
static

Definition at line 203 of file eth_rxq_managed_mempool_receive_sample.c.