more efficient measObjToAddModList reconfiguration by ensuring consistency in EARFCN ordering

master
Francisco 4 years ago committed by Andre Puschmann
parent 68d463b08f
commit 92c1c2a182

@ -68,10 +68,20 @@ bool compute_diff_meascfg(const asn1::rrc::meas_cfg_s& current_meascfg,
bool fill_meascfg_enb_cfg(asn1::rrc::meas_cfg_s& meascfg, const cell_ctxt_dedicated_list& ue_cell_list);
bool apply_meascfg_updates(asn1::rrc::meas_cfg_s& meascfg,
asn1::rrc::meas_cfg_s& current_meascfg,
/**
* Computes diff measConfig based on the previous measConfig and the UE current cells
* @param diff_meascfg resulting configuration to be added to the RRCConnectionReconf message
* @param prev_meascfg measConfig sent in the last RRCConnectionReconfiguration to the UE
* @param ue_cell_list contains the final list of cells configured in the UE after the Reconf procedure
* @param prev_earfcn DL earfcn of Pcell in the last RRCReconf message
* @param prev_pci pci of PCell in the last RRCReconf message
* @return true if updates exist that have been registered in diff_meascfg
*/
bool apply_meascfg_updates(asn1::rrc::meas_cfg_s& diff_meascfg,
asn1::rrc::meas_cfg_s& prev_meascfg,
const cell_ctxt_dedicated_list& ue_cell_list,
int prev_pci = -1);
int prev_earfcn = -1,
int prev_pci = -1);
} // namespace srsenb

