Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
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
Libraries
UERANSIM
Commits
50bce8fc
Commit
50bce8fc
authored
Jan 06, 2022
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance improvements
parent
5ac9bbc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
+26
-14
src/ue/task.cpp
src/ue/task.cpp
+23
-14
src/ue/task.hpp
src/ue/task.hpp
+3
-0
No files found.
src/ue/task.cpp
View file @
50bce8fc
...
...
@@ -20,6 +20,9 @@ struct TimerPeriod
static
constexpr
const
int
SWITCH_OFF
=
500
;
};
#define BUFFER_SIZE 65535
#define RECEIVE_TIMEOUT 500
namespace
nr
::
ue
{
...
...
@@ -28,9 +31,11 @@ ue::UeTask::UeTask(std::unique_ptr<UeConfig> &&config, app::IUeController *ueCon
{
this
->
logBase
=
std
::
make_unique
<
LogBase
>
(
"logs/ue-"
+
config
->
getNodeName
()
+
".log"
);
this
->
config
=
std
::
move
(
config
);
this
->
fdBase
=
std
::
make_unique
<
FdBase
>
();
this
->
ueController
=
ueController
;
this
->
nodeListener
=
nodeListener
;
this
->
cliCallbackTask
=
cliCallbackTask
;
this
->
m_buffer
=
std
::
unique_ptr
<
uint8_t
[]
>
(
new
uint8_t
[
BUFFER_SIZE
]);
this
->
m_logger
=
logBase
->
makeUniqueLogger
(
this
->
config
->
getLoggerPrefix
()
+
"main"
);
this
->
shCtx
.
sti
=
Random
::
Mixed
(
this
->
config
->
getNodeName
()).
nextL
();
...
...
@@ -54,7 +59,6 @@ UeTask::~UeTask() = default;
void
UeTask
::
onStart
()
{
rlsUdp
->
onStart
();
rrc
->
onStart
();
nas
->
onStart
();
...
...
@@ -79,21 +83,27 @@ void UeTask::onLoop()
return
;
}
auto
msg
=
take
();
if
(
!
msg
)
return
;
int
fdId
;
InetAddress
peer
;
if
(
msg
->
msgType
==
NtsMessageType
::
UE_TUN_TO_APP
)
{
auto
&
w
=
dynamic_cast
<
NmUeTunToApp
&>
(
*
msg
);
nas
->
handleUplinkDataRequest
(
w
.
psi
,
std
::
move
(
w
.
data
));
}
else
if
(
msg
->
msgType
==
NtsMessageType
::
UDP_SERVER_RECEIVE
)
size_t
n
=
fdBase
->
read
(
m_buffer
.
get
(),
BUFFER_SIZE
,
RECEIVE_TIMEOUT
,
fdId
,
peer
);
if
(
n
>
0
)
{
auto
&
w
=
dynamic_cast
<
udp
::
NwUdpServerReceive
&>
(
*
msg
);
rlsUdp
->
receiveRlsPdu
(
w
.
fromAddress
,
w
.
packet
);
if
(
fdId
>=
FdBase
::
PS_START
&&
fdId
<=
FdBase
::
PS_END
)
{
nas
->
handleUplinkDataRequest
(
fdId
-
FdBase
::
PS_START
,
OctetString
::
FromArray
(
m_buffer
.
get
(),
n
));
}
else
if
(
fdId
==
FdBase
::
RLS_IP4
||
fdId
==
FdBase
::
RLS_IP6
)
{
rlsUdp
->
receiveRlsPdu
(
peer
,
OctetString
::
FromArray
(
m_buffer
.
get
(),
n
));
}
}
else
if
(
msg
->
msgType
==
NtsMessageType
::
UE_CLI_COMMAND
)
auto
msg
=
poll
();
if
(
!
msg
)
return
;
if
(
msg
->
msgType
==
NtsMessageType
::
UE_CLI_COMMAND
)
{
auto
&
w
=
dynamic_cast
<
NmUeCliCommand
&>
(
*
msg
);
UeCmdHandler
handler
{
this
};
...
...
@@ -107,7 +117,6 @@ void UeTask::onLoop()
void
UeTask
::
onQuit
()
{
rlsUdp
->
onQuit
();
rrc
->
onQuit
();
nas
->
onQuit
();
}
...
...
src/ue/task.hpp
View file @
50bce8fc
...
...
@@ -25,6 +25,7 @@
#include <ue/rrc/layer.hpp>
#include <ue/tun/layer.hpp>
#include <utils/common_types.hpp>
#include <utils/fd_base.hpp>
#include <utils/logger.hpp>
#include <utils/nts.hpp>
...
...
@@ -51,10 +52,12 @@ class UeTask : public NtsTask
private:
bool
m_immediateCycle
;
std
::
unique_ptr
<
uint8_t
[]
>
m_buffer
;
public:
std
::
unique_ptr
<
UeConfig
>
config
;
std
::
unique_ptr
<
LogBase
>
logBase
;
std
::
unique_ptr
<
FdBase
>
fdBase
;
app
::
IUeController
*
ueController
;
app
::
INodeListener
*
nodeListener
;
NtsTask
*
cliCallbackTask
;
...
...
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