Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/plugins/input/dpdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ add_library(ipfixprobe-input-dpdk MODULE
../parser/parser.cpp
../parser/parser.hpp
)
option(DPDK_PCAP_ENABLED "Enable dpdk pcap using secondary application (dpdk-pdump)" OFF)

if (DPDK_PCAP_ENABLED)
target_compile_definitions(ipfixprobe-input-dpdk PRIVATE DPDK_PCAP_ENABLED)
endif()

set_target_properties(ipfixprobe-input-dpdk PROPERTIES
CXX_VISIBILITY_PRESET hidden
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/input/dpdk/src/dpdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <rte_version.h>
#include <unistd.h>

#ifdef DPDK_PCAP_ENABLED
#include <rte_pdump.h>
#endif

#define MEMPOOL_CACHE_SIZE 256

namespace ipxp {
Expand Down Expand Up @@ -125,6 +129,10 @@ void DpdkCore::configureEal(const std::string& ealParams)
if (rte_eal_init(args.size(), args.data()) < 0) {
rte_exit(EXIT_FAILURE, "Cannot initialize RTE_EAL: %s\n", rte_strerror(rte_errno));
}
#ifdef DPDK_PCAP_ENABLED
std::cerr << "Initializing DPDK packet dump framework." << std::endl;
rte_pdump_init(); // Initialize packet dump framework
#endif
}

uint16_t DpdkCore::getRxQueueId() noexcept
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/storage/cache/src/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,11 @@ int NHTFlowCache::put_pkt(Packet& pkt)
flow = m_flow_table[flow_index];

uint8_t flw_flags = source_flow ? flow->m_flow.src_tcp_flags : flow->m_flow.dst_tcp_flags;
if ((pkt.tcp_flags & 0x02) && (flw_flags & (0x01 | 0x04))) {
// Flows with FIN or RST TCP flags are exported when new SYN packet arrives
if (!m_source_optimization_enabled && (pkt.tcp_flags & 0x02) && (flw_flags & (0x01 | 0x04))) {
// Flows with FIN or RST TCP flags are exported when new SYN packet arrives.
// When source optimization is enabled this case do not make any sence as the code would
// trigger a record push even thow we are trying to collect all data to a destination with
// in actvie timeout.
m_flow_table[flow_index]->m_flow.end_reason = FLOW_END_EOF;
export_flow(flow_index);
put_pkt(pkt);
Expand Down