1 #ifndef PCAPPP_DPDK_DEVICE_LIST 2 #define PCAPPP_DPDK_DEVICE_LIST 46 virtual bool run(uint32_t coreId) = 0;
52 virtual void stop() = 0;
78 static bool m_IsDpdkInitialized;
79 static uint32_t m_MBufPoolSizePerDevice;
80 static CoreMask m_CoreMask;
81 std::vector<DpdkDevice*> m_DpdkDeviceList;
82 std::vector<DpdkWorkerThread*> m_WorkerThreads;
86 bool isInitialized()
const {
return (m_IsInitialized && m_IsDpdkInitialized); }
87 bool initDpdkDevices(uint32_t mBufPoolSizePerDevice);
88 static bool verifyHugePagesAndDpdkDriver();
90 static int dpdkWorkerThreadStart(
void* ptr);
103 if (!instance.isInitialized())
104 instance.initDpdkDevices(DpdkDeviceList::m_MBufPoolSizePerDevice);
132 static bool initDpdk(CoreMask coreMask, uint32_t mBufPoolSizePerDevice, uint8_t masterCore = 0, uint32_t initDpdkArgc = 0,
char **initDpdkArgv = NULL,
const std::string& appName =
"pcapplusplusapp");
139 DpdkDevice* getDeviceByPort(
int portId)
const;
146 DpdkDevice* getDeviceByPciAddress(
const std::string& pciAddr)
const;
175 bool writeDpdkLogToFile(FILE* logFile);
195 bool startDpdkWorkerThreads(CoreMask coreMask, std::vector<DpdkWorkerThread*>& workerThreadsVec);
201 void stopDpdkWorkerThreads();
The main namespace for the PcapPlusPlus lib.
LogLevel
Definition: Logger.h:112
virtual ~DpdkWorkerThread()
Definition: DpdkDeviceList.h:39
Definition: SystemUtils.h:27
static DpdkDeviceList & getInstance()
Definition: DpdkDeviceList.h:100
Definition: DpdkDeviceList.h:33
Definition: DpdkDevice.h:169
virtual uint32_t getCoreId() const =0
virtual bool run(uint32_t coreId)=0
Definition: KniDeviceList.h:24
Definition: DpdkDeviceList.h:73
const std::vector< DpdkDevice * > & getDpdkDeviceList() const
Definition: DpdkDeviceList.h:151