Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
OpenXG
OpenXG UE
Commits
5accdbe1
Commit
5accdbe1
authored
Nov 10, 2021
by
mjoang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small change on adding mutex to protect ul_config_pdu against race condition.
parent
e6e59969
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
85 deletions
+85
-85
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+3
-6
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+82
-79
No files found.
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
5accdbe1
...
@@ -673,11 +673,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -673,11 +673,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
nfapi_nr_ue_pusch_pdu_t
*
pusch_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pusch_config_pdu
;
nfapi_nr_ue_pusch_pdu_t
*
pusch_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pusch_config_pdu
;
fill_ul_config
(
ul_config
,
frame_tx
,
slot_tx
,
FAPI_NR_UL_CONFIG_TYPE_PUSCH
);
fill_ul_config
(
ul_config
,
frame_tx
,
slot_tx
,
FAPI_NR_UL_CONFIG_TYPE_PUSCH
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
// Config PUSCH PDU
// Config PUSCH PDU
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
}
}
break
;
break
;
...
@@ -735,11 +734,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -735,11 +734,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
nfapi_nr_ue_pusch_pdu_t
*
pusch_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pusch_config_pdu
;
nfapi_nr_ue_pusch_pdu_t
*
pusch_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pusch_config_pdu
;
fill_ul_config
(
ul_config
,
frame_tx
,
slot_tx
,
FAPI_NR_UL_CONFIG_TYPE_PUSCH
);
fill_ul_config
(
ul_config
,
frame_tx
,
slot_tx
,
FAPI_NR_UL_CONFIG_TYPE_PUSCH
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
// Config PUSCH PDU
// Config PUSCH PDU
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
}
else
AssertFatal
(
1
==
0
,
"Cannot schedule PUSCH
\n
"
);
}
else
AssertFatal
(
1
==
0
,
"Cannot schedule PUSCH
\n
"
);
break
;
break
;
}
}
...
@@ -3930,11 +3928,10 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
...
@@ -3930,11 +3928,10 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
nfapi_nr_ue_pusch_pdu_t
*
pusch_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pusch_config_pdu
;
nfapi_nr_ue_pusch_pdu_t
*
pusch_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pusch_config_pdu
;
fill_ul_config
(
ul_config
,
frame_tx
,
slot_tx
,
FAPI_NR_UL_CONFIG_TYPE_PUSCH
);
fill_ul_config
(
ul_config
,
frame_tx
,
slot_tx
,
FAPI_NR_UL_CONFIG_TYPE_PUSCH
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
// Config Msg3 PDU
// Config Msg3 PDU
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
NULL
,
&
rar_grant
,
rnti
,
NULL
);
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
NULL
,
&
rar_grant
,
rnti
,
NULL
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
}
}
}
else
{
}
else
{
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
5accdbe1
...
@@ -2161,6 +2161,10 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
...
@@ -2161,6 +2161,10 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
);
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
);
AssertFatal
(
ul_config
->
number_pdus
<
FAPI_NR_UL_CONFIG_LIST_NUM
,
"ul_config->number_pdus %d out of bounds
\n
"
,
ul_config
->
number_pdus
);
AssertFatal
(
ul_config
->
number_pdus
<
FAPI_NR_UL_CONFIG_LIST_NUM
,
"ul_config->number_pdus %d out of bounds
\n
"
,
ul_config
->
number_pdus
);
fapi_nr_ul_config_pucch_pdu
*
pucch_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pucch_config_pdu
;
fapi_nr_ul_config_pucch_pdu
*
pucch_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
pucch_config_pdu
;
fill_ul_config
(
ul_config
,
frameP
,
slotP
,
FAPI_NR_UL_CONFIG_TYPE_PUCCH
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
nr_ue_configure_pucch
(
mac
,
nr_ue_configure_pucch
(
mac
,
slotP
,
slotP
,
rnti
,
rnti
,
...
@@ -2168,8 +2172,6 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
...
@@ -2168,8 +2172,6 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
pucch_pdu
,
pucch_pdu
,
O_SR
,
O_ACK
,
O_CSI
);
O_SR
,
O_ACK
,
O_CSI
);
LOG_D
(
NR_MAC
,
"Configuring pucch, is_common = %d
\n
"
,
pucch
->
is_common
);
LOG_D
(
NR_MAC
,
"Configuring pucch, is_common = %d
\n
"
,
pucch
->
is_common
);
fill_ul_config
(
ul_config
,
frameP
,
slotP
,
FAPI_NR_UL_CONFIG_TYPE_PUCCH
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
nr_scheduled_response_t
scheduled_response
;
nr_scheduled_response_t
scheduled_response
;
fill_scheduled_response
(
&
scheduled_response
,
NULL
,
ul_config
,
NULL
,
module_idP
,
0
/*TBR fix*/
,
frameP
,
slotP
,
thread_id
);
fill_scheduled_response
(
&
scheduled_response
,
NULL
,
ul_config
,
NULL
,
module_idP
,
0
/*TBR fix*/
,
frameP
,
slotP
,
thread_id
);
if
(
mac
->
if_module
!=
NULL
&&
mac
->
if_module
->
scheduled_response
!=
NULL
)
if
(
mac
->
if_module
!=
NULL
&&
mac
->
if_module
->
scheduled_response
!=
NULL
)
...
@@ -2233,12 +2235,13 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
...
@@ -2233,12 +2235,13 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
);
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
);
AssertFatal
(
ul_config
->
number_pdus
<
FAPI_NR_UL_CONFIG_LIST_NUM
,
"ul_config->number_pdus %d out of bounds
\n
"
,
ul_config
->
number_pdus
);
AssertFatal
(
ul_config
->
number_pdus
<
FAPI_NR_UL_CONFIG_LIST_NUM
,
"ul_config->number_pdus %d out of bounds
\n
"
,
ul_config
->
number_pdus
);
prach_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
prach_config_pdu
;
prach_config_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
prach_config_pdu
;
memset
(
prach_config_pdu
,
0
,
sizeof
(
fapi_nr_ul_config_prach_pdu
));
fill_ul_config
(
ul_config
,
frameP
,
slotP
,
FAPI_NR_UL_CONFIG_TYPE_PRACH
);
fill_ul_config
(
ul_config
,
frameP
,
slotP
,
FAPI_NR_UL_CONFIG_TYPE_PRACH
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
LOG_D
(
PHY
,
"In %s: (%p) %d UL PDUs:
\n
"
,
__FUNCTION__
,
ul_config
,
ul_config
->
number_pdus
);
LOG_D
(
PHY
,
"In %s: (%p) %d UL PDUs:
\n
"
,
__FUNCTION__
,
ul_config
,
ul_config
->
number_pdus
);
memset
(
prach_config_pdu
,
0
,
sizeof
(
fapi_nr_ul_config_prach_pdu
));
ncs
=
get_NCS
(
rach_ConfigGeneric
->
zeroCorrelationZoneConfig
,
format0
,
setup
->
restrictedSetConfig
);
ncs
=
get_NCS
(
rach_ConfigGeneric
->
zeroCorrelationZoneConfig
,
format0
,
setup
->
restrictedSetConfig
);
prach_config_pdu
->
phys_cell_id
=
mac
->
physCellId
;
prach_config_pdu
->
phys_cell_id
=
mac
->
physCellId
;
...
@@ -2314,7 +2317,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
...
@@ -2314,7 +2317,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
AssertFatal
(
1
==
0
,
"Invalid PRACH format"
);
AssertFatal
(
1
==
0
,
"Invalid PRACH format"
);
}
}
}
// if format1
}
// if format1
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
fill_scheduled_response
(
&
scheduled_response
,
NULL
,
ul_config
,
NULL
,
module_idP
,
0
/*TBR fix*/
,
frameP
,
slotP
,
thread_id
);
fill_scheduled_response
(
&
scheduled_response
,
NULL
,
ul_config
,
NULL
,
module_idP
,
0
/*TBR fix*/
,
frameP
,
slotP
,
thread_id
);
if
(
mac
->
if_module
!=
NULL
&&
mac
->
if_module
->
scheduled_response
!=
NULL
)
if
(
mac
->
if_module
!=
NULL
&&
mac
->
if_module
->
scheduled_response
!=
NULL
)
mac
->
if_module
->
scheduled_response
(
&
scheduled_response
);
mac
->
if_module
->
scheduled_response
(
&
scheduled_response
);
...
...
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