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
canghaiwuhen
OpenXG-RAN
Commits
6116dea9
Commit
6116dea9
authored
Feb 26, 2019
by
wujing
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_nfapi_rm2160' into develop
parents
bf7dfa8d
7615bafe
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
236 additions
and
251 deletions
+236
-251
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+32
-10
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
+2
-0
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
+202
-241
No files found.
nfapi/oai_integration/nfapi_vnf.c
View file @
6116dea9
...
...
@@ -359,11 +359,11 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
// wake up TX for subframe n+sf_ahead
// lock the TX mutex and make sure the thread is ready
if
(
pthread_mutex_timedlock
(
&
L1_proc
->
mutex
,
&
wait
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)
\n
"
,
L1_proc
->
subframe_rx
&
1
,
L1_proc
->
instance_cnt
);
exit_fun
(
"error locking mutex_rxtx"
);
return
(
-
1
);
}
//
if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) {
//
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", L1_proc->subframe_rx&1,L1_proc->instance_cnt );
//
exit_fun( "error locking mutex_rxtx" );
//
return(-1);
//
}
{
static
uint16_t
old_sf
=
0
;
...
...
@@ -379,7 +379,23 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
if
(
old_sf
==
0
&&
old_sfn
%
100
==
0
)
LOG_W
(
PHY
,
"[eNB] sfn/sf:%d%d old_sfn/sf:%d%d proc[rx:%d%d]
\n
"
,
sfn
,
sf
,
old_sfn
,
old_sf
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
}
++
L1_proc
->
instance_cnt
;
// wake up TX for subframe n+sf_ahead
// lock the TX mutex and make sure the thread is ready
if
(
pthread_mutex_timedlock
(
&
L1_proc
->
mutex
,
&
wait
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)
\n
"
,
L1_proc
->
subframe_rx
&
1
,
L1_proc
->
instance_cnt
);
exit_fun
(
"error locking mutex_rxtx"
);
return
(
-
1
);
}
if
(
L1_proc
->
instance_cnt
<
0
){
++
L1_proc
->
instance_cnt
;
}
else
{
LOG_E
(
MAC
,
"RCC singal to rxtx frame %d subframe %d busy %d (frame %d subframe %d)
\n
"
,
L1_proc
->
frame_rx
,
L1_proc
->
subframe_rx
,
L1_proc
->
instance_cnt
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
return
(
0
);
}
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
//LOG_D( PHY,"[VNF-subframe_ind] sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d] L1_proc->instance_cnt_rxtx:%d \n", sfn, sf, proc->frame_rx, proc->subframe_rx, L1_proc->instance_cnt_rxtx);
...
...
@@ -404,10 +420,6 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
return
(
-
1
);
}
//LOG_D(PHY,"%s() About to attempt pthread_mutex_unlock\n", __FUNCTION__);
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
//LOG_D(PHY,"%s() UNLOCKED pthread_mutex_unlock\n", __FUNCTION__);
return
(
0
);
}
...
...
@@ -799,6 +811,7 @@ int vnf_pack_p4_p5_vendor_extension(nfapi_p4_p5_message_header_t* header, uint8_
static
pthread_t
vnf_start_pthread
;
static
pthread_t
vnf_p7_start_pthread
;
static
pthread_t
vnf_p7_time_pthread
;
void
*
vnf_p7_start_thread
(
void
*
ptr
)
{
...
...
@@ -813,6 +826,14 @@ void* vnf_p7_start_thread(void *ptr) {
return
config
;
}
void
*
vnf_p7_time_thread
(
void
*
ptr
)
{
printf
(
"%s()
\n
"
,
__FUNCTION__
);
pthread_setname_np
(
pthread_self
(),
"VNF_P7"
);
nfapi_vnf_p7_config_t
*
config
=
(
nfapi_vnf_p7_config_t
*
)
ptr
;
nfapi_vnf_p7_time
(
config
);
return
config
;
}
void
set_thread_priority
(
int
priority
);
void
*
vnf_p7_thread_start
(
void
*
ptr
)
{
...
...
@@ -856,6 +877,7 @@ void* vnf_p7_thread_start(void* ptr) {
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"[VNF] Creating VNF NFAPI start thread %s
\n
"
,
__FUNCTION__
);
pthread_create
(
&
vnf_p7_start_pthread
,
NULL
,
&
vnf_p7_start_thread
,
p7_vnf
->
config
);
pthread_create
(
&
vnf_p7_time_pthread
,
NULL
,
&
vnf_p7_time_thread
,
p7_vnf
->
config
);
return
0
;
}
...
...
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
View file @
6116dea9
...
...
@@ -884,6 +884,8 @@ void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config);
int
nfapi_vnf_p7_start
(
nfapi_vnf_p7_config_t
*
config
);
int
nfapi_vnf_p7_time
(
nfapi_vnf_p7_config_t
*
config
);
/*! Stop the VNF P7 library.
* \param config A pointer to an vnf p7 configuration structure
* \return A status value. 0 equal success, -1 indicates failure
...
...
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
View file @
6116dea9
This diff is collapsed.
Click to expand it.
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