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
wangjie
OpenXG-RAN
Commits
5c65094e
Commit
5c65094e
authored
Mar 02, 2020
by
Dong Anyuan
Committed by
masayuki.harada
Mar 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change CLOCK_MONOTONIC to CLOCK_MONOTONIC_RAW
# Conflicts: # nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
parent
270f1e10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
nfapi/open-nFAPI/vnf/src/vnf_p7.c
nfapi/open-nFAPI/vnf/src/vnf_p7.c
+1
-1
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
+5
-5
No files found.
nfapi/open-nFAPI/vnf/src/vnf_p7.c
View file @
5c65094e
...
@@ -1012,7 +1012,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
...
@@ -1012,7 +1012,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
if
(
1
)
if
(
1
)
{
{
struct
timespec
ts
;
struct
timespec
ts
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
ts
);
clock_gettime
(
CLOCK_MONOTONIC
_RAW
,
&
ts
);
/* NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
/* NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
...
...
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
View file @
5c65094e
...
@@ -180,7 +180,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -180,7 +180,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
sf_duration
.
tv_nsec
=
1e6
;
// We want 1ms pause
sf_duration
.
tv_nsec
=
1e6
;
// We want 1ms pause
struct
timespec
sf_start
;
struct
timespec
sf_start
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
sf_start
);
clock_gettime
(
CLOCK_MONOTONIC
_RAW
,
&
sf_start
);
long
millisecond
=
sf_start
.
tv_nsec
/
1e6
;
long
millisecond
=
sf_start
.
tv_nsec
/
1e6
;
sf_start
=
timespec_add
(
sf_start
,
sf_duration
);
sf_start
=
timespec_add
(
sf_start
,
sf_duration
);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"next subframe will start at %d.%d
\n
"
,
sf_start
.
tv_sec
,
sf_start
.
tv_nsec
);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"next subframe will start at %d.%d
\n
"
,
sf_start
.
tv_sec
,
sf_start
.
tv_nsec
);
...
@@ -241,7 +241,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -241,7 +241,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
}
}
}
}
#else
#else
clock_gettime
(
CLOCK_MONOTONIC
,
&
pselect_start
);
clock_gettime
(
CLOCK_MONOTONIC
_RAW
,
&
pselect_start
);
//long millisecond = pselect_start.tv_nsec / 1e6;
//long millisecond = pselect_start.tv_nsec / 1e6;
if
((
last_millisecond
==
-
1
)
||
(
millisecond
==
last_millisecond
)
||
(
millisecond
==
(
last_millisecond
+
1
)
%
1000
)
)
if
((
last_millisecond
==
-
1
)
||
(
millisecond
==
last_millisecond
)
||
(
millisecond
==
(
last_millisecond
+
1
)
%
1000
)
)
...
@@ -258,7 +258,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
...
@@ -258,7 +258,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
}
}
selectRetval
=
pselect
(
maxSock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
pselect_timeout
,
NULL
);
selectRetval
=
pselect
(
maxSock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
pselect_timeout
,
NULL
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
pselect_stop
);
clock_gettime
(
CLOCK_MONOTONIC
_RAW
,
&
pselect_stop
);
nfapi_vnf_p7_connection_info_t
*
phy
=
vnf_p7
->
p7_connections
;
nfapi_vnf_p7_connection_info_t
*
phy
=
vnf_p7
->
p7_connections
;
...
@@ -402,7 +402,7 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
...
@@ -402,7 +402,7 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
FD_ZERO
(
&
readfds
);
FD_ZERO
(
&
readfds
);
FD_SET
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
&
readfds
);
FD_SET
(
vnf_p7
->
fapi_1ms_fd_list
[
0
],
&
readfds
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
sf_start
);
clock_gettime
(
CLOCK_MONOTONIC
_RAW
,
&
sf_start
);
//long millisecond = sf_start.tv_nsec / 1e6;
//long millisecond = sf_start.tv_nsec / 1e6;
sf_start
=
timespec_add
(
sf_start
,
sf_duration
);
sf_start
=
timespec_add
(
sf_start
,
sf_duration
);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"next subframe will start at %d.%d
\n
"
,
sf_start
.
tv_sec
,
sf_start
.
tv_nsec
);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"next subframe will start at %d.%d
\n
"
,
sf_start
.
tv_sec
,
sf_start
.
tv_nsec
);
...
@@ -440,7 +440,7 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
...
@@ -440,7 +440,7 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
usleep_time
=
sf_duration
.
tv_nsec
/
1000
;
usleep_time
=
sf_duration
.
tv_nsec
/
1000
;
// usleep(usleep_time);
// usleep(usleep_time);
clock_gettime
(
CLOCK_MONOTONIC
,
&
p1
);
clock_gettime
(
CLOCK_MONOTONIC
_RAW
,
&
p1
);
p3
=
timespec_sub
(
p1
,
p2
);
p3
=
timespec_sub
(
p1
,
p2
);
p2
=
p1
;
p2
=
p1
;
...
...
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