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
4b6da53f
Commit
4b6da53f
authored
Jul 31, 2016
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added timeout on ETHERNET recv
parent
5817a62c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+6
-5
No files found.
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
View file @
4b6da53f
...
...
@@ -72,7 +72,7 @@ int trx_eth_start(openair0_device *device) {
}
/* adjust MTU wrt number of samples per packet */
if
(
ethernet_tune
(
device
,
MTU_SIZE
,
RAW_PACKET_SIZE_BYTES
(
device
->
openair0_cfg
->
samples_per_packet
))
!=
0
)
return
-
1
;
if
(
ethernet_tune
(
device
,
RCV_TIMEOUT
,
999999
)
!=
0
)
return
-
1
;
}
else
if
(
eth
->
flags
==
ETH_RAW_IF4p5_MODE
)
{
if
(
eth_socket_init_raw
(
device
)
!=
0
)
return
-
1
;
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
...
...
@@ -83,7 +83,8 @@ int trx_eth_start(openair0_device *device) {
}
/* adjust MTU wrt number of samples per packet */
if
(
ethernet_tune
(
device
,
MTU_SIZE
,
RAW_IF4p5_PRACH_SIZE_BYTES
)
!=
0
)
return
-
1
;
if
(
ethernet_tune
(
device
,
RCV_TIMEOUT
,
5000
)
!=
0
)
return
-
1
;
}
else
if
(
eth
->
flags
==
ETH_UDP_IF4p5_MODE
)
{
...
...
@@ -225,15 +226,15 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
break
;
case
RCV_TIMEOUT
:
timeout
.
tv_sec
=
value
/
1000000
000
;
timeout
.
tv_usec
=
value
%
1000000
000
;
//less than rt_period?
timeout
.
tv_sec
=
value
/
1000000
;
timeout
.
tv_usec
=
value
%
1000000
;
//less than rt_period?
if
(
setsockopt
(
eth
->
sockfd
[
Mod_id
],
SOL_SOCKET
,
SO_RCVTIMEO
,
(
char
*
)
&
timeout
,
sizeof
(
timeout
)))
{
perror
(
"[ETHERNET] setsockopt()"
);
}
else
{
printf
(
"receive timeout= %
d,%d sec
\n
"
,
timeout
.
tv_sec
,
timeout
.
tv_usec
);
printf
(
"receive timeout= %
u usec
\n
"
,
timeout
.
tv_usec
);
}
break
;
...
...
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