Commit cd22e69f authored by winckel's avatar winckel

Removed non ENABLE_EVENT_FD option in ITTI.

Modified message processing for RT task when RTAI is enabled.
Clean-up logs format in RRC.
Fixed some warnings.

pre-ci Ok.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4550 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9a30eabe
This diff is collapsed.
......@@ -34,9 +34,7 @@
* @{
*/
#if defined(ENABLE_EVENT_FD)
# include <sys/epoll.h>
#endif
#include <sys/epoll.h>
#ifdef RTAI
# include <rtai_sem.h>
......@@ -123,7 +121,6 @@ int itti_send_broadcast_message(MessageDef *message_p);
**/
int itti_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message);
#if defined(ENABLE_EVENT_FD)
/** \brief Add a new fd to monitor.
* NOTE: it is up to the user to read data associated with the fd
* \param task_id Task ID of the receiving task
......@@ -143,7 +140,6 @@ void itti_unsubscribe_event_fd(task_id_t task_id, int fd);
* @returns number of events to handle
**/
int itti_get_events(task_id_t task_id, struct epoll_event **events);
#endif
/** \brief Retrieves a message in the queue associated to task_id.
* If the queue is empty, the thread is blocked till a new message arrives.
......@@ -168,6 +164,13 @@ int itti_create_task(task_id_t task_id,
void *(*start_routine) (void *),
void *args_p);
#ifdef RTAI
/** \brief Mark the task as a real time task
* \param task_id task to mark as real time
**/
void itti_set_task_real_time(task_id_t task_id);
#endif
/** \brief Mark the task as in ready state
* \param task_id task to mark as ready
**/
......
......@@ -69,6 +69,6 @@ int timer_remove(long timer_id);
* \param mme_config MME common configuration
* @returns -1 on failure, 0 otherwise
**/
int timer_init();
int timer_init(void);
#endif
......@@ -2355,12 +2355,12 @@ void *rrc_ue_task(void *args_p) {
break;
case MESSAGE_TEST:
LOG_I(RRC, "Received %s\n", msg_name);
LOG_I(RRC, "[UE %d] Received %s\n", Mod_id, msg_name);
break;
/* MAC messages */
case RRC_MAC_IN_SYNC_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "[UE %d] Received %s: frame %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_IN_SYNC_IND (msg_p).frame, RRC_MAC_IN_SYNC_IND (msg_p).enb_index);
UE_rrc_inst[Mod_id].Info[RRC_MAC_IN_SYNC_IND (msg_p).enb_index].N310_cnt = 0;
......@@ -2369,14 +2369,14 @@ void *rrc_ue_task(void *args_p) {
break;
case RRC_MAC_OUT_OF_SYNC_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "[UE %d] Received %s: frame %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_OUT_OF_SYNC_IND (msg_p).frame, RRC_MAC_OUT_OF_SYNC_IND (msg_p).enb_index);
UE_rrc_inst[Mod_id].Info[RRC_MAC_OUT_OF_SYNC_IND (msg_p).enb_index].N310_cnt ++;
break;
case RRC_MAC_BCCH_DATA_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "[UE %d] Received %s: frame %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_BCCH_DATA_IND (msg_p).frame, RRC_MAC_BCCH_DATA_IND (msg_p).enb_index);
decode_BCCH_DLSCH_Message (Mod_id, RRC_MAC_BCCH_DATA_IND (msg_p).frame,
......@@ -2385,7 +2385,7 @@ void *rrc_ue_task(void *args_p) {
break;
case RRC_MAC_CCCH_DATA_CNF:
LOG_I(RRC, "Received %s: instance %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "[UE %d] Received %s: eNB %d\n", Mod_id, msg_name,
RRC_MAC_CCCH_DATA_CNF (msg_p).enb_index);
// reset the tx buffer to indicate RRC that ccch was successfully transmitted (for example if contention resolution succeeds)
......@@ -2393,7 +2393,7 @@ void *rrc_ue_task(void *args_p) {
break;
case RRC_MAC_CCCH_DATA_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "[UE %d] Received %s: frame %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_CCCH_DATA_IND (msg_p).frame, RRC_MAC_CCCH_DATA_IND (msg_p).enb_index);
srb_info_p = &UE_rrc_inst[Mod_id].Srb0[RRC_MAC_CCCH_DATA_IND (msg_p).enb_index];
......@@ -2407,7 +2407,7 @@ void *rrc_ue_task(void *args_p) {
#ifdef Rel10
case RRC_MAC_MCCH_DATA_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d, mbsfn SA %d\n", msg_name, instance,
LOG_I(RRC, "[UE %d] Received %s: frame %d, eNB %d, mbsfn SA %d\n", Mod_id, msg_name,
RRC_MAC_MCCH_DATA_IND (msg_p).frame, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index, RRC_MAC_MCCH_DATA_IND (msg_p).mbsfn_sync_area);
decode_MCCH_Message (Mod_id, RRC_MAC_MCCH_DATA_IND (msg_p).frame, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index,
......@@ -2418,7 +2418,7 @@ void *rrc_ue_task(void *args_p) {
/* PDCP messages */
case RRC_DCCH_DATA_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d, DCCH %d, UE %d\n", msg_name, instance,
LOG_I(RRC, "[UE %d] Received %s: frame %d, DCCH %d, UE %d\n", Mod_id, msg_name,
RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index, RRC_DCCH_DATA_IND (msg_p).ue_index);
rrc_ue_decode_dcch (Mod_id, RRC_DCCH_DATA_IND (msg_p).frame,
......@@ -2435,7 +2435,7 @@ void *rrc_ue_task(void *args_p) {
uint32_t length;
uint8_t *buffer;
LOG_I(RRC, "Received %s: instance %d, UEid %d\n", msg_name, instance, NAS_UPLINK_DATA_REQ (msg_p).UEid);
LOG_I(RRC, "[UE %d] Received %s: UEid %d\n", Mod_id, msg_name, NAS_UPLINK_DATA_REQ (msg_p).UEid);
/* Create message for PDCP (ULInformationTransfer_t) */
length = do_ULInformationTransfer(&buffer, NAS_UPLINK_DATA_REQ (msg_p).nasMsg.length, NAS_UPLINK_DATA_REQ (msg_p).nasMsg.data);
......@@ -2446,7 +2446,7 @@ void *rrc_ue_task(void *args_p) {
}
default:
LOG_E(RRC, "Received unexpected message %s\n", msg_name);
LOG_E(RRC, "[UE %d] Received unexpected message %s\n", Mod_id, msg_name);
break;
}
......
......@@ -459,7 +459,7 @@ static void rrc_lite_eNB_init_security(u8 Mod_id, u8 UE_index)
}
ascii_buffer[2 * i] = '\0';
LOG_T(RRC, "[OSA][MOD %02d][UE %02d] kenb = %s\n", Mod_id, UE_index, ascii_buffer);
LOG_T(RRC, "[OSA][eNB %d][UE %d] kenb = %s\n", Mod_id, UE_index, ascii_buffer);
#endif
}
......@@ -494,7 +494,7 @@ static uint8_t rrc_eNB_get_next_free_UE_index (uint8_t Mod_id, uint8_t *UE_ident
}
if (reg == 0) {
LOG_I(RRC, "Adding UE %d\n", first_index);
LOG_I(RRC, "[eNB %d] Adding UE %d\n", Mod_id, first_index);
return (first_index);
}
else {
......@@ -507,7 +507,7 @@ void rrc_eNB_free_UE_index (uint8_t Mod_id, uint8_t UE_id)
DevCheck(Mod_id < NB_eNB_INST, Mod_id, UE_id, NB_eNB_INST);
DevCheck(UE_id < NUMBER_OF_UE_MAX, Mod_id, UE_id, NUMBER_OF_UE_MAX);
LOG_I (RRC, "Removing UE %d 0x%" PRIx64 "\n", UE_id, eNB_rrc_inst[Mod_id].Info.UE_list[UE_id]);
LOG_I (RRC, "[eNB %d] Removing UE %d rv 0x%" PRIx64 "\n", Mod_id, UE_id, eNB_rrc_inst[Mod_id].Info.UE_list[UE_id]);
eNB_rrc_inst[Mod_id].Info.UE[UE_id].Status = RRC_IDLE;
eNB_rrc_inst[Mod_id].Info.UE_list[UE_id] = 0;
}
......@@ -3030,12 +3030,12 @@ void *rrc_enb_task(void *args_p) {
break;
case MESSAGE_TEST:
LOG_I(RRC, "Received %s\n", msg_name);
LOG_I(RRC, "[eNB %d] Received %s\n", instance, msg_name);
break;
/* Messages from MAC */
case RRC_MAC_CCCH_DATA_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d,\n", msg_name, instance,
LOG_I(RRC, "[eNB %d] Received %s: instance %d, frame %d,\n", instance, msg_name,
RRC_MAC_CCCH_DATA_IND (msg_p).frame);
srb_info_p = &eNB_rrc_inst[instance].Srb0;
......@@ -3048,8 +3048,8 @@ void *rrc_enb_task(void *args_p) {
/* Messages from PDCP */
case RRC_DCCH_DATA_IND:
LOG_I(RRC, "Received %s: instance %d, frame %d, DCCH %d, UE %d\n", msg_name, instance,
RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index, RRC_DCCH_DATA_IND (msg_p).ue_index);
LOG_I(RRC, "[eNB %d][UE %d] Received %s: instance %d, frame %d, DCCH %d\n", instance, RRC_DCCH_DATA_IND (msg_p).ue_index, msg_name,
RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index);
rrc_eNB_decode_dcch (instance, RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index,
RRC_DCCH_DATA_IND (msg_p).ue_index, RRC_DCCH_DATA_IND (msg_p).sdu_p,
......@@ -3074,7 +3074,7 @@ void *rrc_enb_task(void *args_p) {
break;
case S1AP_PAGING_IND:
LOG_E(RRC, "Received not yet implemented message %s\n", msg_name);
LOG_E(RRC, "[eNB %d] Received not yet implemented message %s\n", instance, msg_name);
break;
case S1AP_UE_CONTEXT_RELEASE_REQ:
......@@ -3083,7 +3083,7 @@ void *rrc_enb_task(void *args_p) {
#endif
default:
LOG_E(RRC, "Received unexpected message %s\n", msg_name);
LOG_E(RRC, "[eNB %d] Received unexpected message %s\n", instance, msg_name);
break;
}
......
......@@ -102,7 +102,7 @@ static uint8_t get_UE_index_from_initial_id(uint8_t mod_id, uint16_t ue_initial_
for (ue_index = 0; ue_index < NUMBER_OF_UE_MAX; ue_index++) {
/* Check if this UE is in use */
LOG_D(RRC, "[eNB %d][UE %d] 0x%" PRIx64 " %d\n", mod_id, ue_index,
LOG_D(RRC, "[eNB %d][UE %d] UE rv 0x%" PRIx64 " %d\n", mod_id, ue_index,
eNB_rrc_inst[mod_id].Info.UE_list[ue_index], eNB_rrc_inst[mod_id].Info.UE[ue_index].ue_initial_id);
if (eNB_rrc_inst[mod_id].Info.UE_list[ue_index] != 0) {
......@@ -129,7 +129,7 @@ static uint8_t get_UE_index_from_eNB_ue_s1ap_id(uint8_t mod_id, uint32_t eNB_ue_
for (ue_index = 0; ue_index < NUMBER_OF_UE_MAX; ue_index++) {
/* Check if this UE is in use */
LOG_D(RRC, "[eNB %d][UE %d] 0x%" PRIx64 " %d\n", mod_id, ue_index,
LOG_D(RRC, "[eNB %d][UE %d] UE rv 0x%" PRIx64 " %d\n", mod_id, ue_index,
eNB_rrc_inst[mod_id].Info.UE_list[ue_index], eNB_rrc_inst[mod_id].Info.UE[ue_index].eNB_ue_s1ap_id);
if (eNB_rrc_inst[mod_id].Info.UE_list[ue_index] != 0) {
......
......@@ -460,24 +460,12 @@ void *emos_thread (void *arg)
#if defined(ENABLE_ITTI)
void *dummy_l2l1_task(void *arg)
{
ssize_t ret = 0;
MessageDef *received_msg;
itti_set_task_real_time(TASK_L2L1);
itti_mark_task_ready(TASK_L2L1);
while (!oai_exit)
{
usleep(100);
do {
itti_poll_msg(TASK_L2L1, &received_msg);
if (received_msg != NULL) {
itti_send_msg_to_task(ITTI_MSG_DESTINATION_ID(received_msg),
ITTI_MSG_INSTANCE(received_msg),
received_msg);
}
} while(received_msg != NULL);
usleep(500000);
}
return NULL;
}
......@@ -534,20 +522,20 @@ static void *eNB_thread(void *arg)
diff = mbox_target - mbox_current;
if (((slot%2==0) && (diff < (-14))) || ((slot%2==1) && (diff < (-7)))) {
// at the eNB, even slots have double as much time since most of the processing is done here and almost nothing in odd slots
LOG_D(HW,"eNB Frame %d, time %llu: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, rt_get_time_ns(), slot, hw_slot, diff);
slot++;
if (frame>0) {
oai_exit=1;
// at the eNB, even slots have double as much time since most of the processing is done here and almost nothing in odd slots
LOG_D(HW,"eNB Frame %d, time %llu: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, rt_get_time_ns(), slot, hw_slot, diff);
slot++;
if (frame > 0) {
oai_exit = 1;
#if defined(ENABLE_ITTI)
itti_send_terminate_message(TASK_L2L1);
itti_send_terminate_message (TASK_L2L1);
#endif
}
if (slot==20){
slot=0;
frame++;
}
continue;
}
if (slot==20){
slot=0;
frame++;
}
continue;
}
if (diff>8)
LOG_D(HW,"eNB Frame %d, time %llu: skipped slot, waiting for hw to catch up (slot %d, hw_slot %d, mbox_current %d, mbox_target %d, diff %d)\n",frame, rt_get_time_ns(), slot, hw_slot, mbox_current, mbox_target, diff);
......@@ -555,9 +543,9 @@ static void *eNB_thread(void *arg)
delay_cnt = 0;
while ((diff>0) && (!oai_exit))
{
time_in = rt_get_time_ns();
//LOG_D(HW,"eNB Frame %d delaycnt %d : hw_slot %d (%d), slot %d, (slot+1)*15=%d, diff %d, time %llu\n",frame,delay_cnt,hw_slot,((unsigned int *)DAQ_MBOX)[0],slot,(((slot+1)*15)>>1),diff,time_in);
//LOG_D(HW,"eNB Frame %d, time %llu: sleeping for %llu (slot %d, hw_slot %d, diff %d, mbox %d, delay_cnt %d)\n", frame, time_in, diff*DAQ_PERIOD,slot,hw_slot,diff,((volatile unsigned int *)DAQ_MBOX)[0],delay_cnt);
time_in = rt_get_time_ns();
//LOG_D(HW,"eNB Frame %d delaycnt %d : hw_slot %d (%d), slot %d, (slot+1)*15=%d, diff %d, time %llu\n",frame,delay_cnt,hw_slot,((unsigned int *)DAQ_MBOX)[0],slot,(((slot+1)*15)>>1),diff,time_in);
//LOG_D(HW,"eNB Frame %d, time %llu: sleeping for %llu (slot %d, hw_slot %d, diff %d, mbox %d, delay_cnt %d)\n", frame, time_in, diff*DAQ_PERIOD,slot,hw_slot,diff,((volatile unsigned int *)DAQ_MBOX)[0],delay_cnt);
ret = rt_sleep_ns(diff*DAQ_PERIOD);
if (ret)
LOG_D(HW,"eNB Frame %d, time %llu: rt_sleep_ns returned %d\n",frame, time_in);
......@@ -618,7 +606,7 @@ static void *eNB_thread(void *arg)
if (fs4_test==0)
{
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0, 0,NULL);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0, no_relay,NULL);
#ifndef IFFT_FPGA
slot_offset_F = (next_slot)*
(PHY_vars_eNB_g[0]->lte_frame_parms.ofdm_symbol_size)*
......@@ -1234,6 +1222,15 @@ int main(int argc, char **argv) {
vcd_signal_dumper_init("/tmp/openair_dump_eNB.vcd");
}
#if defined(ENABLE_ITTI)
if (UE_flag == 1) {
log_set_instance_type (LOG_INSTANCE_UE);
}
else {
log_set_instance_type (LOG_INSTANCE_ENB);
}
#endif
#if defined(ENABLE_ITTI)
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, itti_dump_file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment