#include <mac_sender.h>
|
| MacSender (Config *cfg, std::string &data_filename, size_t mac_packet_length, size_t mac_payload_max_length, size_t packets_per_frame, std::string server_address, size_t server_rx_port, std::function< size_t(size_t)> get_data_symbol_id, size_t core_offset=30, size_t worker_thread_num=1, size_t update_thread_num=1, size_t frame_duration_us=0, size_t inter_frame_delay=0, size_t enable_slow_start=1, bool create_thread_for_master=false) |
| Create and optionally start a Sender Client that sends data packets to a agora mac interface. More...
|
|
| ~MacSender () |
|
void | StartTx () |
|
void | StartTxfromMain (double *in_frame_start, double *in_frame_end) |
|
◆ MacSender()
MacSender::MacSender |
( |
Config * |
cfg, |
|
|
std::string & |
data_filename, |
|
|
size_t |
mac_packet_length, |
|
|
size_t |
mac_payload_max_length, |
|
|
size_t |
packets_per_frame, |
|
|
std::string |
server_address, |
|
|
size_t |
server_rx_port, |
|
|
std::function< size_t(size_t)> |
get_data_symbol_id, |
|
|
size_t |
core_offset = 30 , |
|
|
size_t |
worker_thread_num = 1 , |
|
|
size_t |
update_thread_num = 1 , |
|
|
size_t |
frame_duration_us = 0 , |
|
|
size_t |
inter_frame_delay = 0 , |
|
|
size_t |
enable_slow_start = 1 , |
|
|
bool |
create_thread_for_master = false |
|
) |
| |
Create and optionally start a Sender Client that sends data packets to a agora mac interface.
- Parameters
-
config | The Agora config |
data_filename | Name of the file where the data bytes exist |
socket_thread_num | Number of worker threads sending packets |
mac_packets_per_frame | Number of mac packets in frame |
core_offset | The master thread runs on core [core_offset]. Worker thread i runs on core [core_offset + i] |
frame_duration_us | The TTI slot duration in us |
inter_frame_delay | Delay between frames |
enable_slow_start | If 1, the sender initially sends frames in a duration larger than the TTI |
◆ ~MacSender()
MacSender::~MacSender |
( |
| ) |
|
◆ CreateWorkerThreads()
void MacSender::CreateWorkerThreads |
( |
size_t |
num_workers | ) |
|
|
private |
◆ DataUpdateThread()
void * MacSender::DataUpdateThread |
( |
size_t |
tid, |
|
|
size_t |
num_data_sources |
|
) |
| |
|
private |
- Todo:
- need a list of file names for this
- Todo:
- need a list of file names for this
◆ GetMaxSymbolId()
size_t MacSender::GetMaxSymbolId |
( |
| ) |
const |
|
private |
◆ GetTicksForFrame()
uint64_t MacSender::GetTicksForFrame |
( |
size_t |
frame_id | ) |
const |
|
private |
◆ LoadFrame()
void MacSender::LoadFrame |
( |
size_t |
frame | ) |
|
|
private |
◆ MasterThread()
void * MacSender::MasterThread |
( |
size_t |
tid | ) |
|
|
private |
◆ ScheduleFrame()
void MacSender::ScheduleFrame |
( |
size_t |
frame | ) |
|
|
private |
◆ StartTx()
void MacSender::StartTx |
( |
| ) |
|
◆ StartTxfromMain()
void MacSender::StartTxfromMain |
( |
double * |
in_frame_start, |
|
|
double * |
in_frame_end |
|
) |
| |
◆ TagToTxBuffersIndex()
size_t MacSender::TagToTxBuffersIndex |
( |
gen_tag_t |
tag | ) |
const |
|
inlineprivate |
◆ UpdateTxBuffer()
◆ WorkerThread()
void * MacSender::WorkerThread |
( |
size_t |
tid | ) |
|
|
private |
- Todo:
- Use assume_aligned<kTxBufferElementAlignment> when code has c++20 support
◆ WriteStatsToFile()
void MacSender::WriteStatsToFile |
( |
size_t |
tx_frame_count | ) |
const |
|
private |
◆ cfg_
◆ completion_queue_
◆ core_offset_
const size_t MacSender::core_offset_ |
|
private |
◆ data_filename_
std::string MacSender::data_filename_ |
|
private |
◆ data_update_queue_
◆ enable_slow_start_
const size_t MacSender::enable_slow_start_ |
|
private |
◆ frame_duration_us_
size_t MacSender::frame_duration_us_ |
|
private |
◆ frame_end_
double* MacSender::frame_end_ |
|
private |
◆ frame_start_
double* MacSender::frame_start_ |
|
private |
◆ freq_ghz_
const double MacSender::freq_ghz_ |
|
private |
◆ get_data_symbol_id_
◆ has_master_thread_
const bool MacSender::has_master_thread_ |
|
private |
◆ inter_frame_delay_
const size_t MacSender::inter_frame_delay_ |
|
private |
◆ kDequeueBulkSize
constexpr size_t MacSender::kDequeueBulkSize = 4 |
|
staticconstexpr |
◆ kMessageQueueSize
constexpr size_t MacSender::kMessageQueueSize = 1024 |
|
staticconstexpr |
◆ mac_packet_length_
size_t MacSender::mac_packet_length_ |
|
private |
◆ mac_payload_max_length_
size_t MacSender::mac_payload_max_length_ |
|
private |
◆ packets_per_frame_
size_t MacSender::packets_per_frame_ |
|
private |
◆ send_queue_
◆ server_address_
const std::string MacSender::server_address_ |
|
private |
◆ server_rx_port_
const size_t MacSender::server_rx_port_ |
|
private |
◆ task_ptok_
◆ threads_
std::vector<std::thread> MacSender::threads_ |
|
private |
◆ ticks_all_
uint64_t MacSender::ticks_all_ |
|
private |
◆ ticks_inter_frame_
const uint64_t MacSender::ticks_inter_frame_ |
|
private |
◆ ticks_per_usec_
const double MacSender::ticks_per_usec_ |
|
private |
◆ ticks_wnd1_
uint64_t MacSender::ticks_wnd1_ |
|
private |
◆ ticks_wnd2_
uint64_t MacSender::ticks_wnd2_ |
|
private |
◆ tx_buffer_pkt_offset_
size_t MacSender::tx_buffer_pkt_offset_ |
|
private |
◆ tx_buffers_
Table<uint8_t> MacSender::tx_buffers_ |
|
private |
◆ update_thread_num_
const size_t MacSender::update_thread_num_ |
|
private |
◆ worker_thread_num_
const size_t MacSender::worker_thread_num_ |
|
private |
The documentation for this class was generated from the following files: