Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Worker.N
openairinterface5G
Commits
0a4ffade
Commit
0a4ffade
authored
6 years ago
by
Robert Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Don't malloc() context_t in F1U, stack is sufficient
parent
86fcea8d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
+23
-31
23 additions, 31 deletions
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
with
23 additions
and
31 deletions
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
+
23
−
31
View file @
0a4ffade
...
...
@@ -392,7 +392,7 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
rlc_data
=
data_req
->
pdcp_data
;
ctxt
=
rlc_data
->
fsp_ctxt
;
protocol_ctxt_t
*
ctxt_pP
;
protocol_ctxt_t
ctxt_pP
;
srb_flag_t
srb_flagP
=
0
;
rb_id_t
rb_idP
=
0
;
mui_t
muiP
=
0
;
...
...
@@ -402,15 +402,13 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
mem_block_t
*
pdcp_pdu_p
=
NULL
;
// Create a new protocol context for handling the packet
ctxt_pP
=
malloc
(
sizeof
(
protocol_ctxt_t
));
if
(
!
ctxt_pP
)
goto
error
;
ctxt_pP
->
module_id
=
ctxt
->
fsp_mod_id
;
ctxt_pP
->
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
->
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
->
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
->
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
->
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
->
eNB_index
=
ctxt
->
fsp_enb_index
;
ctxt_pP
.
module_id
=
ctxt
->
fsp_mod_id
;
ctxt_pP
.
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
.
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
.
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
.
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
.
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
.
eNB_index
=
ctxt
->
fsp_enb_index
;
srb_flagP
=
rlc_data
->
fsp_srb_flag
;
flag_MBMS
=
rlc_data
->
fsp_mbms_flag
;
...
...
@@ -422,11 +420,11 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
if
(
!
pdcp_pdu_p
)
goto
error
;
memcpy
(
pdcp_pdu_p
->
data
,
rlc_data
->
fsp_pdu
->
fsp_pdu_data
.
data
,
pdcp_pdu_size
);
result
=
rlc_data_req
(
(
const
protocol_ctxt_t
*
)
ctxt_pP
,
(
const
srb_flag_t
)
srb_flagP
,
(
const
MBMS_flag_t
)
flag_MBMS
,
(
const
rb_id_t
)
rb_idP
,
(
const
mui_t
)
muiP
result
=
rlc_data_req
(
&
ctxt_pP
,
srb_flagP
,
flag_MBMS
,
rb_idP
,
muiP
,
confirmP
,
pdcp_pdu_size
,
pdcp_pdu_p
...
...
@@ -439,8 +437,6 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
return
result
;
error:
if
(
ctxt_pP
)
free
(
ctxt_pP
);
if
(
pdcp_pdu_p
)
free_mem_block
(
pdcp_pdu_p
,
__func__
);
LOG_E
(
PROTO_AGENT
,
"%s: an error occured
\n
"
,
__FUNCTION__
);
...
...
@@ -589,7 +585,7 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
rlc_data
=
data_ind
->
rlc_data
;
ctxt
=
rlc_data
->
fsp_ctxt
;
protocol_ctxt_t
*
ctxt_pP
;
protocol_ctxt_t
ctxt_pP
;
srb_flag_t
srb_flagP
=
0
;
rb_id_t
rb_idP
=
0
;
sdu_size_t
pdcp_pdu_size
=
0
;
...
...
@@ -597,15 +593,13 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
mem_block_t
*
pdcp_pdu_p
=
NULL
;
// Create a new protocol context for handling the packet
ctxt_pP
=
malloc
(
sizeof
(
protocol_ctxt_t
));
if
(
!
ctxt_pP
)
goto
error
;
ctxt_pP
->
module_id
=
ctxt
->
fsp_mod_id
;
ctxt_pP
->
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
->
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
->
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
->
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
->
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
->
eNB_index
=
ctxt
->
fsp_enb_index
;
ctxt_pP
.
module_id
=
ctxt
->
fsp_mod_id
;
ctxt_pP
.
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
.
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
.
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
.
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
.
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
.
eNB_index
=
ctxt
->
fsp_enb_index
;
srb_flagP
=
rlc_data
->
fsp_srb_flag
;
flag_MBMS
=
rlc_data
->
fsp_mbms_flag
;
...
...
@@ -619,8 +613,8 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
// if (xid == 1)
// pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p);
// else if (xid == 0) // FIXME: USE a preprocessed definition
LOG_D
(
PROTO_AGENT
,
"[inst %d] Received PDCP PDU with size %d for UE RNTI %x RB %d, Calling pdcp_data_ind
\n
"
,
ctxt_pP
->
instance
,
pdcp_pdu_size
,
ctxt_pP
->
rnti
,
rb_idP
);
result
=
pdcp_data_ind
(
ctxt_pP
,
LOG_D
(
PROTO_AGENT
,
"[inst %d] Received PDCP PDU with size %d for UE RNTI %x RB %d, Calling pdcp_data_ind
\n
"
,
ctxt_pP
.
instance
,
pdcp_pdu_size
,
ctxt_pP
.
rnti
,
rb_idP
);
result
=
pdcp_data_ind
(
&
ctxt_pP
,
srb_flagP
,
flag_MBMS
,
rb_idP
,
...
...
@@ -630,8 +624,6 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
return
result
;
error:
if
(
ctxt_pP
)
free
(
ctxt_pP
);
if
(
pdcp_pdu_p
)
free_mem_block
(
pdcp_pdu_p
,
__func__
);
LOG_E
(
MAC
,
"%s: an error occured
\n
"
,
__FUNCTION__
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment