Adopt dynamic seq_arr in PDU Session handling (RRC PDU Session)
The RRC PDU Session struct is converted from a fixed-size array to a dynamically sized seq_arr. This improves flexibility and simplifies session management by eliminating arbitrary size limits and enabling dynamic addition/removal of PDU sessions. Helper functions and loops have been adapted to use the seq_arr API. This change is a step toward more robust and maintainable handling of PDU sessions in the gNB RRC layer. The "status" state machine remains untouched in this commit and is refactored in a later commit. Also: * add macro to push to seq_arr and return the new element * move initialization of xid (RRC PDU Session struct) to find_pduSession (temporary, will be finalized in a later commit) since with the new seq_arr design the initialization is no longer possible in the UE context generation (also does not belong to it, initialize when adding a new PDU Session)
This commit is contained in:
@@ -27,10 +27,11 @@
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
#include "ds/seq_arr.h"
|
||||
|
||||
#if defined (NGRAN_GNB_CUCP)
|
||||
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_radio_bearers.h"
|
||||
#endif
|
||||
|
||||
bool read_gtp_sm(void * data)
|
||||
@@ -62,16 +63,15 @@ bool read_gtp_sm(void * data)
|
||||
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[0], ue_id_list[i]);
|
||||
|
||||
gtp->msg.ngut[i].rnti = ue_id_list[i];
|
||||
int nb_pdu_session = ue_context_p->ue_context.nb_of_pdusessions;
|
||||
if (nb_pdu_session > 0) {
|
||||
int nb_pdu_idx = nb_pdu_session - 1;
|
||||
gtp->msg.ngut[i].teidgnb = ue_context_p->ue_context.pduSession[nb_pdu_idx].param.n3_outgoing.teid;
|
||||
gtp->msg.ngut[i].teidupf = ue_context_p->ue_context.pduSession[nb_pdu_idx].param.n3_incoming.teid;
|
||||
FOR_EACH_SEQ_ARR(rrc_pdu_session_param_t*, session, &ue_context_p->ue_context.pduSessions) {
|
||||
gtp->msg.ngut[i].teidgnb = session->param.n3_outgoing.teid;
|
||||
gtp->msg.ngut[i].teidupf = session->param.n3_incoming.teid;
|
||||
// TODO: one PDU session has multiple QoS Flow
|
||||
int nb_qos_flow = ue_context_p->ue_context.pduSession[nb_pdu_idx].param.nb_qos;
|
||||
int nb_qos_flow = session->param.nb_qos;
|
||||
if (nb_qos_flow > 0) {
|
||||
gtp->msg.ngut[i].qfi = ue_context_p->ue_context.pduSession[nb_pdu_idx].param.qos[nb_qos_flow - 1].qfi;
|
||||
gtp->msg.ngut[i].qfi = session->param.qos[nb_qos_flow - 1].qfi;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "openair2/E1AP/e1ap_common.h"
|
||||
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
|
||||
#include "openair2/F1AP/f1ap_ids.h"
|
||||
#include "ds/seq_arr.h"
|
||||
|
||||
static pthread_once_t once_kpm_mutex = PTHREAD_ONCE_INIT;
|
||||
|
||||
@@ -212,8 +213,8 @@ static arr_ue_id_t filter_ues_by_s_nssai_in_cu(const test_info_lst_t test_info)
|
||||
/* UE has no AMF UE NGAP ID yet => can't send message */
|
||||
if (ue->amf_ue_ngap_id >= (1LL << 40))
|
||||
continue;
|
||||
for (int p = 0; p < ue->nb_of_pdusessions; ++p) {
|
||||
pdusession_t *pdu = &ue->pduSession[p].param;
|
||||
FOR_EACH_SEQ_ARR(rrc_pdu_session_param_t*, item, &ue->pduSessions) {
|
||||
pdusession_t* pdu = &item->param;
|
||||
if (nssai_matches(pdu->nssai, sst, sd)) {
|
||||
arr_ue_id.ue_id[arr_ue_id.sz] = fill_ue_id_data[ngran_gNB_CU](ue, 0, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user