Commit 334e3a57 authored by Javier Morgade's avatar Javier Morgade

1. Reference config file defined with basic MBMS configuration stuff

	2. Dedicated MBMS tasks manager:
	   -If MBMS gets enabled through softmodem config file it will launch SCTP task (to check with S1 interface)
	3. "On the flight" dynamic RU configuration update mechanism implemented

	ACKNOWLEDGEMENT:
 	1. This commit was developed at Vicomtech (https://www.vicomtech.org) under UE project CDN-X-ALL: "CDN edge-cloud computing for efficient cache and reliable streaming aCROSS Aggregated unicast-multicast LinkS"
 	2. Project funded by Fed4FIRE+ OC5 (https://www.fed4fire.eu)
Signed-off-by: default avatarJavier Morgade <javier.morgade@ieee.org>
parent 2bd1e119
This diff is collapsed.
This diff is collapsed.
......@@ -28,6 +28,7 @@ extern void *l2l1_task(void *arg);
int create_tasks(uint32_t enb_nb);
int create_tasks_ue(uint32_t ue_nb);
int create_tasks_mbms(uint32_t enb_nb);
#endif
#endif /* CREATE_TASKS_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
# include "intertask_interface.h"
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
# include "targets/RT/USER/lte-softmodem.h"
# include "common/ran_context.h"
#ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#include "m2ap_eNB.h"
#include "m2ap_MCE.h"
#include "m3ap_MME.h"
#include "m3ap_MCE.h"
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
#endif
# include "f1ap_cu_task.h"
# include "f1ap_du_task.h"
# include "enb_app.h"
# include "mce_app.h"
# include "mme_app.h"
//extern RAN_CONTEXT_t RC;
int create_tasks_mbms(uint32_t enb_nb) {
// LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
// ngran_node_t type = RC.rrc[0]->node_type;
int rc;
if (enb_nb == 0) return 0;
if(!EPC_MODE_ENABLED){
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
}
LOG_I(MME_APP, "Creating MME_APP eNB Task\n");
rc = itti_create_task (TASK_MME_APP, MME_app_task, NULL);
AssertFatal(rc >= 0, "Create task for MME APP failed\n");
if (is_m3ap_MME_enabled()) {
rc = itti_create_task(TASK_M3AP_MME, m3ap_MME_task, NULL);
AssertFatal(rc >= 0, "Create task for M3AP MME failed\n");
}
LOG_I(MCE_APP, "Creating MCE_APP eNB Task\n");
rc = itti_create_task (TASK_MCE_APP, MCE_app_task, NULL);
AssertFatal(rc >= 0, "Create task for MCE APP failed\n");
// LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
// rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL);
// AssertFatal(rc >= 0, "Create task for eNB APP failed\n");
//
// LOG_I(RRC,"Creating RRC eNB Task\n");
// rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL);
// AssertFatal(rc >= 0, "Create task for RRC eNB failed\n");
//
// if (EPC_MODE_ENABLED) {
// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for SCTP failed\n");
// }
// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for SCTP failed\n");
//
//
// if (EPC_MODE_ENABLED && !NODE_IS_DU(type)) {
// rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for S1AP failed\n");
// if (!(get_softmodem_params()->emulate_rf)){
// rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for UDP failed\n");
// }
// rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
// if (is_x2ap_enabled()) {
// rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
// AssertFatal(rc >= 0, "Create task for X2AP failed\n");
// } else {
// LOG_I(X2AP, "X2AP is disabled.\n");
// }
// }
////
if(!EPC_MODE_ENABLED){
// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for SCTP failed\n");
rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for UDP failed\n");
rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
}
///
// if (NODE_IS_CU(type)) {
// rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
// AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
// }
//
// if (NODE_IS_DU(type)) {
// rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
// AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
// }
//
if (is_m3ap_MCE_enabled()) {
rc = itti_create_task(TASK_M3AP_MCE, m3ap_MCE_task, NULL);
AssertFatal(rc >= 0, "Create task for M3AP MCE failed\n");
}
if (is_m2ap_MCE_enabled()) {
rc = itti_create_task(TASK_M2AP_MCE, m2ap_MCE_task, NULL);
AssertFatal(rc >= 0, "Create task for M2AP failed\n");
}
if (is_m2ap_eNB_enabled()) {
rc = itti_create_task(TASK_M2AP_ENB, m2ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for M2AP failed\n");
}
return 0;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef CREATE_TASKS_H_
#define CREATE_TASKS_H_
#if defined(ENABLE_ITTI)
/* External declaration of L2L1 task that depend on the target */
extern void *l2l1_task(void *arg);
int create_tasks(uint32_t enb_nb);
int create_tasks_ue(uint32_t ue_nb);
int create_tasks_mbms(uint32_t enb_nb);
#endif
#endif /* CREATE_TASKS_H_ */
......@@ -1280,6 +1280,8 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
AssertFatal((eNB->if_inst = IF_Module_init(inst))!=NULL,"Cannot register interface");
eNB->if_inst->schedule_response = schedule_response;
eNB->if_inst->PHY_config_req = phy_config_request;
eNB->if_inst->PHY_config_update_sib2_req = phy_config_update_sib2_request;
eNB->if_inst->PHY_config_update_sib13_req = phy_config_update_sib13_request;
memset((void *)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO));
memset((void *)&eNB->Sched_INFO,0,sizeof(eNB->Sched_INFO));
LOG_I(PHY,"Setting indication lists\n");
......
......@@ -1800,6 +1800,14 @@ void *ru_thread( void *param ) {
#endif
// wakeup all eNB processes waiting for this RU
if (ru->num_eNB>0) wakeup_L1s(ru);
//Workaround ... this must be properly handled
if(ru->if_south!=LOCAL_RF && RC.eNB[0][0]!=NULL){
if(ru->frame_parms.num_MBSFN_config!=RC.eNB[0][0]->frame_parms.num_MBSFN_config){
ru->frame_parms = RC.eNB[0][0]->frame_parms;//->frame_parms;
LOG_W(PHY,"RU MBSFN SF PARAMS Updated\n");
}
}
#ifndef PHY_TX_THREAD
......
......@@ -708,6 +708,8 @@ int main( int argc, char **argv ) {
pthread_mutex_unlock(&sync_mutex);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
}
create_tasks_mbms(1);
// wait for end of program
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
// CI -- Flushing the std outputs for the previous marker to show on the eNB / DU / CU log file
......
......@@ -493,6 +493,27 @@ void configure_rru(int idx,
}
static int send_update_rru(RU_t * ru, LTE_DL_FRAME_PARMS * fp){
//ssize_t msg_len/*,len*/;
int i;
//LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
RRU_CONFIG_msg_t rru_config_msg;
memset((void *)&rru_config_msg,0,sizeof(rru_config_msg));
rru_config_msg.type = RRU_config_update;
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
LOG_I(PHY,"Sending RAU tick to RRU %d %lu bytes\n",ru->idx,rru_config_msg.len);
RRU_config_t *config = (RRU_config_t *)&rru_config_msg.msg[0];
config->num_MBSFN_config=fp->num_MBSFN_config;
for(i=0; i < fp->num_MBSFN_config; i++){
config->MBSFN_config[i] = fp->MBSFN_config[i];
LOG_W(PHY,"Configuration send to RAU (num MBSFN %d, MBSFN_SubframeConfig[%d] pattern is %x )\n",config->num_MBSFN_config,i,config->MBSFN_config[i].mbsfn_SubframeConfig);
}
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),
"RU %d cannot access remote radio\n",ru->idx);
return 0;
}
void* ru_thread_control( void* param ) {
......@@ -502,6 +523,7 @@ void* ru_thread_control( void* param ) {
RRU_CONFIG_msg_t rru_config_msg;
ssize_t msg_len;
int len;
int ru_sf_update=0; // SF config update flag (MBSFN)
// Start IF device if any
if (ru->start_if) {
......@@ -523,6 +545,16 @@ void* ru_thread_control( void* param ) {
if (ru->state == RU_IDLE && ru->if_south != LOCAL_RF)
send_tick(ru);
if (ru->state == RU_RUN && ru->if_south != LOCAL_RF){
LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
LOG_D(PHY,"Check MBSFN SF changes\n");
if(fp->num_MBSFN_config != ru_sf_update){
ru_sf_update = fp->num_MBSFN_config;
LOG_W(PHY,"RU SF should be updated ... calling send_update_rru(ru)\n");
send_update_rru(ru,fp);
}
}
if ((len = ru->ifdevice.trx_ctlrecv_func(&ru->ifdevice,
&rru_config_msg,
......@@ -656,6 +688,30 @@ void* ru_thread_control( void* param ) {
}
}
break;
case RRU_config_update: //RRU
if (ru->if_south == LOCAL_RF){
LOG_W(PHY,"Configuration update received from RAU \n");
msg_len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
LOG_W(PHY,"New MBSFN config received from RAU --- num_MBSFN_config %d\n",((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config);
ru->frame_parms.num_MBSFN_config = ((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config;
for(int i=0; i < ((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config; i++){
ru->frame_parms.MBSFN_config[i].mbsfn_SubframeConfig=((RRU_config_t *)&rru_config_msg.msg[0])->MBSFN_config[i].mbsfn_SubframeConfig;
LOG_W(PHY,"Configuration received from RAU (num MBSFN %d, MBSFN_SubframeConfig[%d] pattern is %x )\n",
((RRU_config_t *)&rru_config_msg.msg[0])->num_MBSFN_config,
i,
((RRU_config_t *)&rru_config_msg.msg[0])->MBSFN_config[i].mbsfn_SubframeConfig
);
}
} else LOG_E(PHY,"Received RRU_config msg...Ignoring\n");
break;
case RRU_config_update_ok: //RAU
if (ru->if_south == LOCAL_RF) LOG_E(PHY,"Received RRU_config_update_ok msg...Ignoring\n");
else{
LOG_W(PHY,"Received RRU_config_update_ok msg...\n");
}
break;
case RRU_start: // RRU
if (ru->if_south == LOCAL_RF){
......
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