Agora  1.2.0
Agora project
DpdkTransport Class Reference

#include <dpdk_transport.h>

Public Member Functions

 DpdkTransport ()
 
 ~DpdkTransport ()
 

Static Public Member Functions

static std::vector< uint16_t > GetPortIDFromMacAddr (size_t port_num, const std::string &mac_addrs)
 
static int NicInit (uint16_t port, struct rte_mempool *mbuf_pool, int thread_num, size_t pkt_len=kJumboFrameMaxSize)
 
static void InstallFlowRule (uint16_t port_id, uint16_t rx_q, uint32_t src_ip, uint32_t dest_ip, uint16_t src_port, uint16_t dst_port)
 
static void InstallFlowRuleDropAll (uint16_t port_id)
 
static void FastMemcpy (void *pvDest, void *pvSrc, size_t nBytes)
 
static void PrintPkt (rte_be32_t src_ip, rte_be32_t dst_ip, rte_be16_t src_port, rte_be16_t dst_port, size_t len, size_t tid)
 
static std::string PktToString (const rte_mbuf *pkt)
 Return a string representation of this packet. More...
 
static rte_mbuf * AllocUdp (rte_mempool *mbuf_pool, rte_ether_addr src_mac_addr, rte_ether_addr dst_mac_addr, uint32_t src_ip_addr, uint32_t dst_ip_addr, uint16_t src_udp_port, uint16_t dst_udp_port, size_t buffer_length, uint16_t pkt_id)
 
static void DpdkInit (uint16_t core_offset, size_t thread_num)
 Init dpdk on core [core_offset:core_offset+thread_num]. More...
 
static rte_mempool * CreateMempool (size_t num_ports, size_t packet_length=kJumboFrameMaxSize)
 

Constructor & Destructor Documentation

◆ DpdkTransport()

DpdkTransport::DpdkTransport ( )

◆ ~DpdkTransport()

DpdkTransport::~DpdkTransport ( )

Member Function Documentation

◆ AllocUdp()

static rte_mbuf* DpdkTransport::AllocUdp ( rte_mempool *  mbuf_pool,
rte_ether_addr  src_mac_addr,
rte_ether_addr  dst_mac_addr,
uint32_t  src_ip_addr,
uint32_t  dst_ip_addr,
uint16_t  src_udp_port,
uint16_t  dst_udp_port,
size_t  buffer_length,
uint16_t  pkt_id 
)
static

Allocate and return a fresh rte_mbuf with Ethernet, IPv4, and UDP header filled

Here is the caller graph for this function:

◆ CreateMempool()

static rte_mempool* DpdkTransport::CreateMempool ( size_t  num_ports,
size_t  packet_length = kJumboFrameMaxSize 
)
static
Here is the caller graph for this function:

◆ DpdkInit()

static void DpdkTransport::DpdkInit ( uint16_t  core_offset,
size_t  thread_num 
)
static

Init dpdk on core [core_offset:core_offset+thread_num].

Here is the caller graph for this function:

◆ FastMemcpy()

static void DpdkTransport::FastMemcpy ( void *  pvDest,
void *  pvSrc,
size_t  nBytes 
)
static

◆ GetPortIDFromMacAddr()

static std::vector<uint16_t> DpdkTransport::GetPortIDFromMacAddr ( size_t  port_num,
const std::string &  mac_addrs 
)
static
Here is the caller graph for this function:

◆ InstallFlowRule()

static void DpdkTransport::InstallFlowRule ( uint16_t  port_id,
uint16_t  rx_q,
uint32_t  src_ip,
uint32_t  dest_ip,
uint16_t  src_port,
uint16_t  dst_port 
)
static
Here is the caller graph for this function:

◆ InstallFlowRuleDropAll()

static void DpdkTransport::InstallFlowRuleDropAll ( uint16_t  port_id)
static

◆ NicInit()

static int DpdkTransport::NicInit ( uint16_t  port,
struct rte_mempool *  mbuf_pool,
int  thread_num,
size_t  pkt_len = kJumboFrameMaxSize 
)
static
Here is the caller graph for this function:

◆ PktToString()

static std::string DpdkTransport::PktToString ( const rte_mbuf *  pkt)
static

Return a string representation of this packet.

◆ PrintPkt()

static void DpdkTransport::PrintPkt ( rte_be32_t  src_ip,
rte_be32_t  dst_ip,
rte_be16_t  src_port,
rte_be16_t  dst_port,
size_t  len,
size_t  tid 
)
static
Here is the caller graph for this function:

The documentation for this class was generated from the following file: