From 179fd394b2d45b02d7a0ab360f3784119a30202e Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 17 Jan 2020 21:46:44 +0100 Subject: [PATCH] enb: add SRB2+DRB1 to scheduler AFTER receiving Reconfig Complete this commit fixes and issue where, after receiving paging and the resulting PRACH from the UE, the eNB would create DRB1 and already schedule DL traffic on this bearer. However, since the UE has not received the reconfig message yet, the DL traffic is dropped since DRB1 isn't set up yet. the commit also does not reset the BSR state of the bearer inside MAC since this caused to a stall of the received DL PDU. The value would initially be set to a non-zero value (after receiving the DL PDU from EPC). But when the bearer was (re-)introduced to MAC, it would reset the BSR to zero, and, since MAC never polls RLC, the PDU wasn't sent down until the next PDU arrives and sets the BSR to a non-zero value again. --- srsenb/src/stack/mac/scheduler_ue.cc | 2 -- srsenb/src/stack/rrc/rrc.cc | 29 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/srsenb/src/stack/mac/scheduler_ue.cc b/srsenb/src/stack/mac/scheduler_ue.cc index e8efa3365..dd1f11cd8 100644 --- a/srsenb/src/stack/mac/scheduler_ue.cc +++ b/srsenb/src/stack/mac/scheduler_ue.cc @@ -157,8 +157,6 @@ void sched_ue::set_bearer_cfg(uint32_t lc_id, sched_interface::ue_bearer_cfg_t* std::lock_guard lock(mutex); if (lc_id < sched_interface::MAX_LC) { memcpy(&lch[lc_id].cfg, cfg_, sizeof(sched_interface::ue_bearer_cfg_t)); - lch[lc_id].buf_tx = 0; - lch[lc_id].buf_retx = 0; if (lch[lc_id].cfg.direction != sched_interface::ue_bearer_cfg_t::IDLE) { Info("SCHED: Set bearer config lc_id=%d, direction=%d\n", lc_id, (int)lch[lc_id].cfg.direction); } diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index e411ce2a4..f280d423c 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -1215,10 +1215,25 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsl void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte::unique_byte_buffer_t pdu) { - parent->rrc_log->info("RRCReconfigurationComplete transaction ID: %d\n", msg->rrc_transaction_id); + if (last_rrc_conn_recfg.rrc_transaction_id == msg->rrc_transaction_id) { + // Finally, add SRB2 and DRB1 to the scheduler + srsenb::sched_interface::ue_bearer_cfg_t bearer_cfg; + bearer_cfg.direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH; + bearer_cfg.group = 0; + parent->mac->bearer_ue_cfg(rnti, 2, &bearer_cfg); + bearer_cfg.group = last_rrc_conn_recfg.crit_exts.c1() + .rrc_conn_recfg_r8() + .rr_cfg_ded.drb_to_add_mod_list[0] + .lc_ch_cfg.ul_specific_params.lc_ch_group; + parent->mac->bearer_ue_cfg(rnti, 3, &bearer_cfg); - // Acknowledge Dedicated Configuration - parent->mac->phy_config_enabled(rnti, true); + // Acknowledge Dedicated Configuration + parent->mac->phy_config_enabled(rnti, true); + } else { + parent->rrc_log->error("Expected RRCReconfigurationComplete with transaction ID: %d, got %d\n", + last_rrc_conn_recfg.rrc_transaction_id, + msg->rrc_transaction_id); + } } void rrc::ue::handle_security_mode_complete(security_mode_complete_s* msg) @@ -1769,14 +1784,6 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu) return; } - // Add SRB2 and DRB1 to the scheduler - srsenb::sched_interface::ue_bearer_cfg_t bearer_cfg; - bearer_cfg.direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH; - bearer_cfg.group = 0; - parent->mac->bearer_ue_cfg(rnti, 2, &bearer_cfg); - bearer_cfg.group = conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].lc_ch_cfg.ul_specific_params.lc_ch_group; - parent->mac->bearer_ue_cfg(rnti, 3, &bearer_cfg); - // Configure SRB2 in RLC and PDCP parent->rlc->add_bearer(rnti, 2, srslte::rlc_config_t::srb_config(2));