Pass SDAP config by pointer
sdap_config_t is more than 1kB large. Avoid excessive copying by passing it by reference.
This commit is contained in:
committed by
Robert Schmidt
parent
91b3ca77f6
commit
a416db39ba
@@ -153,7 +153,7 @@ static void e1_add_bearers(const int ue_id, const NR_DRB_ToAddModList_t *addMod,
|
||||
// get SDAP config
|
||||
sdap_config_t sdap = nr_sdap_get_config(GNB_FLAG_YES, drb->cnAssociation->choice.sdap_Config, drb->drb_Identity);
|
||||
// add SDAP entity
|
||||
nr_sdap_addmod_entity(GNB_FLAG_YES, ue_id, sdap);
|
||||
nr_sdap_addmod_entity(GNB_FLAG_YES, ue_id, &sdap);
|
||||
// add PDCP entity
|
||||
nr_pdcp_add_drb(GNB_FLAG_YES, ue_id, drb->pdcp_Config, &sdap, sp);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ static void rrc_nsa_add_drb(const int ue_id,
|
||||
sdap.drb_id = drb->drb_Identity;
|
||||
sdap.defaultDRB = true;
|
||||
// add SDAP entity (terminated at gNB, since it's EPC)
|
||||
nr_sdap_addmod_entity(GNB_FLAG_YES, ue_id, sdap);
|
||||
nr_sdap_addmod_entity(GNB_FLAG_YES, ue_id, &sdap);
|
||||
// add PDCP entity
|
||||
nr_pdcp_add_drb(GNB_FLAG_YES, ue_id, drb->pdcp_Config, &sdap, sp);
|
||||
}
|
||||
|
||||
@@ -619,7 +619,7 @@ static void rrc_ue_add_bearer(const int ue_id, const NR_DRB_ToAddMod_t *drb, con
|
||||
sdap = nr_sdap_get_config(GNB_FLAG_NO, drb->cnAssociation->choice.sdap_Config, drb->drb_Identity);
|
||||
}
|
||||
// add SDAP entity
|
||||
nr_sdap_addmod_entity(GNB_FLAG_NO, ue_id, sdap);
|
||||
nr_sdap_addmod_entity(GNB_FLAG_NO, ue_id, &sdap);
|
||||
// add PDCP entity
|
||||
nr_pdcp_add_drb(GNB_FLAG_NO, ue_id, drb->pdcp_Config, &sdap, sp);
|
||||
}
|
||||
|
||||
@@ -487,13 +487,13 @@ static void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, const sdap_conf
|
||||
* @param is_gnb, indicates whether it is for gNB or UE
|
||||
* @param ue_id, UE ID
|
||||
* @param sdap, SDAP configuration */
|
||||
static void nr_sdap_add_entity(const int is_gnb, const ue_id_t ue_id, const sdap_config_t sdap)
|
||||
static void nr_sdap_add_entity(const int is_gnb, const ue_id_t ue_id, const sdap_config_t *sdap)
|
||||
{
|
||||
nr_sdap_entity_t *sdap_entity = calloc_or_fail(1, sizeof(*sdap_entity));
|
||||
|
||||
// SDAP entity ids
|
||||
sdap_entity->ue_id = ue_id;
|
||||
sdap_entity->pdusession_id = sdap.pdusession_id;
|
||||
sdap_entity->pdusession_id = sdap->pdusession_id;
|
||||
sdap_entity->is_gnb = is_gnb;
|
||||
|
||||
// rx/tx entities
|
||||
@@ -513,13 +513,13 @@ static void nr_sdap_add_entity(const int is_gnb, const ue_id_t ue_id, const sdap
|
||||
sdap_entity->pdusession_sock = -1;
|
||||
|
||||
// set default DRB
|
||||
if (sdap.defaultDRB) {
|
||||
sdap_entity->default_drb = sdap.drb_id;
|
||||
if (sdap->defaultDRB) {
|
||||
sdap_entity->default_drb = sdap->drb_id;
|
||||
LOG_I(SDAP, "Default DRB for the created SDAP entity: DRB %d \n", sdap_entity->default_drb);
|
||||
}
|
||||
|
||||
// Add QoS flows to the DRB (initial configuration)
|
||||
nr_sdap_add_qos_flows_to_drb(sdap_entity, &sdap);
|
||||
nr_sdap_add_qos_flows_to_drb(sdap_entity, sdap);
|
||||
|
||||
// update SDAP entity list pointers
|
||||
sdap_entity->next_entity = sdap_info.sdap_entity_llist;
|
||||
@@ -533,11 +533,11 @@ static void nr_sdap_add_entity(const int is_gnb, const ue_id_t ue_id, const sdap
|
||||
}
|
||||
|
||||
/** @brief Add or modify an SDAP entity if it already exists */
|
||||
void nr_sdap_addmod_entity(const int is_gnb, const ue_id_t ue_id, const sdap_config_t sdap)
|
||||
void nr_sdap_addmod_entity(const int is_gnb, const ue_id_t ue_id, const sdap_config_t *sdap)
|
||||
{
|
||||
nr_sdap_entity_t *sdap_entity = nr_sdap_get_entity(ue_id, sdap.pdusession_id);
|
||||
nr_sdap_entity_t *sdap_entity = nr_sdap_get_entity(ue_id, sdap->pdusession_id);
|
||||
if (sdap_entity) {
|
||||
sdap_entity->qfi2drb_map_update(sdap_entity, &sdap);
|
||||
sdap_entity->qfi2drb_map_update(sdap_entity, sdap);
|
||||
} else {
|
||||
nr_sdap_add_entity(is_gnb, ue_id, sdap);
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ sdap_config_t nr_sdap_get_config(const int is_gnb, const NR_SDAP_Config_t *sdap_
|
||||
void nr_sdap_release_drb(ue_id_t ue_id, int drb_id, int pdusession_id);
|
||||
|
||||
/** @brief Add or modify an SDAP entity based on whether it already exists */
|
||||
void nr_sdap_addmod_entity(const int is_gnb, const ue_id_t ue_id, const sdap_config_t sdap);
|
||||
void nr_sdap_addmod_entity(const int is_gnb, const ue_id_t ue_id, const sdap_config_t *sdap);
|
||||
|
||||
/**
|
||||
* @brief Function to delete a single SDAP Entity based on the ue_id and pdusession_id.
|
||||
|
||||
Reference in New Issue
Block a user