DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DpdkTxBackend.hpp
Go to the documentation of this file.
1
13#ifndef DPDKLIBS_INCLUDE_DPDKLIBS_SENDER_DPDKTXBACKEND_HPP_
14#define DPDKLIBS_INCLUDE_DPDKLIBS_SENDER_DPDKTXBACKEND_HPP_
15
16#include <rte_mempool.h>
17
18#include <cstddef>
19#include <cstdint>
20
22
24{
25 rte_mempool* pool = nullptr;
26 std::uint16_t port = 0; // NOLINT(build/unsigned)
27 std::uint16_t queue = 0; // NOLINT(build/unsigned)
28
29 // Returns nullptr if the pool is exhausted.
30 void* alloc();
31
32 // Appends bytes to the mbuf and sets l2_len, l3_len and l4_len. Returns the
33 // start of the appended region, or nullptr if the tailroom is smaller than
34 // bytes.
35 std::uint8_t* prepare(void* buf, std::size_t bytes); // NOLINT(build/unsigned)
36
37 // Enqueues one mbuf. Returns false if the TX ring did not accept it, in
38 // which case the caller still owns buf.
39 bool transmit(void* buf);
40
41 void free(void* buf);
42};
43
44} // namespace dunedaq::dpdklibs::sender
45
46#endif // DPDKLIBS_INCLUDE_DPDKLIBS_SENDER_DPDKTXBACKEND_HPP_
std::uint8_t * prepare(void *buf, std::size_t bytes)