From 493b7ea2da5dd1c864f43c4831d22dd6eb53fdf6 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 22 Jun 2020 21:44:45 +0200 Subject: [PATCH] Remove SNR threshold based link failure detection --- .../srslte/interfaces/enb_interfaces.h | 6 ---- lib/src/phy/enb/enb_dl.c | 12 +++++-- srsenb/enb.conf.example | 3 -- srsenb/hdr/stack/enb_stack_lte.h | 3 -- srsenb/hdr/stack/mac/mac.h | 2 -- srsenb/hdr/stack/mac/ue.h | 3 -- srsenb/hdr/stack/rrc/rrc.h | 3 -- srsenb/hdr/stack/rrc/rrc_ue.h | 2 -- srsenb/src/main.cc | 1 - srsenb/src/phy/cc_worker.cc | 28 ++++----------- srsenb/src/stack/mac/mac.cc | 27 +-------------- srsenb/src/stack/mac/ue.cc | 11 ------ srsenb/src/stack/rrc/rrc.cc | 34 ------------------- srsenb/src/stack/rrc/rrc_ue.cc | 6 ---- srsenb/test/phy/enb_phy_test.cc | 10 ------ 15 files changed, 18 insertions(+), 133 deletions(-) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index 5dcf0271c..62d0fb27c 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -182,10 +182,6 @@ public: virtual int get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res) = 0; virtual int get_ul_sched(uint32_t tti, ul_sched_list_t& ul_sched_res) = 0; virtual void set_sched_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs) = 0; - - // Radio-Link status - virtual void rl_failure(uint16_t rnti) = 0; - virtual void rl_ok(uint16_t rnti) = 0; }; /* Interface MAC -> PHY */ @@ -410,7 +406,6 @@ class rrc_interface_mac { public: /* Radio Link failure */ - virtual void rl_failure(uint16_t rnti) = 0; virtual void add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) = 0; virtual void upd_user(uint16_t new_rnti, uint16_t old_rnti) = 0; virtual void set_activity_user(uint16_t rnti) = 0; @@ -544,7 +539,6 @@ typedef struct { typedef struct { uint32_t nof_prb; ///< Needed to dimension MAC softbuffers for all cells sched_interface::sched_args_t sched; - int link_failure_nof_err; int nr_tb_size = -1; } mac_args_t; diff --git a/lib/src/phy/enb/enb_dl.c b/lib/src/phy/enb/enb_dl.c index 593f412e5..5fb6ffc55 100644 --- a/lib/src/phy/enb/enb_dl.c +++ b/lib/src/phy/enb/enb_dl.c @@ -531,7 +531,11 @@ enb_dl_get_ack_fdd_pcell_skip_drx(const srslte_uci_value_t* uci_value, srslte_pd for (uint32_t tb = 0; tb < nof_tb; tb++) { // Check that TB was transmitted if (pdsch_ack->cc[0].m[0].value[tb] != 2) { - pdsch_ack->cc[0].m[0].value[tb] = uci_value->ack.ack_value[ack_idx++]; + if (uci_value->ack.valid) { + pdsch_ack->cc[0].m[0].value[tb] = uci_value->ack.ack_value[ack_idx++]; + } else { + pdsch_ack->cc[0].m[0].value[tb] = 0; + } } } } @@ -545,7 +549,11 @@ enb_dl_get_ack_fdd_all_keep_drx(const srslte_uci_value_t* uci_value, srslte_pdsc for (uint32_t tb = 0; tb < nof_tb; tb++) { // Check that TB was transmitted if (pdsch_ack->cc[cc_idx].m[0].value[tb] != 2) { - pdsch_ack->cc[cc_idx].m[0].value[tb] = uci_value->ack.ack_value[cc_idx * nof_tb + tb]; + if (uci_value->ack.valid) { + pdsch_ack->cc[cc_idx].m[0].value[tb] = uci_value->ack.ack_value[cc_idx * nof_tb + tb]; + } else { + pdsch_ack->cc[cc_idx].m[0].value[tb] = 0; + } } } } diff --git a/srsenb/enb.conf.example b/srsenb/enb.conf.example index 18f5e78e8..983136521 100644 --- a/srsenb/enb.conf.example +++ b/srsenb/enb.conf.example @@ -277,8 +277,6 @@ pusch_max_mcs = 16 # metrics_csv_filename: File path to use for CSV metrics. # pregenerate_signals: Pregenerate uplink signals after attach. Improves CPU performance. # tx_amplitude: Transmit amplitude factor (set 0-1 to reduce PAPR) -# link_failure_nof_err: Number of PUSCH failures after which a radio-link failure is triggered. -# a link failure is when SNR<0 and CRC=KO # max_prach_offset_us: Maximum allowed RACH offset (in us) # eea_pref_list: Ordered preference list for the selection of encryption algorithm (EEA) (default: EEA0, EEA2, EEA1). # eia_pref_list: Ordered preference list for the selection of integrity algorithm (EIA) (default: EIA2, EIA1, EIA0). @@ -293,7 +291,6 @@ pusch_max_mcs = 16 #metrics_csv_filename = /tmp/enb_metrics.csv #pregenerate_signals = false #tx_amplitude = 0.6 -#link_failure_nof_err = 50 #rrc_inactivity_timer = 60000 #max_prach_offset_us = 30 #eea_pref_list = EEA0, EEA2, EEA1 diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index b55da1eae..e0674aaef 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -101,9 +101,6 @@ public: { mac.set_sched_dl_tti_mask(tti_mask, nof_sfs); } - // Radio-Link status - void rl_failure(uint16_t rnti) final { mac.rl_failure(rnti); } - void rl_ok(uint16_t rnti) final { mac.rl_ok(rnti); } void tti_clock() override; /* STACK-S1AP interface*/ diff --git a/srsenb/hdr/stack/mac/mac.h b/srsenb/hdr/stack/mac/mac.h index ee4ee79c3..3be42174a 100644 --- a/srsenb/hdr/stack/mac/mac.h +++ b/srsenb/hdr/stack/mac/mac.h @@ -74,8 +74,6 @@ public: scheduler.set_dl_tti_mask(tti_mask, nof_sfs); } void build_mch_sched(uint32_t tbs); - void rl_failure(uint16_t rnti) override; - void rl_ok(uint16_t rnti) override; /******** Interface from RRC (RRC -> MAC) ****************/ /* Provides cell configuration including SIB periodicity, etc. */ diff --git a/srsenb/hdr/stack/mac/ue.h b/srsenb/hdr/stack/mac/ue.h index 0461333de..e8874f756 100644 --- a/srsenb/hdr/stack/mac/ue.h +++ b/srsenb/hdr/stack/mac/ue.h @@ -84,9 +84,6 @@ public: void push_pdu(const uint32_t ue_cc_idx, const uint32_t tti, uint32_t len); void deallocate_pdu(const uint32_t ue_cc_idx, const uint32_t tti); - uint32_t rl_failure(); - void rl_failure_reset(); - void set_lcg(uint32_t lcid, uint32_t lcg); void metrics_read(srsenb::mac_metrics_t* metrics); diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index 52b27d952..1cdae7a56 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -69,7 +69,6 @@ public: void tti_clock(); // rrc_interface_mac - void rl_failure(uint16_t rnti) override; void add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) override; void upd_user(uint16_t new_rnti, uint16_t old_rnti) override; void set_activity_user(uint16_t rnti) override; @@ -142,7 +141,6 @@ private: std::map pending_paging; void process_release_complete(uint16_t rnti); - void process_rl_failure(uint16_t rnti); void rem_user(uint16_t rnti); uint32_t generate_sibs(); void configure_mbsfn_sibs(asn1::rrc::sib_type2_s* sib2, asn1::rrc::sib_type13_r9_s* sib13); @@ -162,7 +160,6 @@ private: const static uint32_t LCID_EXIT = 0xffff0000; const static uint32_t LCID_REM_USER = 0xffff0001; const static uint32_t LCID_REL_USER = 0xffff0002; - const static uint32_t LCID_RLF_USER = 0xffff0003; const static uint32_t LCID_ACT_USER = 0xffff0004; bool running = false; diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index 25009503b..148c47e06 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -47,8 +47,6 @@ public: void set_activity(); void activity_timer_expired(); - uint32_t rl_failure(); - rrc_state_t get_state(); void send_connection_setup(); diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index d444a696e..cfabefcf8 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -184,7 +184,6 @@ void parse_args(all_args_t* args, int argc, char* argv[]) ("expert.pusch_meas_evm", bpo::value(&args->phy.pusch_meas_evm)->default_value(false), "Enable/Disable PUSCH EVM measure") ("expert.tx_amplitude", bpo::value(&args->phy.tx_amplitude)->default_value(0.6), "Transmit amplitude factor") ("expert.nof_phy_threads", bpo::value(&args->phy.nof_phy_threads)->default_value(3), "Number of PHY threads") - ("expert.link_failure_nof_err", bpo::value(&args->stack.mac.link_failure_nof_err)->default_value(100), "Number of PUSCH failures after which a radio-link failure is triggered") ("expert.max_prach_offset_us", bpo::value(&args->phy.max_prach_offset_us)->default_value(30), "Maximum allowed RACH offset (in us)") ("expert.equalizer_mode", bpo::value(&args->phy.equalizer_mode)->default_value("mmse"), "Equalizer mode") ("expert.estimator_fil_w", bpo::value(&args->phy.estimator_fil_w)->default_value(0.1), "Chooses the coefficients for the 3-tap channel estimator centered filter.") diff --git a/srsenb/src/phy/cc_worker.cc b/srsenb/src/phy/cc_worker.cc index 098c31b8d..18d475404 100644 --- a/srsenb/src/phy/cc_worker.cc +++ b/srsenb/src/phy/cc_worker.cc @@ -335,19 +335,15 @@ void cc_worker::decode_pusch_rnti(stack_interface_phy_lte::ul_sched_grant_t& ul_ phy->stack->snr_info(ul_sf.tti, rnti, cc_idx, snr_db); if (ul_grant.dci.tb.rv == 0) { - if (!pusch_res.crc) { - Debug("PUSCH: Radio-Link failure snr=%.1f dB\n", snr_db); - phy->stack->rl_failure(rnti); - } else { - phy->stack->rl_ok(rnti); - - // Notify MAC of Time Alignment only if it enabled and valid measurement, ignore value otherwise - if (ul_cfg.pusch.meas_ta_en and not std::isnan(enb_ul.chest_res.ta_us) and - not std::isinf(enb_ul.chest_res.ta_us)) { - phy->stack->ta_info(ul_sf.tti, rnti, enb_ul.chest_res.ta_us); - } + // Notify MAC of Time Alignment only if it enabled and valid measurement, ignore value otherwise + if (ul_cfg.pusch.meas_ta_en and not std::isnan(enb_ul.chest_res.ta_us) and + not std::isinf(enb_ul.chest_res.ta_us)) { + phy->stack->ta_info(ul_sf.tti, rnti, enb_ul.chest_res.ta_us); } } + pusch_res.uci.ack.valid = true; + } else { + pusch_res.uci.ack.valid = false; } // Send UCI data to MAC @@ -408,16 +404,6 @@ int cc_worker::decode_pucch() return SRSLTE_ERROR; } - // Notify MAC of RL status (skip SR subframes) - if (!ul_cfg.pucch.uci_cfg.is_scheduling_request_tti) { - if (pucch_res.correlation < PUCCH_RL_CORR_TH) { - Debug("PUCCH: Radio-Link failure corr=%.1f\n", pucch_res.correlation); - phy->stack->rl_failure(rnti); - } else { - phy->stack->rl_ok(rnti); - } - } - // Send UCI data to MAC phy->ue_db.send_uci_data(tti_rx, rnti, cc_idx, ul_cfg.pucch.uci_cfg, pucch_res.uci_data); diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index a2029d205..9c8563336 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -293,31 +293,6 @@ void mac::get_metrics(mac_metrics_t metrics[ENB_METRICS_MAX_USERS]) * *******************************************************/ -void mac::rl_failure(uint16_t rnti) -{ - srslte::rwlock_read_guard lock(rwlock); - if (ue_db.count(rnti)) { - uint32_t nof_fails = ue_db[rnti]->rl_failure(); - if (nof_fails >= (uint32_t)args.link_failure_nof_err && args.link_failure_nof_err > 0) { - Info("Detected Uplink failure for rnti=0x%x\n", rnti); - rrc_h->rl_failure(rnti); - ue_db[rnti]->rl_failure_reset(); - } - } else { - Error("User rnti=0x%x not found\n", rnti); - } -} - -void mac::rl_ok(uint16_t rnti) -{ - srslte::rwlock_read_guard lock(rwlock); - if (ue_db.count(rnti)) { - ue_db[rnti]->rl_failure_reset(); - } else { - Error("User rnti=0x%x not found\n", rnti); - } -} - int mac::ack_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t tb_idx, bool ack) { srslte::rwlock_read_guard lock(rwlock); @@ -329,7 +304,7 @@ int mac::ack_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t tb_ if (ack) { if (nof_bytes > 64) { // do not count RLC status messages only rrc_h->set_activity_user(rnti); - log_h->debug("DL activity rnti=0x%x, n_bytes=%d\n", rnti, nof_bytes); + log_h->info("DL activity rnti=0x%x, n_bytes=%d\n", rnti, nof_bytes); } } } diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 16c8cc105..5367fb6e3 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -158,17 +158,6 @@ void ue::start_pcap(srslte::mac_pcap* pcap_) pcap = pcap_; } -uint32_t ue::rl_failure() -{ - nof_failures++; - return nof_failures; -} - -void ue::rl_failure_reset() -{ - nof_failures = 0; -} - void ue::set_lcg(uint32_t lcid, uint32_t lcg) { // find and remove if already exists diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 94258c3e2..6b45fdfce 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -122,12 +122,6 @@ uint8_t* rrc::read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index return nullptr; } -void rrc::rl_failure(uint16_t rnti) -{ - rrc_pdu p = {rnti, LCID_RLF_USER, nullptr}; - rx_pdu_queue.push(std::move(p)); -} - void rrc::set_activity_user(uint16_t rnti) { rrc_pdu p = {rnti, LCID_ACT_USER, nullptr}; @@ -503,31 +497,6 @@ void rrc::parse_ul_dcch(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer } } -///< User mutex must be hold by caller -void rrc::process_rl_failure(uint16_t rnti) -{ - auto user_it = users.find(rnti); - if (user_it != users.end()) { - uint32_t n_rfl = user_it->second->rl_failure(); - if (n_rfl == 1) { - rrc_log->info("Radio-Link failure detected rnti=0x%x\n", rnti); - if (s1ap->user_exists(rnti)) { - if (!s1ap->user_release(rnti, asn1::s1ap::cause_radio_network_opts::radio_conn_with_ue_lost)) { - rrc_log->info("Removing rnti=0x%x\n", rnti); - } - } else { - rrc_log->warning("User rnti=0x%x context not existing in S1AP. Removing user\n", rnti); - // Remove user from separate thread to wait to close all resources - rem_user_thread(rnti); - } - } else { - rrc_log->info("%d Radio-Link failure detected rnti=0x%x\n", n_rfl, rnti); - } - } else { - rrc_log->error("Radio-Link failure detected for unknown rnti=0x%x\n", rnti); - } -} - ///< User mutex must be hold by caller void rrc::process_release_complete(uint16_t rnti) { @@ -788,9 +757,6 @@ void rrc::tti_clock() case LCID_REL_USER: process_release_complete(p.rnti); break; - case LCID_RLF_USER: - process_rl_failure(p.rnti); - break; case LCID_ACT_USER: user_it->second->set_activity(); break; diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 49260cfa9..6ff16b046 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -72,12 +72,6 @@ rrc_state_t rrc::ue::get_state() return state; } -uint32_t rrc::ue::rl_failure() -{ - rlf_cnt++; - return rlf_cnt; -} - void rrc::ue::set_activity() { // re-start activity timer with current timeout value diff --git a/srsenb/test/phy/enb_phy_test.cc b/srsenb/test/phy/enb_phy_test.cc index e5b8d22ba..346bf0dd5 100644 --- a/srsenb/test/phy/enb_phy_test.cc +++ b/srsenb/test/phy/enb_phy_test.cc @@ -291,8 +291,6 @@ private: CALLBACK(get_mch_sched); CALLBACK(get_ul_sched); CALLBACK(set_sched_dl_tti_mask); - CALLBACK(rl_failure); - CALLBACK(rl_ok); CALLBACK(tti_clock); typedef struct { @@ -679,8 +677,6 @@ public: return SRSLTE_SUCCESS; } void set_sched_dl_tti_mask(uint8_t* tti_mask, uint32_t nof_sfs) override { notify_set_sched_dl_tti_mask(); } - void rl_failure(uint16_t rnti) override { notify_rl_failure(); } - void rl_ok(uint16_t rnti) override { notify_rl_ok(); } void tti_clock() override { notify_tti_clock(); } int run_tti(bool enable_assert) { @@ -1283,12 +1279,6 @@ public: { int ret = SRSLTE_SUCCESS; - // If no assertion enabled, clear radio link failure to avoid errors in cell transitions - if (change_state != change_state_assert) { - stack->clear_rl_failure(); - } - - TESTASSERT(not stack->get_received_rl_failure()); TESTASSERT(ue_phy->run_tti() >= SRSLTE_SUCCESS); TESTASSERT(stack->run_tti(change_state == change_state_assert) >= SRSLTE_SUCCESS);