Skip to content

Commit

Permalink
Merge pull request CESNET#225 from CESNET/fix-input-check-actually-pa…
Browse files Browse the repository at this point in the history
…rsed

dpdk - fix checking if any packet has actually been parsed
  • Loading branch information
cejkato2 authored Oct 17, 2024
2 parents ebb8d77 + bc2024b commit c4019b7
Show file tree
Hide file tree
Showing 8 changed files with 2,874 additions and 3 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2024-10-17 ipfixprobe-4.13.0
* usability: introduce docker/podman container to convert PCAP files to CSV
* IPFIX: fix order of TCP options flags
* basicplus: update TCP options mask across flow packets
* utils: introduce memcpy_le32toh() for ipfix representation
* wg: fix parsing and exporting byte order (IPFIX)
* DPDK-ring: optimization: prefetch; read timestamp from HW metadata if available
* cache: optimization - prefetch
* IPv6: fix header parsing
* DPDK&DPDK-ring: fix use of parse_packet(), skip invalid packets causing crash

2024-08-28 ipfixprobe-4.12.0
* ipfix plugin: support lz4 compression
* ipfixprobe: possibility to set workers affinity
Expand Down
2,819 changes: 2,819 additions & 0 deletions Doxyfile

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,7 @@ deb:
else
endif

.PHONY: doc
doc:
doxygen

20 changes: 20 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
2024-10-17 (Tomas Cejka): doc: include generated Doxyfile to create documentation
2024-10-17 (Tomas Cejka): doc: add doxygen comment for parse_packet()
2024-10-16 (Jan Sobol): dpdk-ring - fix checking if any packet has actually been parsed
2024-10-16 (Jan Sobol): dpdk - fix checking if any packet has actually been parsed
2024-10-02 (Damir Zainullin): Fix IPv6 header parsing
2024-09-30 (Pavel Šiška): Merge pull request #220 from CESNET/prefetch-optimizations
2024-09-30 (Pavel Šiška): Merge pull request #219 from CESNET/dpdk-ring-metadata-timestamp
2024-09-30 (Pavel Šiška): Merge pull request #215 from CESNET/new-version
2024-09-26 (Jan Sobol): cache - prefetch flow records before checking their expiration
2024-09-26 (Jan Sobol): dpdk-ring - prefetch dequeued packets before processing
2024-09-25 (Jan Sobol): dpdk-ring - read timestamp from hw metadata if available
2024-09-20 (Tomas Cejka): Merge pull request #216 from CESNET/ipfixprobe-docker-wrapper
2024-09-19 (Tomas Cejka): dist: include docker/ files into distribution archive
2024-09-19 (Jan Sobol): wg - fix parsing and exporting byte order
2024-09-19 (Jan Sobol): utils - introduce memcpy_le32toh function
2024-09-18 (Jan Sobol): basicplus test - fix reference values of tcp options
2024-09-18 (Jan Sobol): basicplus - update tcp options mask across flow packets
2024-09-18 (Jan Sobol): parser - fix order of tcp options flags according to ipfix standard https://www.iana.org/assignments/ipfix/ipfix.xhtml, entity 209 - tcpOptions
2024-09-17 (Jaroslav Pesek): process container - introduce docker/podman container wrapper for processing pcaps to csvs

2024-08-28 (Pavel Siska): ipfixprobed - add new option LZ4_COMPRESSION to init script and config example
2024-08-28 (Pavel Siska): README.md - add LZ4 compression info
2024-08-28 (Jakub Antonín Štigler): ipfix plugin: add lz4 compression
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([ipfixprobe], [4.12.0], [[email protected]])
AC_INIT([ipfixprobe], [4.13.0], [[email protected]])

AC_CONFIG_SRCDIR([main.cpp])
AC_CONFIG_HEADERS([config.h])
Expand Down
2 changes: 1 addition & 1 deletion input/dpdk-ring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ InputPlugin::Result DpdkRingReader::get(PacketBlock& packets)
m_stats.receivedPackets += pkts_read_;
m_stats.receivedBytes += packets.bytes;

return Result::PARSED;
return opt.pblock->cnt ? Result::PARSED : Result::NOT_PARSED;
}

telemetry::Content DpdkRingReader::get_queue_telemetry()
Expand Down
2 changes: 1 addition & 1 deletion input/dpdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ InputPlugin::Result DpdkReader::get(PacketBlock& packets)
m_stats.receivedPackets += receivedPackets;
m_stats.receivedBytes += packets.bytes;

return Result::PARSED;
return packets.cnt ? Result::PARSED : Result::NOT_PARSED;
}

}
17 changes: 17 additions & 0 deletions input/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@ typedef struct parser_opt_s {
int datalink;
} parser_opt_t;

/**
* \brief Parse one packet and update output metadata in `opt`, and statistics in `stats`.
*
* The function updates the metadata (using `opt->pblock->cnt` index) when the
* packet is successfully parsed. On error, the packet metadata at
* `opt->pblock->cnt` index are invalid and the index points to the same place.
* The caller must ensure `opt->pblock->size` is higher the `opt->pblock->cnt`;
* this is checked and in case of no free space, `parse_packet()` returns
* without any action.
* \param [out] opt Pointer to the structure with an output list of parsed packet metadata.
* \param [out] stats Structure with the ipfixprobe statistics counters.
* \param [in] ts Timestamp of the current packet
* \param [in] data Input data, i.e., pointer to beginning of the packet header.
* \param [in] len Original size of the packet to process.
* \param [in] caplen Capture length - actual size of the packet, i.e., number of bytes that are available in data.
*/
void parse_packet(parser_opt_t *opt, ParserStats& stats, struct timeval ts, const uint8_t *data, uint16_t len, uint16_t caplen);

}
Expand Down

0 comments on commit c4019b7

Please sign in to comment.