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
wangwenhui
OpenXG-RAN
Commits
4bc842ca
Commit
4bc842ca
authored
Sep 11, 2018
by
Laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first
parent
a0f75c0b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
156 additions
and
404 deletions
+156
-404
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-2
openair2/LAYER2/PDCP_v10.1.0/pdcp.h
openair2/LAYER2/PDCP_v10.1.0/pdcp.h
+0
-4
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+2
-167
openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
+0
-224
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+4
-0
openair2/RRC/LTE/rrc_eNB_S1AP.c
openair2/RRC/LTE/rrc_eNB_S1AP.c
+8
-0
openair3/GTPV1-U/gtpv1u_eNB_noS1.c
openair3/GTPV1-U/gtpv1u_eNB_noS1.c
+123
-0
openair3/GTPV1-U/gtpv1u_eNB_task.h
openair3/GTPV1-U/gtpv1u_eNB_task.h
+13
-0
targets/COMMON/create_tasks.c
targets/COMMON/create_tasks.c
+4
-1
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+0
-3
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+0
-3
No files found.
cmake_targets/CMakeLists.txt
View file @
4bc842ca
...
...
@@ -170,7 +170,7 @@ set(CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS_PROCESSOR
}
-std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC "
)
# add autotools definitions that were maybe used!
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
"
${
CMAKE_C_FLAGS
}
-D
NOS1 -D
STDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
-std=c++11 -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
...
...
@@ -266,7 +266,7 @@ if (${ENABLE_ITTI})
${
OPENAIR_DIR
}
/common/utils/memory_pools.c
)
set
(
ITTI_LIB ITTI
)
set
(
GTPU_need_ITTI
${
OPENAIR3_DIR
}
/GTPV1-U/gtpv1u_eNB.c
)
set
(
GTPU_need_ITTI
${
OPENAIR3_DIR
}
/GTPV1-U/gtpv1u_eNB
_noS1
.c
)
endif
(
${
ENABLE_ITTI
}
)
#############################
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp.h
View file @
4bc842ca
...
...
@@ -380,10 +380,6 @@ int pdcp_module_init (void);
void
pdcp_module_cleanup
(
void
);
void
pdcp_layer_init
(
void
);
void
pdcp_layer_cleanup
(
void
);
#if defined(PDCP_USE_NETLINK_QUEUES)
int
pdcp_netlink_init
(
void
);
#endif
#define PDCP2NW_DRIVER_FIFO 21
#define NW_DRIVER2PDCP_FIFO 22
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
View file @
4bc842ca
...
...
@@ -115,11 +115,8 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
{
//-----------------------------------------------------------------------------
//#if defined(PDCP_USE_NETLINK) && defined(LINUX)
int
ret
=
0
;
//#endif
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
int
ret
=
0
;
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
#define THREAD_NAME_LEN 16
static
char
threadname
[
THREAD_NAME_LEN
];
ret
=
pthread_getname_np
(
pthread_self
(),
threadname
,
THREAD_NAME_LEN
);
...
...
@@ -238,22 +235,13 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
pdcp_output_header_bytes_to_write
=
sizeof
(
pdcp_data_ind_header_t
);
}
#ifdef PDCP_USE_RT_FIFO
bytes_wrote
=
rtf_put
(
PDCP2PDCP_USE_RT_FIFO
,
&
(((
uint8_t
*
)
sdu
->
data
)[
sizeof
(
pdcp_data_ind_header_t
)
-
pdcp_output_header_bytes_to_write
]),
pdcp_output_header_bytes_to_write
);
#else
#ifdef PDCP_USE_NETLINK
#ifdef LINUX
memcpy
(
NLMSG_DATA
(
nas_nlh_tx
),
&
(((
uint8_t
*
)
sdu_p
->
data
)[
sizeof
(
pdcp_data_ind_header_t
)
-
pdcp_output_header_bytes_to_write
]),
pdcp_output_header_bytes_to_write
);
nas_nlh_tx
->
nlmsg_len
=
pdcp_output_header_bytes_to_write
;
#endif //LINUX
#endif //PDCP_USE_NETLINK
bytes_wrote
=
pdcp_output_header_bytes_to_write
;
#endif //PDCP_USE_RT_FIFO
#ifdef PDCP_DEBUG
LOG_D
(
PDCP
,
"Frame %d Sent %d Bytes of header to Nas_mesh
\n
"
,
...
...
@@ -268,9 +256,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
pdcp_output_sdu_bytes_to_write
=
((
pdcp_data_ind_header_t
*
)
sdu_p
->
data
)
->
data_size
;
AssertFatal
(
pdcp_output_sdu_bytes_to_write
>=
0
,
"invalid data_size!"
);
#ifdef PDCP_USE_RT_FIFO
bytes_wrote
=
rtf_put
(
PDCP2PDCP_USE_RT_FIFO
,
&
(
sdu
->
data
[
sizeof
(
pdcp_data_ind_header_t
)]),
pdcp_output_sdu_bytes_to_write
);
#else
#ifdef PDCP_USE_NETLINK
#ifdef LINUX
...
...
@@ -314,7 +299,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
#endif // LINUX
#endif //PDCP_USE_NETLINK
bytes_wrote
=
pdcp_output_sdu_bytes_to_write
;
#endif // PDCP_USE_RT_FIFO
#ifdef PDCP_DEBUG
LOG_D
(
PDCP
,
"PDCP->IP Frame %d INST %d: Sent %d Bytes of data from rab %d to higher layers
\n
"
,
...
...
@@ -357,13 +341,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
}
}
else
{
// continue writing sdu
#ifdef PDCP_USE_RT_FIFO
bytes_wrote
=
rtf_put
(
PDCP2PDCP_USE_RT_FIFO
,
(
uint8_t
*
)
(
&
(
sdu_p
->
data
[
sizeof
(
pdcp_data_ind_header_t
)
+
((
pdcp_data_ind_header_t
*
)
sdu_p
->
data
)
->
data_size
-
pdcp_output_sdu_bytes_to_write
])),
pdcp_output_sdu_bytes_to_write
);
#else // PDCP_USE_RT_FIFO
bytes_wrote
=
pdcp_output_sdu_bytes_to_write
;
#endif // PDCP_USE_RT_FIFO
LOG_D
(
PDCP
,
"THINH 2 bytes_wrote = %d
\n
"
,
bytes_wrote
);
if
(
bytes_wrote
>
0
)
{
...
...
@@ -387,24 +365,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_FLUSH
,
0
);
#ifdef PDCP_USE_RT_FIFO
if
((
pdcp_nb_sdu_sent
))
{
if
((
pdcp_2_nas_irq
>
0
))
{
#ifdef PDCP_DEBUG
LOG_D
(
PDCP
,
"Frame %d : Trigger NAS RX interrupt
\n
"
,
ctxt_pP
->
frame
);
#endif //PDCP_DEBUG
rt_pend_linux_srq
(
pdcp_2_nas_irq
);
}
else
{
LOG_E
(
PDCP
,
"Frame %d: ERROR IF IP STACK WANTED : NOTIF PACKET(S) pdcp_2_nas_irq not initialized : %d
\n
"
,
ctxt_pP
->
frame
,
pdcp_2_nas_irq
);
}
}
#endif //PDCP_USE_RT_FIFO
#ifdef PDCP_SDU_FLUSH_LOCK
if
(
pthread_mutex_unlock
(
&
mtex
))
exit_fun
(
"PDCP_SDU_FLUSH_LOCK unlock error!"
);
...
...
@@ -501,130 +461,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
pc5s_header_t
*
pc5s_header
;
#endif
# if defined(PDCP_USE_NETLINK_QUEUES)
rb_id_t
rab_id
=
0
;
pdcp_transmission_mode_t
pdcp_mode
=
PDCP_TRANSMISSION_MODE_UNKNOWN
;
while
(
pdcp_netlink_dequeue_element
(
ctxt_pP
,
&
data_p
)
!=
0
)
{
DevAssert
(
data_p
!=
NULL
);
rab_id
=
data_p
->
pdcp_read_header
.
rb_id
%
maxDRB
;
// ctxt_pP->rnti is NOT_A_RNTI
ctxt_cpy
.
rnti
=
pdcp_module_id_to_rnti
[
ctxt_cpy
.
module_id
][
data_p
->
pdcp_read_header
.
inst
];
key
=
PDCP_COLL_KEY_VALUE
(
ctxt_pP
->
module_id
,
ctxt_cpy
.
rnti
,
ctxt_pP
->
enb_flag
,
rab_id
,
SRB_FLAG_NO
);
h_rc
=
hashtable_get
(
pdcp_coll_p
,
key
,
(
void
**
)
&
pdcp_p
);
if
(
h_rc
!=
HASH_TABLE_OK
)
{
LOG_W
(
PDCP
,
PROTOCOL_CTXT_FMT
" Dropped IP PACKET cause no PDCP instanciated
\n
"
,
PROTOCOL_CTXT_ARGS
(
ctxt_pP
));
free
(
data_p
->
data
);
free
(
data_p
);
data_p
=
NULL
;
continue
;
}
CHECK_CTXT_ARGS
(
&
ctxt_cpy
);
AssertFatal
(
rab_id
<
maxDRB
,
"RB id is too high (%u/%d)!
\n
"
,
rab_id
,
maxDRB
);
if
(
rab_id
!=
0
)
{
LOG_D
(
PDCP
,
"[FRAME %05d][%s][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ "
"/ %d Bytes --->][PDCP][MOD %u][RB %u]
\n
"
,
ctxt_cpy
.
frame
,
(
ctxt_cpy
.
enb_flag
)
?
"eNB"
:
"UE"
,
data_p
->
pdcp_read_header
.
inst
,
data_p
->
pdcp_read_header
.
rb_id
,
data_p
->
pdcp_read_header
.
data_size
,
ctxt_cpy
.
module_id
,
rab_id
);
#ifdef OAI_NW_DRIVER_TYPE_ETHERNET
if
((
data_p
->
pdcp_read_header
.
traffic_type
==
TRAFFIC_IPV6_TYPE_MULTICAST
)
/*TRAFFIC_IPV6_TYPE_MULTICAST */
||
(
data_p
->
pdcp_read_header
.
traffic_type
==
TRAFFIC_IPV4_TYPE_MULTICAST
)
/*TRAFFIC_IPV4_TYPE_MULTICAST */
||
(
data_p
->
pdcp_read_header
.
traffic_type
==
TRAFFIC_IPV4_TYPE_BROADCAST
)
/*TRAFFIC_IPV4_TYPE_BROADCAST */
)
{
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
PDCP_TRANSMISSION_MODE_TRANSPARENT
;
#else
pdcp_mode
=
PDCP_TRANSMISSION_MODE_DATA
;
#endif
}
else
if
((
data_p
->
pdcp_read_header
.
traffic_type
==
TRAFFIC_IPV6_TYPE_UNICAST
)
/* TRAFFIC_IPV6_TYPE_UNICAST */
||
(
data_p
->
pdcp_read_header
.
traffic_type
==
TRAFFIC_IPV4_TYPE_UNICAST
)
/*TRAFFIC_IPV4_TYPE_UNICAST*/
)
{
pdcp_mode
=
PDCP_TRANSMISSION_MODE_DATA
;
}
else
{
pdcp_mode
=
PDCP_TRANSMISSION_MODE_DATA
;
LOG_W
(
PDCP
,
"unknown IP traffic type
\n
"
);
}
#else // OAI_NW_DRIVER_TYPE_ETHERNET NASMESH driver does not curreenlty support multicast traffic
pdcp_mode
=
PDCP_TRANSMISSION_MODE_DATA
;
#endif
pdcp_data_req
(
&
ctxt_cpy
,
SRB_FLAG_NO
,
rab_id
%
maxDRB
,
RLC_MUI_UNDEFINED
,
RLC_SDU_CONFIRM_NO
,
data_p
->
pdcp_read_header
.
data_size
,
data_p
->
data
,
pdcp_mode
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,
NULL
,
NULL
#endif
);
}
else
if
(
ctxt_cpy
.
enb_flag
)
{
/* rb_id = 0, thus interpreated as broadcast and transported as
* multiple unicast is a broadcast packet, we have to send this
* packet on all default RABS of all connected UEs
*/
LOG_D
(
PDCP
,
"eNB Try Forcing send on DEFAULT_RAB_ID first_ue_local %u nb_ue_local %u
\n
"
,
oai_emulation
.
info
.
first_ue_local
,
oai_emulation
.
info
.
nb_ue_local
);
for
(
ue_id
=
0
;
ue_id
<
NB_UE_INST
;
ue_id
++
)
{
if
(
pdcp_module_id_to_rnti
[
ctxt_cpy
.
module_id
][
ue_id
]
!=
NOT_A_RNTI
)
{
LOG_D
(
PDCP
,
"eNB Try Forcing send on DEFAULT_RAB_ID UE %d
\n
"
,
ue_id
);
ctxt
.
module_id
=
ctxt_cpy
.
module_id
;
ctxt
.
rnti
=
ctxt_cpy
.
pdcp_module_id_to_rnti
[
ctxt_cpy
.
module_id
][
ue_id
];
ctxt
.
frame
=
ctxt_cpy
.
frame
;
ctxt
.
enb_flag
=
ctxt_cpy
.
enb_flag
;
pdcp_data_req
(
&
ctxt
,
SRB_FLAG_NO
,
DEFAULT_RAB_ID
,
RLC_MUI_UNDEFINED
,
RLC_SDU_CONFIRM_NO
,
data_p
->
pdcp_read_header
.
data_size
,
data_p
->
data
,
PDCP_TRANSMISSION_MODE_DATA
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,
NULL
,
NULL
#endif
);
}
}
}
else
{
LOG_D
(
PDCP
,
"Forcing send on DEFAULT_RAB_ID
\n
"
);
pdcp_data_req
(
&
ctxt_cpy
,
SRB_FLAG_NO
,
DEFAULT_RAB_ID
,
RLC_MUI_UNDEFINED
,
RLC_SDU_CONFIRM_NO
,
data_p
->
pdcp_read_header
.
data_size
,
data_p
->
data
,
PDCP_TRANSMISSION_MODE_DATA
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,
NULL
,
NULL
#endif
);
}
free
(
data_p
->
data
);
free
(
data_p
);
data_p
=
NULL
;
}
return
0
;
# else
/* PDCP_USE_NETLINK_QUEUES*/
int
len
=
1
;
int
msg_len
;
rb_id_t
rab_id
=
0
;
...
...
@@ -1156,7 +992,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
return
len
;
# endif
#else // neither PDCP_USE_NETLINK nor PDCP_USE_RT_FIFO
return
0
;
#endif // PDCP_USE_NETLINK
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
View file @
4bc842ca
...
...
@@ -70,227 +70,3 @@ extern struct iovec nas_iov_rx;
extern
int
nas_sock_fd
;
extern
struct
msghdr
nas_msg_rx
;
#if defined(PDCP_USE_NETLINK_QUEUES)
static
pthread_t
pdcp_netlink_thread
;
/* We use lock-free queues between the User-plane driver running in kernel-space
* and the corresponding entity in User-space.
* one queue for eNBs (index 0)/one queue for UEs (index 1)
*/
static
struct
lfds611_queue_state
**
pdcp_netlink_queue_enb
=
NULL
;
static
struct
lfds611_queue_state
**
pdcp_netlink_queue_ue
=
NULL
;
static
uint32_t
*
pdcp_netlink_nb_element_enb
=
NULL
;
static
uint32_t
*
pdcp_netlink_nb_element_ue
=
NULL
;
time_stats_t
ip_pdcp_stats_tmp
;
static
void
*
pdcp_netlink_thread_fct
(
void
*
arg
);
//-----------------------------------------------------------------------------
int
pdcp_netlink_init
(
void
)
//-----------------------------------------------------------------------------
{
int
i
;
int
nb_inst_enb
;
int
nb_inst_ue
;
pthread_attr_t
attr
;
struct
sched_param
sched_param
;
reset_meas
(
&
ip_pdcp_stats_tmp
);
nb_inst_enb
=
1
;
nb_inst_ue
=
1
;
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
nb_inst_enb
=
0
;
LOG_I
(
PDCP
,
"[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication
\n
"
);
#else
#warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues"
pdcp_netlink_queue_enb
=
calloc
(
nb_inst_enb
,
sizeof
(
struct
lfds611_queue_state
*
));
pdcp_netlink_nb_element_enb
=
malloc
(
nb_inst_enb
*
sizeof
(
uint32_t
));
LOG_I
(
PDCP
,
"[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication
\n
"
,
nb_inst_enb
);
for
(
i
=
0
;
i
<
nb_inst_enb
;
i
++
)
{
pdcp_netlink_nb_element_enb
[
i
]
=
0
;
if
(
lfds611_queue_new
(
&
pdcp_netlink_queue_enb
[
i
],
PDCP_QUEUE_NB_ELEMENTS
)
<
0
)
{
LOG_E
(
PDCP
,
"Failed to create new FIFO for eNB Netlink -> PDCP communcation instance %d
\n
"
,
i
);
exit
(
EXIT_FAILURE
);
}
}
#endif
if
(
nb_inst_ue
>
0
)
{
pdcp_netlink_queue_ue
=
calloc
(
nb_inst_ue
,
sizeof
(
struct
lfds611_queue_state
*
));
pdcp_netlink_nb_element_ue
=
malloc
(
nb_inst_ue
*
sizeof
(
uint32_t
));
LOG_I
(
PDCP
,
"[NETLINK] Creating %d queues for UE Netlink -> PDCP communication
\n
"
,
nb_inst_ue
);
for
(
i
=
0
;
i
<
nb_inst_ue
;
i
++
)
{
pdcp_netlink_nb_element_ue
[
i
]
=
0
;
if
(
lfds611_queue_new
(
&
pdcp_netlink_queue_ue
[
i
],
PDCP_QUEUE_NB_ELEMENTS
)
<
0
)
{
LOG_E
(
PDCP
,
"Failed to create new FIFO for UE Netlink -> PDCP communcation instance %d
\n
"
,
i
);
exit
(
EXIT_FAILURE
);
}
}
}
if
((
nb_inst_ue
+
nb_inst_enb
)
>
0
)
{
if
(
pthread_attr_init
(
&
attr
)
!=
0
)
{
LOG_E
(
PDCP
,
"[NETLINK]Failed to initialize pthread attribute for Netlink -> PDCP communication (%d:%s)
\n
"
,
errno
,
strerror
(
errno
));
exit
(
EXIT_FAILURE
);
}
sched_param
.
sched_priority
=
10
;
pthread_attr_setschedpolicy
(
&
attr
,
SCHED_RR
);
pthread_attr_setschedparam
(
&
attr
,
&
sched_param
);
/* Create one thread that fetchs packets from the netlink.
* When the netlink fifo is full, packets are silently dropped, this behaviour
* should be avoided if we want a reliable link.
*/
if
(
pthread_create
(
&
pdcp_netlink_thread
,
&
attr
,
pdcp_netlink_thread_fct
,
NULL
)
!=
0
)
{
LOG_E
(
PDCP
,
"[NETLINK]Failed to create new thread for Netlink/PDCP communication (%d:%s)
\n
"
,
errno
,
strerror
(
errno
));
exit
(
EXIT_FAILURE
);
}
pthread_setname_np
(
pdcp_netlink_thread
,
"PDCP netlink"
);
}
return
0
;
}
//-----------------------------------------------------------------------------
int
pdcp_netlink_dequeue_element
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
struct
pdcp_netlink_element_s
**
data_ppP
)
//-----------------------------------------------------------------------------
{
int
ret
=
0
;
if
(
ctxt_pP
->
enb_flag
)
{
ret
=
lfds611_queue_dequeue
(
pdcp_netlink_queue_enb
[
ctxt_pP
->
module_id
],
(
void
**
)
data_ppP
);
if
(
ret
!=
0
)
{
LOG_D
(
PDCP
,
"[NETLINK]De-queueing packet for eNB instance %d
\n
"
,
ctxt_pP
->
module_id
);
}
}
else
{
ret
=
lfds611_queue_dequeue
(
pdcp_netlink_queue_ue
[
ctxt_pP
->
module_id
],
(
void
**
)
data_ppP
);
if
(
ret
!=
0
)
{
LOG_D
(
PDCP
,
"[NETLINK]De-queueing packet for UE instance %d
\n
"
,
ctxt_pP
->
module_id
);
}
}
return
ret
;
}
//-----------------------------------------------------------------------------
static
void
*
pdcp_netlink_thread_fct
(
void
*
arg
)
//-----------------------------------------------------------------------------
{
int
len
=
0
;
struct
pdcp_netlink_element_s
*
new_data_p
=
NULL
;
uint8_t
pdcp_thread_read_state
;
eNB_flag_t
eNB_flag
=
0
;
module_id_t
module_id
=
0
;
pdcp_thread_read_state
=
0
;
memset
(
nl_rx_buf
,
0
,
NL_MAX_PAYLOAD
);
LOG_I
(
PDCP
,
"[NETLINK_THREAD] binding to fd %d
\n
"
,
nas_sock_fd
);
MSC_START_USE
();
while
(
1
)
{
len
=
recvmsg
(
nas_sock_fd
,
&
nas_msg_rx
,
0
);
if
(
len
==
0
)
{
/* Other peer (kernel) has performed an orderly shutdown
*/
LOG_E
(
PDCP
,
"[NETLINK_THREAD] Kernel module has closed the netlink
\n
"
);
exit
(
EXIT_FAILURE
);
}
else
if
(
len
<
0
)
{
/* There was an error */
LOG_E
(
PDCP
,
"[NETLINK_THREAD] An error occured while reading netlink (%d:%s)
\n
"
,
errno
,
strerror
(
errno
));
exit
(
EXIT_FAILURE
);
}
else
{
/* Normal read.
* NOTE: netlink messages can be assembled to form a multipart message
*/
for
(
nas_nlh_rx
=
(
struct
nlmsghdr
*
)
nl_rx_buf
;
NLMSG_OK
(
nas_nlh_rx
,
(
unsigned
int
)
len
);
nas_nlh_rx
=
NLMSG_NEXT
(
nas_nlh_rx
,
len
))
{
start_meas
(
&
ip_pdcp_stats_tmp
);
/* There is no need to check for nlmsg_type because
* the header is not set in our drivers.
*/
if
(
pdcp_thread_read_state
==
0
)
{
new_data_p
=
malloc
(
sizeof
(
struct
pdcp_netlink_element_s
));
if
(
nas_nlh_rx
->
nlmsg_len
==
sizeof
(
pdcp_data_req_header_t
)
+
sizeof
(
struct
nlmsghdr
))
{
pdcp_thread_read_state
=
1
;
memcpy
((
void
*
)
&
new_data_p
->
pdcp_read_header
,
(
void
*
)
NLMSG_DATA
(
nas_nlh_rx
),
sizeof
(
pdcp_data_req_header_t
));
LOG_I
(
PDCP
,
"[NETLINK_THREAD] RX pdcp_data_req_header_t inst %u, "
"rb_id %u data_size %d
\n
"
,
new_data_p
->
pdcp_read_header
.
inst
,
new_data_p
->
pdcp_read_header
.
rb_id
,
new_data_p
->
pdcp_read_header
.
data_size
);
}
else
{
LOG_E
(
PDCP
,
"[NETLINK_THREAD] WRONG size %d should be sizeof "
"%d ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))
\n
"
,
nas_nlh_rx
->
nlmsg_len
,
sizeof
(
pdcp_data_req_header_t
)
+
sizeof
(
struct
nlmsghdr
));
}
}
else
{
pdcp_thread_read_state
=
0
;
module_id
=
0
;
new_data_p
->
data
=
malloc
(
sizeof
(
uint8_t
)
*
new_data_p
->
pdcp_read_header
.
data_size
);
/* Copy the data */
memcpy
(
new_data_p
->
data
,
NLMSG_DATA
(
nas_nlh_rx
),
new_data_p
->
pdcp_read_header
.
data_size
);
if
(
eNB_flag
)
{
if
(
pdcp_netlink_nb_element_enb
[
module_id
]
>
PDCP_QUEUE_NB_ELEMENTS
)
{
LOG_E
(
PDCP
,
"[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%d)
\n
"
,
module_id
,
pdcp_netlink_nb_element_enb
);
}
LOG_I
(
PDCP
,
"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d
\n
"
,
module_id
);
/* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue
(
pdcp_netlink_queue_enb
[
module_id
],
new_data_p
);
stop_meas
(
&
ip_pdcp_stats_tmp
);
copy_meas
(
&
eNB_pdcp_stats
[
module_id
].
pdcp_ip
,
&
ip_pdcp_stats_tmp
);
}
else
{
if
(
pdcp_netlink_nb_element_ue
[
module_id
]
>
PDCP_QUEUE_NB_ELEMENTS
)
{
LOG_E
(
PDCP
,
"[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%d)
\n
"
,
module_id
,
pdcp_netlink_nb_element_ue
);
}
LOG_I
(
PDCP
,
"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d
\n
"
,
module_id
);
/* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue
(
pdcp_netlink_queue_ue
[
module_id
],
new_data_p
);
stop_meas
(
&
ip_pdcp_stats_tmp
);
copy_meas
(
&
UE_pdcp_stats
[
module_id
].
pdcp_ip
,
&
ip_pdcp_stats_tmp
);
}
}
}
}
}
return
NULL
;
}
#endif
openair2/RRC/LTE/rrc_eNB.c
View file @
4bc842ca
...
...
@@ -1457,7 +1457,11 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
create_tunnel_req
.
rnti
=
ctxt_pP
->
rnti
;
// warning put zero above
create_tunnel_req
.
num_tunnels
=
j
;
#if NOS1
noS1_update_s1u_tunnel
(
#else
gtpv1u_update_s1u_tunnel
(
#endif
ctxt_pP
->
instance
,
&
create_tunnel_req
,
reestablish_rnti
);
...
...
openair2/RRC/LTE/rrc_eNB_S1AP.c
View file @
4bc842ca
...
...
@@ -1002,7 +1002,11 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
create_tunnel_req
.
rnti
=
ue_context_p
->
ue_context
.
rnti
;
// warning put zero above
// create_tunnel_req.num_tunnels = i;
#if NOS1
noS1_create_s1u_tunnel
(
#else
gtpv1u_create_s1u_tunnel
(
#endif
instance
,
&
create_tunnel_req
,
&
create_tunnel_resp
);
...
...
@@ -1349,7 +1353,11 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
create_tunnel_req
.
num_tunnels
=
e_rab_done
;
// NN: not sure if we should create a new tunnel: need to check teid, etc.
#if NOS1
noS1_create_s1u_tunnel
(
#else
gtpv1u_create_s1u_tunnel
(
#endif
instance
,
&
create_tunnel_req
,
&
create_tunnel_resp
);
...
...
openair3/GTPV1-U/gtpv1u_eNB_noS1.c
0 → 100644
View file @
4bc842ca
#include <stdio.h>
#include <errno.h>
#include "mme_config.h"
#include "assertions.h"
#include "intertask_interface.h"
#include "msc.h"
#include "gtpv1u.h"
#include "gtpv1u_eNB_defs.h"
#include "gtpv1_u_messages_types.h"
#include "udp_eNB_task.h"
#include "common/utils/LOG/log.h"
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/ran_context.h"
#include "gtpv1u_eNB_defs.h"
int
noS1_create_s1u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_create_tunnel_req_t
*
create_tunnel_req_pP
,
gtpv1u_enb_create_tunnel_resp_t
*
create_tunnel_resp_pP
){
return
0
;
}
int
noS1_update_s1u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_create_tunnel_req_t
*
create_tunnel_req_pP
,
const
rnti_t
prior_rnti
)
{
return
0
;
}
int
noS1_delete_s1u_tunnel
(
const
instance_t
instance
,
gtpv1u_enb_delete_tunnel_req_t
*
udp_data_ind
)
{
return
0
;
}
int
noS1_send
(
const
instance_t
instance
,
gtpv1u_enb_tunnel_data_req_t
*
req
){
return
0
;
}
int
noS1_init
(
int
a
)
{
return
-
1
;
}
int
noS1_receiver
(
int
fd
)
{
/*
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id);
result = pdcp_data_req(
&ctxt,
SRB_FLAG_NO,
(gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4,
0, // mui
SDU_CONFIRM_NO, // confirm
buffer_len,
buffer,
PDCP_TRANSMISSION_MODE_DATA
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,NULL, NULL
#endif
);
*/
return
0
;
}
void
*
noS1_eNB_task
(
void
*
args
)
{
int
sd
;
AssertFatal
((
sd
=
noS1_init
(
0
))
>=
0
,
""
);
itti_subscribe_event_fd
(
TASK_GTPV1_U
,
sd
);
while
(
1
)
{
MessageDef
*
received_message_p
=
NULL
;
itti_receive_msg
(
TASK_GTPV1_U
,
&
received_message_p
);
if
(
received_message_p
!=
NULL
)
{
instance_t
instance
=
ITTI_MSG_INSTANCE
(
received_message_p
);
switch
(
ITTI_MSG_ID
(
received_message_p
))
{
case
GTPV1U_ENB_DELETE_TUNNEL_REQ
:
{
noS1_delete_s1u_tunnel
(
instance
,
&
received_message_p
->
ittiMsg
.
Gtpv1uDeleteTunnelReq
);
}
break
;
// DATA TO BE SENT TO UDP
case
GTPV1U_ENB_TUNNEL_DATA_REQ
:
{
gtpv1u_enb_tunnel_data_req_t
*
data_req
=
NULL
;
data_req
=
&
GTPV1U_ENB_TUNNEL_DATA_REQ
(
received_message_p
);
noS1_send
(
instance
,
data_req
);
}
break
;
case
TERMINATE_MESSAGE
:
{
itti_exit_task
();
}
break
;
case
TIMER_HAS_EXPIRED
:
LOG_W
(
GTPU
,
"Timer not devlopped
\n
"
);
break
;
default:
{
LOG_E
(
GTPU
,
"Unkwnon message ID %d:%s
\n
"
,
ITTI_MSG_ID
(
received_message_p
),
ITTI_MSG_NAME
(
received_message_p
));
}
break
;
}
AssertFatal
(
EXIT_SUCCESS
==
itti_free
(
ITTI_MSG_ORIGIN_ID
(
received_message_p
),
received_message_p
),
"Failed to free memory !
\n
"
);
received_message_p
=
NULL
;
}
struct
epoll_event
*
events
;
int
nb_events
=
itti_get_events
(
TASK_GTPV1_U
,
&
events
);
if
(
nb_events
>
0
&&
events
!=
NULL
)
for
(
int
i
=
0
;
i
<
nb_events
;
i
++
)
if
(
events
[
i
].
data
.
fd
==
sd
)
noS1_receiver
(
events
[
i
].
data
.
fd
);
}
return
NULL
;
}
openair3/GTPV1-U/gtpv1u_eNB_task.h
View file @
4bc842ca
...
...
@@ -41,6 +41,13 @@ gtpv1u_new_data_req(
uint32_t buf_offset);*/
void
*
gtpv1u_eNB_task
(
void
*
args
);
void
*
noS1_eNB_task
(
void
*
args
);
int
noS1_create_s1u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_create_tunnel_req_t
*
const
create_tunnel_req_pP
,
gtpv1u_enb_create_tunnel_resp_t
*
const
create_tunnel_resp_pP
);
int
gtpv1u_create_s1u_tunnel
(
...
...
@@ -48,6 +55,12 @@ gtpv1u_create_s1u_tunnel(
const
gtpv1u_enb_create_tunnel_req_t
*
const
create_tunnel_req_pP
,
gtpv1u_enb_create_tunnel_resp_t
*
const
create_tunnel_resp_pP
);
int
noS1_update_s1u_tunnel
(
const
instance_t
instanceP
,
const
gtpv1u_enb_create_tunnel_req_t
*
const
create_tunnel_req_pP
,
const
rnti_t
prior_rnti
);
int
gtpv1u_update_s1u_tunnel
(
const
instance_t
instanceP
,
...
...
targets/COMMON/create_tasks.c
View file @
4bc842ca
...
...
@@ -85,8 +85,11 @@ int create_tasks(uint32_t enb_nb)
return
-
1
;
}
}
#if NOS1
if
(
itti_create_task
(
TASK_GTPV1_U
,
&
noS1_eNB_task
,
NULL
)
<
0
)
{
#else
if
(
itti_create_task
(
TASK_GTPV1_U
,
&
gtpv1u_eNB_task
,
NULL
)
<
0
)
{
#endif
LOG_E
(
GTPU
,
"Create task for GTPV1U failed
\n
"
);
return
-
1
;
}
...
...
targets/RT/USER/lte-softmodem.c
View file @
4bc842ca
...
...
@@ -952,9 +952,6 @@ int main( int argc, char **argv )
#ifdef PDCP_USE_NETLINK
printf
(
"PDCP netlink
\n
"
);
netlink_init
();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init
();
#endif
#endif
#if !defined(ENABLE_ITTI)
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
4bc842ca
...
...
@@ -858,9 +858,6 @@ int main( int argc, char **argv )
#ifdef PDCP_USE_NETLINK
printf
(
"PDCP netlink
\n
"
);
netlink_init
();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init
();
#endif
#endif
//TTN for D2D
...
...
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