diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 98978553e6..40ea781ba6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -52,8 +52,6 @@ #include "executables/softmodem-common.h" #include -#include "common/utils/alg/find.h" - extern RAN_CONTEXT_t RC; //extern int l2_init_gNB(void); extern uint8_t nfapi_mode; @@ -268,38 +266,6 @@ nfapi_nr_pm_list_t init_DL_MIMO_codebook(gNB_MAC_INST *gNB, nr_pdsch_AntennaPort return mat; } -static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list, - struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list, - NR_UE_sched_ctrl_t *sched_ctrl) -{ - if (rlc_bearer2release_list) { - for (int i = 0; i < rlc_bearer2release_list->list.count; i++) { - nr_lc_config_t c = {.lcid = *rlc_bearer2release_list->list.array[i]}; - elm_arr_t elm = find_if(&sched_ctrl->lc_config, &c, eq_lcid_config); - if (elm.found) - seq_arr_erase(&sched_ctrl->lc_config, elm.it); - else - LOG_E(NR_MAC, "could not remove rlc bearer: could not find bearer with ID %d\n", c.lcid); - } - } - - if (rlc_bearer2add_list) { - // keep lcids - for (int i = 0; i < rlc_bearer2add_list->list.count; i++) { - nr_lc_config_t c = {.lcid = rlc_bearer2add_list->list.array[i]->logicalChannelIdentity}; - elm_arr_t elm = find_if(&sched_ctrl->lc_config, &c, eq_lcid_config); - if (!elm.found) { - LOG_D(NR_MAC, "Adding LCID %d (%s %d)\n", c.lcid, c.lcid < 4 ? "SRB" : "DRB", c.lcid); - seq_arr_push_back(&sched_ctrl->lc_config, &c, sizeof(c)); - } else { - LOG_W(NR_MAC, "cannot add LCID %d: already present\n", c.lcid); - } - } - } - - LOG_D(NR_MAC, "total num of active bearers %ld\n", seq_arr_size(&sched_ctrl->lc_config)); -} - void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_info_t *UE) { /* we assume that this function is mutex-protected from outside */ @@ -321,7 +287,6 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_info_t *UE) && CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra) { nr_mac_prepare_ra_ue(RC.nrmac[0], UE->rnti, CellGroup); } - process_rlcBearerConfig(CellGroup->rlc_BearerToAddModList, CellGroup->rlc_BearerToReleaseList, &UE->UE_sched_ctrl); } static void config_common(gNB_MAC_INST *nrmac, nr_pdsch_AntennaPorts_t pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) @@ -743,6 +708,8 @@ void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_ bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup) { + /* ideally, instead of this function, "users" of this function should call + * the ue context setup request function in mac_rrc_dl_handler.c */ DevAssert(nrmac != NULL); DevAssert(CellGroup != NULL); DevAssert(get_softmodem_params()->phy_test); @@ -755,6 +722,8 @@ bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t } else { LOG_E(NR_MAC,"Error adding UE %04x\n", rnti); } + process_addmod_bearers_cellGroupConfig(&UE->UE_sched_ctrl, CellGroup->rlc_BearerToAddModList); + AssertFatal(CellGroup->rlc_BearerToReleaseList == NULL, "cannot release bearers while adding new UEs\n"); NR_SCHED_UNLOCK(&nrmac->sched_lock); return UE != NULL; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d26f8a6a4d..a2d55580dd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -59,6 +59,8 @@ #include "common/ran_context.h" #include "nfapi/oai_integration/vendor_ext.h" +#include "common/utils/alg/find.h" + //#define DEBUG_DCI extern RAN_CONTEXT_t RC; @@ -3124,6 +3126,7 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE) NR_SCHED_ENSURE_LOCKED(&mac->sched_lock); /* create this UE's initial CellGroup */ int CC_id = 0; + int srb_id = 1; const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon; const NR_ServingCellConfig_t *sccd = mac->common_channels[CC_id].pre_ServingCellConfig; NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &mac->radio_config); @@ -3137,8 +3140,11 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE) /* the cellGroup sent to CU specifies there is SRB1, so create it */ DevAssert(cellGroupConfig->rlc_BearerToAddModList->list.count == 1); const NR_RLC_BearerConfig_t *bearer = cellGroupConfig->rlc_BearerToAddModList->list.array[0]; - DevAssert(bearer->servedRadioBearer->choice.srb_Identity == 1); + DevAssert(bearer->servedRadioBearer->choice.srb_Identity == srb_id); nr_rlc_add_srb(UE->rnti, bearer->servedRadioBearer->choice.srb_Identity, bearer); + + nr_lc_config_t c = {.lcid = bearer->logicalChannelIdentity}; + nr_mac_add_lcid(&UE->UE_sched_ctrl, &c); } void nr_mac_trigger_release_timer(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing) @@ -3215,6 +3221,23 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_ nrmac->mac_rrc.ue_context_modification_required(&required); } +/* \brief add bearers from CellGroupConfig. + * + * This is a kind of hack, as this should be processed through a F1 UE Context + * setup request, but some modes do not use that (NSA/do-ra/phy_test). */ +void process_addmod_bearers_cellGroupConfig(NR_UE_sched_ctrl_t *sched_ctrl, const struct NR_CellGroupConfig__rlc_BearerToAddModList *addmod) +{ + if (addmod == NULL) + return; /* nothing to do */ + + for (int i = 0; i < addmod->list.count; ++i) { + const NR_RLC_BearerConfig_t *conf = addmod->list.array[i]; + int lcid = conf->logicalChannelIdentity; + nr_lc_config_t c = {.lcid = lcid}; + nr_mac_add_lcid(sched_ctrl, &c); + } +} + long get_lcid_from_drbid(int drb_id) { return drb_id + 3; /* LCID is DRB + 3 */ @@ -3225,9 +3248,36 @@ long get_lcid_from_srbid(int srb_id) return srb_id; } -bool eq_lcid_config(const void *vval, const void *vit) +static bool eq_lcid_config(const void *vval, const void *vit) { const nr_lc_config_t *val = (const nr_lc_config_t *)vval; const nr_lc_config_t *it = (const nr_lc_config_t *)vit; return it->lcid == val->lcid; } + +bool nr_mac_add_lcid(NR_UE_sched_ctrl_t* sched_ctrl, const nr_lc_config_t *c) +{ + elm_arr_t elm = find_if(&sched_ctrl->lc_config, (void *) c, eq_lcid_config); + if (elm.found) { + LOG_I(NR_MAC, "cannot add LCID %d: already present, updating configuration\n", c->lcid); + nr_lc_config_t *exist = (nr_lc_config_t *)elm.it; + *exist = *c; + } else { + LOG_D(NR_MAC, "Add LCID %d\n", c->lcid); + seq_arr_push_back(&sched_ctrl->lc_config, (void*) c, sizeof(*c)); + } + return true; +} + +bool nr_mac_remove_lcid(NR_UE_sched_ctrl_t *sched_ctrl, long lcid) +{ + nr_lc_config_t c = {.lcid = lcid}; + elm_arr_t elm = find_if(&sched_ctrl->lc_config, &c, eq_lcid_config); + if (!elm.found) { + LOG_E(NR_MAC, "can not remove LC: no such LC with ID %ld\n", lcid); + return false; + } + + seq_arr_erase(&sched_ctrl->lc_config, elm.it); + return true; +} diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index fa3e8f9e15..027b8d763a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -780,7 +780,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, reset_ul_harq_list(UE_scheduling_control); nr_clear_ra_proc(ra); process_CellGroup(ra->CellGroup, UE); - + process_addmod_bearers_cellGroupConfig(&UE->UE_sched_ctrl, ra->CellGroup->rlc_BearerToAddModList); } else { LOG_A(NR_MAC, "[RAPROC] RA-Msg3 received (sdu_lenP %d)\n", sdu_lenP); LOG_D(NR_MAC, "[RAPROC] Received Msg3:\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index d0e47075b1..438bb9736f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -443,6 +443,10 @@ void nr_mac_check_ul_failure(const gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ct void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_t *UE); -bool eq_lcid_config(const void *vval, const void *vit); +void process_addmod_bearers_cellGroupConfig(NR_UE_sched_ctrl_t *sched_ctrl, + const struct NR_CellGroupConfig__rlc_BearerToAddModList *addmod); + +bool nr_mac_add_lcid(NR_UE_sched_ctrl_t *sched_ctrl, const nr_lc_config_t *c); +bool nr_mac_remove_lcid(NR_UE_sched_ctrl_t *sched_ctrl, long lcid); #endif /*__LAYER2_NR_MAC_PROTO_H__*/ diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index 492e90d575..ed2c270eea 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -28,7 +28,6 @@ #include "F1AP_CauseRadioNetwork.h" #include "openair3/ocp-gtpu/gtp_itf.h" #include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h" -#include "common/utils/alg/find.h" #include "uper_decoder.h" #include "uper_encoder.h" @@ -149,7 +148,7 @@ static NR_RLC_BearerConfig_t *get_bearerconfig_from_srb(const f1ap_srb_to_be_set return get_SRB_RLC_BearerConfig(get_lcid_from_srbid(srb->srb_id), priority, bucket); } -static int handle_ue_context_srbs_setup(int rnti, +static int handle_ue_context_srbs_setup(NR_UE_info_t *UE, int srbs_len, const f1ap_srb_to_be_setup_t *req_srbs, f1ap_srb_to_be_setup_t **resp_srbs, @@ -162,7 +161,10 @@ static int handle_ue_context_srbs_setup(int rnti, for (int i = 0; i < srbs_len; i++) { const f1ap_srb_to_be_setup_t *srb = &req_srbs[i]; NR_RLC_BearerConfig_t *rlc_BearerConfig = get_bearerconfig_from_srb(srb); - nr_rlc_add_srb(rnti, srb->srb_id, rlc_BearerConfig); + nr_rlc_add_srb(UE->rnti, srb->srb_id, rlc_BearerConfig); + + nr_lc_config_t c = {.lcid = rlc_BearerConfig->logicalChannelIdentity}; + nr_mac_add_lcid(&UE->UE_sched_ctrl, &c); (*resp_srbs)[i] = *srb; @@ -179,7 +181,35 @@ static NR_RLC_BearerConfig_t *get_bearerconfig_from_drb(const f1ap_drb_to_be_set return get_DRB_RLC_BearerConfig(get_lcid_from_drbid(drb->drb_id), drb->drb_id, rlc_conf, priority); } -static int handle_ue_context_drbs_setup(int rnti, +static int get_non_dynamic_priority(int fiveqi) +{ + for (int i = 0; i < sizeofArray(qos_fiveqi); ++i) + if (qos_fiveqi[i] == fiveqi) + return qos_priority[i]; + AssertFatal(false, "illegal 5QI value %d\n", fiveqi); + return 0; +} + +static NR_QoS_config_t get_qos_config(const f1ap_qos_characteristics_t *qos_char) +{ + NR_QoS_config_t qos_c = {0}; + switch (qos_char->qos_type) { + case dynamic: + qos_c.priority = qos_char->dynamic.qos_priority_level; + qos_c.fiveQI = qos_char->dynamic.fiveqi > 0 ? qos_char->dynamic.fiveqi : 0; + break; + case non_dynamic: + qos_c.fiveQI = qos_char->non_dynamic.fiveqi; + qos_c.priority = get_non_dynamic_priority(qos_char->non_dynamic.fiveqi); + break; + default: + AssertFatal(false, "illegal QoS type %d\n", qos_char->qos_type); + break; + } + return qos_c; +} + +static int handle_ue_context_drbs_setup(NR_UE_info_t *UE, int drbs_len, const f1ap_drb_to_be_setup_t *req_drbs, f1ap_drb_to_be_setup_t **resp_drbs, @@ -196,7 +226,12 @@ static int handle_ue_context_drbs_setup(int rnti, const f1ap_drb_to_be_setup_t *drb = &req_drbs[i]; f1ap_drb_to_be_setup_t *resp_drb = &(*resp_drbs)[i]; NR_RLC_BearerConfig_t *rlc_BearerConfig = get_bearerconfig_from_drb(drb); - nr_rlc_add_drb(rnti, drb->drb_id, rlc_BearerConfig); + nr_rlc_add_drb(UE->rnti, drb->drb_id, rlc_BearerConfig); + + nr_lc_config_t c = {.lcid = rlc_BearerConfig->logicalChannelIdentity, .nssai = drb->nssai}; + for (int q = 0; q < drb->drb_info.flows_to_be_setup_length; ++q) + c.qos_config[q] = get_qos_config(&drb->drb_info.flows_mapped_to_drb[q].qos_params.qos_characteristics); + nr_mac_add_lcid(&UE->UE_sched_ctrl, &c); *resp_drb = *drb; // just put same number of tunnels in DL as in UL @@ -207,7 +242,7 @@ static int handle_ue_context_drbs_setup(int rnti, int qfi = -1; // don't put PDU session marker in GTP gtpv1u_gnb_create_tunnel_resp_t resp_f1 = {0}; int ret = drb_gtpu_create(f1inst, - rnti, + UE->rnti, drb->drb_id, drb->drb_id, qfi, @@ -227,7 +262,7 @@ static int handle_ue_context_drbs_setup(int rnti, return drbs_len; } -static int handle_ue_context_drbs_release(int rnti, +static int handle_ue_context_drbs_release(NR_UE_info_t *UE, int drbs_len, const f1ap_drb_to_be_released_t *req_drbs, NR_CellGroupConfig_t *cellGroupConfig) @@ -252,9 +287,10 @@ static int handle_ue_context_drbs_release(int rnti, ++idx; } if (idx < cellGroupConfig->rlc_BearerToAddModList->list.count) { - nr_rlc_release_entity(rnti, lcid); + nr_mac_remove_lcid(&UE->UE_sched_ctrl, lcid); + nr_rlc_release_entity(UE->rnti, lcid); if (f1inst >= 0) - newGtpuDeleteOneTunnel(f1inst, rnti, drb->rb_id); + newGtpuDeleteOneTunnel(f1inst, UE->rnti, drb->rb_id); asn_sequence_del(&cellGroupConfig->rlc_BearerToAddModList->list, idx, 1); long *plcid = malloc(sizeof(*plcid)); AssertFatal(plcid, "out of memory\n"); @@ -314,62 +350,6 @@ NR_CellGroupConfig_t *clone_CellGroupConfig(const NR_CellGroupConfig_t *orig) 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) -{ - for (int i = 0; i < drb_len; i++) { - const f1ap_drb_to_be_setup_t *drb = &req_drbs[i]; - - nr_lc_config_t c = {.lcid = get_lcid_from_drbid(drb->drb_id)}; - elm_arr_t elm = find_if(&sched_ctrl->lc_config, &c, eq_lcid_config); - if (elm.found) { - nr_lc_config_t *c = (nr_lc_config_t *)elm.it; - c->nssai = drb->nssai; - LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for DRB: %ld\n", drb->nssai.sst, drb->nssai.sd, drb->drb_id); - } - } -} - -static void set_QoSConfig(const f1ap_ue_context_modif_req_t *req, NR_UE_sched_ctrl_t *sched_ctrl) -{ - AssertFatal(req != NULL, "f1ap_ue_context_modif_req is NULL\n"); - uint8_t drb_count = req->drbs_to_be_setup_length; - uint8_t srb_count = req->srbs_to_be_setup_length; - LOG_I(NR_MAC, "Number of DRBs = %d and SRBs = %d\n", drb_count, srb_count); - - /* DRBs*/ - for (int i = 0; i < drb_count; i++) { - f1ap_drb_to_be_setup_t *drb_p = &req->drbs_to_be_setup[i]; - uint8_t nb_qos_flows = drb_p->drb_info.flows_to_be_setup_length; - nr_lc_config_t c = {.lcid = get_lcid_from_drbid(drb_p->drb_id)}; - elm_arr_t elm = find_if(&sched_ctrl->lc_config, &c, eq_lcid_config); - DevAssert(elm.found); - nr_lc_config_t *lc_config = (nr_lc_config_t *) elm.it; - LOG_I(NR_MAC, "number of QOS flows mapped to LCID %d: %d\n", c.lcid, nb_qos_flows); - - for (int q = 0; q < nb_qos_flows; q++) { - f1ap_flows_mapped_to_drb_t *qos_flow = &drb_p->drb_info.flows_mapped_to_drb[q]; - - f1ap_qos_characteristics_t *qos_char = &qos_flow->qos_params.qos_characteristics; - uint64_t priority = qos_char->non_dynamic.qos_priority_level; - int64_t fiveqi = qos_char->non_dynamic.fiveqi; - if (qos_char->qos_type == dynamic) { - priority = qos_char->dynamic.qos_priority_level; - fiveqi = qos_char->dynamic.fiveqi > 0 ? qos_char->dynamic.fiveqi : 0; - } - if (qos_char->qos_type == non_dynamic) { - LOG_D(NR_MAC, "Qos Priority level is considered from the standarsdized 5QI to QoS mapping table\n"); - for (int id = 0; id < 26; id++) { - if (qos_fiveqi[id] == fiveqi) - priority = qos_priority[id]; - } - } - lc_config->qos_config[q].fiveQI = fiveqi; - lc_config->qos_config[q].priority = priority; - LOG_D(NR_MAC, "LC ID %d: 5QI %lu priority %lu\n", c.lcid, fiveqi, priority); - } - } -} - void ue_context_setup_request(const f1ap_ue_context_setup_t *req) { gNB_MAC_INST *mac = RC.nrmac[0]; @@ -396,7 +376,7 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req) NR_CellGroupConfig_t *new_CellGroup = clone_CellGroupConfig(UE->CellGroup); if (req->srbs_to_be_setup_length > 0) { - resp.srbs_to_be_setup_length = handle_ue_context_srbs_setup(req->gNB_DU_ue_id, + resp.srbs_to_be_setup_length = handle_ue_context_srbs_setup(UE, req->srbs_to_be_setup_length, req->srbs_to_be_setup, &resp.srbs_to_be_setup, @@ -404,7 +384,7 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req) } if (req->drbs_to_be_setup_length > 0) { - resp.drbs_to_be_setup_length = handle_ue_context_drbs_setup(req->gNB_DU_ue_id, + resp.drbs_to_be_setup_length = handle_ue_context_drbs_setup(UE, req->drbs_to_be_setup_length, req->drbs_to_be_setup, &resp.drbs_to_be_setup, @@ -434,12 +414,6 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req) nr_mac_prepare_cellgroup_update(mac, UE, new_CellGroup); - /* Fill the QoS config in MAC for each active DRB */ - set_QoSConfig(req, &UE->UE_sched_ctrl); - - /* 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); - NR_SCHED_UNLOCK(&mac->sched_lock); /* some sanity checks, since we use the same type for request and response */ @@ -484,7 +458,7 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req) NR_CellGroupConfig_t *new_CellGroup = clone_CellGroupConfig(UE->CellGroup); if (req->srbs_to_be_setup_length > 0) { - resp.srbs_to_be_setup_length = handle_ue_context_srbs_setup(req->gNB_DU_ue_id, + resp.srbs_to_be_setup_length = handle_ue_context_srbs_setup(UE, req->srbs_to_be_setup_length, req->srbs_to_be_setup, &resp.srbs_to_be_setup, @@ -492,7 +466,7 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req) } if (req->drbs_to_be_setup_length > 0) { - resp.drbs_to_be_setup_length = handle_ue_context_drbs_setup(req->gNB_DU_ue_id, + resp.drbs_to_be_setup_length = handle_ue_context_drbs_setup(UE, req->drbs_to_be_setup_length, req->drbs_to_be_setup, &resp.drbs_to_be_setup, @@ -501,7 +475,7 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req) if (req->drbs_to_be_released_length > 0) { resp.drbs_to_be_released_length = - handle_ue_context_drbs_release(req->gNB_DU_ue_id, req->drbs_to_be_released_length, req->drbs_to_be_released, new_CellGroup); + handle_ue_context_drbs_release(UE, req->drbs_to_be_released_length, req->drbs_to_be_released, new_CellGroup); } if (req->rrc_container != NULL) { @@ -538,12 +512,6 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req) resp.du_to_cu_rrc_information->cellGroupConfig_length = (enc_rval.encoded + 7) >> 3; nr_mac_prepare_cellgroup_update(mac, UE, new_CellGroup); - - /* Fill the QoS config in MAC for each active DRB */ - set_QoSConfig(req, &UE->UE_sched_ctrl); - - /* 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); } else { ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, new_CellGroup); // we actually don't need it } @@ -715,6 +683,10 @@ void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc) UE->uid = oldUE->uid; oldUE->uid = temp_uid; configure_UE_BWP(mac, scc, sched_ctrl, NULL, UE, -1, -1); + for (int i = 1; i < seq_arr_size(&oldUE->UE_sched_ctrl.lc_config); ++i) { + const nr_lc_config_t *c = seq_arr_at(&oldUE->UE_sched_ctrl.lc_config, i); + nr_mac_add_lcid(&UE->UE_sched_ctrl, c); + } nr_mac_prepare_cellgroup_update(mac, UE, oldUE->CellGroup); oldUE->CellGroup = NULL; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 4e001a035f..fd7728532c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -516,8 +516,8 @@ typedef struct NR_UE_ul_harq { } NR_UE_ul_harq_t; typedef struct NR_QoS_config_s { - uint64_t fiveQI; - uint64_t priority; + int fiveQI; + int priority; } NR_QoS_config_t; typedef struct nr_lc_config {