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
75de2e40
Commit
75de2e40
authored
Feb 05, 2020
by
Haruki NAOI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add: fail safe for VNF and PNF out of sync.
(cherry picked from commit e9c7c1aae5e61848f0290284ca83d3529553122b)
parent
c218facf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
nfapi/open-nFAPI/vnf/src/vnf_interface.c
nfapi/open-nFAPI/vnf/src/vnf_interface.c
+5
-0
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
+31
-1
No files found.
nfapi/open-nFAPI/vnf/src/vnf_interface.c
View file @
75de2e40
...
...
@@ -36,6 +36,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <pthread.h>
#include <sys/ioctl.h>
#endif
#include "vnf.h"
#ifdef PHY_RM
...
...
@@ -594,6 +595,7 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
int
cell_id
=
0
;
char
Buffer
[
64
];
char
cell
[
64
];
int
attr
;
vnf_info
*
vnf
=
(
vnf_info
*
)(
config
->
user_data
);
vnf_p7_info
*
p7_vnf
=
vnf
->
p7_vnfs
;
...
...
@@ -606,6 +608,9 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
strcat
(
Buffer
,
cell
);
init_server_eventfd
(
vnf_p7
->
fapi_1ms_fd_list
,
1
,
Buffer
);
attr
=
1
;
/* non blocking */
ioctl
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
FIONBIO
,
&
attr
);
vnf_p7
->
maxfd
=
vnf_p7
->
fapi_1ms_fd_list
[
0
];
...
...
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
View file @
75de2e40
...
...
@@ -388,6 +388,13 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
uint8_t
buf_1ms
[
32
];
struct
sockaddr_in
addr
;
int
sock_1ms
;
struct
timeval
tv
;
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
1200
;
fd_set
fds
,
readfds
;
int
retval
;
int
ret
;
static
int
sync
=
0
;
sock_1ms
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
addr
.
sin_family
=
AF_INET
;
...
...
@@ -395,6 +402,9 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
addr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
bind
(
sock_1ms
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
));
FD_ZERO
(
&
readfds
);
FD_SET
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
&
readfds
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
sf_start
);
//long millisecond = sf_start.tv_nsec / 1e6;
sf_start
=
timespec_add
(
sf_start
,
sf_duration
);
...
...
@@ -450,7 +460,27 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
sf_duration
.
tv_nsec
=
1000000
;
}
#ifndef UDP_1MS
recv
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
&
data
,
sizeof
(
data
),
0
);
memcpy
(
&
fds
,
&
readfds
,
sizeof
(
fd_set
));
if
(
!
sync
)
{
retval
=
select
(
vnf_p7
->
fapi_1ms_fd_list
[
0
]
+
1
,
&
fds
,
NULL
,
NULL
,
NULL
);
}
else
{
retval
=
select
(
vnf_p7
->
fapi_1ms_fd_list
[
0
]
+
1
,
&
fds
,
NULL
,
NULL
,
&
tv
);
}
if
(
retval
==
1
)
{
while
(
1
)
{
ret
=
recv
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
&
data
,
sizeof
(
data
),
0
);
if
(
ret
<
1
)
{
break
;
}
}
}
else
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"recv timeout sfnsf = 0x%x
\n
"
,
curr
->
sfn_sf
);
}
sync
=
1
;
#else
recv
(
sock_1ms
,
buf_1ms
,
sizeof
(
buf_1ms
),
0
);
#endif
...
...
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