44 "Field " << field <<
" was not reported",
53 using sid_to_source_map_t = std::map<int, std::shared_ptr<SourceConcept>>;
56 const std::vector<const appmodel::NWDetDataSender*>& senders,
57 sid_to_source_map_t& sources, std::atomic<bool>&
run_marker);
60 IfaceWrapper(
const IfaceWrapper&) =
delete;
61 IfaceWrapper& operator=(
const IfaceWrapper&) =
delete;
62 IfaceWrapper(IfaceWrapper&&) =
delete;
63 IfaceWrapper& operator=(IfaceWrapper&&) =
delete;
69 void generate_opmon_data()
override;
71 void allocate_mbufs();
72 void setup_interface();
73 void setup_flow_steering();
76 void enable_flow() { m_lcore_enable_flow.store(
true);}
77 void disable_flow() { m_lcore_enable_flow.store(
false);}
79 const std::vector<uint16_t>& get_rte_cores()
const {
return m_rte_cores; }
84 std::string m_iface_id_str;
89 std::vector<std::string> m_ip_addr;
90 std::vector<rte_be32_t> m_ip_addr_bin;
91 std::string m_mac_addr;
94 uint16_t m_rx_ring_size;
95 uint16_t m_tx_ring_size;
98 uint32_t m_lcore_sleep_ns;
99 int m_mbuf_cache_size;
102 int m_num_ip_sources;
104 std::set<std::string> m_ips;
105 std::set<int> m_rx_qs;
106 std::set<int> m_tx_qs;
107 std::vector<uint16_t> m_rte_cores;
110 std::map<int, std::map<int, std::string>> m_rx_core_map;
111 unsigned m_arp_rx_queue = 0;
114 std::atomic<bool> m_lcore_quit_signal{
false };
116 std::atomic<bool> m_lcore_enable_flow{
false };
119 std::map<int, std::unique_ptr<rte_mempool>> m_mbuf_pools;
120 std::map<int, struct rte_mbuf **> m_bufs;
123 std::map<int, std::atomic<std::size_t>> m_num_frames_rxq;
124 std::map<int, std::atomic<std::size_t>> m_num_bytes_rxq;
125 std::map<int, std::atomic<std::size_t>> m_num_unexid_frames;
126 std::map<int, std::atomic<std::size_t>> m_num_full_bursts;
127 std::map<int, std::atomic<uint16_t>> m_max_burst_size;
134 std::map<int, std::map<uint, uint>> m_stream_id_to_source_id;
135 sid_to_source_map_t& m_sources;
138 std::atomic<bool>& m_run_marker;
141 std::unique_ptr<rte_mempool> m_garp_mbuf_pool;
142 std::map<int, struct rte_mbuf **> m_garp_bufs;
143 std::thread m_garp_thread;
145 std::atomic<uint64_t> m_garps_sent{0};
148 std::unique_ptr<rte_mempool> m_arp_mbuf_pool;
149 std::map<int, struct rte_mbuf **> m_arp_bufs;
150 std::thread m_arp_thread;
152 std::atomic<uint64_t> m_arps_sent{0};
155 int rx_runner(
void *arg __rte_unused);
156 int arp_response_runner(
void *arg __rte_unused);
159 void handle_eth_payload(
int src_rx_q,
char* payload, std::size_t
size);