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
249e815e
Commit
249e815e
authored
Jul 28, 2023
by
Stone WU
Committed by
Jerome Peraldi
Aug 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #125147: fix issue in ss_eNB_vt_timer message queue and schedule future message request
parent
b972891e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
98 deletions
+43
-98
openair3/SS/ss_eNB_vt_timer_task.c
openair3/SS/ss_eNB_vt_timer_task.c
+43
-93
openair3/SS/ss_eNB_vt_timer_task.h
openair3/SS/ss_eNB_vt_timer_task.h
+0
-5
No files found.
openair3/SS/ss_eNB_vt_timer_task.c
View file @
249e815e
...
...
@@ -37,15 +37,11 @@
extern
SSConfigContext_t
SS_context
;
extern
RAN_CONTEXT_t
RC
;
static
uint8_t
_vt_timer_setup
(
ss_set_timinfo_t
*
tinfo
,
task_id_t
task_id
,
instance_t
instance
,
void
*
msg
);
static
uint8_t
_msg_can_be_queued
(
ss_set_timinfo_t
*
req_tinfo
);
/*
* Function : vt_subtract_sf
* Function :
_
vt_subtract_sf
* Description: Helper function to substract offset to SFN_SF
*/
static
void
vt_subtract_sf
(
uint16_t
*
frameP
,
uint8_t
*
subframeP
,
int
offset
)
static
void
_
vt_subtract_sf
(
uint16_t
*
frameP
,
uint8_t
*
subframeP
,
int
offset
)
{
if
(
*
subframeP
<
offset
)
{
...
...
@@ -54,11 +50,26 @@ static void vt_subtract_sf(uint16_t *frameP, uint8_t *subframeP, int offset)
*
subframeP
=
(
*
subframeP
+
10
-
offset
)
%
10
;
}
/*
* Function : vt_add_sf
* Description: Helper function to add offset to SFN_SF
*/
static
void
_vt_add_sf
(
uint16_t
*
frameP
,
uint8_t
*
subframeP
,
int
offset
)
{
if
(
offset
>
0
)
{
*
frameP
=
(
*
frameP
+
((
*
subframeP
+
offset
)
/
10
))
%
1024
;
*
subframeP
=
((
*
subframeP
+
offset
)
%
10
);
}
else
{
_vt_subtract_sf
(
frameP
,
subframeP
,
0
-
offset
);
}
}
/*
* Function : msg_can_be_queued
* Description: Helper function to check if the received MSG shall be queued
*/
uint8_t
msg_can_be_queued
(
ss_set_timinfo_t
req_tinfo
,
ss_set_timinfo_t
*
timer_tinfo
)
static
uint8_t
_
msg_can_be_queued
(
ss_set_timinfo_t
req_tinfo
,
ss_set_timinfo_t
*
timer_tinfo
)
{
ss_set_timinfo_t
curr_tinfo
;
curr_tinfo
.
sfn
=
SS_context
.
sfn
;
...
...
@@ -69,7 +80,7 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti
/*It is nonsense to check req_tinfo is after curr_tinfo */
if
(
req_tinfo
.
sfn
!=
curr_tinfo
.
sfn
||
((
req_tinfo
.
sfn
==
curr_tinfo
.
sfn
)
&&
(
req_tinfo
.
sf
-
curr_tinfo
.
sf
)
>
0
)
)
{
vt_subtract_sf
(
&
timer_tinfo
->
sfn
,
&
timer_tinfo
->
sf
,
4
);
/* queued ahead of 4 subframes because of mac schedule 4 subframes ahead when processing */
_
vt_subtract_sf
(
&
timer_tinfo
->
sfn
,
&
timer_tinfo
->
sf
,
4
);
/* queued ahead of 4 subframes because of mac schedule 4 subframes ahead when processing */
LOG_A
(
ENB_SS_VT_TIMER
,
"VT_TIMER MSG to be queued TRUE for SFN %d , SF %d
\n
"
,
timer_tinfo
->
sfn
,
timer_tinfo
->
sf
);
return
true
;
}
...
...
@@ -77,33 +88,29 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti
return
false
;
}
/*
* Function : vt_timer_setup
* Description: Function to set upt the VT timer for the SFN_SF
* and store the message to received
*/
uint8_t
vt_timer_setup
(
ss_set_timinfo_t
tinfo
,
task_id_t
task_id
,
instance_t
instance
,
void
*
msg
)
static
uint8_t
_vt_timer_setup
(
ss_set_timinfo_t
*
tinfo
,
task_id_t
task_id
,
instance_t
instance
,
void
*
msg
)
{
return
_vt_timer_setup
(
&
tinfo
,
task_id
,
instance
,
msg
);
}
uint32_t
sfnSfKey
=
(
tinfo
->
sfn
<<
4
)
|
tinfo
->
sf
;
/*
* Function : vt_add_sf
* Description: Helper function to add offset to SFN_SF
*/
vt_timer_elm_t
*
timer_ele_p
=
calloc
(
1
,
sizeof
(
vt_timer_elm_t
));
assert
(
timer_ele_p
);
timer_ele_p
->
instance
=
instance
;
timer_ele_p
->
task_id
=
task_id
;
timer_ele_p
->
msg
=
msg
;
static
void
_vt_add_sf
(
uint16_t
*
frameP
,
uint8_t
*
subframeP
,
int
offset
)
{
if
(
offset
>
0
)
{
*
frameP
=
(
*
frameP
+
((
*
subframeP
+
offset
)
/
10
))
%
1024
;
*
subframeP
=
((
*
subframeP
+
offset
)
%
10
);
}
else
{
if
(
*
subframeP
<
offset
)
{
*
frameP
=
(
*
frameP
+
1024
-
1
)
%
1024
;
}
*
subframeP
=
(
*
subframeP
+
10
-
offset
)
%
10
;
if
(
hashtable_insert
(
SS_context
.
vt_timer_table
,
(
hash_key_t
)
sfnSfKey
,
(
void
*
)
timer_ele_p
)
==
HASH_TABLE_OK
)
{
LOG_A
(
ENB_SS_VT_TIMER
,
"VT_TIMER setup for SFN %d , SF %d
\n
"
,
tinfo
->
sfn
,
tinfo
->
sf
);
return
1
;
}
return
false
;
}
void
vt_add_sf
(
struct
TimingInfo_Type
*
at
,
int
offset
)
...
...
@@ -136,11 +143,6 @@ int vt_timer_push_msg(struct TimingInfo_Type* at, task_id_t task_id,instance_t i
int
msg_queued
=
0
;
if
(
at
!=
NULL
&&
at
->
d
==
TimingInfo_Type_SubFrame
)
{
if
(
at
->
v
.
SubFrame
.
HSFN
.
d
==
SystemFrameNumberInfo_Type_Number
)
{
return
0
;
}
ss_set_timinfo_t
timer_tinfo
=
{
.
sfn
=
SS_context
.
sfn
,
.
sf
=
SS_context
.
sf
+
6
,
...
...
@@ -160,69 +162,17 @@ int vt_timer_push_msg(struct TimingInfo_Type* at, task_id_t task_id,instance_t i
return
0
;
}
msg_queued
=
_msg_can_be_queued
(
&
timer_tinfo
);
msg_queued
=
_msg_can_be_queued
(
timer_tinfo
,
&
timer_tinfo
);
if
(
msg_queued
)
{
msg_queued
=
_vt_timer_setup
(
&
timer_tinfo
,
task_id
,
instance
,
msg_p
);
LOG_
E
(
ENB_SS
,
"Message Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d, msg_queued: %d
\r\n
"
,
LOG_
A
(
ENB_SS_VT_TIMER
,
"Message Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d, msg_queued: %d
\r\n
"
,
timer_tinfo
.
sfn
,
timer_tinfo
.
sf
,
SS_context
.
sfn
,
SS_context
.
sf
,
msg_queued
);
}
else
{
vt_add_sf
(
at
,
-
3
);
LOG_E
(
ENB_SS
,
"VT_TIMER SYS Rescheduling MSG %p for future SFN %d , SF %d
\r\n
"
,
msg_p
,
timer_tinfo
.
sfn
,
timer_tinfo
.
sf
);
return
vt_timer_push_msg
(
at
,
task_id
,
instance
,
msg_p
);
}
}
return
msg_queued
;
}
/*
* Function : msg_can_be_queued
* Description: Helper function to check if the received MSG shall be queued
*/
static
uint8_t
_msg_can_be_queued
(
ss_set_timinfo_t
*
req_tinfo
)
{
ss_set_timinfo_t
curr_tinfo
;
curr_tinfo
.
sfn
=
SS_context
.
sfn
;
curr_tinfo
.
sf
=
SS_context
.
sf
;
uint32_t
sfnSfKey
=
(
req_tinfo
->
sfn
<<
4
)
|
req_tinfo
->
sf
;
/*It is nonsense to check req_tinfo is after curr_tinfo */
if
(
hashtable_is_key_exists
(
SS_context
.
vt_timer_table
,
sfnSfKey
)
!=
HASH_TABLE_OK
&&
(
req_tinfo
->
sfn
!=
curr_tinfo
.
sfn
||
((
req_tinfo
->
sfn
==
curr_tinfo
.
sfn
)
&&
(
req_tinfo
->
sf
-
curr_tinfo
.
sf
)
>
0
)))
{
LOG_E
(
ENB_APP
,
"VT_TIMER MSG to be queued TRUE for SFN %d , SF %d
\n
"
,
req_tinfo
->
sfn
,
req_tinfo
->
sf
);
return
true
;
}
return
false
;
}
/*
* Function : vt_timer_setup
* Description: Function to set upt the VT timer for the SFN_SF
* and store the message to received
*/
static
uint8_t
_vt_timer_setup
(
ss_set_timinfo_t
*
tinfo
,
task_id_t
task_id
,
instance_t
instance
,
void
*
msg
)
{
uint32_t
sfnSfKey
=
(
tinfo
->
sfn
<<
4
)
|
tinfo
->
sf
;
vt_timer_elm_t
*
timer_ele_p
=
calloc
(
1
,
sizeof
(
vt_timer_elm_t
));
assert
(
timer_ele_p
);
timer_ele_p
->
instance
=
instance
;
timer_ele_p
->
task_id
=
task_id
;
timer_ele_p
->
msg
=
msg
;
if
(
hashtable_insert
(
SS_context
.
vt_timer_table
,
(
hash_key_t
)
sfnSfKey
,
(
void
*
)
timer_ele_p
)
==
HASH_TABLE_OK
)
{
LOG_E
(
ENB_APP
,
"VT_TIMER setup for SFN %d , SF %d
\n
"
,
tinfo
->
sfn
,
tinfo
->
sf
);
return
1
;
}
return
false
;
}
/*
* Function : ss_vt_timer_check
* Description: Function to check if any SFN_SF is timed out and forward
...
...
@@ -237,7 +187,7 @@ static inline void ss_vt_timer_check(ss_set_timinfo_t tinfo)
//printf("VT_TIMER foudn queued SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
while
(
hashtable_is_key_exists
(
SS_context
.
vt_timer_table
,
(
hash_key_t
)
sfnSfKey
)
==
HASH_TABLE_OK
)
{
LOG_
E
(
ENB_APP
,
"VT_TIMER Timeout sending curr SFN %d SF %d
\n
"
,
LOG_
D
(
ENB_SS_VT_TIMER
,
"VT_TIMER Timeout sending curr SFN %d SF %d
\n
"
,
SS_context
.
sfn
,
SS_context
.
sf
);
hashtable_get
(
SS_context
.
vt_timer_table
,
(
hash_key_t
)
sfnSfKey
,
(
void
**
)
&
timer_ele_p
);
...
...
@@ -249,15 +199,15 @@ static inline void ss_vt_timer_check(ss_set_timinfo_t tinfo)
int
send_res
=
itti_send_msg_to_task
(
timer_ele_p
->
task_id
,
timer_ele_p
->
instance
,
(
MessageDef
*
)
timer_ele_p
->
msg
);
if
(
send_res
<
0
)
{
LOG_E
(
ENB_
APP
,
"[VT_TIMER] Error in SS_VT_TIME_OUT itti_send_msg_to_task"
);
LOG_E
(
ENB_
SS_VT_TIMER
,
"[VT_TIMER] Error in SS_VT_TIME_OUT itti_send_msg_to_task"
);
}
else
{
LOG_
E
(
ENB_APP
,
"VT_TIMER Sent message to taskID %d timer_ele.task_id instance %ld
\n
"
,
LOG_
A
(
ENB_SS_VT_TIMER
,
"VT_TIMER Sent message to taskID %d timer_ele.task_id instance %ld
\n
"
,
timer_ele_p
->
task_id
,
timer_ele_p
->
instance
);
hashtable_remove
(
SS_context
.
vt_timer_table
,
(
hash_key_t
)
sfnSfKey
);
}
LOG_
E
(
ENB_APP
,
"VT_TIMER Timeout sending done curr SFN %d SF %d
\n
"
,
LOG_
D
(
ENB_SS_VT_TIMER
,
"VT_TIMER Timeout sending done curr SFN %d SF %d
\n
"
,
SS_context
.
sfn
,
SS_context
.
sf
);
}
}
...
...
@@ -282,7 +232,7 @@ void *ss_eNB_vt_timer_process_itti_msg(void *notUsed)
ss_set_timinfo_t
tinfo
;
tinfo
.
sf
=
SS_UPD_TIM_INFO
(
received_msg
).
sf
;
tinfo
.
sfn
=
SS_UPD_TIM_INFO
(
received_msg
).
sfn
;
LOG_D
(
ENB_
APP
,
"[VT_TIMER] received_UPD_TIM_INFO SFN: %d SF: %d
\n
"
,
tinfo
.
sfn
,
tinfo
.
sf
);
LOG_D
(
ENB_
SS_VT_TIMER
,
"[VT_TIMER] received_UPD_TIM_INFO SFN: %d SF: %d
\n
"
,
tinfo
.
sfn
,
tinfo
.
sf
);
ss_vt_timer_check
(
tinfo
);
}
...
...
@@ -293,7 +243,7 @@ void *ss_eNB_vt_timer_process_itti_msg(void *notUsed)
break
;
}
default:
LOG_E
(
ENB_
APP
,
"[SS-VT_TIMER] Received unhandled message %d:%s
\n
"
,
LOG_E
(
ENB_
SS_VT_TIMER
,
"[SS-VT_TIMER] Received unhandled message %d:%s
\n
"
,
ITTI_MSG_ID
(
received_msg
),
ITTI_MSG_NAME
(
received_msg
));
}
result
=
itti_free
(
ITTI_MSG_ORIGIN_ID
(
received_msg
),
received_msg
);
...
...
@@ -324,14 +274,14 @@ void* ss_eNB_vt_timer_task(void *arg) {
int
retVal
=
ss_eNB_vt_timer_init
();
if
(
retVal
!=
-
1
)
{
LOG_A
(
ENB_
APP
,
"[SS-VT_TIMER] Enabled TASK_VT_TIMER starting the itti_msg_handler
\n
"
);
LOG_A
(
ENB_
SS_VT_TIMER
,
"[SS-VT_TIMER] Enabled TASK_VT_TIMER starting the itti_msg_handler
\n
"
);
while
(
1
)
{
(
void
)
ss_eNB_vt_timer_process_itti_msg
(
NULL
);
}
}
else
{
LOG_A
(
ENB_
APP
,
"[SS-VT_TIMER] TASK_VT_TIMER port disabled at eNB
\n
"
);
LOG_A
(
ENB_
SS_VT_TIMER
,
"[SS-VT_TIMER] TASK_VT_TIMER port disabled at eNB
\n
"
);
sleep
(
10
);
}
...
...
openair3/SS/ss_eNB_vt_timer_task.h
View file @
249e815e
...
...
@@ -41,11 +41,6 @@ void *ss_eNB_vt_timer_task(void *arg);
int
vt_timer_push_msg
(
struct
TimingInfo_Type
*
at
,
task_id_t
task_id
,
instance_t
instance
,
MessageDef
*
msg_p
);
void
vt_add_sf
(
struct
TimingInfo_Type
*
at
,
int
offset
);
uint8_t
msg_can_be_queued
(
ss_set_timinfo_t
req_tinfo
,
ss_set_timinfo_t
*
timer_tinfo
);
uint8_t
vt_timer_setup
(
ss_set_timinfo_t
tinfo
,
task_id_t
task_id
,
instance_t
instance
,
void
*
msg
);
typedef
struct
vt_timer_elm_s
{
//uint8_t msg_type; ///MSG type
task_id_t
task_id
;
...
...
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