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
lizhongxiao
OpenXG-RAN
Commits
0f1d787a
Commit
0f1d787a
authored
Jul 26, 2021
by
Laurent OpenCells
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix obsolete system call
parent
4a5a73bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
23 deletions
+26
-23
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+26
-23
No files found.
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
View file @
0f1d787a
...
@@ -218,11 +218,6 @@ int ethernet_tune(openair0_device *device,
...
@@ -218,11 +218,6 @@ int ethernet_tune(openair0_device *device,
struct
timeval
timeout
;
struct
timeval
timeout
;
struct
ifreq
ifr
;
struct
ifreq
ifr
;
char
system_cmd
[
256
];
char
system_cmd
[
256
];
int
rname
[]
=
{
CTL_NET
,
NET_CORE
,
NET_CORE_RMEM_MAX
};
int
wname
[]
=
{
CTL_NET
,
NET_CORE
,
NET_CORE_WMEM_MAX
};
int
namelen
=
3
;
int
newval
[
1
];
int
newlen
=
sizeof
(
newval
);
int
ret
=
0
;
int
ret
=
0
;
// int i=0;
// int i=0;
...
@@ -362,28 +357,36 @@ int ethernet_tune(openair0_device *device,
...
@@ -362,28 +357,36 @@ int ethernet_tune(openair0_device *device,
}
}
break
;
break
;
case
KERNEL_RCV_BUF_MAX_SIZE
:
case
KERNEL_RCV_BUF_MAX_SIZE
:
newval
[
0
]
=
value
;
ret
=
snprintf
(
system_cmd
,
sizeof
(
system_cmd
),
"sysctl -w net.core.rmem_max=%d"
,
value
);
ret
=
sysctl
(
rname
,
namelen
,
NULL
,
0
,
newval
,
newlen
);
if
(
ret
>
0
)
{
if
(
ret
)
{
ret
=
system
(
system_cmd
);
fprintf
(
stderr
,
"[ETHERNET] Error using sysctl():%s
\n
"
,
strerror
(
errno
));
if
(
ret
==
-
1
)
{
fprintf
(
stderr
,
"[ETHERNET] Can't start shell to execute %s %s"
,
system_cmd
,
strerror
(
errno
));
}
else
{
}
else
{
printf
(
"[ETHERNET] Kernel network receive buffer max size is set to %u
\n
"
,(
unsigned
int
)
newval
[
0
]);
printf
(
"[ETHERNET] status of %s is %d
\n
"
,
system_cmd
,
WEXITSTATUS
(
ret
));
}
printf
(
"[ETHERNET] net core rmem %s
\n
"
,
system_cmd
);
}
else
{
perror
(
"[ETHERNET] Can't set net core rmem
\n
"
);
}
}
break
;
break
;
case
KERNEL_SND_BUF_MAX_SIZE
:
case
KERNEL_SND_BUF_MAX_SIZE
:
newval
[
0
]
=
value
;
ret
=
snprintf
(
system_cmd
,
sizeof
(
system_cmd
),
"sysctl -w net.core.wmem_max=%d"
,
value
);
ret
=
sysctl
(
wname
,
namelen
,
NULL
,
0
,
newval
,
newlen
);
if
(
ret
>
0
)
{
if
(
ret
)
{
ret
=
system
(
system_cmd
);
fprintf
(
stderr
,
"[ETHERNET] Error using sysctl():%s
\n
"
,
strerror
(
errno
));
if
(
ret
==
-
1
)
{
fprintf
(
stderr
,
"[ETHERNET] Can't start shell to execute %s %s"
,
system_cmd
,
strerror
(
errno
));
}
else
{
printf
(
"[ETHERNET] status of %s is %d
\n
"
,
system_cmd
,
WEXITSTATUS
(
ret
));
}
printf
(
"[ETHERNET] net core wmem %s
\n
"
,
system_cmd
);
}
else
{
}
else
{
printf
(
"[ETHERNET] Kernel network send buffer max size is set to %u
\n
"
,(
unsigned
int
)
newval
[
0
]
);
perror
(
"[ETHERNET] Can't set net core wmem
\n
"
);
}
}
break
;
break
;
default:
default:
break
;
break
;
}
}
return
0
;
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