removal of srb handling from srsenb::rrc::bearer_cfg_handler

master
Francisco Paisana 4 years ago
parent 2ef1e286b2
commit 7bf196a6e0

@ -70,7 +70,6 @@ public:
bearer_cfg_handler(uint16_t rnti_, const rrc_cfg_t& cfg_);
void add_srb(uint8_t srb_id);
int add_erab(uint8_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos,
const asn1::bounded_bitstring<1, 160, true, true>& addr,
@ -87,12 +86,10 @@ public:
void add_gtpu_bearer(gtpu_interface_rrc* gtpu, uint32_t erab_id);
void fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_s* msg);
const std::map<uint8_t, erab_t>& get_erabs() const { return erabs; }
const asn1::rrc::drb_to_add_mod_list_l& get_established_drbs() const { return current_drbs; }
const asn1::rrc::srb_to_add_mod_list_l& get_established_srbs() const { return current_srbs; }
const asn1::rrc::drb_to_add_mod_list_l& get_pending_addmod_drbs() const { return drbs_to_add; }
srslte::span<const uint8_t> get_pending_rem_drbs() const { return drbs_to_release; }
srslte::span<const asn1::rrc::srb_to_add_mod_s> get_pending_addmod_srbs() const { return srbs_to_add; }
const std::map<uint8_t, erab_t>& get_erabs() const { return erabs; }
const asn1::rrc::drb_to_add_mod_list_l& get_established_drbs() const { return current_drbs; }
const asn1::rrc::drb_to_add_mod_list_l& get_pending_addmod_drbs() const { return drbs_to_add; }
srslte::span<const uint8_t> get_pending_rem_drbs() const { return drbs_to_release; }
std::map<uint8_t, std::vector<uint8_t> > erab_info_list;
std::map<uint8_t, erab_t> erabs;
@ -103,11 +100,9 @@ private:
const rrc_cfg_t* cfg = nullptr;
// last cfg
asn1::rrc::srb_to_add_mod_list_l current_srbs;
asn1::rrc::drb_to_add_mod_list_l current_drbs;
// pending cfg updates
asn1::rrc::srb_to_add_mod_list_l srbs_to_add;
asn1::rrc::drb_to_add_mod_list_l drbs_to_add;
asn1::rrc::drb_to_release_list_l drbs_to_release;
};

@ -176,9 +176,9 @@ private:
* Reconfigures PDCP bearers
* @param srbs_to_add SRBs to add
*/
void apply_pdcp_srb_updates();
void apply_pdcp_drb_updates();
void apply_rlc_rb_updates();
void apply_pdcp_srb_updates(const asn1::rrc::rr_cfg_ded_s& pending_rr_cfg);
void apply_pdcp_drb_updates(const asn1::rrc::rr_cfg_ded_s& pending_rr_cfg);
void apply_rlc_rb_updates(const asn1::rrc::rr_cfg_ded_s& pending_rr_cfg);
}; // class ue
} // namespace srsenb

