Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
openairinterface5G
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
20
Merge Requests
20
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
oai
openairinterface5G
Commits
675fd0af
Commit
675fd0af
authored
Feb 01, 2018
by
Wu Jing
Committed by
Haruki Naoi
Apr 12, 2018
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch develop-get-freememblock.patch into closed_item
parent
afcdb1e6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
14 deletions
+29
-14
openair2/LAYER2/PDCP_v10.1.0/pdcp_control_primitive.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_control_primitive.c
+1
-0
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
+4
-0
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c
+12
-3
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
+2
-2
openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.c
openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.c
+1
-0
openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c
openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c
+3
-4
openair2/UTIL/MEM/mem_block.c
openair2/UTIL/MEM/mem_block.c
+3
-3
openair2/UTIL/MEM/mem_block.h
openair2/UTIL/MEM/mem_block.h
+1
-1
openair2/UTIL/TIMER/umts_timer.c
openair2/UTIL/TIMER/umts_timer.c
+1
-0
targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
+1
-1
No files found.
openair2/LAYER2/PDCP_v10.1.0/pdcp_control_primitive.c
View file @
675fd0af
...
...
@@ -45,6 +45,7 @@ configure_pdcp_req (struct pdcp_entity *pdcpP, void *rlcP, uint8_t rlc_sap_typeP
mem_block
*
mb
;
mb
=
get_free_mem_block
(
sizeof
(
struct
cpdcp_primitive
),
__func__
);
if
(
mb
==
NULL
)
return
;
((
struct
cpdcp_primitive
*
)
mb
->
data
)
->
type
=
CPDCP_CONFIG_REQ
;
((
struct
cpdcp_primitive
*
)
mb
->
data
)
->
primitive
.
config_req
.
rlc_sap
=
rlcP
;
((
struct
cpdcp_primitive
*
)
mb
->
data
)
->
primitive
.
config_req
.
rlc_type_sap
=
rlc_sap_typeP
;
...
...
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
View file @
675fd0af
...
...
@@ -265,6 +265,7 @@ mem_block_t* rlc_am_retransmit_get_copy (
/* We need to allocate a new buffer and copy to it because header content may change for Polling bit */
int
size
=
pdu_mngt
->
header_and_payload_size
+
sizeof
(
struct
mac_tb_req
);
mem_block_t
*
mb_copy
=
get_free_mem_block
(
size
,
__func__
);
if
(
mb_copy
==
NULL
)
return
NULL
;
memcpy
(
mb_copy
->
data
,
mb_original_p
->
data
,
size
);
rlc_am_pdu_sn_10_t
*
pdu_p
=
(
rlc_am_pdu_sn_10_t
*
)
(
&
mb_copy
->
data
[
sizeof
(
struct
mac_tb_req
)]);
...
...
@@ -339,6 +340,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
*
payload_sizeP
=
retx_so_stop
-
retx_so_start
+
1
;
mem_pdu_segment_p
=
get_free_mem_block
((
*
payload_sizeP
+
RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE
+
sizeof
(
struct
mac_tb_req
)),
__func__
);
if
(
mem_pdu_segment_p
==
NULL
)
return
NULL
;
pdu_segment_header_p
=
(
uint8_t
*
)
&
mem_pdu_segment_p
->
data
[
sizeof
(
struct
mac_tb_req
)];
((
struct
mac_tb_req
*
)(
mem_pdu_segment_p
->
data
))
->
data_ptr
=
pdu_segment_header_p
;
((
struct
mac_tb_req
*
)(
mem_pdu_segment_p
->
data
))
->
tb_size
=
RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE
+
*
payload_sizeP
;
...
...
@@ -551,6 +553,7 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
AssertFatal
(
header_segment_length
+
*
payload_sizeP
<=
pdu_mngt
->
header_and_payload_size
+
2
,
"RLC AM PDU Segment Error: Hdr=%d Data=%d Original Hdr+Data =%d sn=%d LcId=%d !
\n
"
,
header_segment_length
,
*
payload_sizeP
,
pdu_mngt
->
header_and_payload_size
,
sn
,
rlc_pP
->
channel_id
);
mem_pdu_segment_p
=
get_free_mem_block
((
*
payload_sizeP
+
header_segment_length
+
sizeof
(
struct
mac_tb_req
)),
__func__
);
if
(
mem_pdu_segment_p
==
NULL
)
return
NULL
;
pdu_segment_header_p
=
(
uint8_t
*
)
&
mem_pdu_segment_p
->
data
[
sizeof
(
struct
mac_tb_req
)];
((
struct
mac_tb_req
*
)(
mem_pdu_segment_p
->
data
))
->
data_ptr
=
pdu_segment_header_p
;
((
struct
mac_tb_req
*
)(
mem_pdu_segment_p
->
data
))
->
tb_size
=
header_segment_length
+
*
payload_sizeP
;
...
...
@@ -718,6 +721,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
if (mb_original_p != NULL) {
mem_block_t* mb_sub_segment_p = get_free_mem_block(*sizeP + sizeof(struct mac_tb_req), __func__);
if(mb_sub_segment_p == NULL) return NULL;
rlc_am_pdu_sn_10_t* pdu_original_p = (rlc_am_pdu_sn_10_t*) (&mb_original_p->data[sizeof(struct mac_tb_req)]);
rlc_am_pdu_sn_10_t* pdu_sub_segment_p = (rlc_am_pdu_sn_10_t*) (&mb_sub_segment_p->data[sizeof(struct mac_tb_req)]);
rlc_am_pdu_info_t pdu_info;
...
...
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c
View file @
675fd0af
...
...
@@ -212,6 +212,9 @@ rlc_am_get_control_pdu_infos(
if
(
!
pdu_info_pP
->
nack_list
[
pdu_info_pP
->
num_nack
-
1
].
e1
)
{
nack_to_read
=
0
;
*
total_size_pP
=
*
total_size_pP
-
(
sdu_size_t
)((
uint64_t
)
byte_pos_p
+
(
uint64_t
)((
bit_pos
+
7
)
/
8
)
-
(
uint64_t
)
header_pP
);
if
(
*
total_size_pP
!=
0
)
{
LOG_E
(
RLC
,
"[RLC_AM_GET_CONTROL_PDU_INFOS][FIRST]header_pP->b1=%d,header_pP->b2=%d
\n
"
,
header_pP
->
b1
,
header_pP
->
b2
);
}
return
0
;
}
...
...
@@ -225,7 +228,9 @@ rlc_am_get_control_pdu_infos(
}
else
{
*
total_size_pP
=
*
total_size_pP
-
2
;
}
if
(
*
total_size_pP
!=
0
)
{
LOG_E
(
RLC
,
"[RLC_AM_GET_CONTROL_PDU_INFOS][SECOND]header_pP->b1=%d,header_pP->b2=%d
\n
"
,
header_pP
->
b1
,
header_pP
->
b2
);
}
return
0
;
}
else
{
return
-
1
;
...
...
@@ -388,13 +393,15 @@ rlc_am_receive_process_control_pdu(
}
else
{
LOG_
N
(
RLC
,
PROTOCOL_RLC_AM_CTXT_FMT
" WARNING CONTROL PDU ACK SN %d OUT OF WINDOW vtA=%d vtS=%d
\n
"
,
LOG_
E
(
RLC
,
PROTOCOL_RLC_AM_CTXT_FMT
" WARNING CONTROL PDU ACK SN %d OUT OF WINDOW vtA=%d vtS=%d
\n
"
,
PROTOCOL_RLC_AM_CTXT_ARGS
(
ctxt_pP
,
rlc_pP
),
ack_sn
,
rlc_pP
->
vt_a
,
rlc_pP
->
vt_s
);
*
tb_size_in_bytes_pP
=
0
;
status
=
FALSE
;
}
}
else
{
LOG_
W
(
RLC
,
PROTOCOL_RLC_AM_CTXT_FMT
" ERROR IN DECODING CONTROL PDU
\n
"
,
LOG_
E
(
RLC
,
PROTOCOL_RLC_AM_CTXT_FMT
" ERROR IN DECODING CONTROL PDU
\n
"
,
PROTOCOL_RLC_AM_CTXT_ARGS
(
ctxt_pP
,
rlc_pP
));
*
tb_size_in_bytes_pP
=
0
;
status
=
FALSE
;
}
...
...
@@ -807,6 +814,7 @@ rlc_am_send_status_pdu(
pdu_size
);
#endif
tb_p
=
get_free_mem_block
(
sizeof
(
struct
mac_tb_req
)
+
pdu_size
,
__func__
);
if
(
tb_p
==
NULL
)
return
;
memset
(
tb_p
->
data
,
0
,
sizeof
(
struct
mac_tb_req
)
+
pdu_size
);
//estimation only ((struct mac_tb_req*)(tb_p->data))->tb_size = pdu_size;
((
struct
mac_tb_req
*
)(
tb_p
->
data
))
->
data_ptr
=
(
uint8_t
*
)
&
(
tb_p
->
data
[
sizeof
(
struct
mac_tb_req
)]);
...
...
@@ -1151,6 +1159,7 @@ end_push_nack:
pdu_size);
#endif
tb_p = get_free_mem_block(sizeof(struct mac_tb_req) + pdu_size, __func__);
if(tb_p == NULL) return;
memset(tb_p->data, 0, sizeof(struct mac_tb_req) + pdu_size);
//estimation only ((struct mac_tb_req*)(tb_p->data))->tb_size = pdu_size;
((struct mac_tb_req*)(tb_p->data))->data_ptr = (uint8_t*)&(tb_p->data[sizeof(struct mac_tb_req)]);
...
...
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
View file @
675fd0af
...
...
@@ -534,7 +534,7 @@ void rlc_am_v9_3_0_test_send_sdu(rlc_am_entity_t *am_txP, int sdu_indexP)
assert
(
g_send_id_write_index
[
am_txP
->
rb_id
]
<
TEST_MAX_SEND_SDU
);
}
else
{
printf
(
"Out of memory error
\n
"
);
exit
(
-
1
);
//
exit(-1);
}
}
//-----------------------------------------------------------------------------
...
...
@@ -577,7 +577,7 @@ void rlc_am_v9_3_0_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct ma
data_indP
->
no_tb
+=
1
;
}
else
{
printf
(
"Out of memory error
\n
"
);
exit
(
-
1
);
//
exit(-1);
}
}
else
{
printf
(
"[RLC-LOOP] DROPPING 1 TB
\n
"
);
...
...
openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.c
View file @
675fd0af
...
...
@@ -83,6 +83,7 @@ void rlc_tm_init (
if
((
rlcP
->
input_sdus_alloc
==
NULL
)
&&
(
rlcP
->
size_input_sdus_buffer
>
0
))
{
rlcP
->
input_sdus_alloc
=
get_free_mem_block
(
rlcP
->
size_input_sdus_buffer
*
sizeof
(
void
*
),
__func__
);
if
(
rlcP
->
input_sdus_alloc
==
NULL
)
return
;
rlcP
->
input_sdus
=
(
mem_block_t
**
)
(
rlcP
->
input_sdus_alloc
->
data
);
memset
(
rlcP
->
input_sdus
,
0
,
rlcP
->
size_input_sdus_buffer
*
sizeof
(
void
*
));
}
...
...
openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c
View file @
675fd0af
...
...
@@ -317,7 +317,7 @@ void rlc_um_v9_3_0_test_send_sdu(rlc_um_entity_t *um_txP, int sdu_indexP)
assert
(
g_send_id_write_index
[
um_txP
->
rb_id
]
<
TEST_MAX_SEND_SDU
);
}
else
{
printf
(
"Out of memory error
\n
"
);
exit
(
-
1
);
//
exit(-1);
}
}
...
...
@@ -406,9 +406,8 @@ void rlc_um_v9_3_0_test_mac_rlc_loop (struct mac_data_ind* data_indP, struct ma
if
(
*
drop_countP
==
0
)
{
tb_dst
=
get_free_mem_block
(
sizeof
(
mac_rlc_max_rx_header_size_t
)
+
tb_size
,
__func__
);
memset
(
tb_dst
->
data
,
0
,
sizeof
(
mac_rlc_max_rx_header_size_t
)
+
tb_size
);
if
(
tb_dst
!=
NULL
)
{
memset
(
tb_dst
->
data
,
0
,
sizeof
(
mac_rlc_max_rx_header_size_t
)
+
tb_size
);
//printf("[RLC-LOOP] Testing tb_dst (1)\n");
check_free_mem_block
(
tb_dst
,
__func__
);
tb_dst
->
next
=
NULL
;
...
...
@@ -427,7 +426,7 @@ void rlc_um_v9_3_0_test_mac_rlc_loop (struct mac_data_ind* data_indP, struct ma
check_free_mem_block
(
tb_dst
,
__func__
);
}
else
{
printf
(
"Out of memory error
\n
"
);
exit
(
-
1
);
//
exit(-1);
}
}
else
{
printf
(
"[RLC-LOOP] DROPPING 1 TB
\n
"
);
...
...
openair2/UTIL/MEM/mem_block.c
View file @
675fd0af
...
...
@@ -275,9 +275,9 @@ get_free_mem_block (uint32_t sizeP, const char* caller)
}
while
(
pool_selected
++
<
12
);
LOG_E
(
PHY
,
"[MEM_MNGT][ERROR][FATAL] failed allocating MEM_BLOCK size %d byes (pool_selected=%d size=%d)
\n
"
,
sizeP
,
pool_selected
,
size
);
display_mem_load
();
AssertFatal
(
1
==
0
,
"get_free_mem_block failed"
);
//
display_mem_load();
//
AssertFatal(1==0,"get_free_mem_block failed");
LOG_E
(
MAC
,
"[MEM_MNGT][ERROR][FATAL] get_free_mem_block failed!!!
\n
"
);
#ifdef MEMBLOCK_BIG_LOCK
if
(
pthread_mutex_unlock
(
&
mtex
))
abort
();
#endif
...
...
openair2/UTIL/MEM/mem_block.h
View file @
675fd0af
...
...
@@ -91,7 +91,7 @@ private_mem_block(void check_free_mem_block (mem_block_t * leP);)
# define MEM_MNGT_MB5_BLOCK_SIZE MEM_MNGT_MB0_BLOCK_SIZE*32
// 2048
# define MEM_MNGT_MB5_NB_BLOCKS 1024 * MEM_SCALE // LG WAS 1024
# define MEM_MNGT_MB5_NB_BLOCKS 1024 * MEM_SCALE
* 50
// LG WAS 1024
# define MEM_MNGT_POOL_ID5 5
# define MEM_MNGT_MB6_BLOCK_SIZE MEM_MNGT_MB0_BLOCK_SIZE*64
...
...
openair2/UTIL/TIMER/umts_timer.c
View file @
675fd0af
...
...
@@ -94,6 +94,7 @@ umts_add_timer_list_up (list2_t * atimer_listP, void (*procP) (void *, void *),
uint8_t
inserted
=
0
;
mb
=
get_free_mem_block
(
sizeof
(
struct
timer_unit
),
__func__
);
if
(
mb
==
NULL
)
return
NULL
;
((
struct
timer_unit
*
)
(
mb
->
data
))
->
proc
=
procP
;
((
struct
timer_unit
*
)
(
mb
->
data
))
->
protocol
=
protocolP
;
((
struct
timer_unit
*
)
(
mb
->
data
))
->
timer_id
=
timer_idP
;
...
...
targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
View file @
675fd0af
...
...
@@ -148,7 +148,7 @@ void pdcp_rlc_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_dat
data_indP
->
no_tb
+=
1
;
}
else
{
printf
(
"Out of memory error
\n
"
);
exit
(
-
1
);
//
exit(-1);
}
}
else
{
printf
(
"[RLC-LOOP] DROPPING 1 TB
\n
"
);
...
...
Cedric Roux
@cedric.roux
mentioned in commit
b6fd23ca
·
Jun 20, 2018
mentioned in commit
b6fd23ca
mentioned in commit b6fd23caaf59a4b6184af6513e95c29cbb9f111d
Toggle commit list
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