Fix gnb race condition in asynchronous PRACH processing by setting number of threads to 0

This commit is contained in:
Xavier Arteaga 2021-07-23 13:20:54 +02:00 committed by Xavier Arteaga
parent 9c298b203d
commit 5b31fa72d3
5 changed files with 19 additions and 14 deletions

View File

@ -82,6 +82,7 @@ private:
uint32_t current_tti = 0; ///< Current TTI, read and write from same thread
srslog::basic_logger& logger;
prach_stack_adaptor_t prach_stack_adaptor;
uint32_t nof_prach_workers = 0;
// Current configuration
std::mutex common_cfg_mutex;
@ -91,6 +92,7 @@ private:
public:
struct args_t {
uint32_t nof_phy_threads = 3;
uint32_t nof_prach_workers = 0;
uint32_t prio = 52;
uint32_t pusch_max_nof_iter = 10;
srsran::phy_log_args_t log = {};

View File

@ -30,6 +30,8 @@ worker_pool::worker_pool(srsran::phy_common_interface& common_,
bool worker_pool::init(const args_t& args, const phy_cell_cfg_list_nr_t& cell_list)
{
nof_prach_workers = args.nof_prach_workers;
// Configure logger
srslog::basic_levels log_level = srslog::str_to_basic_level(args.log.phy_level);
logger.set_level(log_level);
@ -131,7 +133,7 @@ int worker_pool::set_common_cfg(const phy_interface_rrc_nr::common_cfg_t& common
prach_cfg.is_nr = true;
// Set the PRACH configuration
prach.init(0, cell, prach_cfg, &prach_stack_adaptor, logger, 0, 1);
prach.init(0, cell, prach_cfg, &prach_stack_adaptor, logger, 0, nof_prach_workers);
prach.set_max_prach_offset_us(1000);
// Save current configuration

View File

@ -60,16 +60,15 @@ if (RF_FOUND AND ENABLE_SRSUE AND ENABLE_SRSENB)
--ue.phy.nof_threads=${NR_PHY_TEST_UE_NOF_THREADS}
)
# Disabled until fixed
#add_nr_test(nr_phy_test_10MHz_prach nr_phy_test
# --duration=1000 # 100 slots
# --gnb.stack.pdsch.slots=none # No PDSCH
# --gnb.stack.pusch.slots=none # No PUSCH
# --gnb.phy.nof_threads=${NR_PHY_TEST_GNB_NOF_THREADS}
# --ue.stack.prach.period=30 # Transmit PRACH every 30 radio frames
# --ue.stack.prach.preamble=10 # Use preamble 10
# --ue.phy.nof_threads=${NR_PHY_TEST_UE_NOF_THREADS}
# )
add_nr_test(nr_phy_test_10MHz_prach nr_phy_test
--duration=1000 # 100 slots
--gnb.stack.pdsch.slots=none # No PDSCH
--gnb.stack.pusch.slots=none # No PUSCH
--gnb.phy.nof_threads=${NR_PHY_TEST_GNB_NOF_THREADS}
--ue.stack.prach.period=30 # Transmit PRACH every 30 radio frames
--ue.stack.prach.preamble=10 # Use preamble 10
--ue.phy.nof_threads=${NR_PHY_TEST_UE_NOF_THREADS}
)
add_nr_test(nr_phy_test_10MHz_sr nr_phy_test
--duration=1000 # 100 slots

View File

@ -566,6 +566,11 @@ public:
return SRSRAN_ERROR;
}
// Skip next steps if uci data is invalid
if (not pucch_info.uci_data.value.valid) {
return SRSRAN_SUCCESS;
}
// Handle PHY metrics
metrics.pucch.epre_db_avg = SRSRAN_VEC_CMA(pucch_info.csi.epre_dB, metrics.pucch.epre_db_avg, metrics.pucch.count);
metrics.pucch.epre_db_min = SRSRAN_MIN(metrics.pucch.epre_db_min, pucch_info.csi.epre_dB);

View File

@ -254,9 +254,6 @@ int main(int argc, char** argv)
metrics.gnb_stack.pucch.ta_us_min,
metrics.gnb_stack.pucch.ta_us_max);
srsran::console(" +------------+------------+------------+------------+\n");
} else {
// In this case the gNb should not have detected any
TESTASSERT(metrics.gnb_stack.prach.empty());
}
// Print SR