Apply PHY configs to workers sequentially without interrupting processing

master
Ismael Gomez 5 years ago committed by Xavier Arteaga
parent fd3d4a7874
commit 71723c315d

@ -409,8 +409,11 @@ void phy::set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rn
void phy::set_crnti(uint16_t rnti) void phy::set_crnti(uint16_t rnti)
{ {
// set_crnti() is an operation that takes time, apply asynrhonously with processing
for (uint32_t i = 0; i < nof_workers; i++) { for (uint32_t i = 0; i < nof_workers; i++) {
workers[i]->set_crnti(rnti); sf_worker* w = (sf_worker*)workers_pool.wait_worker_id(i);
w->set_crnti(rnti);
w->release();
} }
} }
@ -439,8 +442,12 @@ void phy::set_config(srslte::phy_cfg_t& config_, uint32_t cc_idx, uint32_t earfc
// Send configuration to workers // Send configuration to workers
for (uint32_t i = 0; i < nof_workers; i++) { for (uint32_t i = 0; i < nof_workers; i++) {
if (cell_info) { if (cell_info) {
workers[i]->set_cell(cc_idx, *cell_info); // set_cell() is an operation that takes time, apply asynrhonously with processing
sf_worker* w = (sf_worker*)workers_pool.wait_worker_id(i);
w->set_cell(cc_idx, *cell_info);
w->release();
} }
// set_config() is just a memcpy
workers[i]->set_config(cc_idx, config_); workers[i]->set_config(cc_idx, config_);
} }

@ -765,11 +765,15 @@ bool sync::set_cell()
sfn_p.set_cell(cell); sfn_p.set_cell(cell);
worker_com->set_cell(cell); worker_com->set_cell(cell);
bool success = true;
for (uint32_t i = 0; i < workers_pool->get_nof_workers(); i++) { for (uint32_t i = 0; i < workers_pool->get_nof_workers(); i++) {
if (!((sf_worker*)workers_pool->get_worker(i))->set_cell(0, cell)) { sf_worker* w = (sf_worker*)workers_pool->wait_worker_id(i);
Error("SYNC: Setting cell: initiating PHCH worker\n"); success &= w->set_cell(0, cell);
return false; w->release();
} }
if (!success) {
Error("SYNC: Setting cell: initiating PHCH worker\n");
return false;
} }
// Set options defined in expert section // Set options defined in expert section

Loading…
Cancel
Save