7 #include "DeviceListBase.h"
37 virtual bool run(uint32_t coreId) = 0;
66 static bool m_IsDpdkInitialized;
67 static uint32_t m_MBufPoolSizePerDevice;
68 static uint16_t m_MBufDataSize;
69 static CoreMask m_CoreMask;
70 std::vector<DpdkDevice*> m_DpdkDeviceListView;
71 std::vector<DpdkWorkerThread*> m_WorkerThreads;
75 bool isInitialized()
const
77 return (m_IsInitialized && m_IsDpdkInitialized);
79 bool initDpdkDevices(uint32_t mBufPoolSizePerDevice, uint16_t mMbufDataSize);
80 static bool verifyHugePagesAndDpdkDriver();
82 static int dpdkWorkerThreadStart(
void* ptr);
94 if (!instance.isInitialized())
95 instance.initDpdkDevices(DpdkDeviceList::m_MBufPoolSizePerDevice, DpdkDeviceList::m_MBufDataSize);
128 static bool initDpdk(CoreMask coreMask, uint32_t mBufPoolSizePerDevice, uint16_t mBufDataSize = 0,
129 uint8_t masterCore = 0, uint32_t initDpdkArgc = 0,
char** initDpdkArgv =
nullptr,
130 const std::string& appName =
"pcapplusplusapp",
bool verifyHugePagesAndDriver =
true);
145 return m_DpdkDeviceListView;
Definition: DpdkDevice.h:168
Definition: DpdkDeviceList.h:59
SystemCore getDpdkMasterCore() const
void stopDpdkWorkerThreads()
const std::vector< DpdkDevice * > & getDpdkDeviceList() const
Definition: DpdkDeviceList.h:143
DpdkDevice * getDeviceByPort(int portId) const
bool startDpdkWorkerThreads(CoreMask coreMask, std::vector< DpdkWorkerThread * > &workerThreadsVec)
static DpdkDeviceList & getInstance()
Definition: DpdkDeviceList.h:91
static bool initDpdk(CoreMask coreMask, uint32_t mBufPoolSizePerDevice, uint16_t mBufDataSize=0, uint8_t masterCore=0, uint32_t initDpdkArgc=0, char **initDpdkArgv=nullptr, const std::string &appName="pcapplusplusapp", bool verifyHugePagesAndDriver=true)
Logger::LogLevel getDpdkLogLevel() const
DpdkDevice * getDeviceByPciAddress(const std::string &pciAddr) const
void setDpdkLogLevel(Logger::LogLevel logLevel)
bool writeDpdkLogToFile(FILE *logFile)
Definition: DpdkDeviceList.h:28
virtual uint32_t getCoreId() const =0
virtual ~DpdkWorkerThread()=default
A virtual d'tor. Can be overridden by child class if needed.
virtual bool run(uint32_t coreId)=0
Definition: KniDeviceList.h:19
A base class for device lists, providing common functionality for managing a list of devices.
Definition: DeviceListBase.h:10
The main namespace for the PcapPlusPlus lib.
LogLevel
Definition: Logger.h:146
Definition: SystemUtils.h:29