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
canghaiwuhen
OpenXG-RAN
Commits
3ad4d26f
Commit
3ad4d26f
authored
Jan 22, 2016
by
Xenofon Foukas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the structures for storing agent context info
parent
dec1c93c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
111 deletions
+47
-111
openair2/ENB_APP/enb_agent.c
openair2/ENB_APP/enb_agent.c
+24
-79
openair2/ENB_APP/enb_agent_common.c
openair2/ENB_APP/enb_agent_common.c
+2
-2
openair2/ENB_APP/enb_agent_defs.h
openair2/ENB_APP/enb_agent_defs.h
+9
-20
openair2/ENB_APP/enb_agent_extern.h
openair2/ENB_APP/enb_agent_extern.h
+4
-3
openair2/ENB_APP/enb_agent_mac_defs.h
openair2/ENB_APP/enb_agent_mac_defs.h
+7
-3
openair2/ENB_APP/enb_agent_mac_internal.h
openair2/ENB_APP/enb_agent_mac_internal.h
+1
-4
No files found.
openair2/ENB_APP/enb_agent.c
View file @
3ad4d26f
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "enb_agent_common.h"
#include "enb_agent_common.h"
#include "log.h"
#include "log.h"
#include "enb_agent.h"
#include "enb_agent.h"
#include "enb_agent_mac_defs.h"
#include "enb_agent_extern.h"
#include "enb_agent_extern.h"
...
@@ -47,10 +48,7 @@
...
@@ -47,10 +48,7 @@
//#define TEST_TIMER
//#define TEST_TIMER
enb_agent_instance_t
enb_agent
[
NUM_MAX_ENB_AGENT
];
enb_agent_instance_t
enb_agent
[
NUM_MAX_ENB
];
msg_context_t
shared_ctxt
[
NUM_MAX_ENB_AGENT
];
/* this could also go into enb_agent struct*/
enb_agent_info_t
enb_agent_info
;
char
in_ip
[
40
];
char
in_ip
[
40
];
static
uint16_t
in_port
;
static
uint16_t
in_port
;
...
@@ -66,7 +64,7 @@ Protocol__ProgranMessage *enb_agent_timeout(void* args);
...
@@ -66,7 +64,7 @@ Protocol__ProgranMessage *enb_agent_timeout(void* args);
*/
*/
void
*
enb_agent_task
(
void
*
args
){
void
*
enb_agent_task
(
void
*
args
){
msg_context_t
*
d
=
(
msg_context
_t
*
)
args
;
enb_agent_instance_t
*
d
=
(
enb_agent_instance
_t
*
)
args
;
Protocol__ProgranMessage
*
msg
;
Protocol__ProgranMessage
*
msg
;
void
*
data
;
void
*
data
;
int
size
;
int
size
;
...
@@ -101,15 +99,11 @@ void *enb_agent_task(void *args){
...
@@ -101,15 +99,11 @@ void *enb_agent_task(void *args){
msg
=
enb_agent_process_timeout
(
msg_p
->
ittiMsg
.
timer_has_expired
.
timer_id
,
msg_p
->
ittiMsg
.
timer_has_expired
.
arg
);
msg
=
enb_agent_process_timeout
(
msg_p
->
ittiMsg
.
timer_has_expired
.
timer_id
,
msg_p
->
ittiMsg
.
timer_has_expired
.
arg
);
if
(
msg
!=
NULL
){
if
(
msg
!=
NULL
){
data
=
enb_agent_pack_message
(
msg
,
&
size
);
data
=
enb_agent_pack_message
(
msg
,
&
size
);
if
(
enb_agent_msg_send
(
d
->
mod
_id
,
ENB_AGENT_DEFAULT
,
data
,
size
,
priority
))
{
if
(
enb_agent_msg_send
(
d
->
enb
_id
,
ENB_AGENT_DEFAULT
,
data
,
size
,
priority
))
{
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING
;
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING
;
goto
error
;
goto
error
;
}
}
/* if (message_put(d->tx_mq, data, size, priority)){ */
/* err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING; */
/* goto error; */
/* } */
LOG_D
(
ENB_AGENT
,
"sent message with size %d
\n
"
,
size
);
LOG_D
(
ENB_AGENT
,
"sent message with size %d
\n
"
,
size
);
}
}
break
;
break
;
...
@@ -131,7 +125,7 @@ void *enb_agent_task(void *args){
...
@@ -131,7 +125,7 @@ void *enb_agent_task(void *args){
void
*
receive_thread
(
void
*
args
)
{
void
*
receive_thread
(
void
*
args
)
{
msg_context
_t
*
d
=
args
;
enb_agent_instance
_t
*
d
=
args
;
void
*
data
;
void
*
data
;
int
size
;
int
size
;
int
priority
;
int
priority
;
...
@@ -140,38 +134,27 @@ void *receive_thread(void *args) {
...
@@ -140,38 +134,27 @@ void *receive_thread(void *args) {
Protocol__ProgranMessage
*
msg
;
Protocol__ProgranMessage
*
msg
;
while
(
1
)
{
while
(
1
)
{
if
(
enb_agent_msg_recv
(
d
->
mod
_id
,
ENB_AGENT_DEFAULT
,
&
data
,
&
size
,
&
priority
))
{
if
(
enb_agent_msg_recv
(
d
->
enb
_id
,
ENB_AGENT_DEFAULT
,
&
data
,
&
size
,
&
priority
))
{
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_DEQUEUING
;
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_DEQUEUING
;
goto
error
;
goto
error
;
}
}
/* if (message_get(d->rx_mq, &data, &size, &priority)){ */
/* err_code = PROTOCOL__PROGRAN_ERR__MSG_DEQUEUING; */
/* goto error; */
/* } */
LOG_D
(
ENB_AGENT
,
"received message with size %d
\n
"
,
size
);
LOG_D
(
ENB_AGENT
,
"received message with size %d
\n
"
,
size
);
msg
=
enb_agent_handle_message
(
d
->
mod
_id
,
data
,
size
);
msg
=
enb_agent_handle_message
(
d
->
enb
_id
,
data
,
size
);
free
(
data
);
free
(
data
);
d
->
rx_xid
=
((
d
->
rx_xid
)
+
1
)
%
4
;
d
->
tx_xid
=
d
->
rx_xid
;
// check if there is something to send back to the controller
// check if there is something to send back to the controller
if
(
msg
!=
NULL
){
if
(
msg
!=
NULL
){
data
=
enb_agent_pack_message
(
msg
,
&
size
);
data
=
enb_agent_pack_message
(
msg
,
&
size
);
if
(
enb_agent_msg_send
(
d
->
mod
_id
,
ENB_AGENT_DEFAULT
,
data
,
size
,
priority
))
{
if
(
enb_agent_msg_send
(
d
->
enb
_id
,
ENB_AGENT_DEFAULT
,
data
,
size
,
priority
))
{
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING
;
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING
;
goto
error
;
goto
error
;
}
}
/* if (message_put(d->tx_mq, data, size, priority)){ */
/* err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING; */
/* goto error; */
/* } */
LOG_D
(
ENB_AGENT
,
"sent message with size %d
\n
"
,
size
);
LOG_D
(
ENB_AGENT
,
"sent message with size %d
\n
"
,
size
);
}
}
...
@@ -214,10 +197,8 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
...
@@ -214,10 +197,8 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
int
channel_id
;
int
channel_id
;
//
set_enb_vars
(
mod_id
,
RAN_LTE_OAI
);
set_enb_vars
(
mod_id
,
RAN_LTE_OAI
);
enb_agent
[
mod_id
].
mod_id
=
mod_id
;
enb_agent
[
mod_id
].
enb_id
=
mod_id
;
enb_agent_info
.
nb_modules
+=
1
;
/*
/*
* check the configuration
* check the configuration
...
@@ -235,7 +216,7 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
...
@@ -235,7 +216,7 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
in_port
=
DEFAULT_ENB_AGENT_PORT
;
in_port
=
DEFAULT_ENB_AGENT_PORT
;
}
}
LOG_I
(
ENB_AGENT
,
"starting enb agent client for module id %d on ipv4 %s, port %d
\n
"
,
LOG_I
(
ENB_AGENT
,
"starting enb agent client for module id %d on ipv4 %s, port %d
\n
"
,
enb_agent
[
mod_id
].
mod
_id
,
enb_agent
[
mod_id
].
enb
_id
,
in_ip
,
in_ip
,
in_port
);
in_port
);
...
@@ -271,46 +252,10 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
...
@@ -271,46 +252,10 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
*enb_agent_register_channel(mod_id, channel, ENB_AGENT_MAC);
*enb_agent_register_channel(mod_id, channel, ENB_AGENT_MAC);
*/
*/
/* /\* */
/*Initialize the continuous MAC stats update mechanism*/
/* * create a socket */
enb_agent_init_cont_mac_stats_update
(
mod_id
);
/* *\/ */
/* enb_agent[mod_id].link = new_link_client(in_ip, in_port); */
/* if (enb_agent[mod_id].link == NULL) goto error; */
/* LOG_I(ENB_AGENT,"starting enb agent client for module id %d on ipv4 %s, port %d\n", */
/* enb_agent[mod_id].mod_id, */
/* in_ip, */
/* in_port); */
/* /\* */
/* * create a message queue */
/* *\/ */
/* enb_agent[mod_id].send_queue = new_message_queue(); */
/* if (enb_agent[mod_id].send_queue == NULL) goto error; */
/* enb_agent[mod_id].receive_queue = new_message_queue(); */
/* if (enb_agent[mod_id].receive_queue == NULL) goto error; */
/* /\* */
/* * create a link manager */
/* *\/ */
/* enb_agent[mod_id].manager = create_link_manager(enb_agent[mod_id].send_queue, enb_agent[mod_id].receive_queue, enb_agent[mod_id].link); */
new_thread
(
receive_thread
,
&
enb_agent
[
mod_id
]);
/* if (enb_agent[mod_id].manager == NULL) goto error; */
/* memset(&shared_ctxt, 0, sizeof(msg_context_t)); */
/* shared_ctxt[mod_id].mod_id = mod_id; */
/* shared_ctxt[mod_id].tx_mq = enb_agent[mod_id].send_queue; */
/* shared_ctxt[mod_id].rx_mq = enb_agent[mod_id].receive_queue; */
/*
* start the enb agent rx thread
*/
memset
(
&
shared_ctxt
,
0
,
sizeof
(
msg_context_t
));
shared_ctxt
[
mod_id
].
mod_id
=
mod_id
;
new_thread
(
receive_thread
,
&
shared_ctxt
[
mod_id
]);
/*
/*
* initilize a timer
* initilize a timer
...
@@ -322,7 +267,7 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
...
@@ -322,7 +267,7 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
* start the enb agent task for tx and interaction with the underlying network function
* start the enb agent task for tx and interaction with the underlying network function
*/
*/
if
(
itti_create_task
(
TASK_ENB_AGENT
,
enb_agent_task
,
(
void
*
)
&
shared_ctx
t
[
mod_id
])
<
0
)
{
if
(
itti_create_task
(
TASK_ENB_AGENT
,
enb_agent_task
,
(
void
*
)
&
enb_agen
t
[
mod_id
])
<
0
)
{
LOG_E
(
ENB_AGENT
,
"Create task for eNB Agent failed
\n
"
);
LOG_E
(
ENB_AGENT
,
"Create task for eNB Agent failed
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -338,21 +283,21 @@ error:
...
@@ -338,21 +283,21 @@ error:
int
enb_agent_stop
(
mid_t
mod_id
){
/* int enb_agent_stop(mid_t mod_id){ */
int
i
=
0
;
/* int i=0; */
enb_agent_destroy_timers
();
/* enb_agent_destroy_timers(); */
for
(
i
=
0
;
i
<
enb_agent_info
.
nb_modules
;
i
++
)
{
/* for ( i =0; i < enb_agent_info.nb_modules; i++) { */
destroy_link_manager
(
enb_agent
[
i
].
manager
);
/* destroy_link_manager(enb_agent[i].manager); */
destroy_message_queue
(
enb_agent
[
i
].
send_queue
);
/* destroy_message_queue(enb_agent[i].send_queue); */
destroy_message_queue
(
enb_agent
[
i
].
receive_queue
);
/* destroy_message_queue(enb_agent[i].receive_queue); */
close_link
(
enb_agent
[
i
].
link
);
/* close_link(enb_agent[i].link); */
}
/* } */
}
/* } */
...
...
openair2/ENB_APP/enb_agent_common.c
View file @
3ad4d26f
...
@@ -39,8 +39,8 @@
...
@@ -39,8 +39,8 @@
#include "log.h"
#include "log.h"
void
*
enb
[
NUM_MAX_ENB
_AGENT
];
void
*
enb
[
NUM_MAX_ENB
];
void
*
enb_ue
[
NUM_MAX_ENB
_AGENT
];
void
*
enb_ue
[
NUM_MAX_ENB
];
/*
/*
* message primitives
* message primitives
*/
*/
...
...
openair2/ENB_APP/enb_agent_defs.h
View file @
3ad4d26f
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
#include "link_manager.h"
#include "link_manager.h"
#define NUM_MAX_ENB
_AGENT
2
#define NUM_MAX_ENB 2
#define NUM_MAX_UE 2048
#define NUM_MAX_UE 2048
#define DEFAULT_ENB_AGENT_IPv4_ADDRESS "127.0.0.1"
#define DEFAULT_ENB_AGENT_IPv4_ADDRESS "127.0.0.1"
#define DEFAULT_ENB_AGENT_PORT 2210
#define DEFAULT_ENB_AGENT_PORT 2210
...
@@ -108,36 +108,25 @@ typedef uint8_t mid_t; // module or enb id
...
@@ -108,36 +108,25 @@ typedef uint8_t mid_t; // module or enb id
typedef
uint8_t
lcid_t
;
typedef
uint8_t
lcid_t
;
typedef
int32_t
err_code_t
;
typedef
int32_t
err_code_t
;
// tx and rx shared context
typedef
struct
{
mid_t
mod_id
;
socket_link_t
*
link
;
message_queue_t
*
send_queue
;
message_queue_t
*
receive_queue
;
link_manager_t
*
manager
;
}
enb_agent_instance_t
;
typedef
struct
{
typedef
struct
{
/* general info */
/* general info */
uint32_t
nb_modules
;
/* stats */
/* stats */
uint32_t
total_rx_msg
;
uint32_t
total_rx_msg
;
uint32_t
total_tx_msg
;
uint32_t
total_tx_msg
;
uint32_t
rx_msg
[
NUM_MAX_ENB
_AGENT
];
uint32_t
rx_msg
[
NUM_MAX_ENB
];
uint32_t
tx_msg
[
NUM_MAX_ENB
_AGENT
];
uint32_t
tx_msg
[
NUM_MAX_ENB
];
}
enb_agent_info_t
;
}
enb_agent_info_t
;
typedef
struct
{
typedef
struct
{
mid_t
mod_id
;
mid_t
enb_id
;
// message_queue_t *tx_mq;
enb_agent_info_t
agent_info
;
// message_queue_t *rx_mq;
xid_t
tx_xid
;
}
enb_agent_instance_t
;
xid_t
rx_xid
;
}
msg_context_t
;
#endif
#endif
openair2/ENB_APP/enb_agent_extern.h
View file @
3ad4d26f
...
@@ -41,10 +41,11 @@
...
@@ -41,10 +41,11 @@
#include "enb_agent_defs.h"
#include "enb_agent_defs.h"
#include "enb_agent_mac_defs.h"
#include "enb_agent_mac_defs.h"
extern
msg_context_t
shared_ctxt
[
NUM_MAX_ENB_AGENT
];
extern
AGENT_MAC_xface
*
agent_mac_xface
;
//extern msg_context_t shared_ctxt[NUM_MAX_ENB][ENB_AGENT_MAX]
;
extern
unsigned
int
mac_agent_registered
[
NUM_MAX_ENB_AGENT
];
extern
AGENT_MAC_xface
*
agent_mac_xface
[
NUM_MAX_ENB
][
ENB_AGENT_MAX
];
extern
unsigned
int
mac_agent_registered
[
NUM_MAX_ENB
];
#endif
#endif
openair2/ENB_APP/enb_agent_mac_defs.h
View file @
3ad4d26f
...
@@ -42,13 +42,17 @@
...
@@ -42,13 +42,17 @@
/* ENB AGENT-MAC Interface */
/* ENB AGENT-MAC Interface */
typedef
struct
{
typedef
struct
{
msg_context_t
*
agent_ctxt
;
//
msg_context_t *agent_ctxt;
/// Inform the controller about the scheduling requests received during the subframe
/// Inform the controller about the scheduling requests received during the subframe
void
(
*
enb_agent_send_sr_info
)(
mid_t
mod_id
,
msg_context_t
*
context
);
void
(
*
enb_agent_send_sr_info
)(
mid_t
mod_id
);
/// Inform the controller about the current UL/DL subframe
/// Inform the controller about the current UL/DL subframe
void
(
*
enb_agent_send_sf_trigger
)(
mid_t
mod_id
,
msg_context_t
*
context
);
void
(
*
enb_agent_send_sf_trigger
)(
mid_t
mod_id
);
/// Send to the controller all the mac stat updates that occured during this subframe
/// based on the stats request configuration
void
(
*
enb_agent_send_update_mac_stats
)(
mid_t
mod_id
);
/*TODO: Fill in with the rest of the MAC layer technology specific callbacks (UL/DL scheduling, RACH info etc)*/
/*TODO: Fill in with the rest of the MAC layer technology specific callbacks (UL/DL scheduling, RACH info etc)*/
...
...
openair2/ENB_APP/enb_agent_mac_internal.h
View file @
3ad4d26f
...
@@ -43,9 +43,6 @@
...
@@ -43,9 +43,6 @@
#include "enb_agent_common.h"
#include "enb_agent_common.h"
/*Flags showing if a mac agent has already been registered*/
unsigned
int
mac_agent_registered
[
NUM_MAX_ENB_AGENT
];
/*This will be used for producing continuous status updates for the MAC
/*This will be used for producing continuous status updates for the MAC
*Needs to be thread-safe
*Needs to be thread-safe
*/
*/
...
@@ -61,7 +58,7 @@ typedef struct {
...
@@ -61,7 +58,7 @@ typedef struct {
}
mac_stats_updates_context_t
;
}
mac_stats_updates_context_t
;
/*Array holding the last stats reports for each eNB. Used for continuous reporting*/
/*Array holding the last stats reports for each eNB. Used for continuous reporting*/
mac_stats_updates_context_t
mac_stats_context
[
NUM_MAX_ENB
_AGENT
];
mac_stats_updates_context_t
mac_stats_context
[
NUM_MAX_ENB
];
/*Functions to initialize and destroy the struct required for the
/*Functions to initialize and destroy the struct required for the
*continuous stats update report*/
*continuous stats update report*/
...
...
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