Avoid copying gNb common configuration in slot basis

master
Xavier Arteaga 3 years ago committed by Andre Puschmann
parent 95bf85b3d3
commit b54d4ad8e2

@ -90,12 +90,6 @@ private:
uint32_t nof_prach_workers = 0; uint32_t nof_prach_workers = 0;
double srate_hz = 0.0; ///< Current sampling rate in Hz double srate_hz = 0.0; ///< Current sampling rate in Hz
// Current configuration
std::mutex common_cfg_mutex;
srsran_carrier_nr_t carrier = {};
srsran_pdcch_cfg_nr_t pdcch_cfg = {};
srsran_ssb_cfg_t ssb_cfg = {};
public: public:
struct args_t { struct args_t {
double srate_hz = 0.0; double srate_hz = 0.0;

@ -89,27 +89,6 @@ slot_worker* worker_pool::wait_worker(uint32_t tti)
{ {
slot_worker* w = (slot_worker*)pool.wait_worker(tti); slot_worker* w = (slot_worker*)pool.wait_worker(tti);
// Only if a worker was available
if (w != nullptr) {
srsran_carrier_nr_t carrier_;
srsran_pdcch_cfg_nr_t pdcch_cfg_;
srsran_ssb_cfg_t ssb_cfg_;
// Copy configuration
{
std::unique_lock<std::mutex> lock(common_cfg_mutex);
carrier_ = carrier;
pdcch_cfg_ = pdcch_cfg;
ssb_cfg_ = ssb_cfg;
}
// Set worker configuration
if (not w->set_common_cfg(carrier_, pdcch_cfg_, ssb_cfg_)) {
logger.error("Error setting common config");
return nullptr;
}
}
// Save current TTI // Save current TTI
current_tti = tti; current_tti = tti;
@ -153,15 +132,28 @@ int worker_pool::set_common_cfg(const phy_interface_rrc_nr::common_cfg_t& common
prach.init(0, cell, prach_cfg, &prach_stack_adaptor, logger, 0, nof_prach_workers); prach.init(0, cell, prach_cfg, &prach_stack_adaptor, logger, 0, nof_prach_workers);
prach.set_max_prach_offset_us(1000); prach.set_max_prach_offset_us(1000);
// Save current configuration // Setup SSB sampling rate and scaling
{ srsran_ssb_cfg_t ssb_cfg = common_cfg.ssb;
std::unique_lock<std::mutex> lock(common_cfg_mutex); ssb_cfg.srate_hz = srate_hz;
carrier = common_cfg.carrier; ssb_cfg.scaling =
pdcch_cfg = common_cfg.pdcch; srsran_convert_dB_to_amplitude(srsran_gnb_dl_get_maximum_signal_power_dBfs(common_cfg.carrier.nof_prb));
ssb_cfg = common_cfg.ssb;
ssb_cfg.srate_hz = srate_hz; // For each worker set configuration
ssb_cfg.scaling = for (uint32_t i = 0; i < pool.get_nof_workers(); i++) {
srsran_convert_dB_to_amplitude(srsran_gnb_dl_get_maximum_signal_power_dBfs(common_cfg.carrier.nof_prb)); // Reserve worker from pool
slot_worker* w = (slot_worker*)pool.wait_worker_id(i);
if (w == nullptr) {
// Skip worker if invalid pointer
continue;
}
// Setup worker common configuration
if (not w->set_common_cfg(common_cfg.carrier, common_cfg.pdcch, ssb_cfg)) {
return SRSRAN_ERROR;
}
// Release worker
w->release();
} }
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;

Loading…
Cancel
Save