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
spbro
OpenXG-RAN
Commits
ba2c28f6
Commit
ba2c28f6
authored
3 years ago
by
Mahesh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PNF slot ticking fix
parent
6210519d
Branches unavailable
2024.w43
2024.w42
2024.w41
2024.w40
2024.w39
2024.w38
2024.w36
2024.w35
2024.w34
2024.w33
2024.w32
2024.w31
2024.w30
2024.w29
2024.w28
2024.w27
2024.w26
2024.w25
2024.w24
2024.w23
2024.w22
2024.w21
2024.w18
2024.w17
2024.w16
2024.w15
2024.w14
2024.w13
2024.w12
2024.w11
2024.w10
2024.w09
2024.w08
2024.w06
2024.w05
2024.w04
2024.w03
2024.w02
2024.w01
2023.w51
2023.w50
2023.w49
2023.w48
2023.w47
2023.w45
2023.w43
2023.w42
2023.w41
2023.w40
2023.w39
2023.w38
2023.w37
2023.w36
2023.w34
2023.w33
2023.w32
2023.w31
2023.w30
2023.w29
2023.w28
2023.w27
2023.w26
2023.w25
2023.w24
2023.w23
2023.w22
2023.w21
2023.w20
2023.w19
2023.w18
2023.w18b
2023.w16
2023.w15
2023.w14
2023.w13
2023.w12
2023.w11
2023.w11b
2023.w10
2023.w10b
2023.w09
2023.w08
2023.w08b
2023.w07
2023.w06
2023.w05
2023.w03
2023.w02
2022.42
2022.41
2022.w51
2022.w50
2022.w49
2022.w48
2022.w47
2022.w46
2022.w45
2022.w43
2022.w42
2022.w42b
2022.w41
2022.w40
2022.w39
2022.w38
2022.w37
2022.w37b
2022.w36
2022.w35
2022.w33
2022.w32
2022.w31
2022.w31b
2022.w30
2022.w29
2022.w26
2022.w25
2022.w24
2022.w24b
2022.w23
2022.w22
2022.w21
2022.w20
2022.w19
2022.w18
2022.w17
2022.w15
2022.w15b
2022.w14a
2022.w13
2022.w13b
2022.w13a
2022.w12
2022.w10
2022.w09
2022.w09b
2022.w08
2022.w08b
2022.w07
2022.w07b
2022.w06
2022.w06a
2022.w05
2022.w05b
2022.w03_hotfix
2022.w03_b
2022.w02
2022.w01
2021.wk46
2021.w51_c
2021.w51_a
2021.w50_a
2021.w49_b
2021.w49_a
2021.w48
2021.w47
2021.w46
2021.w46-powder
2021.w45
2021.w45_b
2021.w44
2021.w43
2021.w42
2021.w37
2021.w36
2021.w35
2021.w34
2021.w33
v2.1.0
v2.0.0
setparam
flexran-eol
ARC_1.3
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
27 deletions
+92
-27
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+1
-1
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+0
-1
nfapi/open-nFAPI/pnf/src/pnf_p7.c
nfapi/open-nFAPI/pnf/src/pnf_p7.c
+76
-8
nfapi/open-nFAPI/vnf/src/vnf_p7.c
nfapi/open-nFAPI/vnf/src/vnf_p7.c
+14
-15
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
+1
-2
No files found.
nfapi/oai_integration/nfapi_vnf.c
View file @
ba2c28f6
...
...
@@ -596,7 +596,7 @@ extern pthread_mutex_t nfapi_sync_mutex;
extern
int
nfapi_sync_var
;
int
phy_sync_indication
(
struct
nfapi_vnf_p7_config
*
config
,
uint8_t
sync
)
{
//
printf("[VNF] SYNC %s\n", sync==1 ? "ACHIEVED" : "LOST");
printf
(
"[VNF] SYNC %s
\n
"
,
sync
==
1
?
"ACHIEVED"
:
"LOST"
);
if
(
sync
==
1
&&
nfapi_sync_var
!=
0
)
{
...
...
This diff is collapsed.
Click to expand it.
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
View file @
ba2c28f6
...
...
@@ -307,7 +307,6 @@ static uint8_t pack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppWritePac
static
uint8_t
pack_dl_tti_pdsch_pdu_rel15_value
(
void
*
tlv
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
)
{
printf
(
"packing pdsch pdu.
\n
"
);
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
value
=
(
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
)
tlv
;
// TODO: resolve the packaging of array (currently sending a single element)
...
...
This diff is collapsed.
Click to expand it.
nfapi/open-nFAPI/pnf/src/pnf_p7.c
View file @
ba2c28f6
...
...
@@ -935,9 +935,9 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
// save the curren time, sfn and slot
pnf_p7
->
slot_start_time_hr
=
pnf_get_current_time_hr
();
pnf_p7
->
sfn
=
sfn
;
//
pnf_p7->sfn = sfn;
pnf_p7
->
slot
=
slot
;
//
pnf_p7->slot = slot;
...
...
@@ -3202,6 +3202,38 @@ int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
return
0
;
}
struct
timespec
pnf_timespec_add
(
struct
timespec
lhs
,
struct
timespec
rhs
)
{
struct
timespec
result
;
result
.
tv_sec
=
lhs
.
tv_sec
+
rhs
.
tv_sec
;
result
.
tv_nsec
=
lhs
.
tv_nsec
+
rhs
.
tv_nsec
;
if
(
result
.
tv_nsec
>
1e9
)
{
result
.
tv_sec
++
;
result
.
tv_nsec
-=
1e9
;
}
return
result
;
}
struct
timespec
pnf_timespec_sub
(
struct
timespec
lhs
,
struct
timespec
rhs
)
{
struct
timespec
result
;
if
((
lhs
.
tv_nsec
-
rhs
.
tv_nsec
)
<
0
)
{
result
.
tv_sec
=
lhs
.
tv_sec
-
rhs
.
tv_sec
-
1
;
result
.
tv_nsec
=
1000000000
+
lhs
.
tv_nsec
-
rhs
.
tv_nsec
;
}
else
{
result
.
tv_sec
=
lhs
.
tv_sec
-
rhs
.
tv_sec
;
result
.
tv_nsec
=
lhs
.
tv_nsec
-
rhs
.
tv_nsec
;
}
return
result
;
}
int
pnf_nr_p7_message_pump
(
pnf_p7_t
*
pnf_p7
)
{
...
...
@@ -3279,6 +3311,23 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
}
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"PNF P7 bind succeeded...
\n
"
);
//Initializaing timing structures needed for slot ticking
struct
timespec
slot_start
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
slot_start
);
struct
timespec
pselect_start
;
struct
timespec
timeout
;
timeout
.
tv_sec
=
0
;
timeout
.
tv_nsec
=
500000
;
struct
timespec
slot_duration
;
slot_duration
.
tv_sec
=
0
;
slot_duration
.
tv_nsec
=
0.5e6
;
//Infinite loop
while
(
pnf_p7
->
terminate
==
0
)
{
fd_set
rfds
;
...
...
@@ -3288,11 +3337,26 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
FD_ZERO
(
&
rfds
);
FD_SET
(
pnf_p7
->
p7_sock
,
&
rfds
);
struct
timeval
timeout
;
timeout
.
tv_sec
=
0
;
timeout
.
tv_usec
=
500
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
pselect_start
);
selectRetval
=
select
(
pnf_p7
->
p7_sock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
timeout
);
//setting the timeout
if
((
pselect_start
.
tv_sec
>
slot_start
.
tv_sec
)
||
((
pselect_start
.
tv_sec
==
slot_start
.
tv_sec
)
&&
(
pselect_start
.
tv_nsec
>
slot_start
.
tv_nsec
)))
{
// overran the end of the subframe we do not want to wait
timeout
.
tv_sec
=
0
;
timeout
.
tv_nsec
=
0
;
//struct timespec overrun = pnf_timespec_sub(pselect_start, sf_start);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Subframe overrun detected of %d.%d running to catchup\n", overrun.tv_sec, overrun.tv_nsec);
}
else
{
// still time before the end of the subframe wait
timeout
=
pnf_timespec_sub
(
slot_start
,
pselect_start
);
}
selectRetval
=
pselect
(
pnf_p7
->
p7_sock
+
1
,
&
rfds
,
NULL
,
NULL
,
&
timeout
,
NULL
);
uint32_t
now_hr_time
=
pnf_get_current_time_hr
();
...
...
@@ -3302,15 +3366,19 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
if
(
selectRetval
==
0
)
{
// timeout
//continue;
//update slot start timing
slot_start
=
pnf_timespec_add
(
slot_start
,
slot_duration
);
//increment sfn/slot
if
(
pnf_slot
==
19
)
pnf_frame
=
(
pnf_frame
+
1
)
%
1024
;
pnf_slot
=
(
pnf_slot
+
1
)
%
20
;
pnf_p7
->
sfn
=
pnf_frame
;
pnf_p7
->
slot
=
pnf_slot
;
struct
timespec
curr_time
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
curr_time
);
//printf("SFN=%d, slot=%d, Curr_time=%d.%d \n",pnf_p7->sfn,pnf_p7->slot,curr_time.tv_sec,curr_time.tv_nsec);
}
else
if
(
selectRetval
==
-
1
&&
(
errno
==
EINTR
))
{
...
...
This diff is collapsed.
Click to expand it.
nfapi/open-nFAPI/vnf/src/vnf_p7.c
View file @
ba2c28f6
...
...
@@ -1616,14 +1616,6 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
// divide by 2 using shift operator
uint32_t
latency
=
(
tx_2_rx
-
pnf_proc_time
)
>>
1
;
if
(
phy
->
in_sync
==
0
)
{
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
if
(
vnf_p7
->
_public
.
sync_indication
)
(
vnf_p7
->
_public
.
sync_indication
)(
&
(
vnf_p7
->
_public
),
1
);
}
printf
(
"t1 = %d,t2 = %d, t3 = %d, t4 = %d.
\n
"
,
ind
.
t1
,
ind
.
t2
,
ind
.
t3
,
t4
);
//phy->in_sync = 1;
if
(
!
(
phy
->
filtered_adjust
))
...
...
@@ -1675,17 +1667,24 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
struct
timespec
ts
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
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",
// phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
//
ind.t1, ind.t2, ind.t3, t4,
//
tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
//
(ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
//
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",
//
phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
//
ind.t1, ind.t2, ind.t3, t4,
//
tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
//
(ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
}
}
if
(
phy
->
filtered_adjust
&&
(
phy
->
slot_offset_filtered
>
1e6
||
phy
->
slot_offset_filtered
<
-
1e6
))
{
{
struct
timespec
ts
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
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
"
,
phy
->
sfn
,
phy
->
slot
,
ts
.
tv_sec
,
ts
.
tv_nsec
,
ind
.
header
.
phy_id
,
ind
.
t1
,
ind
.
t2
,
ind
.
t3
,
t4
,
tx_2_rx
,
pnf_proc_time
,
latency
,
phy
->
average_latency
,
phy
->
slot_offset
,
phy
->
slot_offset_filtered
,
(
ind
.
t1
<
phy
->
previous_t1
),
(
ind
.
t2
<
phy
->
previous_t2
));
phy
->
filtered_adjust
=
0
;
phy
->
zero_count
=
0
;
phy
->
min_sync_cycle_count
=
2
;
...
...
@@ -1961,7 +1960,7 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
phy->zero_count,
phy->in_sync ? "IN_SYNC" : "OUT_OF_SYNC");*/
phy
->
sfn
=
new_sfn
;
phy
->
sfn
=
new_sfn
;
phy
->
slot
=
new_slot
;
}
}
...
...
This diff is collapsed.
Click to expand it.
nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
View file @
ba2c28f6
...
...
@@ -418,12 +418,11 @@ struct timespec current_time;
{
curr
->
slot
++
;
}
//printf("Frame = %d, slot = %d in VNF main loop. n",curr->sfn,curr->slot);
//printf("Frame = %d, slot = %d in VNF main loop.
\
n",curr->sfn,curr->slot);
vnf_frame
=
curr
->
sfn
;
vnf_slot
=
curr
->
slot
;
struct
timespec
curr_time
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
curr_time
);
//printf("SFN=%d, slot=%d, Curr_time=%d.%d \n",vnf_frame,vnf_slot,curr_time.tv_sec,curr_time.tv_nsec);
vnf_nr_sync
(
vnf_p7
,
curr
);
curr
=
curr
->
next
;
...
...
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