Commit f326c15d authored by Chieh-Chun Chen's avatar Chieh-Chun Chen

Add default slice sst 0 sd 0 for SRB

Note: assume default slice nssai is sst 0 and sd 0, which is reserved for SRB. it needs to be assigned to sched_ctrl before gnb created slice from RC control message in order to be able associated to the corresponding slice
parent 88daeb39
......@@ -3033,6 +3033,10 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE)
LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for SRB: %ld\n", default_nssai->sst, default_nssai->sd, lcid);
dl->add_UE(dl->slices, UE);
} else {
nssai_t nssai = {.sst = 0, .sd = 0};
UE->UE_sched_ctrl.dl_lc_nssai[lcid] = nssai;
LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for SRB: %ld\n", UE->UE_sched_ctrl.dl_lc_nssai[lcid].sst, UE->UE_sched_ctrl.dl_lc_nssai[lcid].sd, lcid);
}
/* activate SRB0 */
......
......@@ -253,8 +253,11 @@ static void set_nssaiConfig(const int srb_len,
if (dl->slices) {
nssai_t *default_nssai = &dl->slices->s[0]->nssai;
sched_ctrl->dl_lc_nssai[lcid] = *default_nssai;
LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for SRB: %ld\n", default_nssai->sst, default_nssai->sd, srb->srb_id);
} else {
nssai_t nssai = {.sst = 0, .sd = 0};
sched_ctrl->dl_lc_nssai[lcid] = nssai;
}
LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for SRB: %ld\n", sched_ctrl->dl_lc_nssai[lcid].sst, sched_ctrl->dl_lc_nssai[lcid].sd, srb->srb_id);
}
for (int i = 0; i < drb_len; i++) {
......
......@@ -96,6 +96,7 @@ void nr_slicing_add_UE(nr_slice_info_t *si, NR_UE_info_t *new_ue)
for (int l = 0; l < sched_ctrl->dl_lc_num; ++l) {
lcid = sched_ctrl->dl_lc_ids[l];
LOG_D(NR_MAC, "l %d, lcid %ld, sst %d, sd %d\n", l, lcid, sched_ctrl->dl_lc_nssai[lcid].sst, sched_ctrl->dl_lc_nssai[lcid].sd);
LOG_D(NR_MAC, "slice %d, sst %d, sd %d\n", i, si->s[i]->nssai.sst, si->s[i]->nssai.sd);
if (nssai_matches(sched_ctrl->dl_lc_nssai[lcid], si->s[i]->nssai.sst, &si->s[i]->nssai.sd)) {
add_nr_list(&new_ue->UE_sched_ctrl.sliceInfo[i].lcid, lcid);
matched_ue = true;
......@@ -110,10 +111,10 @@ void nr_slicing_add_UE(nr_slice_info_t *si, NR_UE_info_t *new_ue)
} else {
LOG_E(NR_MAC, "cannot add new UE rnti 0x%04x to slice idx %d, num_UEs %d\n", new_ue->rnti, i, si->s[i]->num_UEs);
}
LOG_W(NR_MAC, "Matched UE, Add UE rnti 0x%04x to slice idx %d, sst %d, sd %d\n",
LOG_W(NR_MAC, "Matched slice, Add UE rnti 0x%04x to slice idx %d, sst %d, sd %d\n",
new_ue->rnti, i, si->s[i]->nssai.sst, si->s[i]->nssai.sd);
} else {
LOG_W(NR_MAC, "cannot find matched UE, do nothing for UE rnti 0x%04x\n", new_ue->rnti);
LOG_W(NR_MAC, "cannot find matched slice, do nothing for UE rnti 0x%04x\n", new_ue->rnti);
}
}
}
......@@ -556,19 +557,16 @@ nr_pp_impl_param_dl_t nvs_nr_dl_init(module_id_t mod_id)
/* insert default slice, all resources */
nvs_nr_slice_param_t *dlp = malloc(sizeof(nvs_nr_slice_param_t));
DevAssert(dlp);
NR_UEs_t *UE_info = &RC.nrmac[mod_id]->UE_info;
int num_ue = 0;
UE_iterator(UE_info->list, UE) {
num_ue += 1;
}
dlp->type = NVS_RES;
dlp->pct_reserved = 0.05f*num_ue;
// we reserved 5% resource for RRC connection while UE is connecting before created slice or
// PDU setup while UE is trying to connect after created slice
dlp->pct_reserved = 0.05f;
nr_dl_sched_algo_t *algo = &RC.nrmac[mod_id]->pre_processor_dl.dl_algo;
algo->data = NULL;
// default slice: sst = 1, sd = 0x000000, id = 999, label = default
nssai_t nssai = {.sst = 1, .sd = 0};
nssai_t nssai = {.sst = 0, .sd = 0};
const int rc = addmod_nvs_nr_slice_dl(si, 99, nssai, strdup("default"), algo, dlp);
LOG_W(NR_MAC, "Add default DL slice id 999, label default, sst %d, sd %d, slice sched algo NVS_CAPACITY, pct_reserved %.2f, ue sched algo %s\n", nssai.sst, nssai.sd, dlp->pct_reserved, algo->name);
LOG_W(NR_MAC, "Add default DL slice id 99, label default, sst %d, sd %d, slice sched algo NVS_CAPACITY, pct_reserved %.2f, ue sched algo %s\n", nssai.sst, nssai.sd, dlp->pct_reserved, algo->name);
DevAssert(0 == rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment