Commit 57c1600d authored by Sakthivel Velumani's avatar Sakthivel Velumani

Remove UE from slice list(to be squashed)

more fixes: add SRBs to default slice
parent 4584c3eb
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#define DEBUG_gNB_SCHEDULER 1 #define DEBUG_gNB_SCHEDULER 1
#include "common/ran_context.h" #include "common/ran_context.h"
#include "NR_MAC_gNB/slicing/nr_slicing.h"
//#define DEBUG_DCI //#define DEBUG_DCI
...@@ -2544,6 +2545,14 @@ void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti) ...@@ -2544,6 +2545,14 @@ void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti)
NR_SCHED_UNLOCK(&UE_info->mutex); NR_SCHED_UNLOCK(&UE_info->mutex);
delete_nr_ue_data(UE, nr_mac->common_channels, &UE_info->uid_allocator); delete_nr_ue_data(UE, nr_mac->common_channels, &UE_info->uid_allocator);
/* Dissociate UE from all corresponding slice*/
nr_pp_impl_param_dl_t *dl = &nr_mac->pre_processor_dl;
if (dl->slices) {
for (int i = 0; i < dl->slices->num; i++) {
dl->remove_UE(dl->slices, UE, i);
}
}
} }
uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) { uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
...@@ -3015,6 +3024,17 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE) ...@@ -3015,6 +3024,17 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE)
UE->CellGroup = cellGroupConfig; UE->CellGroup = cellGroupConfig;
process_CellGroup(cellGroupConfig, UE); process_CellGroup(cellGroupConfig, UE);
/* Assign SRB1 to default slice */
const long lcid = 1;
nr_pp_impl_param_dl_t *dl = &mac->pre_processor_dl;
if (dl->slices) {
nssai_t *default_nssai = &dl->slices->s[0]->nssai;
UE->UE_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, lcid);
dl->add_UE(dl->slices, UE);
}
/* activate SRB0 */ /* activate SRB0 */
nr_rlc_activate_srb0(UE->rnti, UE, send_initial_ul_rrc_message); nr_rlc_activate_srb0(UE->rnti, UE, send_initial_ul_rrc_message);
......
...@@ -238,8 +238,25 @@ static NR_CellGroupConfig_t *clone_CellGroupConfig(const NR_CellGroupConfig_t *o ...@@ -238,8 +238,25 @@ static NR_CellGroupConfig_t *clone_CellGroupConfig(const NR_CellGroupConfig_t *o
return cloned; return cloned;
} }
static void set_nssaiConfig(const int drb_len, const f1ap_drb_to_be_setup_t *req_drbs, NR_UE_sched_ctrl_t *sched_ctrl) static void set_nssaiConfig(const int srb_len,
const f1ap_srb_to_be_setup_t *req_srbs,
const int drb_len,
const f1ap_drb_to_be_setup_t *req_drbs,
NR_UE_sched_ctrl_t *sched_ctrl)
{ {
gNB_MAC_INST *mac = RC.nrmac[0];
for (int i = 0; i < srb_len; i++) {
const f1ap_srb_to_be_setup_t *srb = &req_srbs[i];
const long lcid = get_lcid_from_srbid(srb->srb_id);
/* consider first slice as default slice and assign it for SRBs */
nr_pp_impl_param_dl_t *dl = &mac->pre_processor_dl;
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);
}
}
for (int i = 0; i < drb_len; i++) { for (int i = 0; i < drb_len; i++) {
const f1ap_drb_to_be_setup_t *drb = &req_drbs[i]; const f1ap_drb_to_be_setup_t *drb = &req_drbs[i];
...@@ -362,7 +379,11 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req) ...@@ -362,7 +379,11 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req)
set_QoSConfig(req, &UE->UE_sched_ctrl); set_QoSConfig(req, &UE->UE_sched_ctrl);
/* Set NSSAI config in MAC for each active DRB */ /* Set NSSAI config in MAC for each active DRB */
set_nssaiConfig(req->drbs_to_be_setup_length, req->drbs_to_be_setup, &UE->UE_sched_ctrl); set_nssaiConfig(req->srbs_to_be_setup_length,
req->srbs_to_be_setup,
req->drbs_to_be_setup_length,
req->drbs_to_be_setup,
&UE->UE_sched_ctrl);
/* Associate UE to the corresponding slice*/ /* Associate UE to the corresponding slice*/
nr_pp_impl_param_dl_t *dl = &mac->pre_processor_dl; nr_pp_impl_param_dl_t *dl = &mac->pre_processor_dl;
...@@ -469,7 +490,11 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req) ...@@ -469,7 +490,11 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req)
set_QoSConfig(req, &UE->UE_sched_ctrl); set_QoSConfig(req, &UE->UE_sched_ctrl);
/* Set NSSAI config in MAC for each active DRB */ /* Set NSSAI config in MAC for each active DRB */
set_nssaiConfig(req->drbs_to_be_setup_length, req->drbs_to_be_setup, &UE->UE_sched_ctrl); set_nssaiConfig(req->srbs_to_be_setup_length,
req->srbs_to_be_setup,
req->drbs_to_be_setup_length,
req->drbs_to_be_setup,
&UE->UE_sched_ctrl);
/* Associate UE to the corresponding slice*/ /* Associate UE to the corresponding slice*/
nr_pp_impl_param_dl_t *dl = &mac->pre_processor_dl; nr_pp_impl_param_dl_t *dl = &mac->pre_processor_dl;
......
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