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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
1f21757d
Commit
1f21757d
authored
Jan 20, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/bugfix-better-exit-eth-udp' into integration_2023_w03
parents
206f8ae1
fc7bccec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
radio/ETHERNET/USERSPACE/LIB/eth_udp.c
radio/ETHERNET/USERSPACE/LIB/eth_udp.c
+25
-6
No files found.
radio/ETHERNET/USERSPACE/LIB/eth_udp.c
View file @
1f21757d
...
...
@@ -417,7 +417,7 @@ extern int oai_exit;
void
*
udp_write_thread
(
void
*
arg
)
{
udp_ctx_t
*
utx
=
(
udp_ctx_t
*
)
arg
;
utx
->
resp
=
(
notifiedFIFO_t
*
)
malloc
(
sizeof
(
notifiedFIFO_elt_t
));
utx
->
resp
=
malloc
(
sizeof
(
*
utx
->
resp
));
initNotifiedFIFO
(
utx
->
resp
);
LOG_D
(
PHY
,
"UDP write thread started on core %d
\n
"
,
sched_getcpu
());
reset_meas
(
&
utx
->
device
->
tx_fhaul
);
...
...
@@ -447,15 +447,29 @@ void *udp_read_thread(void *arg) {
while
(
oai_exit
==
0
)
{
LOG_I
(
PHY
,
"UDP read thread %d, waiting for start sampling_rate_d %d, sampling_rate_n %d
\n
"
,
u
->
thread_id
,
device
->
sampling_rate_ratio_n
,
device
->
sampling_rate_ratio_d
);
while
(
fhstate
->
active
>
0
)
{
size_t
count
=
recvfrom
(((
eth_state_t
*
)
device
->
priv
)
->
sockfdd
[
0
],
s
s
ize_t
count
=
recvfrom
(((
eth_state_t
*
)
device
->
priv
)
->
sockfdd
[
0
],
buffer
,
sizeof
(
buffer
),
0
,
(
struct
sockaddr
*
)
&
((
eth_state_t
*
)
device
->
priv
)
->
dest_addrd
,
(
socklen_t
*
)
&
((
eth_state_t
*
)
device
->
priv
)
->
addr_len
);
/* log and skip processing in case of error from recvfrom */
/* (to be refined if needed) */
if
(
count
==
0
)
{
LOG_E
(
PHY
,
"recvfrom returned 0
\n
"
);
continue
;
}
if
(
count
<
0
)
{
LOG_E
(
PHY
,
"recvfrom failed (%s)
\n
"
,
strerror
(
errno
));
continue
;
}
/* if oai_exit is 1 here, don't access the array rxbase,
* it may have been freed(), so let's break at this point
*/
if
(
oai_exit
)
break
;
aid
=
*
(
uint16_t
*
)(
&
buffer
[
ECPRICOMMON_BYTES
]);
TS
=
*
(
openair0_timestamp
*
)(
&
buffer
[
ECPRICOMMON_BYTES
+
ECPRIPCID_BYTES
]);
// convert TS to samples, /6 for AW2S @ 30.72 Ms/s, this is converted for other sample rates in OAI application
TS
=
(
device
->
sampling_rate_ratio_n
*
TS
)
/
(
device
->
sampling_rate_ratio_d
*
6
);
if
((
int
)
count
<=
0
)
continue
;
AssertFatal
(
aid
<
8
,
"Cannot handle more than 8 antennas, got aid %d
\n
"
,
aid
);
fhstate
->
r
[
aid
]
=
1
;
if
(
aid
==
0
&&
first_read
==
0
)
fhstate
->
TS0
=
TS
;
...
...
@@ -475,6 +489,11 @@ void *udp_read_thread(void *arg) {
}
sleep
(
1
);
}
/* let's unblock reader (maybe not the best way to do it) */
fhstate
->
first_read
=
0
;
fhstate
->
r
[
0
]
=
1
;
return
(
0
);
}
...
...
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