NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
eth_rxq_batch_managed_mempool_receive_sample.c File Reference
#include <time.h>
#include <stdint.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_batch_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 for event batch every 10 microseconds */
 
#define MAX_BURST_SIZE   2048 /* 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_BATCH_MANAGED_MEMPOOL_RECEIVE)
 
static void event_batch_managed_rcv_success_cb (struct doca_eth_rxq_event_batch_managed_recv *event_batch_managed_recv, uint16_t events_number, union doca_data event_batch_user_data, doca_error_t status, struct doca_buf **pkt_array)
 
static void event_batch_managed_rcv_error_cb (struct doca_eth_rxq_event_batch_managed_recv *event_batch_managed_recv, uint16_t events_number, union doca_data event_batch_user_data, doca_error_t status, struct doca_buf **pkt_array)
 
static doca_error_t destroy_eth_rxq_ctx (struct eth_rxq_sample_objects *state)
 
static void retrieve_rxq_managed_recv_event_batches (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_batch_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*/

◆ LOG_MAX_LRO_PKT_SIZE

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

◆ MAX_BURST_SIZE

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

◆ MAX_PKT_SIZE

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

◆ PKT_MAX_TIME

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

◆ RATE

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

◆ SAMPLE_RUNS_TIME

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

◆ SLEEP_IN_NANOS

#define SLEEP_IN_NANOS   (10 * 1000) /* sample for event batch every 10 microseconds */

Function Documentation

◆ check_device()

static doca_error_t check_device ( struct doca_devinfo *  devinfo)
static

◆ create_eth_rxq_ctx()

static doca_error_t create_eth_rxq_ctx ( struct eth_rxq_sample_objects state)
static

◆ destroy_eth_rxq_ctx()

static doca_error_t destroy_eth_rxq_ctx ( struct eth_rxq_sample_objects state)
static

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( ETH_RXQ_BATCH_MANAGED_MEMPOOL_RECEIVE  )

◆ eth_rxq_batch_managed_mempool_receive()

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

◆ eth_rxq_cleanup()

static void eth_rxq_cleanup ( struct eth_rxq_sample_objects state)
static

◆ event_batch_managed_rcv_error_cb()

static void event_batch_managed_rcv_error_cb ( struct doca_eth_rxq_event_batch_managed_recv *  event_batch_managed_recv,
uint16_t  events_number,
union doca_data  event_batch_user_data,
doca_error_t  status,
struct doca_buf **  pkt_array 
)
static

◆ event_batch_managed_rcv_success_cb()

static void event_batch_managed_rcv_success_cb ( struct doca_eth_rxq_event_batch_managed_recv *  event_batch_managed_recv,
uint16_t  events_number,
union doca_data  event_batch_user_data,
doca_error_t  status,
struct doca_buf **  pkt_array 
)
static

◆ retrieve_rxq_managed_recv_event_batches()

static void retrieve_rxq_managed_recv_event_batches ( struct eth_rxq_sample_objects state)
static