NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
dpdk_utils.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <rte_mbuf.h>
#include <rte_flow.h>
#include <doca_error.h>
Include dependency graph for dpdk_utils.h:

Go to the source code of this file.

Data Structures

struct  application_port_config
 
struct  application_dpdk_config
 

Macros

#define RX_RING_SIZE   1024 /* RX ring size */
 
#define TX_RING_SIZE   1024 /* TX ring size */
 
#define NUM_MBUFS   (8 * 1024) /* Number of mbufs to be allocated in the mempool */
 
#define MBUF_CACHE_SIZE   250 /* mempool cache size */
 

Functions

doca_error_t dpdk_init (int argc, char **argv)
 
void dpdk_fini (void)
 
doca_error_t dpdk_queues_and_ports_init (struct application_dpdk_config *app_dpdk_config)
 
void dpdk_queues_and_ports_fini (struct application_dpdk_config *app_dpdk_config)
 
struct dpdk_mempool_shadowdpdk_mempool_shadow_create (struct rte_mempool *mbuf_pool, struct doca_dev *device)
 
struct dpdk_mempool_shadowdpdk_mempool_shadow_create_extbuf (const struct rte_pktmbuf_extmem **ext_mem, uint32_t ext_num, struct doca_dev *device)
 
doca_error_t dpdk_mempool_shadow_find_buf_by_data (struct dpdk_mempool_shadow *mempool_shadow, struct doca_buf_inventory *inventory, uintptr_t mem_range_start, size_t mem_range_size, struct doca_buf **out_buf)
 
void dpdk_mempool_shadow_destroy (struct dpdk_mempool_shadow *mempool_shadow)
 
void print_header_info (const struct rte_mbuf *packet, const bool l2, const bool l3, const bool l4)
 

Macro Definition Documentation

◆ MBUF_CACHE_SIZE

#define MBUF_CACHE_SIZE   250 /* mempool cache size */

Definition at line 46 of file dpdk_utils.h.

◆ NUM_MBUFS

#define NUM_MBUFS   (8 * 1024) /* Number of mbufs to be allocated in the mempool */

Definition at line 45 of file dpdk_utils.h.

◆ RX_RING_SIZE

#define RX_RING_SIZE   1024 /* RX ring size */

Definition at line 43 of file dpdk_utils.h.

◆ TX_RING_SIZE

#define TX_RING_SIZE   1024 /* TX ring size */

Definition at line 44 of file dpdk_utils.h.

Function Documentation

◆ dpdk_fini()

void dpdk_fini ( void  )

Definition at line 919 of file dpdk_utils.c.

◆ dpdk_init()

doca_error_t dpdk_init ( int  argc,
char **  argv 
)

Definition at line 907 of file dpdk_utils.c.

◆ dpdk_mempool_shadow_create()

struct dpdk_mempool_shadow* dpdk_mempool_shadow_create ( struct rte_mempool *  mbuf_pool,
struct doca_dev *  device 
)

Definition at line 749 of file dpdk_utils.c.

◆ dpdk_mempool_shadow_create_extbuf()

struct dpdk_mempool_shadow* dpdk_mempool_shadow_create_extbuf ( const struct rte_pktmbuf_extmem **  ext_mem,
uint32_t  ext_num,
struct doca_dev *  device 
)

Definition at line 824 of file dpdk_utils.c.

◆ dpdk_mempool_shadow_destroy()

void dpdk_mempool_shadow_destroy ( struct dpdk_mempool_shadow mempool_shadow)

Definition at line 857 of file dpdk_utils.c.

◆ dpdk_mempool_shadow_find_buf_by_data()

doca_error_t dpdk_mempool_shadow_find_buf_by_data ( struct dpdk_mempool_shadow mempool_shadow,
struct doca_buf_inventory *  inventory,
uintptr_t  mem_range_start,
size_t  mem_range_size,
struct doca_buf **  out_buf 
)

Definition at line 869 of file dpdk_utils.c.

◆ dpdk_queues_and_ports_fini()

void dpdk_queues_and_ports_fini ( struct application_dpdk_config app_dpdk_config)

Definition at line 564 of file dpdk_utils.c.

◆ dpdk_queues_and_ports_init()

doca_error_t dpdk_queues_and_ports_init ( struct application_dpdk_config app_dpdk_config)

Definition at line 515 of file dpdk_utils.c.

◆ print_header_info()

void print_header_info ( const struct rte_mbuf *  packet,
const bool  l2,
const bool  l3,
const bool  l4 
)

Definition at line 897 of file dpdk_utils.c.