Commit 5c65094e authored by Dong Anyuan's avatar Dong Anyuan Committed by masayuki.harada

Change CLOCK_MONOTONIC to CLOCK_MONOTONIC_RAW

# Conflicts:
#	nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
parent 270f1e10
...@@ -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,
......
...@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment