From 0984debe1b865fe46083f6463b554d22c8cc25a5 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Fri, 20 Sep 2019 15:41:16 +0200 Subject: [PATCH] Fix issues with RLF in B210 and X300 (#669) * Calling tx_end() from radio_reset() causes long execution time in B210. Using boolean to call later instead. Fixes RLF failing in B210. Checked in X300 * Fix issue #655 --- .../srslte/interfaces/rrc_interface_types.h | 35 +++++++++++++------ srsue/hdr/phy/phy_common.h | 2 ++ srsue/src/phy/phy_common.cc | 25 +++++++------ srsue/src/stack/rrc/rrc.cc | 5 ++- 4 files changed, 43 insertions(+), 24 deletions(-) diff --git a/lib/include/srslte/interfaces/rrc_interface_types.h b/lib/include/srslte/interfaces/rrc_interface_types.h index fdb4ebfcb..aa118e561 100644 --- a/lib/include/srslte/interfaces/rrc_interface_types.h +++ b/lib/include/srslte/interfaces/rrc_interface_types.h @@ -408,38 +408,51 @@ struct mac_cfg_t { **************************/ struct phy_cfg_t { - phy_cfg_t() + phy_cfg_t() { set_defaults(); } + + void set_defaults() { ZERO_OBJECT(ul_cfg); ZERO_OBJECT(dl_cfg); ZERO_OBJECT(prach_cfg); - set_defaults_common(); - set_defaults_dedicated(); - } - - void set_defaults_common() - { + // CommonConfig defaults for non-zero values ul_cfg.pucch.delta_pucch_shift = 1; ul_cfg.power_ctrl.delta_f_pucch[0] = 0; ul_cfg.power_ctrl.delta_f_pucch[1] = 1; ul_cfg.power_ctrl.delta_f_pucch[2] = 0; ul_cfg.power_ctrl.delta_f_pucch[3] = 0; ul_cfg.power_ctrl.delta_f_pucch[4] = 0; + + set_defaults_dedicated(); } + // 36.331 9.2.4 void set_defaults_dedicated() { dl_cfg.tm = SRSLTE_TM1; + dl_cfg.pdsch.use_tbs_index_alt = false; + dl_cfg.pdsch.p_a = 0; + + dl_cfg.cqi_report.periodic_configured = false; + dl_cfg.cqi_report.aperiodic_configured = false; + + ul_cfg.pucch.tdd_ack_multiplex = false; + ul_cfg.pusch.uci_offset.I_offset_ack = 10; - ul_cfg.pusch.uci_offset.I_offset_cqi = 15; ul_cfg.pusch.uci_offset.I_offset_ri = 12; + ul_cfg.pusch.uci_offset.I_offset_cqi = 15; + + ul_cfg.power_ctrl.p0_nominal_pusch = 0; + ul_cfg.power_ctrl.delta_mcs_based = false; + ul_cfg.power_ctrl.acc_enabled = true; + ul_cfg.power_ctrl.p0_nominal_pucch = 0; + ul_cfg.power_ctrl.p_srs_offset = 7; - ul_cfg.power_ctrl.acc_enabled = true; - ul_cfg.power_ctrl.p_srs_offset = 7; + ul_cfg.srs.dedicated_enabled = false; - // Rest of default values are 0 or false + ul_cfg.pucch.sr_configured = false; } srslte_dl_cfg_t dl_cfg; diff --git a/srsue/hdr/phy/phy_common.h b/srsue/hdr/phy/phy_common.h index 42c657845..acf2d648d 100644 --- a/srsue/hdr/phy/phy_common.h +++ b/srsue/hdr/phy/phy_common.h @@ -177,6 +177,8 @@ private: uint32_t nof_workers; uint32_t max_workers; + bool is_pending_tx_end = false; + srslte::radio_interface_phy* radio_h; float cfo; srslte::log* log_h; diff --git a/srsue/src/phy/phy_common.cc b/srsue/src/phy/phy_common.cc index 3b1ec62f1..1ccd79adc 100644 --- a/srsue/src/phy/phy_common.cc +++ b/srsue/src/phy/phy_common.cc @@ -584,17 +584,24 @@ void phy_common::worker_end(uint32_t tti, radio_h->tx(i, buffer[i], nof_samples[i], tx_time[i]); } else { if (radio_h->is_continuous_tx()) { - if (!radio_h->get_is_start_of_burst(i)) { + if (is_pending_tx_end) { + radio_h->tx_end(); + is_pending_tx_end = false; + } else { + if (!radio_h->get_is_start_of_burst(i)) { - if (ul_channel && !srslte_timestamp_iszero(&tx_time[i])) { - bzero(zeros_multi[0], sizeof(cf_t) * nof_samples[i]); - ul_channel->run(zeros_multi, zeros_multi, nof_samples[i], tx_time[i]); - } + if (ul_channel && !srslte_timestamp_iszero(&tx_time[i])) { + bzero(zeros_multi[0], sizeof(cf_t) * nof_samples[i]); + ul_channel->run(zeros_multi, zeros_multi, nof_samples[i], tx_time[i]); + } - radio_h->tx(i, zeros_multi, nof_samples[i], tx_time[i]); + radio_h->tx(i, zeros_multi, nof_samples[i], tx_time[i]); + } } } else { - radio_h->tx_end(); + if (i == 0) { + radio_h->tx_end(); + } } } } @@ -696,9 +703,7 @@ void phy_common::reset_radio() // Since is_first_of_burst is set to true, the radio need to send // end of burst in order to stall correctly the Tx stream. // This is required for UHD version 3.10 and newer. - if (radio_h) { - radio_h->tx_end(); - } + is_pending_tx_end = true; } void phy_common::reset() diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 958cf110b..156c00e25 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -1340,8 +1340,8 @@ void rrc::leave_connected() nas->leave_connected(); pdcp->reset(); rlc->reset(); - phy->reset(); mac->reset(); + phy->reset(); set_phy_default(); set_mac_default(); stop_timers(); @@ -2421,8 +2421,7 @@ void rrc::log_phy_config_dedicated() // Apply default physical common and dedicated configuration void rrc::set_phy_default() { - current_phy_cfg.set_defaults_dedicated(); - current_phy_cfg.set_defaults_common(); + current_phy_cfg.set_defaults(); if (phy != nullptr) { phy->set_config(current_phy_cfg);