|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #ifndef DPDK_NET_DEVICE_H
24 #define DPDK_NET_DEVICE_H
29 #include <rte_mempool.h>
30 #include <rte_cycles.h>
32 struct rte_eth_dev_tx_buffer;
81 void InitDpdk (
int argc,
char **argv, std::string dpdkDriver);
135 ssize_t
Write (uint8_t *buffer,
size_t length);
a unique identifier for an interface.
void DoFinishStoppingDevice(void)
Complete additional actions, if any, to tear down the device.
struct rte_eth_dev_tx_buffer * m_rxBuffer
Buffer to handle burst reception.
static int LaunchCore(void *arg)
A function to handle rx & tx operations.
std::string m_deviceName
The device name;.
An identifier for simulation events.
virtual uint8_t * AllocateBuffer(size_t len)
Allocate packet buffer.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsLinkUp(void) const
Check the status of the link.
void InitDpdk(int argc, char **argv, std::string dpdkDriver)
Initialize Dpdk.
uint32_t m_maxRxPktBurst
Size of Rx burst.
DpdkNetDevice()
Constructor for the DpdkNetDevice.
uint32_t m_mempoolCacheSize
Mempool cache size.
void CheckAllPortsLinkStatus(void)
Check the link status of all ports in up to 9s and print them finally.
uint16_t m_portId
The port number of the device to be used.
void HandleTx()
Transmit packets in burst from the tx_buffer to the nic.
struct rte_mempool * m_mempool
Packet memory pool.
Simulation virtual time values and global simulation resolution.
void HandleRx()
Receive packets in burst from the nic to the rx_buffer.
~DpdkNetDevice()
Destructor for the DpdkNetDevice.
static TypeId GetTypeId(void)
Get the type ID.
a NetDevice to read/write network traffic from/into a Dpdk enabled port.
a NetDevice to read/write network traffic from/into a file descriptor.
EventId m_txEvent
Event for stale packet transmission.
void SetDeviceName(std::string deviceName)
Set device name.
uint32_t m_maxTxPktBurst
Size of Tx burst.
ssize_t Write(uint8_t *buffer, size_t length)
Write packet data to device.
uint16_t m_nbRxDesc
Number of Rx descriptors.
uint16_t m_nbTxDesc
Number of Tx descriptors.
virtual void FreeBuffer(uint8_t *buf)
Free the given packet buffer.
static volatile bool m_forceQuit
Condition variable for Dpdk to stop.
static void SignalHandler(int signum)
A signal handler for SIGINT and SIGTERM signals.
struct rte_eth_dev_tx_buffer * m_txBuffer
Buffer to handle burst transmission.
Time m_txTimeout
The time to wait before transmitting burst from Tx buffer.