DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DpdkMempool.hpp File Reference
#include <rte_mempool.h>
#include <map>
#include <memory>
Include dependency graph for DpdkMempool.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dunedaq::dpdklibs::MempoolDeleter
class  dunedaq::dpdklibs::BorrowedPoolMap

Namespaces

namespace  dunedaq
 The DUNE-DAQ namespace.
namespace  dunedaq::dpdklibs

Typedefs

using dunedaq::dpdklibs::unique_mempool = std::unique_ptr<rte_mempool, MempoolDeleter>

Functions

unique_mempool dunedaq::dpdklibs::take_mempool_ownership (std::unique_ptr< rte_mempool > &&legacy)

Detailed Description

Ownership handles for rte_mempool.

rte_mempool objects are created by rte_pktmbuf_pool_create and must be released with rte_mempool_free before rte_eal_cleanup. They must not be passed to operator delete, so std::unique_ptr<rte_mempool> with its default deleter encodes the wrong contract. This header provides:

  • unique_mempool: unique_ptr with the rte_mempool_free deleter. Destroying it before EAL cleanup releases the pool name, so a configure -> scrap -> configure cycle can recreate a pool of the same name.
  • BorrowedPoolMap: non-owning adapter for legacy interfaces (ealutils::iface_init) that take std::map<int, std::unique_ptr<rte_mempool>>&. It releases every entry on destruction, including on exception paths, so the legacy map's default deleter cannot run on a live pool.

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 DpdkMempool.hpp.