Commit 96dc2001 authored by Guido Casati's avatar Guido Casati

sdap: pass sdap_config_t through E1 QoS-flow remap

E1 DRB-To-Modify already carries the new QFI list. The old
nr_sdap_entity_update_qos_flows() duplicated that as a bare qfi[] plus other params
while map_update expects a full sdap_config_t (add/release lists and per-DRB
role). Route the E1 path through one struct instead.

Changes:
- nr_sdap_entity_update_qos_flows(): take sdap_config_t *, caller fills the struct,
  function sets role and defaultDRB from qfi2drb_table, builds mappedQFIs2Release
  for QFIs dropped from the DRB, then calls qfi2drb_map_update()
- cucp_cuup_handler.c: build stack sdap_config_t from E1 qosFlows[] and call
  the new API
Signed-off-by: default avatarGuido Casati <guido.casati@openairinterface.org>
parent 1edb0a09
...@@ -427,9 +427,15 @@ void e1_bearer_context_modif(const e1ap_bearer_mod_req_t *req) ...@@ -427,9 +427,15 @@ void e1_bearer_context_modif(const e1ap_bearer_mod_req_t *req)
DevAssert(to_modif->numQosFlowsMod <= E1AP_MAX_NUM_QOS_FLOWS); DevAssert(to_modif->numQosFlowsMod <= E1AP_MAX_NUM_QOS_FLOWS);
modified->numQosFlowSetup = to_modif->numQosFlowsMod; modified->numQosFlowSetup = to_modif->numQosFlowsMod;
uint8_t qfi_list[E1AP_MAX_NUM_QOS_FLOWS]; sdap_config_t sdap = {
.pdusession_id = req_pdu_mod->sessionId,
.drb_id = to_modif->id,
.mappedQFIs2AddCount = to_modif->numQosFlowsMod,
};
for (int q = 0; q < to_modif->numQosFlowsMod; q++) { for (int q = 0; q < to_modif->numQosFlowsMod; q++) {
modified->qosFlows[q].qfi = qfi_list[q] = to_modif->qosFlows[q].qfi; sdap.mappedQFIs2Add[q] = to_modif->qosFlows[q].qfi;
modified->qosFlows[q].qfi = to_modif->qosFlows[q].qfi;
} }
LOG_D(NR_RRC, LOG_D(NR_RRC,
...@@ -438,11 +444,7 @@ void e1_bearer_context_modif(const e1ap_bearer_mod_req_t *req) ...@@ -438,11 +444,7 @@ void e1_bearer_context_modif(const e1ap_bearer_mod_req_t *req)
req_pdu_mod->sessionId, req_pdu_mod->sessionId,
to_modif->id, to_modif->id,
to_modif->numQosFlowsMod); to_modif->numQosFlowsMod);
nr_sdap_entity_update_qos_flows(req->gNB_cu_up_ue_id, nr_sdap_entity_update_qos_flows(req->gNB_cu_up_ue_id, &sdap);
req_pdu_mod->sessionId,
to_modif->id,
qfi_list,
to_modif->numQosFlowsMod);
} }
if (to_modif->pdcp_config && to_modif->pdcp_config->pDCP_Reestablishment) { if (to_modif->pdcp_config && to_modif->pdcp_config->pDCP_Reestablishment) {
......
...@@ -681,54 +681,46 @@ void nr_sdap_release_drb(ue_id_t ue_id, int drb_id, int pdusession_id) ...@@ -681,54 +681,46 @@ void nr_sdap_release_drb(ue_id_t ue_id, int drb_id, int pdusession_id)
* On E1 Bearer Context Modification (CP to UP), Flow Mapping Information in DRB To Modify * On E1 Bearer Context Modification (CP to UP), Flow Mapping Information in DRB To Modify
* carries the QoS Flow QoS Parameters List for that DRB. Per TS 38.463, when present the * carries the QoS Flow QoS Parameters List for that DRB. Per TS 38.463, when present the
* CU-UP replaces the previous mapping for that DRB. * CU-UP replaces the previous mapping for that DRB.
* Remove every QFI currently mapped to the DRB that is absent from the list of QFIs to be mapped. * @param sdap mapped QoS flows to add */
* @param qfis[] list of QFIs to be mapped to the DRB void nr_sdap_entity_update_qos_flows(ue_id_t ue_id, sdap_config_t *sdap)
* @param n_qfis number of QFIs in the list
* @param drb_id the DRB ID to be mapped */
void nr_sdap_entity_update_qos_flows(ue_id_t ue_id, int pdusession_id, int drb_id, const uint8_t *qfis, int n_qfis)
{ {
nr_sdap_entity_t *entity = nr_sdap_get_entity(ue_id, pdusession_id); DevAssert(sdap);
nr_sdap_entity_t *entity = nr_sdap_get_entity(ue_id, sdap->pdusession_id);
if (!entity) { if (!entity) {
LOG_W(SDAP, "gNB SDAP: no entity for UE %lu PDU session %d when updating QoS flows for DRB %d\n", ue_id, pdusession_id, drb_id); LOG_W(SDAP, "No entity when updating QoS flows for DRB %d (pdu_session=%d)\n", sdap->drb_id, sdap->pdusession_id);
return; return;
} }
const qfi2drb_t *drb_map = nr_sdap_drb_lookup(entity, drb_id); const qfi2drb_t *drb_map = nr_sdap_drb_lookup(entity, sdap->drb_id);
if (!drb_map) { if (!drb_map) {
LOG_W(SDAP, "DRB %d: no qfi2drb_table entry, skip QoS-flow mapping update (pdu_session=%d)\n", drb_id, pdusession_id); LOG_E(SDAP, "DRB %d: no qfi2drb_table entry, skip QoS-flow mapping update (pdu_session=%d)\n", sdap->drb_id, sdap->pdusession_id);
return; return;
} }
sdap_config_t sdap = {.pdusession_id = pdusession_id, /* TS 38.331: sdap-HeaderUL/DL cannot change after DRB establishment */
.drb_id = drb_id, sdap->role = drb_map->entity_role;
.role = drb_map->entity_role, sdap->defaultDRB = (entity->default_drb.drb_id == sdap->drb_id);
.defaultDRB = (entity->default_drb.drb_id == drb_id),
.mappedQFIs2AddCount = n_qfis};
/* Build list of QFIs to be released */ /* TS 37.324 clause 5.3.1 mappedQoS-FlowsToRelease: QFIs on this DRB not in the new list */
for (int q = 0; q < SDAP_MAX_QFI; q++) { for (int q = 0; q < SDAP_MAX_QFI; q++) {
if (entity->qfi2drb_table[q].drb_id != drb_id) if (entity->qfi2drb_table[q].drb_id != sdap->drb_id)
continue; continue;
bool keep = false; bool keep = false;
for (int i = 0; i < n_qfis; i++) { for (int i = 0; i < sdap->mappedQFIs2AddCount; i++) {
if (qfis[i] == q) { if (sdap->mappedQFIs2Add[i] == q) {
keep = true; keep = true;
break; break;
} }
} }
if (!keep) { if (!keep) {
DevAssert(sdap.mappedQFIs2ReleaseCount < SDAP_MAX_QFI); DevAssert(sdap->mappedQFIs2ReleaseCount < SDAP_MAX_QFI);
sdap.mappedQFIs2Release[sdap.mappedQFIs2ReleaseCount++] = q; sdap->mappedQFIs2Release[sdap->mappedQFIs2ReleaseCount++] = q;
LOG_I(SDAP, "gNB SDAP mapping update: UE %lu pduSession %d DRB %d release_qfi=%d\n", ue_id, pdusession_id, drb_id, q); LOG_I(SDAP, "Update: release QFI %d from DRB %d (pdu_session=%d)\n", q, sdap->drb_id, sdap->pdusession_id);
} }
} }
/* Build list of QFIs to be added */ LOG_I(SDAP, "Update: add %d QFIs to DRB %d (pdu_session=%d)\n", sdap->mappedQFIs2AddCount, sdap->drb_id, sdap->pdusession_id);
for (int i = 0; i < n_qfis; i++) /* TS 37.324 clause 5.3.1: mappedQoS-FlowsToAdd and apply mapping on the DRB */
sdap.mappedQFIs2Add[i] = qfis[i]; entity->qfi2drb_map_update(entity, sdap);
LOG_I(SDAP, "gNB SDAP mapping update: UE %lu pduSession %d DRB %d n_qfis=%d\n", ue_id, pdusession_id, drb_id, n_qfis);
entity->qfi2drb_map_update(entity, &sdap);
} }
bool nr_sdap_delete_entity(ue_id_t ue_id, int pdusession_id) bool nr_sdap_delete_entity(ue_id_t ue_id, int pdusession_id)
......
...@@ -180,7 +180,7 @@ bool nr_sdap_delete_ue_entities(ue_id_t ue_id); ...@@ -180,7 +180,7 @@ bool nr_sdap_delete_ue_entities(ue_id_t ue_id);
*/ */
void nr_reconfigure_sdap_entity(NR_SDAP_Config_t *sdap_config, ue_id_t ue_id, int pdusession_id, int drb_id); void nr_reconfigure_sdap_entity(NR_SDAP_Config_t *sdap_config, ue_id_t ue_id, int pdusession_id, int drb_id);
void nr_sdap_entity_update_qos_flows(ue_id_t ue_id, int pdusession_id, int drb_id, const uint8_t *qfis, int n_qfis); void nr_sdap_entity_update_qos_flows(ue_id_t ue_id, sdap_config_t *sdap);
void set_qfi(uint8_t qfi, uint8_t pduid, ue_id_t ue_id); void set_qfi(uint8_t qfi, uint8_t pduid, ue_id_t ue_id);
#endif #endif
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