Skip to content

Commit 6c6a347

Browse files
.
1 parent cc89faf commit 6c6a347

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/plugins/input/dpdk/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ add_library(ipfixprobe-input-dpdk MODULE
1616
../parser/parser.cpp
1717
../parser/parser.hpp
1818
)
19+
option(DPDK_PCAP_ENABLED "Enable dpdk pcap (dpdk-dumpcap)" OFF)
20+
21+
if (DPDK_PCAP_ENABLED)
22+
target_compile_definitions(ipfixprobe-input-dpdk PRIVATE DPDK_PCAP_ENABLED)
23+
endif()
1924

2025
set_target_properties(ipfixprobe-input-dpdk PROPERTIES
2126
CXX_VISIBILITY_PRESET hidden

src/plugins/input/dpdk/src/dpdkDevice.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#include <rte_errno.h>
3535
#include <rte_version.h>
3636
#include <unistd.h>
37+
#ifdef DPDK_DUMP_ENABLED
38+
#include <rte_pdump.h>
39+
#endif
3740

3841
namespace ipxp {
3942

@@ -107,6 +110,8 @@ void DpdkDevice::recognizeDriver()
107110
}
108111
std::cerr << "\tDetected HW timestamp capability: " << (m_supportedHWTimestamp ? "yes" : "no")
109112
<< std::endl;
113+
114+
110115
}
111116

112117
void DpdkDevice::registerRxTimestamp()
@@ -273,6 +278,13 @@ void DpdkDevice::enablePort()
273278
}
274279

275280
std::cerr << "DPDK input at port " << m_portID << " started." << std::endl;
281+
282+
#ifdef DPDK_DUMP_ENABLED
283+
rte_pdump_init(); // Initialize packet dump framework
284+
if (rte_pdump_enable(m_portID, 0, 0) < 0) {
285+
std::cerr << "Failed to enable pdump on port " << m_portID << std::endl;
286+
}
287+
#endif
276288
}
277289

278290
uint16_t DpdkDevice::receive(DpdkMbuf& dpdkMuf, uint16_t rxQueueID)

0 commit comments

Comments
 (0)