36 virtual bool run(uint32_t coreId) = 0;
63 static bool m_IsDpdkInitialized;
64 static uint32_t m_MBufPoolSizePerDevice;
65 static uint16_t m_MBufDataSize;
66 static CoreMask m_CoreMask;
67 std::vector<DpdkDevice*> m_DpdkDeviceList;
68 std::vector<DpdkWorkerThread*> m_WorkerThreads;
72 bool isInitialized()
const
74 return (m_IsInitialized && m_IsDpdkInitialized);
76 bool initDpdkDevices(uint32_t mBufPoolSizePerDevice, uint16_t mMbufDataSize);
77 static bool verifyHugePagesAndDpdkDriver();
79 static int dpdkWorkerThreadStart(
void* ptr);
91 if (!instance.isInitialized())
92 instance.initDpdkDevices(DpdkDeviceList::m_MBufPoolSizePerDevice, DpdkDeviceList::m_MBufDataSize);
125 static bool initDpdk(CoreMask coreMask, uint32_t mBufPoolSizePerDevice, uint16_t mBufDataSize = 0,
126 uint8_t masterCore = 0, uint32_t initDpdkArgc = 0,
char** initDpdkArgv =
nullptr,
127 const std::string& appName =
"pcapplusplusapp",
bool verifyHugePagesAndDriver =
true);
142 return m_DpdkDeviceList;
Definition: DpdkDevice.h:169
Definition: DpdkDeviceList.h:58
SystemCore getDpdkMasterCore() const
void stopDpdkWorkerThreads()
const std::vector< DpdkDevice * > & getDpdkDeviceList() const
Definition: DpdkDeviceList.h:140
DpdkDevice * getDeviceByPort(int portId) const
bool startDpdkWorkerThreads(CoreMask coreMask, std::vector< DpdkWorkerThread * > &workerThreadsVec)
static DpdkDeviceList & getInstance()
Definition: DpdkDeviceList.h:88
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:27
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
LogLevel
Definition: Logger.h:139
The main namespace for the PcapPlusPlus lib.
Definition: SystemUtils.h:23