DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
EALSetup.hpp
Go to the documentation of this file.
1
8#ifndef DPDKLIBS_INCLUDE_DPDKLIBS_EALSETUP_HPP_
9#define DPDKLIBS_INCLUDE_DPDKLIBS_EALSETUP_HPP_
10
11#include "logging/Logging.hpp"
12
13#include <boost/program_options/parsers.hpp>
14
15#include <rte_eal.h>
16#include <rte_ethdev.h>
17
18namespace dunedaq {
19namespace dpdklibs {
20namespace ealutils {
21
22#define NUM_MBUFS 8191
23#define MBUF_CACHE_SIZE 250
24
25static volatile uint8_t dpdk_quit_signal;
26
27std::string
28get_mac_addr_str(const rte_ether_addr& addr);
29
30// Modifies Ethernet device configuration to multi-queue RSS with offload
31void
32iface_conf_rss_mode(struct rte_eth_conf& iface_conf, bool mode = false, bool offload = false);
33
34// Enables RX in promiscuous mode for the Ethernet device.
35int
36iface_promiscuous_mode(std::uint16_t iface, bool mode = false);
37
38int
39iface_init(uint16_t iface,
40 uint16_t rx_rings,
41 uint16_t tx_rings,
42 uint16_t rx_ring_size,
43 uint16_t tx_ring_size,
44 std::map<int, std::unique_ptr<rte_mempool>>& mbuf_pool,
45 bool with_reset = false,
46 bool with_mq_rss = false,
47 bool check_link_status = false);
48
49std::unique_ptr<rte_mempool>
50get_mempool(const std::string& pool_name,
51 int num_mbufs = NUM_MBUFS,
52 int mbuf_cache_size = MBUF_CACHE_SIZE,
53 int data_room_size = 9800,
54 int socket_id = 0);
55
56std::vector<const char*>
57construct_eal_argv(const std::vector<std::string>& std_argv);
58
59void
60init_eal(int argc, const char* argv[]);
61
62void
63init_eal(const std::vector<std::string>& args);
64
65int
67
68int
70
71void
73
74} // namespace ealutils
75} // namespace dpdklibs
76} // namespace dunedaq
77
78#endif // DPDKLIBS_INCLUDE_DPDKLIBS_EALSETUP_HPP_
#define MBUF_CACHE_SIZE
#define NUM_MBUFS
std::unique_ptr< rte_mempool > get_mempool(const std::string &pool_name, int num_mbufs=NUM_MBUFS, int mbuf_cache_size=MBUF_CACHE_SIZE, int data_room_size=9800, int socket_id=0)
Definition EALSetup.cpp:263
std::vector< const char * > construct_eal_argv(const std::vector< std::string > &std_argv)
Definition EALSetup.cpp:279
void init_eal(int argc, const char *argv[])
Definition EALSetup.cpp:289
static volatile uint8_t dpdk_quit_signal
Definition EALSetup.hpp:25
void iface_conf_rss_mode(struct rte_eth_conf &iface_conf, bool mode=false, bool offload=false)
Definition EALSetup.cpp:62
int iface_promiscuous_mode(std::uint16_t iface, bool mode=false)
Definition EALSetup.cpp:76
std::string get_mac_addr_str(const rte_ether_addr &addr)
Definition EALSetup.cpp:51
int iface_init(uint16_t iface, uint16_t rx_rings, uint16_t tx_rings, uint16_t rx_ring_size, uint16_t tx_ring_size, std::map< int, std::unique_ptr< rte_mempool > > &mbuf_pool, bool with_reset=false, bool with_mq_rss=false, bool check_link_status=false)
Definition EALSetup.cpp:95
The DUNE-DAQ namespace.