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
Michael Black
OpenXG-RAN
Commits
bfd7bfbb
Commit
bfd7bfbb
authored
May 06, 2023
by
huanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
offset+msq+shm
parent
bb936c61
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
11 deletions
+53
-11
openair2/SDAP/nr_sdap/nr_sdap.c
openair2/SDAP/nr_sdap/nr_sdap.c
+42
-2
openair3/ocp-gtpu/gtp_itf.cpp
openair3/ocp-gtpu/gtp_itf.cpp
+11
-9
No files found.
openair2/SDAP/nr_sdap/nr_sdap.c
View file @
bfd7bfbb
...
@@ -24,7 +24,25 @@
...
@@ -24,7 +24,25 @@
#include <sys/msg.h>
#include <sys/msg.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <netdb.h>
#include <stdlib.h>
#include <sys/shm.h>
#include <unistd.h>
#include <openair2/COMMON/platform_types.h>
#include <openair3/UTILS/conversions.h>
#include "common/utils/LOG/log.h"
#include <common/utils/ocp_itti/intertask_interface.h>
#include <openair2/COMMON/gtpv1_u_messages_types.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
#include <openair2/LAYER2/PDCP_v10.1.0/pdcp.h>
#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"
uint8_t
nas_qfi
;
uint8_t
nas_qfi
;
uint8_t
nas_pduid
;
uint8_t
nas_pduid
;
...
@@ -173,10 +191,12 @@ void set_qfi_pduid(uint8_t qfi, uint8_t pduid){
...
@@ -173,10 +191,12 @@ void set_qfi_pduid(uint8_t qfi, uint8_t pduid){
nas_pduid
=
pduid
;
nas_pduid
=
pduid
;
return
;
return
;
}
}
#define SHM_SIZE 10000000
void
*
SP_task
(
void
*
arg
){
void
*
SP_task
(
void
*
arg
){
msgbuf
readBuf
;
msgbuf
readBuf
;
printf
(
"SP任务启动成功
\n
"
);
printf
(
"SP任务启动成功
\n
"
);
while
(
1
)
{
while
(
1
)
{
int
msgId
=
msgget
(
0x1234
,
0777
);
int
msgId
=
msgget
(
0x1234
,
0777
);
if
(
msgId
==-
1
){
if
(
msgId
==-
1
){
...
@@ -189,6 +209,26 @@ void *SP_task(void *arg){
...
@@ -189,6 +209,26 @@ void *SP_task(void *arg){
}
else
{
}
else
{
printf
(
"消息队列读取成功
\n
"
);
printf
(
"消息队列读取成功
\n
"
);
printf
(
"接受的shmoffset:%d"
,
readBuf
.
sq
.
shm_offset
);
printf
(
"接受的shmoffset:%d"
,
readBuf
.
sq
.
shm_offset
);
printf
(
"接受的shmoffset:%d"
,
readBuf
.
sq
.
offset
);
int
shmid_data
;
uint8_t
*
shm
;
if
((
shmid_data
=
shmget
((
key_t
)
1
,
SHM_SIZE
,
0666
))
<
0
)
{
perror
(
"shmget"
);
exit
(
1
);}
if
((
shm
=
(
uint8_t
*
)
shmat
(
shmid_data
,
NULL
,
0
))
==
(
uint8_t
*
)
-
1
)
{
perror
(
"shmat"
);
exit
(
1
);
}
shm
=
shm
+
readBuf
.
sq
.
shm_offset
*
65536
+
readBuf
.
sq
.
offset
;
for
(
int
i
=
0
;
i
<
8
;
i
++
){
printf
(
"shm=%c "
,
*
(
shm
+
i
));
}
bool
sdap_ret
=
sdap_data_req
(
readBuf
.
sq
.
ctxt_p
,
bool
sdap_ret
=
sdap_data_req
(
readBuf
.
sq
.
ctxt_p
,
readBuf
.
sq
.
ue_id
,
readBuf
.
sq
.
ue_id
,
readBuf
.
sq
.
srb_flag
,
readBuf
.
sq
.
srb_flag
,
...
@@ -196,7 +236,7 @@ void *SP_task(void *arg){
...
@@ -196,7 +236,7 @@ void *SP_task(void *arg){
readBuf
.
sq
.
mui
,
readBuf
.
sq
.
mui
,
readBuf
.
sq
.
confirm
,
readBuf
.
sq
.
confirm
,
readBuf
.
sq
.
sdu_buffer_size
,
readBuf
.
sq
.
sdu_buffer_size
,
readBuf
.
sq
.
sdu_buffer
,
shm
,
readBuf
.
sq
.
pt_mode
,
readBuf
.
sq
.
pt_mode
,
readBuf
.
sq
.
sourceL2Id
,
readBuf
.
sq
.
sourceL2Id
,
readBuf
.
sq
.
destinationL2Id
,
readBuf
.
sq
.
destinationL2Id
,
...
...
openair3/ocp-gtpu/gtp_itf.cpp
View file @
bfd7bfbb
...
@@ -1191,15 +1191,17 @@ static int Gtpv1uHandleGpdu(int h,
...
@@ -1191,15 +1191,17 @@ static int Gtpv1uHandleGpdu(int h,
shm
=
shm
+
shm_offset
*
65536
+
offset
;
shm
=
shm
+
shm_offset
*
65536
+
offset
;
printf
(
"shm_addr=%p msgbuf_addr=%p
\n
"
,
shm
,(
sctxt
->
sdu_buffer
+
offset
));
// printf("shm_addr=%p msgbuf_addr=%p \n",shm,(sctxt->sdu_buffer+offset));
for
(
int
i
=
0
;
i
<
8
;
i
++
){
// for(int i=0;i<8;i++){
printf
(
"shm=%c "
,
*
(
shm
+
i
));
// printf("shm=%c ",*(shm+i));
}
// }
printf
(
"
\n
"
);
// printf("\n");
for
(
int
i
=
0
;
i
<
8
;
i
++
){
// for(int i=0;i<8;i++){
printf
(
"msgbuf=%c "
,
*
(
sctxt
->
sdu_buffer
+
i
));
// printf("msgbuf=%c ",*(sctxt->sdu_buffer+i));
}
// }
printf
(
"
\n
"
);
// printf("\n");
printf
(
"shm=%d offset=%d
\n
"
,
shm_offset
,
offset
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
...
...
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