@ -473,8 +473,8 @@ void rrc::ue::rrc_mobility::fill_mobility_reconf_common(asn1::rrc::dl_dcch_msg_s
intralte.next_hop_chaining_count = rrc_ue->ue_security_cfg.get_ncc();
// Add MeasConfig of target cell
recfg_r8.meas_cfg_present =
apply_meascfg_updates(recfg_r8.meas_cfg, rrc_ue->current_ue_cfg.meas_cfg, rrc_ue->cell_ded_list, src_pci);
recfg_r8.meas_cfg_present = apply_meascfg_updates(
recfg_r8.meas_cfg, rrc_ue->current_ue_cfg.meas_cfg, rrc_ue->cell_ded_list, src_dl_earfcn, src_pci);
apply_reconf_updates(recfg_r8,
rrc_ue->current_ue_cfg,

@ -338,9 +338,18 @@ bool fill_meascfg_enb_cfg(meas_cfg_s& meascfg, const cell_ctxt_dedicated_list& u
const auto& pcell_meascfg = pcell_cfg->cell_cfg.meas_cfg;
// Add PCell+Scells to measObjToAddModList
// NOTE: sort by EARFCN to avoid unnecessary reconfigurations of measObjToAddModList
std::vector<const cell_ctxt_dedicated*> sorted_ue_cells(ue_cell_list.nof_cells());
for (uint32_t ue_cc_idx = 0; ue_cc_idx < ue_cell_list.nof_cells(); ++ue_cc_idx) {
const auto* cell = ue_cell_list.get_ue_cc_idx(ue_cc_idx);
add_meas_obj(meascfg.meas_obj_to_add_mod_list, cell->get_dl_earfcn());
sorted_ue_cells[ue_cc_idx] = ue_cell_list.get_ue_cc_idx(ue_cc_idx);
}
std::sort(sorted_ue_cells.begin(),
sorted_ue_cells.end(),
[](const cell_ctxt_dedicated* cc1, const cell_ctxt_dedicated* cc2) {
return cc1->get_dl_earfcn() < cc2->get_dl_earfcn();
});
for (auto* cc : sorted_ue_cells) {
add_meas_obj(meascfg.meas_obj_to_add_mod_list, cc->get_dl_earfcn());
}
// Inserts all cells in meas_cell_list that are not PCell or SCells
@ -403,23 +412,21 @@ bool compute_diff_meascfg(const meas_cfg_s& current_meascfg, const meas_cfg_s& t
bool apply_meascfg_updates(meas_cfg_s& meascfg,
meas_cfg_s& current_meascfg,
const cell_ctxt_dedicated_list& ue_cell_list,
int prev_earfcn,
int prev_pci)
{
meascfg = {};
const cell_ctxt_dedicated* pcell = ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX);
uint32_t prev_earfcn = 0, target_earfcn = pcell->get_dl_earfcn();
if (current_meascfg.meas_obj_to_add_mod_list_present) {
prev_earfcn = get_earfcn(current_meascfg.meas_obj_to_add_mod_list[0]);
}
const cell_ctxt_dedicated* pcell = ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX);
uint32_t target_earfcn = pcell->get_dl_earfcn();
if (static_cast<uint32_t>(prev_pci) == pcell->get_pci() and prev_earfcn == target_earfcn) {
if (static_cast<uint32_t>(prev_pci) == pcell->get_pci() and static_cast<uint32_t>(prev_earfcn) == target_earfcn) {
// Shortcut: No PCell change -> no measConfig updates
return false;
}
// Apply TS 36.331 5.5.6.1 - If Source and Target eNB EARFCNs do no match, update SourceMeasCfg.MeasIdList
if (prev_earfcn != target_earfcn) {
if ((uint32_t)prev_earfcn != target_earfcn) {
meas_obj_t* found_target_obj = find_meas_obj(current_meascfg.meas_obj_to_add_mod_list, target_earfcn);
meas_obj_t* found_src_obj = prev_earfcn != 0 ? &current_meascfg.meas_obj_to_add_mod_list[0] : nullptr;
if (found_target_obj != nullptr and found_src_obj != nullptr) {

@ -24,6 +24,7 @@
#include "srslte/common/test_common.h"
#include "srslte/interfaces/enb_rrc_interface_types.h"
#include "test_helpers.h"
#include "srslte/rrc/rrc_cfg_utils.h"
using namespace asn1::rrc;
@ -279,6 +280,54 @@ int test_correct_meascfg_calculation()
return SRSLTE_SUCCESS;
}
int test_minimize_meascfg_reordering()
{
rrc_cfg_t default_cfg, cfg1;
srsenb::all_args_t all_args;
TESTASSERT(test_helpers::parse_default_cfg(&default_cfg, all_args) == SRSLTE_SUCCESS);
cfg1 = default_cfg;
cfg1.enb_id = 0x19B;
cfg1.cell.nof_prb = 6;
cfg1.meas_cfg_present = true;
cfg1.cell_list.resize(2);
cfg1.cell_list[0].dl_earfcn = 2850;
cfg1.cell_list[0].cell_id = 0x01;
cfg1.cell_list[0].scell_list.resize(1);
cfg1.cell_list[0].scell_list[0].cell_id = 0x02;
cfg1.cell_list[0].meas_cfg.meas_cells.resize(1);
cfg1.cell_list[0].meas_cfg.meas_cells[0] = generate_cell1();
cfg1.cell_list[0].meas_cfg.meas_cells[0].pci = 3;
cfg1.cell_list[1].dl_earfcn = 3400;
cfg1.cell_list[1].cell_id = 0x02;
cell_info_common_list cell_list{cfg1};
TESTASSERT(cell_list.nof_cells() == 2);
TESTASSERT(cell_list.get_cc_idx(0)->scells.size() == 1);
TESTASSERT(cell_list.get_cc_idx(0)->scells[0] == cell_list.get_cc_idx(1));
TESTASSERT(cell_list.get_cc_idx(1)->scells.empty());
freq_res_common_list freq_res{cfg1};
cell_ctxt_dedicated_list ue_cell_list1{cfg1, freq_res, cell_list};
cell_ctxt_dedicated_list ue_cell_list2{cfg1, freq_res, cell_list};
meas_cfg_s mcfg1{}, mcfg2{};
ue_cell_list1.set_cells({0, 1});
ue_cell_list2.set_cells({1, 0});
TESTASSERT(fill_meascfg_enb_cfg(mcfg1, ue_cell_list1));
TESTASSERT(fill_meascfg_enb_cfg(mcfg2, ue_cell_list2));
// TEST1: Ensure consistent order of measObjects based on DL-EARFCN
TESTASSERT(mcfg1.meas_obj_to_add_mod_list_present and mcfg2.meas_obj_to_add_mod_list_present);
TESTASSERT(mcfg1.meas_obj_to_add_mod_list.size() == mcfg2.meas_obj_to_add_mod_list.size());
TESTASSERT(get_earfcn(mcfg1.meas_obj_to_add_mod_list[0]) == get_earfcn(mcfg2.meas_obj_to_add_mod_list[0]));
TESTASSERT(get_earfcn(mcfg1.meas_obj_to_add_mod_list[1]) == get_earfcn(mcfg2.meas_obj_to_add_mod_list[1]));
TESTASSERT(std::is_sorted(
mcfg1.meas_obj_to_add_mod_list.begin(), mcfg1.meas_obj_to_add_mod_list.end(), srslte::rrc_obj_id_cmp{}));
TESTASSERT(std::is_sorted(
mcfg2.meas_obj_to_add_mod_list.begin(), mcfg2.meas_obj_to_add_mod_list.end(), srslte::rrc_obj_id_cmp{}));
return SRSLTE_SUCCESS;
}
} // namespace srsenb
int main(int argc, char** argv)
@ -292,6 +341,7 @@ int main(int argc, char** argv)
argparse::parse_args(argc, argv);
TESTASSERT(test_correct_meascfg_insertion() == 0);
TESTASSERT(test_correct_meascfg_calculation() == 0);
TESTASSERT(test_minimize_meascfg_reordering() == 0);
srslte::console("Success\n");
return 0;

Loading…
Cancel
Save