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
23#define NUM_MBUFS 8191
24#define MBUF_CACHE_SIZE 250
25
26static volatile uint8_t dpdk_quit_signal;
27
28std::string get_mac_addr_str(const rte_ether_addr& addr);
29
30// Modifies Ethernet device configuration to multi-queue RSS with offload
31void iface_conf_rss_mode(struct rte_eth_conf& iface_conf, bool mode = false, bool offload = false);
32
33// Enables RX in promiscuous mode for the Ethernet device.
34int iface_promiscuous_mode(std::uint16_t iface, bool mode = false);
35
36int iface_init(uint16_t iface, uint16_t rx_rings, uint16_t tx_rings,
37 uint16_t rx_ring_size, uint16_t tx_ring_size,
38 std::map<int, std::unique_ptr<rte_mempool>>& mbuf_pool,
39 bool with_reset=false, bool with_mq_rss=false, bool check_link_status=false);
40
41std::unique_ptr<rte_mempool> get_mempool(const std::string& pool_name,
42 int num_mbufs=NUM_MBUFS, int mbuf_cache_size=MBUF_CACHE_SIZE,
43 int data_room_size=9800, int socket_id=0);
44
45std::vector<const char*> construct_eal_argv(const std::vector<std::string> &std_argv);
46
47void init_eal(int argc, const char* argv[]);
48
49void init_eal( const std::vector<std::string>& args );
50
52
53int wait_for_lcores();
54
55void finish_eal();
56
57
58} // namespace ealutils
59} // namespace dpdklibs
60} // namespace dunedaq
61
62#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:253
std::vector< const char * > construct_eal_argv(const std::vector< std::string > &std_argv)
Definition EALSetup.cpp:274
void init_eal(int argc, const char *argv[])
Definition EALSetup.cpp:285
static volatile uint8_t dpdk_quit_signal
Definition EALSetup.hpp:26
void iface_conf_rss_mode(struct rte_eth_conf &iface_conf, bool mode=false, bool offload=false)
Definition EALSetup.cpp:60
int iface_promiscuous_mode(std::uint16_t iface, bool mode=false)
Definition EALSetup.cpp:74
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
Including Qt Headers.