Agora
1.2.0
Agora project
|
Implementations of this class provide packet I/O for Agora. More...
#include <packet_txrx.h>
Public Member Functions | |
PacketTxRx (AgoraTxRx::TxRxTypes type, Config *const cfg, size_t core_offset, moodycamel::ConcurrentQueue< EventData > *event_notify_q, moodycamel::ConcurrentQueue< EventData > *tx_pending_q, moodycamel::ProducerToken **notify_producer_tokens, moodycamel::ProducerToken **tx_producer_tokens, Table< char > &rx_buffer, size_t packet_num_in_buffer, Table< size_t > &frame_start, char *tx_buffer) | |
virtual | ~PacketTxRx () |
virtual bool | StartTxRx (Table< complex_float > &calib_dl_buffer, Table< complex_float > &calib_ul_buffer) |
Start the network I/O threads. More... | |
size_t | AntNumToWorkerId (size_t ant_num) const |
Convert the antenna id to txrx worker id. More... | |
Protected Member Functions | |
bool | StopTxRx () |
void | NotifyWorkers () |
size_t | NumberTotalWorkers () const |
size_t | NumberTotalInterfaces () const |
const size_t & | InterfaceToWorker (size_t interface) const |
size_t | NumChannels () const |
Protected Attributes | |
std::vector< std::unique_ptr< TxRxWorker > > | worker_threads_ |
Config *const | cfg_ |
const size_t | core_offset_ |
moodycamel::ConcurrentQueue< EventData > * | event_notify_q_ |
moodycamel::ConcurrentQueue< EventData > * | tx_pending_q_ |
moodycamel::ProducerToken ** | notify_producer_tokens_ |
moodycamel::ProducerToken ** | tx_producer_tokens_ |
std::mutex | mutex_ |
Owned by this class and shared with the workers. More... | |
std::condition_variable | cond_ |
std::atomic< bool > | proceed_ |
Private Member Functions | |
virtual bool | CreateWorker (size_t tid, size_t interface_count, size_t interface_offset, size_t *rx_frame_start, std::vector< RxPacket > &rx_memory, std::byte *const tx_memory)=0 |
Private Attributes | |
std::vector< std::vector< RxPacket > > | rx_packets_ |
std::byte *const | tx_memory_ |
Table< size_t > & | frame_start_ |
size_t | worker_thread_count_ |
std::vector< size_t > | interface_to_worker_ |
const AgoraTxRx::TxRxTypes | type_ |
size_t | num_channels_ |
Implementations of this class provide packet I/O for Agora.
In the vanilla mode, this class provides socket or DPDK-based packet I/O to Agora (running on the base station server or client) for communicating with simulated peers.
In the "Argos" mode, this class provides SoapySDR-based communication for Agora (running on the base station server or client) for communicating with real wireless hardware peers (antenna hubs for the server, UE devices for the client).
PacketTxRx::PacketTxRx | ( | AgoraTxRx::TxRxTypes | type, |
Config *const | cfg, | ||
size_t | core_offset, | ||
moodycamel::ConcurrentQueue< EventData > * | event_notify_q, | ||
moodycamel::ConcurrentQueue< EventData > * | tx_pending_q, | ||
moodycamel::ProducerToken ** | notify_producer_tokens, | ||
moodycamel::ProducerToken ** | tx_producer_tokens, | ||
Table< char > & | rx_buffer, | ||
size_t | packet_num_in_buffer, | ||
Table< size_t > & | frame_start, | ||
char * | tx_buffer | ||
) |
Will make (packet_num_in_buffer % total_radios) unused buffers
Make sure all antennas on an interface is assigned to the same worker
For each requested worker, start assigning interfaces / buffers
Front load the workers
Worker <-> Interface assignment logic
Distribute the buffers per interface
If last interface has been assigned, exit assignment.
The +1 is for worker_index to worker count conversion
|
virtual |
size_t PacketTxRx::AntNumToWorkerId | ( | size_t | ant_num | ) | const |
Convert the antenna id to txrx worker id.
ant_num | antenna number |
|
privatepure virtual |
Implemented in PacketTxRxDpdk, PacketTxRxRadio, PacketTxRxClientRadio, PacketTxRxClientSim, and PacketTxRxSim.
|
inlineprotected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
virtual |
Start the network I/O threads.
Can exit here because this list is ordered
Reimplemented in PacketTxRxRadio, and PacketTxRxClientRadio.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
|
protected |
Owned by this class and shared with the workers.
|
protected |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
protected |
|
private |
|
private |
|
protected |