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
c871e77c
Commit
c871e77c
authored
Jun 26, 2023
by
lfq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more-sp-msg-num-65536
parent
95be6886
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
275 additions
and
94 deletions
+275
-94
ci-scripts/conf_files/gnb-cucp.sa.f1.conf
ci-scripts/conf_files/gnb-cucp.sa.f1.conf
+1
-1
common/utils/ocp_itti/intertask_interface.h
common/utils/ocp_itti/intertask_interface.h
+2
-2
executables/nr-cuup.c
executables/nr-cuup.c
+6
-5
executables/nr-sdap.c
executables/nr-sdap.c
+2
-2
openair2/COMMON/gtpv1_u_messages_types.h
openair2/COMMON/gtpv1_u_messages_types.h
+1
-0
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
+53
-18
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h
+1
-1
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+14
-10
openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c
openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c
+2
-2
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+1
-1
openair2/SDAP/nr_sdap/nr_sdap.c
openair2/SDAP/nr_sdap/nr_sdap.c
+24
-5
openair2/SDAP/nr_sdap/nr_sdap_entity.c
openair2/SDAP/nr_sdap/nr_sdap_entity.c
+3
-2
openair2/SDAP/nr_sdap/nr_sdap_entity.h
openair2/SDAP/nr_sdap/nr_sdap_entity.h
+13
-0
openair3/ocp-gtpu/gtp_itf.cpp
openair3/ocp-gtpu/gtp_itf.cpp
+151
-44
openair3/ocp-gtpu/gtp_itf.h
openair3/ocp-gtpu/gtp_itf.h
+1
-1
No files found.
ci-scripts/conf_files/gnb-cucp.sa.f1.conf
View file @
c871e77c
...
...
@@ -171,7 +171,7 @@ gNBs =
//////////
AMF
parameters
:
amf_ip_address
= ( {
ipv4
=
"192.168.199.
218
"
;
amf_ip_address
= ( {
ipv4
=
"192.168.199.
193
"
;
ipv6
=
"192:168:30::17"
;
active
=
"yes"
;
preference
=
"ipv4"
;
...
...
common/utils/ocp_itti/intertask_interface.h
View file @
c871e77c
...
...
@@ -337,12 +337,12 @@ void *rrc_enb_process_msg(void *);
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000, NULL, NULL) \
TASK_DEF(TASK_
PDCP_GTP
, TASK_PRIORITY_MED, 1000, NULL, NULL) \
TASK_DEF(TASK_
SP_SORT
, TASK_PRIORITY_MED, 1000, NULL, NULL) \
TASK_DEF(TASK_SDAP_GTP, TASK_PRIORITY_MED, 1000, NULL, NULL) \
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SP_U, TASK_PRIORITY_MED, 200, NULL, NULL)
\
TASK_DEF(TASK_SP_U, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_CUCP_E1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_CUUP_E1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
...
...
executables/nr-cuup.c
View file @
c871e77c
...
...
@@ -24,6 +24,7 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/msg.h>
#include <sys/sem.h>
#include "common/utils/simple_executable.h"
#include "executables/softmodem-common.h"
#include "common/utils/ocp_itti/intertask_interface.h"
...
...
@@ -132,7 +133,7 @@ int main(int argc, char **argv)
logInit
();
set_softmodem_sighandler
();
itti_init
(
TASK_MAX
,
tasks_info
);
int
shmid_data
,
shmid_ctxt
,
shmid_pdcp_ctxt
,
para_shm
;
int
shmid_data
,
shmid_ctxt
,
shmid_pdcp_ctxt
,
para_shm
,
semid
;
uint8_t
*
pdcp_ctxt
,
*
shm
,
*
cshm
,
*
para
;
if
((
shmid_data
=
shmget
((
key_t
)
1
,
SHM_SIZE
,
IPC_CREAT
|
0666
))
<
0
)
{
perror
(
"shmget"
);
...
...
@@ -158,6 +159,8 @@ int main(int argc, char **argv)
perror
(
"shmat"
);
}
semid
=
semget
(
5
,
1
,
IPC_CREAT
|
0666
);
semctl
(
semid
,
0
,
SETVAL
,
1
);
msgget
(
0x1234
,
IPC_CREAT
|
0777
);
msgget
(
0x2345
,
IPC_CREAT
|
0777
);
msgget
(
0x3456
,
IPC_CREAT
|
0777
);
...
...
@@ -174,10 +177,8 @@ int main(int argc, char **argv)
AssertFatal
(
rc
>=
0
,
"Create task for CUUP E1 failed
\n
"
);
// rc = itti_create_task(TASK_SP_U, SP_U_task, NULL);
// AssertFatal(rc >= 0, "Create task for SP U failed\n");
// rc = itti_create_task(TASK_SP, SP_task, NULL);
// AssertFatal(rc >= 0, "Create task for SP failed\n");
rc
=
itti_create_task
(
TASK_PDCP_GTP
,
pdcp_gtp_Task
,
NULL
);
AssertFatal
(
rc
>=
0
,
"Create task for pdcp gtp failed
\n
"
);
rc
=
itti_create_task
(
TASK_SP_SORT
,
SP_sort_task
,
NULL
);
AssertFatal
(
rc
>=
0
,
"Create task for SP sort failed
\n
"
);
rc
=
itti_create_task
(
TASK_SDAP_GTP
,
sdap_gtp_Task
,
NULL
);
AssertFatal
(
rc
>=
0
,
"Create task for sdap gtp failed
\n
"
);
nr_pdcp_layer_init
();
...
...
executables/nr-sdap.c
View file @
c871e77c
...
...
@@ -85,11 +85,11 @@ int main(int argc, char **argv)
// while(argc) //当(统计参数个数)
// printf("%s\n",argv[--argc]);
if
(
strcmp
(
argv
[
1
],
"1"
)
==
0
){
printf
(
"
模式1
\n
"
);
printf
(
"
pdcp sdap ul
\n
"
);
rc
=
itti_create_task
(
TASK_SP_U
,
SP_U_task
,
NULL
);
AssertFatal
(
rc
>=
0
,
"Create task for SP U failed
\n
"
);
}
else
{
printf
(
"
模式2
\n
"
);
printf
(
"
sdap pdcp dl
\n
"
);
rc
=
itti_create_task
(
TASK_SP
,
SP_task
,
NULL
);
AssertFatal
(
rc
>=
0
,
"Create task for SP failed
\n
"
);
}
...
...
openair2/COMMON/gtpv1_u_messages_types.h
View file @
c871e77c
...
...
@@ -113,6 +113,7 @@ typedef struct gtpv1u_tunnel_data_req_s {
uint32_t
offset
;
///< start of message offset in buffer
ue_id_t
ue_id
;
rb_id_t
bearer_id
;
int
num
;
}
gtpv1u_tunnel_data_req_t
;
typedef
struct
gtpv1u_enb_data_forwarding_req_s
{
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
View file @
c871e77c
...
...
@@ -24,7 +24,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include "nr_pdcp_security_nea2.h"
#include "nr_pdcp_integrity_nia2.h"
#include "nr_pdcp_integrity_nia1.h"
...
...
@@ -32,6 +34,20 @@
#include "LOG/log.h"
int
P
(
int
semid
,
int
idx
){
struct
sembuf
sbuf
;
sbuf
.
sem_num
=
idx
;
sbuf
.
sem_op
=
-
1
;
sbuf
.
sem_flg
=
0
;
semop
(
semid
,
&
sbuf
,
1
);
}
int
V
(
int
semid
,
int
idx
){
struct
sembuf
sbuf
;
sbuf
.
sem_num
=
idx
;
sbuf
.
sem_op
=
1
;
sbuf
.
sem_flg
=
0
;
semop
(
semid
,
&
sbuf
,
1
);
}
void
nr_pdcp_entity_recv_pdu
(
nr_pdcp_entity_t
*
entity
,
char
*
_buffer
,
int
size
,
int
shm_offset_cu
)
{
...
...
@@ -44,7 +60,7 @@
int
integrity_size
;
int
rx_deliv_sn
;
uint32_t
rx_deliv_hfn
;
LOG_I
(
PDCP
,
"entry nr_pdcp_entity_recv_pdu,shm_offset_cu:%d
\n
"
,
shm_offset_cu
);
//
LOG_I(PDCP,"entry nr_pdcp_entity_recv_pdu,shm_offset_cu:%d\n",shm_offset_cu);
if
(
size
<
1
)
{
LOG_E
(
PDCP
,
"bad PDU received (size = %d)
\n
"
,
size
);
return
;
...
...
@@ -63,14 +79,17 @@
entity
->
stats
.
rxpdu_bytes
+=
size
;
if
(
entity
->
sn_size
==
12
)
{
rcvd_sn
=
((
buffer
[
0
]
&
0xf
)
<<
8
)
|
buffer
[
1
];
header_size
=
2
;
}
else
{
// LOG_I(PDCP,"buffer[0]:%x----buffer[1]:%x----buffer[2]:%x-----\n",buffer[0],buffer[1],buffer[2]);
rcvd_sn
=
((
buffer
[
0
]
&
0x3
)
<<
16
)
|
(
buffer
[
1
]
<<
8
)
|
buffer
[
2
];
// LOG_I(PDCP,"rcvd_sn:%d",rcvd_sn);
header_size
=
3
;
}
entity
->
stats
.
rxpdu_sn
=
rcvd_sn
;
...
...
@@ -91,10 +110,10 @@
return
;
}
// LOG_I(PDCP,"------entity->rx_deliv:%d-------entity->sn_max:%d-------entity->sn_size:%d-\n",entity->rx_deliv,entity->sn_max,entity->sn_size);
rx_deliv_sn
=
entity
->
rx_deliv
&
entity
->
sn_max
;
rx_deliv_hfn
=
entity
->
rx_deliv
>>
entity
->
sn_size
;
// LOG_I(PDCP,"------rcvd_sn:%d-------entity->window_size:%d-------\n",rcvd_sn,entity->window_size);
if
(
rcvd_sn
<
rx_deliv_sn
-
entity
->
window_size
)
{
rcvd_hfn
=
rx_deliv_hfn
+
1
;
}
else
if
(
rcvd_sn
>=
rx_deliv_sn
+
entity
->
window_size
)
{
...
...
@@ -102,9 +121,9 @@
}
else
{
rcvd_hfn
=
rx_deliv_hfn
;
}
// LOG_I(PDCP,"------rcvd_hfn:%d---------\n",rcvd_hfn);
rcvd_count
=
(
rcvd_hfn
<<
entity
->
sn_size
)
|
rcvd_sn
;
// LOG_I(PDCP,"------rcvd_count:%d---------\n",rcvd_count);
if
(
entity
->
has_ciphering
)
entity
->
cipher
(
entity
->
security_context
,
buffer
+
header_size
,
size
-
header_size
,
...
...
@@ -123,7 +142,7 @@
}
}
LOG_I
(
PDCP
,
"rcvd_count=%d, entity->rx_deliv %d,sdu_in_list %d
\n
"
,
rcvd_count
,
entity
->
rx_deliv
,
nr_pdcp_sdu_in_list
(
entity
->
rx_list
,
rcvd_count
));
//
LOG_I(PDCP,"rcvd_count=%d, entity->rx_deliv %d,sdu_in_list %d\n",rcvd_count,entity->rx_deliv,nr_pdcp_sdu_in_list(entity->rx_list,rcvd_count));
if
(
rcvd_count
<
entity
->
rx_deliv
||
nr_pdcp_sdu_in_list
(
entity
->
rx_list
,
rcvd_count
))
{
LOG_W
(
PDCP
,
"discard NR PDU rcvd_count=%d, entity->rx_deliv %d,sdu_in_list %d
\n
"
,
rcvd_count
,
entity
->
rx_deliv
,
nr_pdcp_sdu_in_list
(
entity
->
rx_list
,
rcvd_count
));
...
...
@@ -151,7 +170,7 @@
uint32_t
count
=
entity
->
rx_deliv
;
while
(
entity
->
rx_list
!=
NULL
&&
count
==
entity
->
rx_list
->
count
)
{
nr_pdcp_sdu_t
*
cur
=
entity
->
rx_list
;
LOG_I
(
PDCP
,
"deliver sdu 1
\n
"
);
//
LOG_I(PDCP,"deliver sdu 1\n");
entity
->
deliver_sdu
(
entity
->
deliver_sdu_data
,
entity
,
cur
->
buffer
,
cur
->
size
,
shm_offset_cu
);
entity
->
rx_list
=
cur
->
next
;
...
...
@@ -180,7 +199,7 @@
int
nr_pdcp_entity_process_sdu
(
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
,
in
t
sdu_id
,
uint16_
t
sdu_id
,
char
*
pdu_buffer
,
int
pdu_max_size
)
{
...
...
@@ -191,14 +210,31 @@
char
*
buf
=
buffer
;
DevAssert
(
size
+
3
+
4
<=
pdu_max_size
);
int
dc_bit
;
int
semid
;
entity
->
stats
.
rxsdu_pkts
++
;
entity
->
stats
.
rxsdu_bytes
+=
size
;
count
=
entity
->
tx_next
;
sn
=
entity
->
tx_next
&
entity
->
sn_max
;
semid
=
semget
(
5
,
1
,
IPC_CREAT
|
0666
);
// P(semid,0);
// count = entity->tx_next;
// entity->tx_next++;
// entity->tx_next = sdu_id;
// entity->tx_next++;
// V(semid,0);
// sn = sdu_id;
// sn = count & entity->sn_max;
if
(
sdu_id
>
0
){
entity
->
tx_next
=
sdu_id
;
entity
->
tx_next
++
;
sn
=
sdu_id
;
}
else
{
count
=
entity
->
tx_next
;
entity
->
tx_next
++
;
sn
=
count
&
entity
->
sn_max
;
}
// LOG_I(PDCP,"sn *********** %d\n",sn);
/* D/C bit is only to be set for DRBs */
if
(
entity
->
type
==
NR_PDCP_DRB_AM
||
entity
->
type
==
NR_PDCP_DRB_UM
)
{
...
...
@@ -250,13 +286,12 @@
entity
->
security_mode_completed
=
true
;
}
entity
->
tx_next
++
;
entity
->
stats
.
txpdu_pkts
++
;
entity
->
stats
.
txpdu_bytes
+=
header_size
+
size
+
integrity_size
;
entity
->
stats
.
txpdu_sn
=
sn
;
pdu_buffer
=
buf
-
header_size
;
printf
(
"header_size%d
\n
"
,
header_size
);
//
printf("header_size%d\n",header_size);
return
header_size
+
size
+
integrity_size
;
}
...
...
@@ -340,7 +375,7 @@
/* deliver all SDUs with count < rx_reord */
while
(
entity
->
rx_list
!=
NULL
&&
entity
->
rx_list
->
count
<
entity
->
rx_reord
)
{
nr_pdcp_sdu_t
*
cur
=
entity
->
rx_list
;
LOG_I
(
PDCP
,
"deliver sdu 2"
);
//
LOG_I(PDCP,"deliver sdu 2");
entity
->
deliver_sdu
(
entity
->
deliver_sdu_data
,
entity
,
cur
->
buffer
,
cur
->
size
,
0
);
entity
->
rx_list
=
cur
->
next
;
...
...
@@ -352,7 +387,7 @@
count
=
entity
->
rx_reord
;
while
(
entity
->
rx_list
!=
NULL
&&
count
==
entity
->
rx_list
->
count
)
{
nr_pdcp_sdu_t
*
cur
=
entity
->
rx_list
;
LOG_I
(
PDCP
,
"deliver sdu 3"
);
//
LOG_I(PDCP,"deliver sdu 3");
entity
->
deliver_sdu
(
entity
->
deliver_sdu_data
,
entity
,
cur
->
buffer
,
cur
->
size
,
0
);
entity
->
rx_list
=
cur
->
next
;
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h
View file @
c871e77c
...
...
@@ -217,7 +217,7 @@ void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity,
int
nr_pdcp_entity_process_sdu
(
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
,
in
t
sdu_id
,
uint16_
t
sdu_id
,
char
*
pdu_buffer
,
int
pdu_max_size
);
void
nr_pdcp_entity_set_security
(
nr_pdcp_entity_t
*
entity
,
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
c871e77c
...
...
@@ -65,7 +65,7 @@
#include "nr_pdcp_e1_api.h"
#include "gnb_config.h"
#include "executables/softmodem-common.h"
int
count_pdcp
=
0
;
uint8_t
*
pdcp_ctxt
;
typedef
struct
{
int
shm_offset
;
...
...
@@ -73,6 +73,7 @@ typedef struct {
uint32_t
offset
;
int
ue_id
;
int
bearer_id
;
int
num
;
}
pdcp_data_req_queue_item
;
typedef
struct
{
...
...
@@ -312,7 +313,7 @@ static void do_pdcp_data_ind(
nr_pdcp_entity_t
rb_entity_tmp
;
ue_id_t
rntiMaybeUEid
=
ctxt_pP
->
rntiMaybeUEid
;
int
shmid_pdcp_ctxt
;
LOG_I
(
PDCP
,
"entry do pdcp data ind,shm_offset_cu:%d
\n
"
,
shm_offset_cu
);
//
LOG_I(PDCP,"entry do pdcp data ind,shm_offset_cu:%d\n",shm_offset_cu);
if
(
ctxt_pP
->
module_id
!=
0
||
//ctxt_pP->enb_flag != 1 ||
ctxt_pP
->
instance
!=
0
||
...
...
@@ -337,7 +338,7 @@ static void do_pdcp_data_ind(
int64_t
*
pdcp_num
=
(
struct
int64_t
*
)
pdcp_ctxt
;
// nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
rntiMaybeUEid
);
LOG_I
(
PDCP
,
"srb_flagP %d"
,
srb_flagP
);
//
LOG_I(PDCP,"srb_flagP %d",srb_flagP);
if
(
srb_flagP
==
1
)
{
if
(
rb_id
<
1
||
rb_id
>
2
)
rb
=
NULL
;
...
...
@@ -387,6 +388,7 @@ static void do_pdcp_data_ind(
nr_pdcp_entity_set_security
(
rb
,
rb
->
has_integrity_algorithm
,
&
rb
->
has_integrity_key
,
rb
->
has_ciphering_algorithm
,
&
rb
->
has_ciphering_key
);
// LOG_I(PDCP,"recv buffer[0]:%x-------buffer[1]:%x--------buffer[2]:%x\n",((char *)sdu_buffer->data)[0],((char *)sdu_buffer->data)[1],((char *)sdu_buffer->data)[2]);
rb
->
recv_pdu
(
rb
,
(
char
*
)
sdu_buffer
->
data
,
sdu_buffer_size
,
shm_offset_cu
);
}
else
{
LOG_E
(
PDCP
,
"%s:%d:%s: no RB found (rb_id %ld, srb_flag %d)
\n
"
,
...
...
@@ -464,7 +466,7 @@ static void enqueue_pdcp_data_ind(
i
=
(
pq
.
start
+
pq
.
length
)
%
PDCP_DATA_IND_QUEUE_SIZE
;
pq
.
length
++
;
// LOG_I(PDCP,"enqueue_pdcp_data_ind buffer[0]:%x-------buffer[1]:%x--------buffer[2]:%x\n",((char *)sdu_buffer->data)[0],((char *)sdu_buffer->data)[1],((char *)sdu_buffer->data)[2]);
pq
.
q
[
i
].
ctxt_pP
=
*
ctxt_pP
;
pq
.
q
[
i
].
srb_flagP
=
srb_flagP
;
pq
.
q
[
i
].
MBMS_flagP
=
MBMS_flagP
;
...
...
@@ -487,7 +489,7 @@ bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
const
uint32_t
*
const
dstID
,
int
shm_offset_cu
)
{
LOG_I
(
PDCP
,
"pdcp_data_ind shm_offset:%d"
,
shm_offset_cu
);
//
LOG_I(PDCP,"pdcp_data_ind shm_offset:%d",shm_offset_cu);
enqueue_pdcp_data_ind
(
ctxt_pP
,
srb_flagP
,
MBMS_flagP
,
...
...
@@ -747,7 +749,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
nr_pdcp_ue_t
*
ue
=
_ue
;
int
rb_id
;
int
i
;
LOG_I
(
PDCP
,
"deliver_sdu_drb shm_offset_cu:%d
\n
"
,
shm_offset_cu
);
//
LOG_I(PDCP,"deliver_sdu_drb shm_offset_cu:%d\n",shm_offset_cu);
if
(
IS_SOFTMODEM_NOS1
||
UE_NAS_USE_TUN
)
{
LOG_D
(
PDCP
,
"IP packet received with size %d, to be sent to SDAP interface, UE ID/RNTI: %ld
\n
"
,
size
,
ue
->
rntiMaybeUEid
);
sdap_data_ind
(
entity
->
rb_id
,
entity
->
is_gnb
,
entity
->
has_sdap_rx
,
entity
->
pdusession_id
,
ue
->
rntiMaybeUEid
,
buf
,
size
,
0
);
...
...
@@ -765,7 +767,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
rb_found:
{
LOG_
I
(
PDCP
,
"%s() (drb %d) sending message to SDAP size %d
\n
"
,
__func__
,
rb_id
,
size
);
LOG_
D
(
PDCP
,
"%s() (drb %d) sending message to SDAP size %d
\n
"
,
__func__
,
rb_id
,
size
);
sdap_data_ind
(
rb_id
,
ue
->
drb
[
rb_id
-
1
]
->
is_gnb
,
ue
->
drb
[
rb_id
-
1
]
->
has_sdap_rx
,
ue
->
drb
[
rb_id
-
1
]
->
pdusession_id
,
ue
->
rntiMaybeUEid
,
buf
,
size
,
shm_offset_cu
);
}
}
...
...
@@ -777,7 +779,7 @@ static void deliver_pdu_drb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
DevAssert
(
deliver_pdu_data
==
NULL
);
protocol_ctxt_t
ctxt
=
{
.
enb_flag
=
1
,
.
rntiMaybeUEid
=
ue_id
};
// node_type = get_node_type();
printf
(
"####
\n
"
);
//
printf("####\n");
if
(
NODE_IS_CU
(
node_type
))
{
// MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
// GTPV1U_TUNNEL_DATA_REQ,
...
...
@@ -808,6 +810,7 @@ static void deliver_pdu_drb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
writeBuf
.
q
.
offset
=
GTPU_HEADER_OVERHEAD_MAX
;
writeBuf
.
q
.
ue_id
=
ue_id
;
writeBuf
.
q
.
bearer_id
=
rb_id
;
writeBuf
.
q
.
num
=
sdu_id
;
int
msgId
=
msgget
(
0x2345
,
IPC_CREAT
|
0777
);
if
(
msgId
==
-
1
){
LOG_E
(
GTPU
,
"pdcp create msg error"
);
...
...
@@ -1410,7 +1413,7 @@ void *SP_U_task(void *arg){
}
shm_cu_f1u
=
shm_cu_f1u_t
;
shm_cu_f1u
=
shm_cu_f1u
+
cu_f1u_readBuf
.
sq
.
shm_offset
*
SHMDATE_SIZE
+
cu_f1u_readBuf
.
sq
.
offset
+
hdr_sdap
;
LOG_I
(
PDCP
,
"cu_f1u_readBuf.sq.shm_offset : %d cu_f1u_readBuf.sq.offset:%d
\n
"
,
cu_f1u_readBuf
.
sq
.
shm_offset
,
cu_f1u_readBuf
.
sq
.
offset
);
//
LOG_I(PDCP,"cu_f1u_readBuf.sq.shm_offset : %d cu_f1u_readBuf.sq.offset:%d\n",cu_f1u_readBuf.sq.shm_offset,cu_f1u_readBuf.sq.offset);
protocol_ctxt_t
ctxtS
;
ctxtS
.
module_id
=
0
;
ctxtS
.
enb_flag
=
1
;
...
...
@@ -1454,7 +1457,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
const
uint32_t
*
const
sourceL2Id
,
const
uint32_t
*
const
destinationL2Id
)
{
//Force instance id to 0, OAI incoherent instance management
LOG_I
(
PDCP
,
"entry cu_f1u_data_req"
);
//
LOG_I(PDCP,"entry cu_f1u_data_req");
ctxt_pP
->
instance
=
0
;
mem_block_t
*
memblock
=
get_free_mem_block
(
sdu_buffer_size
,
__func__
);
if
(
memblock
==
NULL
)
{
...
...
@@ -1463,6 +1466,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
};
int
shm_offset_cu
=
muiP
;
memcpy
(
memblock
->
data
,
sdu_buffer
,
sdu_buffer_size
);
// LOG_I(PDCP,"memblock->data buffer[0]:%x-------buffer[1]:%x--------buffer[2]:%x\n",(memblock->data)[0],(memblock->data)[1],(memblock->data)[2]);
int
ret
=
pdcp_data_ind
(
ctxt_pP
,
srb_flagP
,
false
,
rb_id
,
sdu_buffer_size
,
memblock
,
NULL
,
NULL
,
shm_offset_cu
);
if
(
!
ret
)
{
LOG_E
(
RLC
,
"%s:%d:%s: ERROR: pdcp_data_ind failed
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c
View file @
c871e77c
...
...
@@ -49,7 +49,7 @@ static void *nr_pdcp_timer_thread(void *_nr_pdcp_ue_manager)
curtime
=
timer_thread_curtime
;
if
(
pthread_mutex_unlock
(
&
timer_thread_mutex
)
!=
0
)
abort
();
nr_pdcp_manager_lock
(
nr_pdcp_ue_manager
);
//
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue_list
=
nr_pdcp_manager_get_ue_list
(
nr_pdcp_ue_manager
);
ue_count
=
nr_pdcp_manager_get_ue_count
(
nr_pdcp_ue_manager
);
...
...
@@ -64,7 +64,7 @@ static void *nr_pdcp_timer_thread(void *_nr_pdcp_ue_manager)
}
}
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
//
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
}
return
NULL
;
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
c871e77c
...
...
@@ -124,7 +124,7 @@ bool DURecvCb(protocol_ctxt_t *ctxt_pP,
const
uint32_t
*
destinationL2Id
)
{
// The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue
mem_block_t
*
sdu
=
get_free_mem_block
(
sdu_buffer_sizeP
,
__func__
);
LOG_E
(
PDCP
,
"enrty DURecvCb"
);
//
LOG_E(PDCP,"enrty DURecvCb");
memcpy
(
sdu
->
data
,
sdu_buffer_pP
,
sdu_buffer_sizeP
);
du_rlc_data_req
(
ctxt_pP
,
srb_flagP
,
false
,
rb_idP
,
muiP
,
confirmP
,
sdu_buffer_sizeP
,
sdu
);
return
true
;
...
...
openair2/SDAP/nr_sdap/nr_sdap.c
View file @
c871e77c
...
...
@@ -43,7 +43,9 @@
#include <openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h>
#include <openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h>
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
#include "openair2/SDAP/nr_sdap/nr_sdap_entity.h"
// #include "openair2/SDAP/nr_sdap/nr_sdap_entity.c"
int
count
=
0
;
uint8_t
nas_qfi
;
uint8_t
nas_pduid
;
#define SHMDATE_SIZE 65536
...
...
@@ -70,6 +72,7 @@ typedef struct {
int
shm_offset
;
unsigned
int
offset
;
instance_t
cxtx_instance
;
uint16_t
num
;
}
sdap_data_req_queue_item
;
typedef
struct
{
...
...
@@ -97,7 +100,7 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p,
LOG_E
(
SDAP
,
"%s:%d:%s: Entity not found with ue: 0x%"
PRIx64
" and pdusession id: %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
ue_id
,
pdusession_id
);
return
0
;
}
bool
ret
=
sdap_entity
->
tx_entity
(
sdap_entity
,
bool
ret
=
nr_sdap_
tx_entity
(
sdap_entity
,
ctxt_p
,
srb_flag
,
rb_id
,
...
...
@@ -110,6 +113,19 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p,
destinationL2Id
,
qfi
,
rqi
);
// bool ret = sdap_entity->tx_entity(sdap_entity,
// ctxt_p,
// srb_flag,
// rb_id,
// mui,
// confirm,
// sdu_buffer_size,
// sdu_buffer,
// pt_mode,
// shm_offset,
// destinationL2Id,
// qfi,
// rqi);
return
ret
;
}
...
...
@@ -149,6 +165,8 @@ bool enqueue_sdap_data_req(protocol_ctxt_t *ctxt_p,
writeBuf
.
sq
.
shm_offset
=
shm_offset
;
writeBuf
.
sq
.
offset
=
offset
;
writeBuf
.
sq
.
cxtx_instance
=
cxtx_instance
;
writeBuf
.
sq
.
num
=
count
;
count
++
;
int
msgId
=
msgget
(
0x1234
,
IPC_CREAT
|
0777
);
if
(
msgId
==
-
1
){
...
...
@@ -156,6 +174,7 @@ bool enqueue_sdap_data_req(protocol_ctxt_t *ctxt_p,
return
false
;
}
else
{
int
ret
=
msgsnd
(
msgId
,
&
writeBuf
,
sizeof
(
writeBuf
)
-
sizeof
(
long
),
0
);
// LOG_I(SDAP,"aaaaaaaa send to sdap msg num:%d\n",writeBuf.sq.num);
if
(
ret
==-
1
){
return
false
;
...
...
@@ -182,7 +201,7 @@ void sdap_data_ind(rb_id_t pdcp_entity,
LOG_E
(
SDAP
,
"%s:%d:%s: Entity not found for ue rnti/ue_id: %lx and pdusession id: %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
ue_id
,
pdusession_id
);
return
;
}
LOG_I
(
SDAP
,
"sdap_data_ind shm_offset_cu:%d
\n
"
,
shm_offset_cu
);
//
LOG_I(SDAP,"sdap_data_ind shm_offset_cu:%d\n",shm_offset_cu);
sdap_entity
->
rx_entity
(
sdap_entity
,
pdcp_entity
,
is_gnb
,
...
...
@@ -239,12 +258,12 @@ void *SP_task(void *arg){
ctxtS
.
subframe
=
0
;
ctxtS
.
eNB_index
=
0
;
ctxtS
.
brOption
=
0
;
// LOG_I(SDAP,"msg num :%d\n",readBuf.sq.num);
bool
sdap_ret
=
sdap_data_req
(
&
ctxtS
,
readBuf
.
sq
.
ue_id
,
readBuf
.
sq
.
srb_flag
,
readBuf
.
sq
.
rb_id
,
readBuf
.
sq
.
mui
,
readBuf
.
sq
.
num
,
readBuf
.
sq
.
confirm
,
readBuf
.
sq
.
sdu_buffer_size
,
shm
,
...
...
openair2/SDAP/nr_sdap/nr_sdap_entity.c
View file @
c871e77c
...
...
@@ -83,7 +83,7 @@ void nr_pdcp_submit_sdap_ctrl_pdu(ue_id_t ue_id, rb_id_t sdap_ctrl_pdu_drb, nr_s
return
;
}
static
bool
nr_sdap_tx_entity
(
nr_sdap_entity_t
*
entity
,
bool
nr_sdap_tx_entity
(
nr_sdap_entity_t
*
entity
,
protocol_ctxt_t
*
ctxt_p
,
const
srb_flag_t
srb_flag
,
const
rb_id_t
rb_id
,
...
...
@@ -218,7 +218,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
int
shm_offset_cu
)
{
/* The offset of the SDAP header, it might be 0 if has_sdap_rx is not true in the pdcp entity. */
int
offset
=
0
;
LOG_I
(
SDAP
,
"nr_sdap_rx_entity shm_offset_cu:%d
\n
"
,
shm_offset_cu
);
//
LOG_I(SDAP,"nr_sdap_rx_entity shm_offset_cu:%d\n",shm_offset_cu);
if
(
is_gnb
)
{
// gNB
if
(
has_sdap_rx
)
{
// Handling the SDAP Header
offset
=
SDAP_HDR_LENGTH
;
...
...
@@ -359,6 +359,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
if
(
len
!=
size
-
offset
)
LOG_E
(
SDAP
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
// LOG_E(SDAP, " len %d:size-off %d\n", len,size-offset);
}
}
...
...
openair2/SDAP/nr_sdap/nr_sdap_entity.h
View file @
c871e77c
...
...
@@ -124,6 +124,19 @@ void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t d
/* QFI to DRB Mapping Related Function */
void
nr_sdap_qfi2drb_map_del
(
nr_sdap_entity_t
*
entity
,
uint8_t
qfi
);
bool
nr_sdap_tx_entity
(
nr_sdap_entity_t
*
entity
,
protocol_ctxt_t
*
ctxt_p
,
const
srb_flag_t
srb_flag
,
const
rb_id_t
rb_id
,
const
mui_t
mui
,
const
confirm_t
confirm
,
const
sdu_size_t
sdu_buffer_size
,
unsigned
char
*
const
sdu_buffer
,
const
pdcp_transmission_mode_t
pt_mode
,
int
shm_offset
,
const
uint32_t
*
destinationL2Id
,
const
uint8_t
qfi
,
const
bool
rqi
);
/*
* TS 37.324
* 4.4 Functions
...
...
openair3/ocp-gtpu/gtp_itf.cpp
View file @
c871e77c
This diff is collapsed.
Click to expand it.
openair3/ocp-gtpu/gtp_itf.h
View file @
c871e77c
...
...
@@ -106,7 +106,7 @@ extern "C" {
int
newGtpuDeleteTunnels
(
instance_t
instance
,
ue_id_t
ue_id
,
int
nbTunnels
,
pdusessionid_t
*
pdusession_id
);
instance_t
gtpv1Init
(
openAddr_t
context
);
void
*
gtpv1uTask
(
void
*
args
);
void
*
pdcp_gtp_T
ask
(
void
*
args
);
void
*
SP_sort_t
ask
(
void
*
args
);
void
*
sdap_gtp_Task
(
void
*
args
);
// Legacy to fix
...
...
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