Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
57f0cb13
Commit
57f0cb13
authored
Oct 30, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix-cellconfig-segv' into integration_2023_w43
parents
a828da1b
60d867a9
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
207 additions
and
68 deletions
+207
-68
common/utils/ocp_itti/intertask_interface.h
common/utils/ocp_itti/intertask_interface.h
+0
-2
common/utils/utils.h
common/utils/utils.h
+7
-6
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+25
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+9
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+2
-0
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+0
-1
openair2/RRC/NR/nr_rrc_config.c
openair2/RRC/NR/nr_rrc_config.c
+143
-36
openair2/RRC/NR/nr_rrc_config.h
openair2/RRC/NR/nr_rrc_config.h
+1
-0
openair3/NAS/UE/EMM/IdleMode.c
openair3/NAS/UE/EMM/IdleMode.c
+1
-1
openair3/NAS/UE/EMM/emm_main.c
openair3/NAS/UE/EMM/emm_main.c
+4
-4
openair3/NAS/UE/ESM/esm_ebr.c
openair3/NAS/UE/ESM/esm_ebr.c
+1
-1
openair3/NAS/UE/ESM/esm_main.c
openair3/NAS/UE/ESM/esm_main.c
+1
-1
openair3/NAS/UE/ESM/esm_pt.c
openair3/NAS/UE/ESM/esm_pt.c
+1
-1
openair3/NAS/UE/nas_proc.c
openair3/NAS/UE/nas_proc.c
+2
-2
openair3/NAS/UE/nas_ue_task.c
openair3/NAS/UE/nas_ue_task.c
+7
-7
openair3/NAS/UE/nas_user.c
openair3/NAS/UE/nas_user.c
+2
-2
No files found.
common/utils/ocp_itti/intertask_interface.h
View file @
57f0cb13
...
...
@@ -552,8 +552,6 @@ void itti_set_task_real_time(task_id_t task_id);
void
itti_send_terminate_message
(
task_id_t
task_id
);
void
*
itti_malloc
(
task_id_t
origin_task_id
,
task_id_t
destination_task_id
,
ssize_t
size
);
void
*
calloc_or_fail
(
size_t
size
);
void
*
malloc_or_fail
(
size_t
size
);
int
memory_read
(
const
char
*
datafile
,
void
*
data
,
size_t
size
);
int
itti_free
(
task_id_t
task_id
,
void
*
ptr
);
...
...
common/utils/utils.h
View file @
57f0cb13
...
...
@@ -56,23 +56,24 @@ static inline void *malloc16_clear( size_t size ) {
return
ptr
;
}
static
inline
void
*
calloc_or_fail
(
size_t
size
)
{
void
*
ptr
=
calloc
(
1
,
size
);
static
inline
void
*
calloc_or_fail
(
size_t
nmemb
,
size_t
size
)
{
void
*
ptr
=
calloc
(
nmemb
,
size
);
if
(
ptr
==
NULL
)
{
fprintf
(
stderr
,
"
[UE] Failed to calloc %zu bytes"
,
size
);
fprintf
(
stderr
,
"
Failed to calloc() %zu elements of %zu bytes: out of memory"
,
nmemb
,
size
);
exit
(
EXIT_FAILURE
);
}
return
ptr
;
}
static
inline
void
*
malloc_or_fail
(
size_t
size
)
{
static
inline
void
*
malloc_or_fail
(
size_t
size
)
{
void
*
ptr
=
malloc
(
size
);
if
(
ptr
==
NULL
)
{
fprintf
(
stderr
,
"
[UE] Failed to malloc %zu bytes
"
,
size
);
fprintf
(
stderr
,
"
Failed to malloc() %zu bytes: out of memory
"
,
size
);
exit
(
EXIT_FAILURE
);
}
...
...
openair2/GNB_APP/gnb_config.c
View file @
57f0cb13
...
...
@@ -970,16 +970,40 @@ static NR_ServingCellConfigCommon_t *get_scc_config(int minRXTXTIME)
fix_scc
(
scc
,
ssb_bitmap
);
}
nr_rrc_config_ul_tda
(
scc
,
minRXTXTIME
);
// the gNB uses the servingCellConfigCommon everywhere, even when it should use the servingCellConfigCommonSIB.
// previously (before this commit), the following fields were indirectly populated through get_SIB1_NR().
// since this might lead to memory problems (e.g., double frees), it has been moved here.
// note that the "right solution" would be to not populate the servingCellConfigCommon here, and use
// an "abstraction struct" that contains the corresponding values, from which SCC/SIB1/... is generated.
NR_PDCCH_ConfigCommon_t
*
pcc
=
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
pdcch_ConfigCommon
->
choice
.
setup
;
AssertFatal
(
pcc
!=
NULL
&&
pcc
->
commonSearchSpaceList
==
NULL
,
"memory leak
\n
"
);
pcc
->
commonSearchSpaceList
=
calloc_or_fail
(
1
,
sizeof
(
*
pcc
->
commonSearchSpaceList
));
NR_SearchSpace_t
*
ss1
=
rrc_searchspace_config
(
true
,
1
,
0
);
asn1cSeqAdd
(
&
pcc
->
commonSearchSpaceList
->
list
,
ss1
);
NR_SearchSpace_t
*
ss2
=
rrc_searchspace_config
(
true
,
2
,
0
);
asn1cSeqAdd
(
&
pcc
->
commonSearchSpaceList
->
list
,
ss2
);
NR_SearchSpace_t
*
ss3
=
rrc_searchspace_config
(
true
,
3
,
0
);
asn1cSeqAdd
(
&
pcc
->
commonSearchSpaceList
->
list
,
ss3
);
asn1cCallocOne
(
pcc
->
searchSpaceSIB1
,
0
);
asn1cCallocOne
(
pcc
->
ra_SearchSpace
,
1
);
asn1cCallocOne
(
pcc
->
pagingSearchSpace
,
2
);
asn1cCallocOne
(
pcc
->
searchSpaceOtherSystemInformation
,
3
);
return
scc
;
}
static
NR_ServingCellConfig_t
*
get_scd_config
(
void
)
{
char
aprefix
[
MAX_OPTNAME_SIZE
*
2
+
8
];
NR_ServingCellConfig_t
*
scd
=
calloc
(
1
,
sizeof
(
*
scd
));
prepare_scd
(
scd
);
paramdef_t
SCDsParams
[]
=
SCDPARAMS_DESC
(
scd
);
paramlist_def_t
SCDsParamList
=
{
GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED
,
NULL
,
0
};
char
aprefix
[
MAX_OPTNAME_SIZE
*
2
+
8
];
snprintf
(
aprefix
,
sizeof
(
aprefix
),
"%s.[%i]"
,
GNB_CONFIG_STRING_GNB_LIST
,
0
);
config_getlist
(
&
SCDsParamList
,
NULL
,
0
,
aprefix
);
if
(
SCDsParamList
.
numelt
>
0
)
{
sprintf
(
aprefix
,
"%s.[%i].%s.[%i]"
,
GNB_CONFIG_STRING_GNB_LIST
,
0
,
GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED
,
0
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
57f0cb13
...
...
@@ -586,6 +586,15 @@ bool nr_find_nb_rb(uint16_t Qm,
return
*
tbs
>=
bytes
&&
*
nb_rb
<=
nb_rb_max
;
}
const
NR_DMRS_UplinkConfig_t
*
get_DMRS_UplinkConfig
(
const
NR_PUSCH_Config_t
*
pusch_Config
,
const
NR_tda_info_t
*
tda_info
)
{
if
(
pusch_Config
==
NULL
)
return
NULL
;
return
tda_info
->
mapping_type
==
typeA
?
pusch_Config
->
dmrs_UplinkForPUSCH_MappingTypeA
->
choice
.
setup
:
pusch_Config
->
dmrs_UplinkForPUSCH_MappingTypeB
->
choice
.
setup
;
}
NR_pusch_dmrs_t
get_ul_dmrs_params
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
NR_UE_UL_BWP_t
*
ul_bwp
,
const
NR_tda_info_t
*
tda_info
,
...
...
@@ -623,8 +632,6 @@ NR_pusch_dmrs_t get_ul_dmrs_params(const NR_ServingCellConfigCommon_t *scc,
num_dmrs_symb
+=
(
dmrs
.
ul_dmrs_symb_pos
>>
i
)
&
1
;
dmrs
.
num_dmrs_symb
=
num_dmrs_symb
;
dmrs
.
N_PRB_DMRS
=
dmrs
.
num_dmrs_cdm_grps_no_data
*
(
dmrs
.
dmrs_config_type
==
0
?
6
:
4
);
dmrs
.
NR_DMRS_UplinkConfig
=
NR_DMRS_UplinkConfig
;
return
dmrs
;
}
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
57f0cb13
...
...
@@ -2234,7 +2234,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n
/* FAPI: DMRS */
pusch_pdu
->
ul_dmrs_symb_pos
=
sched_pusch
->
dmrs_info
.
ul_dmrs_symb_pos
;
pusch_pdu
->
dmrs_config_type
=
sched_pusch
->
dmrs_info
.
dmrs_config_type
;
const
NR_DMRS_UplinkConfig_t
*
NR_DMRS_UplinkConfig
=
sched_pusch
->
dmrs_info
.
NR_DMRS_UplinkConfig
;
const
NR_DMRS_UplinkConfig_t
*
NR_DMRS_UplinkConfig
=
get_DMRS_UplinkConfig
(
current_BWP
->
pusch_Config
,
&
sched_pusch
->
tda_info
)
;
if
(
pusch_pdu
->
transform_precoding
)
{
// transform precoding disabled
long
*
scramblingid
=
NULL
;
if
(
NR_DMRS_UplinkConfig
&&
pusch_pdu
->
scid
==
0
)
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
57f0cb13
...
...
@@ -269,6 +269,8 @@ long get_K2(NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList,
int
time_domain_assignment
,
int
mu
);
const
NR_DMRS_UplinkConfig_t
*
get_DMRS_UplinkConfig
(
const
NR_PUSCH_Config_t
*
pusch_Config
,
const
NR_tda_info_t
*
tda_info
);
NR_pusch_dmrs_t
get_ul_dmrs_params
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
NR_UE_UL_BWP_t
*
ul_bwp
,
const
NR_tda_info_t
*
tda_info
,
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
57f0cb13
...
...
@@ -378,7 +378,6 @@ typedef struct NR_pusch_dmrs {
uint16_t
ul_dmrs_symb_pos
;
uint8_t
num_dmrs_cdm_grps_no_data
;
nfapi_nr_dmrs_type_e
dmrs_config_type
;
NR_DMRS_UplinkConfig_t
*
NR_DMRS_UplinkConfig
;
}
NR_pusch_dmrs_t
;
typedef
struct
NR_sched_pusch
{
...
...
openair2/RRC/NR/nr_rrc_config.c
View file @
57f0cb13
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/nr_rrc_config.h
View file @
57f0cb13
...
...
@@ -43,6 +43,7 @@ void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsc
NR_TDD_UL_DL_ConfigCommon_t
*
tdd_UL_DL_ConfigurationCommon
,
int
curr_bwp
);
void
nr_rrc_config_ul_tda
(
NR_ServingCellConfigCommon_t
*
scc
,
int
min_fb_delay
);
NR_SearchSpace_t
*
rrc_searchspace_config
(
bool
is_common
,
int
searchspaceid
,
int
coresetid
);
void
prepare_sim_uecap
(
NR_UE_NR_Capability_t
*
cap
,
NR_ServingCellConfigCommon_t
*
scc
,
...
...
openair3/NAS/UE/EMM/IdleMode.c
View file @
57f0cb13
...
...
@@ -107,7 +107,7 @@ static IdleMode_callback_t _emm_indication_notify;
***************************************************************************/
void
IdleMode_initialize
(
nas_user_t
*
user
,
IdleMode_callback_t
cb
)
{
emm_plmn_list_t
*
emm_plmn_list
=
calloc_or_fail
(
sizeof
(
emm_plmn_list_t
));
emm_plmn_list_t
*
emm_plmn_list
=
calloc_or_fail
(
1
,
sizeof
(
emm_plmn_list_t
));
user
->
emm_plmn_list
=
emm_plmn_list
;
/* Initialize the list of available PLMNs */
emm_plmn_list
->
n_plmns
=
0
;
...
...
openair3/NAS/UE/EMM/emm_main.c
View file @
57f0cb13
...
...
@@ -135,7 +135,7 @@ void _emm_detach_initialize(emm_detach_data_t *emm_detach) {
void
emm_main_initialize
(
nas_user_t
*
user
,
emm_indication_callback_t
cb
,
const
char
*
imei
)
{
LOG_FUNC_IN
;
user
->
emm_data
=
calloc_or_fail
(
sizeof
(
emm_data_t
));
user
->
emm_data
=
calloc_or_fail
(
1
,
sizeof
(
emm_data_t
));
/* USIM validity indicator */
user
->
emm_data
->
usim_is_valid
=
false
;
/* The IMEI read from the UE's non-volatile memory */
...
...
@@ -433,19 +433,19 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
/*
* Initialize EMM timers
*/
user
->
emm_data
->
emm_timers
=
calloc_or_fail
(
sizeof
(
emm_timers_t
));
user
->
emm_data
->
emm_timers
=
calloc_or_fail
(
1
,
sizeof
(
emm_timers_t
));
_emm_timers_initialize
(
user
->
emm_data
->
emm_timers
);
/*
* Initialize Internal data used for detach procedure
*/
user
->
emm_data
->
emm_detach_data
=
calloc_or_fail
(
sizeof
(
emm_detach_data_t
));
user
->
emm_data
->
emm_detach_data
=
calloc_or_fail
(
1
,
sizeof
(
emm_detach_data_t
));
_emm_detach_initialize
(
user
->
emm_data
->
emm_detach_data
);
/*
* Initialize Internal data used for attach procedure
*/
user
->
emm_data
->
emm_attach_data
=
calloc_or_fail
(
sizeof
(
emm_attach_data_t
));
user
->
emm_data
->
emm_attach_data
=
calloc_or_fail
(
1
,
sizeof
(
emm_attach_data_t
));
_emm_attach_initialize
(
user
->
emm_data
->
emm_attach_data
);
/*
...
...
openair3/NAS/UE/ESM/esm_ebr.c
View file @
57f0cb13
...
...
@@ -119,7 +119,7 @@ esm_ebr_data_t *esm_ebr_initialize(void)
LOG_FUNC_IN
;
int
i
;
esm_ebr_data_t
*
esm_ebr_data
=
calloc_or_fail
(
sizeof
(
esm_ebr_data_t
));
esm_ebr_data_t
*
esm_ebr_data
=
calloc_or_fail
(
1
,
sizeof
(
esm_ebr_data_t
));
esm_ebr_data
->
index
=
0
;
...
...
openair3/NAS/UE/ESM/esm_main.c
View file @
57f0cb13
...
...
@@ -79,7 +79,7 @@ void esm_main_initialize(nas_user_t *user, esm_indication_callback_t cb)
int
i
;
esm_data_t
*
esm_data
=
calloc_or_fail
(
sizeof
(
esm_data_t
));
esm_data_t
*
esm_data
=
calloc_or_fail
(
1
,
sizeof
(
esm_data_t
));
user
->
esm_data
=
esm_data
;
default_eps_bearer_context_data_t
*
default_eps_bearer_context
=
calloc
(
1
,
sizeof
(
default_eps_bearer_context_data_t
));
...
...
openair3/NAS/UE/ESM/esm_pt.c
View file @
57f0cb13
...
...
@@ -88,7 +88,7 @@ static int _esm_pt_get_available_entry(esm_pt_data_t *esm_pt_data);
esm_pt_data_t
*
esm_pt_initialize
(
void
)
{
LOG_FUNC_IN
;
esm_pt_data_t
*
esm_pt_data
=
calloc_or_fail
(
sizeof
(
esm_pt_data_t
));
esm_pt_data_t
*
esm_pt_data
=
calloc_or_fail
(
1
,
sizeof
(
esm_pt_data_t
));
int
i
;
esm_pt_data
->
index
=
0
;
...
...
openair3/NAS/UE/nas_proc.c
View file @
57f0cb13
...
...
@@ -97,8 +97,8 @@ void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
user
->
proc
.
rsrq
=
NAS_PROC_RSRQ_UNKNOWN
;
user
->
proc
.
rsrp
=
NAS_PROC_RSRP_UNKNOWN
;
user
->
authentication_data
=
calloc_or_fail
(
sizeof
(
authentication_data_t
));
user
->
security_data
=
calloc_or_fail
(
sizeof
(
security_data_t
));
user
->
authentication_data
=
calloc_or_fail
(
1
,
sizeof
(
authentication_data_t
));
user
->
security_data
=
calloc_or_fail
(
1
,
sizeof
(
security_data_t
));
/* Initialize the EMM procedure manager */
emm_main_initialize
(
user
,
emm_cb
,
imei
);
...
...
openair3/NAS/UE/nas_ue_task.c
View file @
57f0cb13
...
...
@@ -67,7 +67,7 @@ static bool nas_ue_process_events(nas_user_container_t *users, struct epoll_even
// Initialize user api id and port number
void
nas_user_api_id_initialize
(
nas_user_t
*
user
)
{
user_api_id_t
*
user_api_id
=
calloc_or_fail
(
sizeof
(
user_api_id_t
));
user_api_id_t
*
user_api_id
=
calloc_or_fail
(
1
,
sizeof
(
user_api_id_t
));
user
->
user_api_id
=
user_api_id
;
char
*
port
=
make_port_str_from_ueid
(
NAS_PARSER_DEFAULT_USER_PORT_NUMBER
,
user
->
ueid
);
if
(
port
==
NULL
)
{
...
...
@@ -130,9 +130,9 @@ void *nas_ue_task(void *args_p)
/* Initialize user interface (to exchange AT commands with user process) */
nas_user_api_id_initialize
(
user
);
/* allocate needed structures */
user
->
user_at_commands
=
calloc_or_fail
(
sizeof
(
user_at_commands_t
));
user
->
at_response
=
calloc_or_fail
(
sizeof
(
at_response_t
));
user
->
lowerlayer_data
=
calloc_or_fail
(
sizeof
(
lowerlayer_data_t
));
user
->
user_at_commands
=
calloc_or_fail
(
1
,
sizeof
(
user_at_commands_t
));
user
->
at_response
=
calloc_or_fail
(
1
,
sizeof
(
at_response_t
));
user
->
lowerlayer_data
=
calloc_or_fail
(
1
,
sizeof
(
lowerlayer_data_t
));
/* Initialize NAS user */
nas_user_initialize
(
user
,
&
user_api_emm_callback
,
&
user_api_esm_callback
,
FIRMWARE_VERSION
);
}
...
...
@@ -170,9 +170,9 @@ void *nas_ue_task(void *args_p)
/* Initialize user interface (to exchange AT commands with user process) */
nas_user_api_id_initialize
(
user
);
/* allocate needed structures */
user
->
user_at_commands
=
calloc_or_fail
(
sizeof
(
user_at_commands_t
));
user
->
at_response
=
calloc_or_fail
(
sizeof
(
at_response_t
));
user
->
lowerlayer_data
=
calloc_or_fail
(
sizeof
(
lowerlayer_data_t
));
user
->
user_at_commands
=
calloc_or_fail
(
1
,
sizeof
(
user_at_commands_t
));
user
->
at_response
=
calloc_or_fail
(
1
,
sizeof
(
at_response_t
));
user
->
lowerlayer_data
=
calloc_or_fail
(
1
,
sizeof
(
lowerlayer_data_t
));
/* Initialize NAS user */
nas_user_initialize
(
user
,
&
user_api_emm_callback
,
&
user_api_esm_callback
,
FIRMWARE_VERSION
);
user
->
ueid
=
0
;
...
...
openair3/NAS/UE/nas_user.c
View file @
57f0cb13
...
...
@@ -154,7 +154,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
{
LOG_FUNC_IN
;
user
->
nas_user_nvdata
=
calloc_or_fail
(
sizeof
(
user_nvdata_t
));
user
->
nas_user_nvdata
=
calloc_or_fail
(
1
,
sizeof
(
user_nvdata_t
));
/* Get UE data stored in the non-volatile memory device */
int
rc
=
memory_read
(
user
->
user_nvdata_store
,
user
->
nas_user_nvdata
,
sizeof
(
user_nvdata_t
));
...
...
@@ -163,7 +163,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
abort
();
}
user
->
nas_user_context
=
calloc_or_fail
(
sizeof
(
nas_user_context_t
));
user
->
nas_user_context
=
calloc_or_fail
(
1
,
sizeof
(
nas_user_context_t
));
_nas_user_context_initialize
(
user
->
nas_user_context
,
version
);
/* Initialize the internal NAS processing data */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment