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
spbro
OpenXG-RAN
Commits
1001f2eb
Commit
1001f2eb
authored
May 23, 2024
by
Jaroslava Fiedlerova
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix-mutex-management-bug' into integration_2024_w21b
parents
018ca77a
f2213bf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+14
-12
No files found.
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
1001f2eb
...
...
@@ -56,6 +56,11 @@
#include "LAYER2/RLC/rlc.h"
//#define SRS_DEBUG
#define verifyMutex(a) \
{ \
int ret = a; \
AssertFatal(ret == 0, "Failure in mutex management ret=%d\n", a); \
}
static
void
nr_ue_prach_scheduler
(
NR_UE_MAC_INST_t
*
mac
,
frame_t
frameP
,
sub_frame_t
slotP
);
static
void
schedule_ta_command
(
fapi_nr_dl_config_request_t
*
dl_config
,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
);
...
...
@@ -65,9 +70,9 @@ void clear_ul_config_request(NR_UE_MAC_INST_t *mac, int scs)
int
slots
=
nr_slots_per_frame
[
scs
];
for
(
int
i
=
0
;
i
<
slots
;
i
++
)
{
fapi_nr_ul_config_request_t
*
ul_config
=
mac
->
ul_config_request
+
i
;
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
)
);
ul_config
->
number_pdus
=
0
;
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
)
);
}
}
...
...
@@ -81,7 +86,7 @@ fapi_nr_ul_config_request_pdu_t *lockGet_ul_config(NR_UE_MAC_INST_t *mac, frame_
AssertFatal
(
mac
->
ul_config_request
!=
NULL
,
"mac->ul_config_request not initialized, logic bug
\n
"
);
fapi_nr_ul_config_request_t
*
ul_config
=
mac
->
ul_config_request
+
slot_tx
;
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
)
);
if
(
ul_config
->
number_pdus
!=
0
&&
(
ul_config
->
frame
!=
frame_tx
||
ul_config
->
slot
!=
slot_tx
))
{
LOG_E
(
NR_MAC
,
"Error in ul config consistency, clearing slot %d
\n
"
,
slot_tx
);
ul_config
->
number_pdus
=
0
;
...
...
@@ -90,12 +95,11 @@ fapi_nr_ul_config_request_pdu_t *lockGet_ul_config(NR_UE_MAC_INST_t *mac, frame_
ul_config
->
slot
=
slot_tx
;
if
(
ul_config
->
number_pdus
>=
FAPI_NR_UL_CONFIG_LIST_NUM
)
{
LOG_E
(
NR_MAC
,
"Error in ul config for slot %d, no memory
\n
"
,
slot_tx
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
)
);
return
NULL
;
}
fapi_nr_ul_config_request_pdu_t
*
pdu
=
ul_config
->
ul_config_list
+
ul_config
->
number_pdus
++
;
pdu
->
pdu_type
=
pdu_type
;
AssertFatal
(
!
pdu
->
lock
,
"no lock in fapi_nr_ul_config_request_pdu_t, aborting"
);
pdu
->
lock
=
&
ul_config
->
mutex_ul_config
;
pdu
->
privateNBpdus
=
&
ul_config
->
number_pdus
;
LOG_D
(
NR_MAC
,
"Added ul pdu for %d.%d, type %d
\n
"
,
frame_tx
,
slot_tx
,
pdu_type
);
...
...
@@ -181,30 +185,28 @@ void remove_ul_config_last_item(fapi_nr_ul_config_request_pdu_t *pdu)
void
release_ul_config
(
fapi_nr_ul_config_request_pdu_t
*
configPerSlot
,
bool
clearIt
)
{
pthread_mutex_t
*
lock
=
configPerSlot
->
lock
;
configPerSlot
->
lock
=
NULL
;
if
(
clearIt
)
*
configPerSlot
->
privateNBpdus
=
0
;
pthread_mutex_unlock
(
lock
);
verifyMutex
(
pthread_mutex_unlock
(
configPerSlot
->
lock
)
);
}
fapi_nr_ul_config_request_pdu_t
*
fapiLockIterator
(
fapi_nr_ul_config_request_t
*
ul_config
,
frame_t
frame_tx
,
int
slot_tx
)
{
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_lock
(
&
ul_config
->
mutex_ul_config
)
);
if
(
ul_config
->
number_pdus
>=
FAPI_NR_UL_CONFIG_LIST_NUM
)
{
LOG_E
(
NR_MAC
,
"Error in ul config in slot %d no memory
\n
"
,
ul_config
->
slot
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
)
);
return
NULL
;
}
if
(
ul_config
->
number_pdus
!=
0
&&
(
ul_config
->
frame
!=
frame_tx
||
ul_config
->
slot
!=
slot_tx
))
{
LOG_E
(
NR_MAC
,
"Error in ul config consistency, clearing it slot %d
\n
"
,
slot_tx
);
ul_config
->
number_pdus
=
0
;
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
)
);
return
NULL
;
}
if
(
ul_config
->
number_pdus
>=
FAPI_NR_UL_CONFIG_LIST_NUM
)
{
LOG_E
(
NR_MAC
,
"Error in ul config for slot %d, no memory
\n
"
,
slot_tx
);
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
);
verifyMutex
(
pthread_mutex_unlock
(
&
ul_config
->
mutex_ul_config
)
);
return
NULL
;
}
fapi_nr_ul_config_request_pdu_t
*
pdu
=
ul_config
->
ul_config_list
+
ul_config
->
number_pdus
;
...
...
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