PcapPlusPlus  23.09
pcpp::DpdkDevice::DpdkDeviceConfiguration Struct Reference

#include <DpdkDevice.h>

Public Member Functions

 DpdkDeviceConfiguration (uint16_t receiveDescriptorsNumber=128, uint16_t transmitDescriptorsNumber=512, uint16_t flushTxBufferTimeout=100, uint64_t rssHashFunction=RSS_DEFAULT, uint8_t *rssKey=DpdkDevice::m_RSSKey, uint8_t rssKeyLength=40)
 

Public Attributes

uint16_t receiveDescriptorsNumber
 
uint16_t transmitDescriptorsNumber
 
uint16_t flushTxBufferTimeout
 
uint8_t * rssKey
 
uint8_t rssKeyLength
 
uint64_t rssHashFunction
 

Detailed Description

A struct that contains user configurable parameters for opening a DpdkDevice. All of these parameters have default values so the user doesn't have to use these parameters or understand exactly what is their effect

Constructor & Destructor Documentation

◆ DpdkDeviceConfiguration()

pcpp::DpdkDevice::DpdkDeviceConfiguration::DpdkDeviceConfiguration ( uint16_t  receiveDescriptorsNumber = 128,
uint16_t  transmitDescriptorsNumber = 512,
uint16_t  flushTxBufferTimeout = 100,
uint64_t  rssHashFunction = RSS_DEFAULT,
uint8_t *  rssKey = DpdkDevice::m_RSSKey,
uint8_t  rssKeyLength = 40 
)
inlineexplicit

A c'tor for this struct

Parameters
[in]receiveDescriptorsNumberAn optional parameter for defining the number of RX descriptors that will be allocated for each RX queue. Default value is 128
[in]transmitDescriptorsNumberAn optional parameter for defining the number of TX descriptors that will be allocated for each TX queue. Default value is 512
[in]flushTxBufferTimeoutAn optional parameter for setting TX buffer timeout in usec. Default value is 100 usec
[in]rssHashFunctionThis parameter enable to configure the types of packets to which the RSS hashing must be applied. The value provided here should be a mask composed of hash functions described in DpdkRssHashFunction enum. The default value is RSS_DEFAULT.
[in]rssKeyA pointer to an array holding the RSS key to use for hashing specific header of received packets. If not specified, there is a default key defined inside DpdkDevice
[in]rssKeyLengthThe length in bytes of the array pointed by rssKey. Default value is the length of default rssKey

Member Data Documentation

◆ flushTxBufferTimeout

uint16_t pcpp::DpdkDevice::DpdkDeviceConfiguration::flushTxBufferTimeout

Set the TX buffer flush timeout in millisecond (only relevant if sending packets using DPDK TX buffer mechanism). A value of zero means no timeout

◆ receiveDescriptorsNumber

uint16_t pcpp::DpdkDevice::DpdkDeviceConfiguration::receiveDescriptorsNumber

When configuring a DPDK RX queue, DPDK creates descriptors it will use for receiving packets from the network to this RX queue. This parameter enables to configure the number of descriptors that will be created for each RX queue

◆ rssHashFunction

uint64_t pcpp::DpdkDevice::DpdkDeviceConfiguration::rssHashFunction

This parameter enables to configure the types of packets to which the RSS hashing must be applied. The value is a mask composed of hash functions described in DpdkRssHashFunction enum. Supplying a value equal to zero disables the RSS feature. Supplying a value equal to -1 enables all hash functions supported by this PMD

◆ rssKey

uint8_t* pcpp::DpdkDevice::DpdkDeviceConfiguration::rssKey

When configuring a DPDK device, DPDK supports to activate the Receive Side Scaling (RSS) feature to distribute traffic between the RX queues This parameter points to an array holding the RSS key to use for hashing specific header fields of received packets. The length of this array should be indicated by rssKeyLength below. Supplying a NULL value causes a default random hash key to be used by the device driver

◆ rssKeyLength

uint8_t pcpp::DpdkDevice::DpdkDeviceConfiguration::rssKeyLength

This parameter indicates the length in bytes of the array pointed by rssKey. This length will be checked in i40e only. Others assume 40 bytes to be used.

◆ transmitDescriptorsNumber

uint16_t pcpp::DpdkDevice::DpdkDeviceConfiguration::transmitDescriptorsNumber

When configuring a DPDK TX queue, DPDK creates descriptors it will use for transmitting packets to the network through this TX queue. This parameter enables to configure the number of descriptors that will be created for each TX queue