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
zzha zzha
OpenXG-RAN
Commits
3b0c43c0
Commit
3b0c43c0
authored
Jan 10, 2021
by
Laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory allocation error
parent
0dab0871
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
35 deletions
+41
-35
common/utils/ocp_itti/intertask_interface.cpp
common/utils/ocp_itti/intertask_interface.cpp
+28
-27
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+2
-3
openair2/NETWORK_DRIVER/MESH/device.c
openair2/NETWORK_DRIVER/MESH/device.c
+4
-0
openair2/RRC/NR/rrc_gNB_nsa.c
openair2/RRC/NR/rrc_gNB_nsa.c
+1
-1
openair3/SCTP/sctp_eNB_task.c
openair3/SCTP/sctp_eNB_task.c
+1
-1
targets/ARCH/rfsimulator/apply_channelmod.c
targets/ARCH/rfsimulator/apply_channelmod.c
+3
-2
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+2
-1
No files found.
common/utils/ocp_itti/intertask_interface.cpp
View file @
3b0c43c0
...
...
@@ -45,7 +45,7 @@ extern "C" {
std
::
vector
<
MessageDef
*>
message_queue
;
std
::
map
<
long
,
timer_elm_t
>
timer_map
;
uint64_t
next_timer
=
UINT64_MAX
;
struct
epoll_event
*
events
=
NULL
;
struct
epoll_event
*
events
=
NULL
;
int
nb_fd_epoll
=
0
;
int
nb_events
=
0
;
int
epoll_fd
=-
1
;
...
...
@@ -53,7 +53,7 @@ extern "C" {
}
task_list_t
;
int
timer_expired
(
int
fd
);
task_list_t
*
tasks
;
static
task_list_t
**
tasks
=
NULL
;
static
int
nb_queues
=
0
;
static
pthread_mutex_t
lock_nb_queues
;
...
...
@@ -124,7 +124,7 @@ extern "C" {
}
static
inline
int
itti_send_msg_to_task_locked
(
task_id_t
destination_task_id
,
instance_t
destinationInstance
,
MessageDef
*
message
)
{
task_list_t
*
t
=
tasks
+
destination_task_id
;
task_list_t
*
t
=
tasks
[
destination_task_id
]
;
message
->
ittiMsgHeader
.
destinationTaskId
=
destination_task_id
;
message
->
ittiMsgHeader
.
destinationInstance
=
destinationInstance
;
message
->
ittiMsgHeader
.
lte_time
.
frame
=
0
;
...
...
@@ -146,7 +146,7 @@ extern "C" {
}
int
itti_send_msg_to_task
(
task_id_t
destination_task_id
,
instance_t
destinationInstance
,
MessageDef
*
message
)
{
task_list_t
*
t
=
&
tasks
[
destination_task_id
];
task_list_t
*
t
=
tasks
[
destination_task_id
];
pthread_mutex_lock
(
&
t
->
queue_cond_lock
);
int
ret
=
itti_send_msg_to_task_locked
(
destination_task_id
,
destinationInstance
,
message
);
...
...
@@ -165,7 +165,7 @@ extern "C" {
void
itti_subscribe_event_fd
(
task_id_t
task_id
,
int
fd
)
{
struct
epoll_event
event
;
task_list_t
*
t
=
&
tasks
[
task_id
];
task_list_t
*
t
=
tasks
[
task_id
];
t
->
nb_fd_epoll
++
;
t
->
events
=
(
struct
epoll_event
*
)
realloc
((
void
*
)
t
->
events
,
t
->
nb_fd_epoll
*
sizeof
(
struct
epoll_event
));
...
...
@@ -178,7 +178,7 @@ extern "C" {
}
void
itti_unsubscribe_event_fd
(
task_id_t
task_id
,
int
fd
)
{
task_list_t
*
t
=
&
tasks
[
task_id
];
task_list_t
*
t
=
tasks
[
task_id
];
AssertFatal
(
epoll_ctl
(
t
->
epoll_fd
,
EPOLL_CTL_DEL
,
fd
,
NULL
)
==
0
,
"epoll_ctl (EPOLL_CTL_DEL) failed for task %s, fd %d: %s!
\n
"
,
itti_get_task_name
(
task_id
),
fd
,
strerror
(
errno
));
...
...
@@ -186,7 +186,7 @@ extern "C" {
}
static
inline
int
itti_get_events_locked
(
task_id_t
task_id
,
struct
epoll_event
**
events
)
{
task_list_t
*
t
=
&
tasks
[
task_id
];
task_list_t
*
t
=
tasks
[
task_id
];
uint64_t
current_time
=
0
;
do
{
...
...
@@ -266,13 +266,13 @@ extern "C" {
}
int
itti_get_events
(
task_id_t
task_id
,
struct
epoll_event
**
events
)
{
pthread_mutex_lock
(
&
tasks
[
task_id
]
.
queue_cond_lock
);
pthread_mutex_lock
(
&
tasks
[
task_id
]
->
queue_cond_lock
);
return
itti_get_events_locked
(
task_id
,
events
);
}
void
itti_receive_msg
(
task_id_t
task_id
,
MessageDef
**
received_msg
)
{
// Reception of one message, blocking caller
task_list_t
*
t
=
&
tasks
[
task_id
];
task_list_t
*
t
=
tasks
[
task_id
];
pthread_mutex_lock
(
&
t
->
queue_cond_lock
);
// Weird condition to deal with crap legacy itti interface
...
...
@@ -304,7 +304,7 @@ extern "C" {
void
itti_poll_msg
(
task_id_t
task_id
,
MessageDef
**
received_msg
)
{
//reception of one message, non-blocking
task_list_t
*
t
=
&
tasks
[
task_id
];
task_list_t
*
t
=
tasks
[
task_id
];
pthread_mutex_lock
(
&
t
->
queue_cond_lock
);
if
(
!
t
->
message_queue
.
empty
())
{
...
...
@@ -320,7 +320,7 @@ extern "C" {
int
itti_create_task
(
task_id_t
task_id
,
void
*
(
*
start_routine
)(
void
*
),
void
*
args_p
)
{
task_list_t
*
t
=
&
tasks
[
task_id
];
task_list_t
*
t
=
tasks
[
task_id
];
threadCreate
(
&
t
->
thread
,
start_routine
,
args_p
,
(
char
*
)
itti_get_task_name
(
task_id
),
-
1
,
OAI_PRIORITY_RT
);
LOG_I
(
TMR
,
"Created Posix thread %s
\n
"
,
itti_get_task_name
(
task_id
)
);
return
0
;
...
...
@@ -338,19 +338,20 @@ extern "C" {
int
itti_create_queue
(
const
task_info_t
*
task_info
)
{
pthread_mutex_lock
(
&
lock_nb_queues
);
int
newQueue
=
nb_queues
;
nb_queues
++
;
AssertFatal
(
realloc
(
tasks
,
nb_queues
*
sizeof
(
*
tasks
)),
"no memory"
)
;
int
newQueue
=
nb_queues
++
;
AssertFatal
(
tasks
=
(
task_list_t
**
)
realloc
(
tasks
,
nb_queues
*
sizeof
(
*
tasks
)),
""
)
;
tasks
[
newQueue
]
=
new
task_list_t
;
pthread_mutex_unlock
(
&
lock_nb_queues
);
LOG_I
(
TMR
,
"Starting itti queue: %s as task %d
\n
"
,
tasks_info
->
name
,
newQueue
);
pthread_mutex_init
(
&
tasks
[
newQueue
].
queue_cond_lock
,
NULL
);
memcpy
(
&
tasks
[
newQueue
].
admin
,
tasks_info
,
sizeof
(
task_info_t
));
AssertFatal
(
(
tasks
[
newQueue
].
epoll_fd
=
epoll_create1
(
0
)
)
>=
0
,
""
);
AssertFatal
(
(
tasks
[
newQueue
].
sem_fd
=
eventfd
(
0
,
EFD_SEMAPHORE
)
)
>=
0
,
""
);
itti_subscribe_event_fd
((
task_id_t
)
newQueue
,
tasks
[
newQueue
].
sem_fd
);
if
(
tasks
[
newQueue
].
admin
.
threadFunc
!=
NULL
)
itti_create_task
((
task_id_t
)
newQueue
,
tasks
[
newQueue
].
admin
.
threadFunc
,
NULL
);
pthread_mutex_init
(
&
tasks
[
newQueue
]
->
queue_cond_lock
,
NULL
);
memcpy
(
&
tasks
[
newQueue
]
->
admin
,
tasks_info
,
sizeof
(
task_info_t
));
AssertFatal
(
(
tasks
[
newQueue
]
->
epoll_fd
=
epoll_create1
(
0
)
)
>=
0
,
""
);
AssertFatal
(
(
tasks
[
newQueue
]
->
sem_fd
=
eventfd
(
0
,
EFD_SEMAPHORE
)
)
>=
0
,
""
);
itti_subscribe_event_fd
((
task_id_t
)
newQueue
,
tasks
[
newQueue
]
->
sem_fd
);
if
(
tasks
[
newQueue
]
->
admin
.
threadFunc
!=
NULL
)
itti_create_task
((
task_id_t
)
newQueue
,
tasks
[
newQueue
]
->
admin
.
threadFunc
,
NULL
);
return
newQueue
;
}
...
...
@@ -376,7 +377,7 @@ extern "C" {
timer_type_t
type
,
void
*
timer_arg
,
long
*
timer_id
)
{
task_list_t
*
t
=
&
tasks
[
task_id
];
task_list_t
*
t
=
tasks
[
task_id
];
do
{
// set the taskid in the timer id to keep compatible with the legacy API
...
...
@@ -412,9 +413,9 @@ extern "C" {
int
timer_remove
(
long
timer_id
)
{
task_id_t
task_id
=
(
task_id_t
)(
timer_id
&
0xffff
);
int
ret
;
pthread_mutex_lock
(
&
tasks
[
task_id
]
.
queue_cond_lock
);
ret
=
tasks
[
task_id
]
.
timer_map
.
erase
(
timer_id
);
pthread_mutex_unlock
(
&
tasks
[
task_id
]
.
queue_cond_lock
);
pthread_mutex_lock
(
&
tasks
[
task_id
]
->
queue_cond_lock
);
ret
=
tasks
[
task_id
]
->
timer_map
.
erase
(
timer_id
);
pthread_mutex_unlock
(
&
tasks
[
task_id
]
->
queue_cond_lock
);
if
(
ret
==
1
)
return
0
;
...
...
@@ -429,7 +430,7 @@ extern "C" {
}
const
char
*
itti_get_task_name
(
task_id_t
task_id
)
{
return
tasks
[
task_id
]
.
admin
.
name
;
return
tasks
[
task_id
]
->
admin
.
name
;
}
// void for compatibility
...
...
openair2/ENB_APP/enb_config.c
View file @
3b0c43c0
...
...
@@ -121,15 +121,14 @@ void RCconfig_L1(void) {
RC
.
nb_L1_CC
[
j
]
=
*
(
L1_ParamList
.
paramarray
[
j
][
L1_CC_IDX
].
uptr
);
if
(
RC
.
eNB
[
j
]
==
NULL
)
{
RC
.
eNB
[
j
]
=
(
PHY_VARS_eNB
**
)
malloc
((
1
+
MAX_NUM_CCs
)
*
sizeof
(
PHY_VARS_eNB
*
));
RC
.
eNB
[
j
]
=
(
PHY_VARS_eNB
**
)
malloc
((
1
+
MAX_NUM_CCs
)
*
sizeof
(
PHY_VARS_eNB
*
));
LOG_I
(
PHY
,
"RC.eNB[%d] = %p
\n
"
,
j
,
RC
.
eNB
[
j
]);
memset
(
RC
.
eNB
[
j
],
0
,(
1
+
MAX_NUM_CCs
)
*
sizeof
(
PHY_VARS_eNB
*
));
}
for
(
i
=
0
;
i
<
RC
.
nb_L1_CC
[
j
];
i
++
)
{
if
(
RC
.
eNB
[
j
][
i
]
==
NULL
)
{
RC
.
eNB
[
j
][
i
]
=
(
PHY_VARS_eNB
*
)
malloc
(
sizeof
(
PHY_VARS_eNB
));
memset
((
void
*
)
RC
.
eNB
[
j
][
i
],
0
,
sizeof
(
PHY_VARS_eNB
));
RC
.
eNB
[
j
][
i
]
=
(
PHY_VARS_eNB
*
)
calloc
(
1
,
sizeof
(
PHY_VARS_eNB
));
LOG_I
(
PHY
,
"RC.eNB[%d][%d] = %p
\n
"
,
j
,
i
,
RC
.
eNB
[
j
][
i
]);
RC
.
eNB
[
j
][
i
]
->
Mod_id
=
j
;
RC
.
eNB
[
j
][
i
]
->
CC_id
=
i
;
...
...
openair2/NETWORK_DRIVER/MESH/device.c
View file @
3b0c43c0
...
...
@@ -297,7 +297,11 @@ int nas_change_mtu(struct net_device *dev, int mtu)
}
//---------------------------------------------------------------------------
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)
void
nas_tx_timeout
(
struct
net_device
*
dev
)
#else
void
nas_tx_timeout
(
struct
net_device
*
dev
,
unsigned
int
x
)
#endif
{
//---------------------------------------------------------------------------
// Transmitter timeout, serious problems.
...
...
openair2/RRC/NR/rrc_gNB_nsa.c
View file @
3b0c43c0
...
...
@@ -151,7 +151,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
msg
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
0
,
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
);
gtpv1u_enb_create_tunnel_req_t
create_tunnel_req
;
gtpv1u_enb_create_tunnel_resp_t
create_tunnel_resp
;
protocol_ctxt_t
ctxt
;
protocol_ctxt_t
ctxt
=
{
0
}
;
// NR RRCReconfiguration
AssertFatal
(
rrc
->
Nb_ue
<
MAX_NR_RRC_UE_CONTEXTS
,
"cannot add another UE
\n
"
);
ue_context_p
->
ue_context
.
reconfig
=
calloc
(
1
,
sizeof
(
NR_RRCReconfiguration_t
));
...
...
openair3/SCTP/sctp_eNB_task.c
View file @
3b0c43c0
...
...
@@ -364,7 +364,7 @@ sctp_handle_new_association_req(
int
sd
=
0
;
int32_t
assoc_id
=
0
;
struct
sctp_event_subscribe
events
;
struct
sctp_event_subscribe
events
=
{
0
}
;
struct
sctp_cnx_list_elm_s
*
sctp_cnx
=
NULL
;
enum
sctp_connection_type_e
connection_type
=
SCTP_TYPE_CLIENT
;
...
...
targets/ARCH/rfsimulator/apply_channelmod.c
View file @
3b0c43c0
...
...
@@ -102,8 +102,9 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
}
//l
}
out_ptr
->
r
+=
round
(
rx_tmp
.
x
*
pathLossLinear
+
noise_per_sample
*
gaussZiggurat
(
0
.
0
,
1
.
0
));
out_ptr
->
i
+=
round
(
rx_tmp
.
y
*
pathLossLinear
+
noise_per_sample
*
gaussZiggurat
(
0
.
0
,
1
.
0
));
// Fixme: lround(), rount(), ... is detected by valgrind as error, not found why
out_ptr
->
r
+=
lround
(
rx_tmp
.
x
*
pathLossLinear
+
noise_per_sample
*
gaussZiggurat
(
0
.
0
,
1
.
0
));
out_ptr
->
i
+=
lround
(
rx_tmp
.
y
*
pathLossLinear
+
noise_per_sample
*
gaussZiggurat
(
0
.
0
,
1
.
0
));
out_ptr
++
;
}
...
...
targets/RT/USER/lte-enb.c
View file @
3b0c43c0
...
...
@@ -1239,7 +1239,8 @@ void init_eNB(int single_thread_flag,
if
(
RC
.
eNB
[
inst
]
==
NULL
)
RC
.
eNB
[
inst
]
=
(
PHY_VARS_eNB
**
)
malloc
(
RC
.
nb_CC
[
inst
]
*
sizeof
(
PHY_VARS_eNB
*
));
for
(
CC_id
=
0
;
CC_id
<
RC
.
nb_L1_CC
[
inst
];
CC_id
++
)
{
if
(
RC
.
eNB
[
inst
][
CC_id
]
==
NULL
)
RC
.
eNB
[
inst
][
CC_id
]
=
(
PHY_VARS_eNB
*
)
malloc
(
sizeof
(
PHY_VARS_eNB
));
if
(
RC
.
eNB
[
inst
][
CC_id
]
==
NULL
)
RC
.
eNB
[
inst
][
CC_id
]
=
(
PHY_VARS_eNB
*
)
calloc
(
1
,
sizeof
(
PHY_VARS_eNB
));
eNB
=
RC
.
eNB
[
inst
][
CC_id
];
eNB
->
abstraction_flag
=
0
;
...
...
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