@ -34,6 +34,7 @@ using ue_cfg_t = sched_interface::ue_cfg_t;
sched_interface::ue_bearer_cfg_t get_bearer_default_ccch_config()
{
sched_interface::ue_bearer_cfg_t bearer = {};
bearer.direction = sched_interface::ue_bearer_cfg_t::BOTH;
bearer.priority = 1;
bearer.pbr = -1;
bearer.bsd = -1;
@ -132,9 +133,9 @@ int rrc::ue::mac_controller::apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s&
current_sched_ue_cfg.supported_cc_list[0].enb_cc_idx = pcell->cell_common->enb_cc_idx;
// Only SRB0 and SRB1 active in the Scheduler at this point
current_sched_ue_cfg.ue_bearers = {};
current_sched_ue_cfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
current_sched_ue_cfg.ue_bearers[1].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
current_sched_ue_cfg.ue_bearers = {};
current_sched_ue_cfg.ue_bearers[0] = get_bearer_default_ccch_config();
current_sched_ue_cfg.ue_bearers[1] = get_bearer_default_srb1_config();
// Set default configuration
current_sched_ue_cfg.supported_cc_list[0].dl_cfg.tm = SRSLTE_TM1;
@ -206,41 +207,6 @@ void rrc::ue::mac_controller::handle_con_reconf_complete()
void rrc::ue::mac_controller::apply_current_bearers_cfg()
{
current_sched_ue_cfg.ue_bearers = {};
current_sched_ue_cfg.ue_bearers[0].direction = sched_interface::ue_bearer_cfg_t::BOTH;
// Configure SRBs
const srb_to_add_mod_list_l& srbs = rrc_ue->bearer_list.get_established_srbs();
for (const srb_to_add_mod_s& srb : srbs) {
auto& bcfg = current_sched_ue_cfg.ue_bearers[srb.srb_id];
switch (srb.srb_id) {
case 0:
bcfg = get_bearer_default_ccch_config();
break;
case 1:
bcfg = get_bearer_default_srb1_config();
break;
case 2:
bcfg = get_bearer_default_srb2_config();
break;
default:
bcfg = {};
}
bcfg.direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
if (srb.lc_ch_cfg_present and
srb.lc_ch_cfg.type().value == srb_to_add_mod_s::lc_ch_cfg_c_::types_opts::explicit_value and
srb.lc_ch_cfg.explicit_value().ul_specific_params_present) {
// NOTE: Use UL values for DL prioritization as well
auto& ul_params = srb.lc_ch_cfg.explicit_value().ul_specific_params;
bcfg.pbr = ul_params.prioritised_bit_rate.to_number();
bcfg.priority = ul_params.prio;
bcfg.bsd = ul_params.bucket_size_dur.to_number();
if (ul_params.lc_ch_group_present) {
bcfg.group = ul_params.lc_ch_group;
}
}
}
// Configure DRBs
const drb_to_add_mod_list_l& drbs = rrc_ue->bearer_list.get_established_drbs();
for (const drb_to_add_mod_s& drb : drbs) {
@ -384,6 +350,37 @@ void ue_cfg_apply_reconf_complete_updates(ue_cfg_t& ue_cfg
ue_cfg.uci_offset.I_offset_ri = phy_cfg.pusch_cfg_ded.beta_offset_ri_idx;
}
}
// Apply SRB updates
if (conn_recfg.rr_cfg_ded.srb_to_add_mod_list_present) {
for (const srb_to_add_mod_s& srb : conn_recfg.rr_cfg_ded.srb_to_add_mod_list) {
auto& bcfg = ue_cfg.ue_bearers[srb.srb_id];
switch (srb.srb_id) {
case 1:
bcfg = get_bearer_default_srb1_config();
break;
case 2:
bcfg = get_bearer_default_srb2_config();
break;
default:
srslte::logmap::get("RRC")->warning("Invalid SRB ID %d\n", (int)srb.srb_id);
bcfg = {};
}
bcfg.direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
if (srb.lc_ch_cfg_present and
srb.lc_ch_cfg.type().value == srb_to_add_mod_s::lc_ch_cfg_c_::types_opts::explicit_value and
srb.lc_ch_cfg.explicit_value().ul_specific_params_present) {
// NOTE: Use UL values for DL prioritization as well
auto& ul_params = srb.lc_ch_cfg.explicit_value().ul_specific_params;
bcfg.pbr = ul_params.prioritised_bit_rate.to_number();
bcfg.priority = ul_params.prio;
bcfg.bsd = ul_params.bucket_size_dur.to_number();
if (ul_params.lc_ch_group_present) {
bcfg.group = ul_params.lc_ch_group;
}
}
}
}
}
// Apply Scell configurations

@ -211,21 +211,6 @@ void security_cfg_handler::regenerate_keys_handover(uint32_t new_pci, uint32_t n
bearer_cfg_handler::bearer_cfg_handler(uint16_t rnti_, const rrc_cfg_t& cfg_) : rnti(rnti_), cfg(&cfg_) {}
void bearer_cfg_handler::add_srb(uint8_t srb_id)
{
if (srb_id > 2 or srb_id == 0) {
log_h->error("Invalid SRB id=%d\n", srb_id);
return;
}
// Set SRBtoAddMod
auto srb_it = srslte::add_rrc_obj_id(srbs_to_add, srb_id);
srb_it->lc_ch_cfg_present = true;
srb_it->lc_ch_cfg.set(srb_to_add_mod_s::lc_ch_cfg_c_::types_opts::default_value);
srb_it->rlc_cfg_present = true;
srb_it->rlc_cfg.set(srb_to_add_mod_s::rlc_cfg_c_::types_opts::default_value);
}
int bearer_cfg_handler::add_erab(uint8_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos,
const asn1::bounded_bitstring<1, 160, true, true>& addr,
@ -309,18 +294,15 @@ void bearer_cfg_handler::release_erabs()
void bearer_cfg_handler::reest_bearers()
{
// Re-add all SRBs/DRBs
srbs_to_add = current_srbs;
drbs_to_add = current_drbs;
}
void bearer_cfg_handler::rr_ded_cfg_complete()
{
// Apply changes in internal bearer_handler DRB/SRBtoAddModLists
srslte::apply_addmodlist_diff(current_srbs, srbs_to_add, current_srbs);
srslte::apply_addmodremlist_diff(current_drbs, drbs_to_add, drbs_to_release, current_drbs);
// Reset DRBs/SRBs to Add/mod/release
srbs_to_add = {};
drbs_to_add = {};
drbs_to_release.resize(0);
}
@ -328,8 +310,6 @@ void bearer_cfg_handler::rr_ded_cfg_complete()
bool bearer_cfg_handler::fill_rr_cfg_ded(asn1::rrc::rr_cfg_ded_s& msg)
{
// Add altered bearers to message
msg.srb_to_add_mod_list_present = srbs_to_add.size() > 0;
msg.srb_to_add_mod_list = srbs_to_add;
msg.drb_to_add_mod_list_present = drbs_to_add.size() > 0;
msg.drb_to_add_mod_list = drbs_to_add;
msg.drb_to_release_list_present = drbs_to_release.size() > 0;

@ -1155,13 +1155,15 @@ void rrc::ue::rrc_mobility::handle_ho_req(idle_st& s, const ho_req_rx_ev& ho_req
/* Configure remaining layers based on pending changes */
// Update RLC + PDCP SRBs (no DRBs until MME Status Transfer)
rrc_ue->apply_pdcp_srb_updates();
rrc_ue->apply_rlc_rb_updates();
rrc_ue->apply_pdcp_srb_updates(recfg_r8.rr_cfg_ded);
rrc_ue->apply_rlc_rb_updates(recfg_r8.rr_cfg_ded);
// Update MAC
rrc_ue->mac_ctrl->handle_target_enb_ho_cmd(recfg_r8);
// Apply PHY updates
rrc_ue->apply_reconf_phy_config(recfg_r8, true);
apply_rr_cfg_ded_diff(rrc_ue->current_rr_cfg, recfg_r8.rr_cfg_ded);
/* send S1AP HandoverRequestAcknowledge */
std::vector<asn1::fixed_octstring<4, true> > admitted_erabs;
for (auto& erab : rrc_ue->bearer_list.get_erabs()) {
@ -1177,16 +1179,8 @@ void rrc::ue::rrc_mobility::handle_ho_req(idle_st& s, const ho_req_rx_ev& ho_req
bool rrc::ue::rrc_mobility::apply_ho_prep_cfg(const ho_prep_info_r8_ies_s& ho_prep,
const asn1::s1ap::ho_request_s& ho_req_msg)
{
const cell_ctxt_dedicated* target_cell = rrc_ue->cell_ded_list.get_ue_cc_idx(UE_PCELL_CC_IDX);
const cell_cfg_t& target_cell_cfg = target_cell->cell_common->cell_cfg;
const asn1::rrc::rr_cfg_ded_s& src_rr_cfg = ho_prep.as_cfg.source_rr_cfg;
// Establish SRBs
if (src_rr_cfg.srb_to_add_mod_list_present) {
for (auto& srb : src_rr_cfg.srb_to_add_mod_list) {
rrc_ue->bearer_list.add_srb(srb.srb_id);
}
}
const cell_ctxt_dedicated* target_cell = rrc_ue->cell_ded_list.get_ue_cc_idx(UE_PCELL_CC_IDX);
const cell_cfg_t& target_cell_cfg = target_cell->cell_common->cell_cfg;
// Establish ERABs/DRBs
for (const auto& erab_item : ho_req_msg.protocol_ies.erab_to_be_setup_list_ho_req.value) {
@ -1262,7 +1256,7 @@ void rrc::ue::rrc_mobility::handle_recfg_complete(wait_recfg_comp& s, const recf
void rrc::ue::rrc_mobility::handle_status_transfer(s1_target_ho_st& s, const status_transfer_ev& erabs)
{
// Establish DRBs
rrc_ue->apply_pdcp_drb_updates();
rrc_ue->apply_pdcp_drb_updates(rrc_ue->current_rr_cfg);
// Set DRBs SNs
for (const auto& erab : erabs) {
@ -1337,15 +1331,18 @@ void rrc::ue::rrc_mobility::intraenb_ho_st::enter(rrc_mobility* f, const ho_meas
/* Prepare RRC Reconf Message with mobility info */
dl_dcch_msg_s dl_dcch_msg;
f->fill_mobility_reconf_common(dl_dcch_msg, *target_cell, source_cell->cell_cfg.dl_earfcn);
rrc_conn_recfg_r8_ies_s& reconf_r8 = dl_dcch_msg.msg.c1().rrc_conn_recfg().crit_exts.c1().rrc_conn_recfg_r8();
// Apply changes to the MAC scheduler
f->rrc_ue->mac_ctrl->handle_intraenb_ho_cmd(dl_dcch_msg.msg.c1().rrc_conn_recfg().crit_exts.c1().rrc_conn_recfg_r8());
f->rrc_ue->mac_ctrl->handle_intraenb_ho_cmd(reconf_r8);
// Send DL-DCCH Message via current PCell
if (not f->rrc_ue->send_dl_dcch(&dl_dcch_msg)) {
f->trigger(srslte::failure_ev{});
return;
}
apply_rr_cfg_ded_diff(f->rrc_ue->current_rr_cfg, reconf_r8.rr_cfg_ded);
}
void rrc::ue::rrc_mobility::handle_crnti_ce(intraenb_ho_st& s, const user_crnti_upd_ev& ev)
@ -1367,8 +1364,8 @@ void rrc::ue::rrc_mobility::handle_crnti_ce(intraenb_ho_st& s, const user_crnti_
rrc_ue->ue_security_cfg.regenerate_keys_handover(s.target_cell->cell_cfg.pci, s.target_cell->cell_cfg.dl_earfcn);
rrc_ue->bearer_list.reest_bearers();
rrc_ue->apply_pdcp_srb_updates();
rrc_ue->apply_pdcp_drb_updates();
rrc_ue->apply_pdcp_srb_updates(rrc_ue->current_rr_cfg);
rrc_ue->apply_pdcp_drb_updates(rrc_ue->current_rr_cfg);
} else {
rrc_log->info("Received duplicate C-RNTI CE during rnti=0x%x handover.\n", rrc_ue->rnti);
}

@ -249,9 +249,6 @@ void rrc::ue::handle_rrc_con_req(rrc_conn_request_s* msg)
void rrc::ue::send_connection_setup()
{
// (Re-)Establish SRB1
bearer_list.add_srb(1);
dl_ccch_msg_s dl_ccch_msg;
dl_ccch_msg.msg.set_c1();
@ -267,9 +264,9 @@ void rrc::ue::send_connection_setup()
mac_ctrl->handle_con_setup(setup_r8);
// Add SRBs/DRBs, and configure RLC+PDCP
apply_pdcp_srb_updates();
apply_pdcp_drb_updates();
apply_rlc_rb_updates();
apply_pdcp_srb_updates(setup_r8.rr_cfg_ded);
apply_pdcp_drb_updates(setup_r8.rr_cfg_ded);
apply_rlc_rb_updates(setup_r8.rr_cfg_ded);
// Configure PHY layer
apply_setup_phy_config_dedicated(rr_cfg.phys_cfg_ded); // It assumes SCell has not been set before
@ -368,8 +365,8 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg)
old_reest_pdcp_state[lcid].next_pdcp_rx_sn,
old_reest_pdcp_state[lcid].last_submitted_pdcp_rx_sn);
}
// Apply PDCP configuration to SRB1
apply_pdcp_srb_updates();
// // Apply PDCP configuration to SRB1
// apply_pdcp_srb_updates(setup_r8.rr_cfg_ded);
// Make sure UE capabilities are copied over to new RNTI
eutra_capabilities = parent->users[old_rnti]->eutra_capabilities;
@ -395,9 +392,6 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg)
void rrc::ue::send_connection_reest(uint8_t ncc)
{
// Re-Establish SRB1
bearer_list.add_srb(1);
dl_ccch_msg_s dl_ccch_msg;
auto& reest = dl_ccch_msg.msg.set_c1().set_rrc_conn_reest();
reest.rrc_transaction_id = (uint8_t)((transaction_id++) % 4);
@ -414,9 +408,9 @@ void rrc::ue::send_connection_reest(uint8_t ncc)
mac_ctrl->handle_con_reest(reest_r8);
// Add SRBs/DRBs, and configure RLC+PDCP
apply_pdcp_srb_updates();
apply_pdcp_drb_updates();
apply_rlc_rb_updates();
apply_pdcp_srb_updates(rr_cfg);
apply_pdcp_drb_updates(rr_cfg);
apply_rlc_rb_updates(rr_cfg);
// Configure PHY layer
apply_setup_phy_config_dedicated(rr_cfg.phys_cfg_ded); // It assumes SCell has not been set before
@ -479,8 +473,6 @@ void rrc::ue::send_connection_reest_rej()
void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
{
parent->rrc_log->debug("RRC state %d\n", state);
// Setup SRB2
bearer_list.add_srb(2);
dl_dcch_msg_s dl_dcch_msg;
rrc_conn_recfg_s& recfg = dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg();
@ -506,9 +498,9 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
apply_reconf_phy_config(recfg_r8, true);
// setup SRB2/DRBs in PDCP and RLC
apply_pdcp_srb_updates();
apply_pdcp_drb_updates();
apply_rlc_rb_updates();
apply_pdcp_srb_updates(recfg_r8.rr_cfg_ded);
apply_pdcp_drb_updates(recfg_r8.rr_cfg_ded);
apply_rlc_rb_updates(recfg_r8.rr_cfg_ded);
// Add pending NAS info
bearer_list.fill_pending_nas_info(&recfg_r8);
@ -615,9 +607,9 @@ void rrc::ue::send_connection_reconf_new_bearer()
conn_reconf->rr_cfg_ded_present = bearer_list.fill_rr_cfg_ded(conn_reconf->rr_cfg_ded);
// Setup new bearer
apply_pdcp_srb_updates();
apply_pdcp_drb_updates();
apply_rlc_rb_updates();
apply_pdcp_srb_updates(conn_reconf->rr_cfg_ded);
apply_pdcp_drb_updates(conn_reconf->rr_cfg_ded);
apply_rlc_rb_updates(conn_reconf->rr_cfg_ded);
// Add pending NAS info
bearer_list.fill_pending_nas_info(conn_reconf);
@ -1301,9 +1293,9 @@ void rrc::ue::apply_reconf_phy_config(const rrc_conn_recfg_r8_ies_s& reconfig_r8
}
}
void rrc::ue::apply_pdcp_srb_updates()
void rrc::ue::apply_pdcp_srb_updates(const rr_cfg_ded_s& pending_rr_cfg)
{
for (const srb_to_add_mod_s& srb : bearer_list.get_pending_addmod_srbs()) {
for (const srb_to_add_mod_s& srb : pending_rr_cfg.srb_to_add_mod_list) {
parent->pdcp->add_bearer(rnti, srb.srb_id, srslte::make_srb_pdcp_config_t(srb.srb_id, false));
// For SRB2, enable security/encryption/integrity
@ -1315,12 +1307,12 @@ void rrc::ue::apply_pdcp_srb_updates()
}
}
void rrc::ue::apply_pdcp_drb_updates()
void rrc::ue::apply_pdcp_drb_updates(const rr_cfg_ded_s& pending_rr_cfg)
{
for (uint8_t drb_id : bearer_list.get_pending_rem_drbs()) {
for (uint8_t drb_id : pending_rr_cfg.drb_to_release_list) {
parent->pdcp->del_bearer(rnti, drb_id + 2);
}
for (const drb_to_add_mod_s& drb : bearer_list.get_pending_addmod_drbs()) {
for (const drb_to_add_mod_s& drb : pending_rr_cfg.drb_to_add_mod_list) {
// Configure DRB1 in PDCP
if (drb.pdcp_cfg_present) {
srslte::pdcp_config_t pdcp_cnfg_drb = srslte::make_drb_pdcp_config_t(drb.drb_id, false, drb.pdcp_cfg);
@ -1338,15 +1330,15 @@ void rrc::ue::apply_pdcp_drb_updates()
}
}
void rrc::ue::apply_rlc_rb_updates()
void rrc::ue::apply_rlc_rb_updates(const rr_cfg_ded_s& pending_rr_cfg)
{
for (const srb_to_add_mod_s& srb : bearer_list.get_pending_addmod_srbs()) {
for (const srb_to_add_mod_s& srb : pending_rr_cfg.srb_to_add_mod_list) {
parent->rlc->add_bearer(rnti, srb.srb_id, srslte::rlc_config_t::srb_config(srb.srb_id));
}
if (bearer_list.get_pending_rem_drbs().size() > 0) {
if (pending_rr_cfg.drb_to_release_list.size() > 0) {
parent->rrc_log->error("Removing DRBs not currently supported\n");
}
for (const drb_to_add_mod_s& drb : bearer_list.get_pending_addmod_drbs()) {
for (const drb_to_add_mod_s& drb : pending_rr_cfg.drb_to_add_mod_list) {
if (not drb.rlc_cfg_present) {
parent->rrc_log->warning("Default RLC DRB config not supported\n");
}

Loading…
Cancel
Save