|
DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
#include <cstddef>#include <cstdint>#include <cstring>Go to the source code of this file.
Classes | |
| class | dunedaq::dpdklibs::sender::BufGuard< Backend > |
Namespaces | |
| namespace | dunedaq |
| The DUNE-DAQ namespace. | |
| namespace | dunedaq::dpdklibs |
| namespace | dunedaq::dpdklibs::sender |
Functions | |
| template<typename Backend, typename BuildFn, typename OnSentFn> | |
| TxOutcome | dunedaq::dpdklibs::sender::send_packet (Backend &backend, std::size_t packet_bytes, std::uint8_t *pre_tx_copy, BuildFn &&build, OnSentFn &&on_sent) |
Single-packet transmit with RAII buffer ownership. The engine is templated on a Backend, so the failure matrix (allocation failure, tailroom failure, TX backpressure) is unit-testable without EAL or a NIC.
Backend concept: void* alloc(); // nullptr on failure std::uint8_t* prepare(void* buf, std::size_t len); // bounded append; nullptr on failure bool transmit(void* buf); // true = NIC took ownership void free(void* buf);
One transmit attempt per packet. A full TX ring yields kTxFailed, which the caller counts; there is no retry loop. At the rates measured for this sender the TX ring drains faster than it fills and the former retry path never executed. At rates where backpressure is expected, the correct mechanism is a dedicated TX queue owner, not blocking inside a producer callback.
Sequence numbers advance in on_sent() only. A drop therefore produces no sequence gap on the wire; it appears downstream as a missing timestamp.
Ownership rule: on kSent the backend owns the buffer. On every other outcome the engine frees it exactly once through BufGuard. No path leaks and no path double-frees.
This is part of the DUNE DAQ , copyright 2020. Licensing/copyright details are in the COPYING file that you should have received with this code.
Definition in file TxEngine.hpp.