Commit bbf6d514 authored by Haruki NAOI's avatar Haruki NAOI

Clean PRE_SCD_THREAD build option. FairRR scheduler always use Pre_Scheduler.

parent e6e9ea28
...@@ -633,7 +633,6 @@ add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchang ...@@ -633,7 +633,6 @@ add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchang
add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE") add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE") add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE") add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
add_boolean_option(PHY_RM False "enable PHY_RM with phy resource management") add_boolean_option(PHY_RM False "enable PHY_RM with phy resource management")
add_boolean_option(UDP_1MS False "enable using UDP socket for VNF-PNF interface") add_boolean_option(UDP_1MS False "enable using UDP socket for VNF-PNF interface")
......
...@@ -504,7 +504,6 @@ function main() { ...@@ -504,7 +504,6 @@ function main() {
echo "set ( PHY_RM $PHY_RM )" >> $cmake_file echo "set ( PHY_RM $PHY_RM )" >> $cmake_file
echo "set ( UDP_1MS $UDP_1MS )" >> $cmake_file echo "set ( UDP_1MS $UDP_1MS )" >> $cmake_file
echo "set ( PHYSIM $PHYSIM )" >> $cmake_file echo "set ( PHYSIM $PHYSIM )" >> $cmake_file
echo "set ( PRE_SCD_THREAD True )" >> $cmake_file
echo "set ( UESIM_EXPANSION $UESIM_EXPANSION )" >> $cmake_file echo "set ( UESIM_EXPANSION $UESIM_EXPANSION )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
......
...@@ -588,6 +588,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -588,6 +588,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP) sub_frame_t subframeP)
{ {
protocol_ctxt_t ctxt;
int mbsfn_status[MAX_NUM_CCs]; int mbsfn_status[MAX_NUM_CCs];
int CC_id = 0; int CC_id = 0;
int UE_id = -1; int UE_id = -1;
...@@ -622,13 +623,12 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -622,13 +623,12 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
} }
#if (!defined(PRE_SCD_THREAD)) if (eNB->scheduler_mode == SCHED_MODE_DEFAULT) {
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP, module_idP); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP, module_idP);
pdcp_run(&ctxt); pdcp_run(&ctxt);
rrc_rx_tx(&ctxt, CC_id); rrc_rx_tx(&ctxt, CC_id);
}
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
...@@ -787,11 +787,7 @@ void update_ue_timers(module_id_t module_idP,frame_t frameP, sub_frame_t subfram ...@@ -787,11 +787,7 @@ void update_ue_timers(module_id_t module_idP,frame_t frameP, sub_frame_t subfram
UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes, UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes,
UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus, UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus,
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used, UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used,
#if defined(PRE_SCD_THREAD) eNB->scheduler_mode == SCHED_MODE_DEFAULT ? 0 : dl_buffer_total[CC_id][UE_id],
dl_buffer_total[CC_id][UE_id],
#else
0,
#endif
UE_scheduling_control->first_cnt[CC_id], UE_scheduling_control->first_cnt[CC_id],
UE_scheduling_control->ret_cnt[CC_id], UE_scheduling_control->ret_cnt[CC_id],
UE_scheduling_control->aperiodic_ri_received[CC_id] UE_scheduling_control->aperiodic_ri_received[CC_id]
......
...@@ -61,12 +61,9 @@ int last_dlsch_ue_id_volte[MAX_NUM_CCs] = {-1}; ...@@ -61,12 +61,9 @@ int last_dlsch_ue_id_volte[MAX_NUM_CCs] = {-1};
int last_ulsch_ue_id[MAX_NUM_CCs] = {-1}; int last_ulsch_ue_id[MAX_NUM_CCs] = {-1};
int last_ulsch_ue_id_volte[MAX_NUM_CCs] = {-1}; int last_ulsch_ue_id_volte[MAX_NUM_CCs] = {-1};
#if defined(PRE_SCD_THREAD) uint64_t dl_buffer_total[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
uint64_t dl_buffer_total[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX];
eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX];
eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
#endif
#define DEBUG_eNB_SCHEDULER 1 #define DEBUG_eNB_SCHEDULER 1
#define DEBUG_HEADER_PARSING 1 #define DEBUG_HEADER_PARSING 1
...@@ -86,7 +83,7 @@ void set_dl_ue_select_msg4(int CC_idP, uint16_t nb_rb, int UE_id, rnti_t rnti) { ...@@ -86,7 +83,7 @@ void set_dl_ue_select_msg4(int CC_idP, uint16_t nb_rb, int UE_id, rnti_t rnti) {
dlsch_ue_select[CC_idP].list[dlsch_ue_select[CC_idP].ue_num].rnti = rnti; dlsch_ue_select[CC_idP].list[dlsch_ue_select[CC_idP].ue_num].rnti = rnti;
dlsch_ue_select[CC_idP].ue_num++; dlsch_ue_select[CC_idP].ue_num++;
} }
#if defined(PRE_SCD_THREAD)
inline uint16_t search_rbs_required(uint16_t mcs, uint64_t len, uint32_t NB_RB, uint16_t step_size) { inline uint16_t search_rbs_required(uint16_t mcs, uint64_t len, uint32_t NB_RB, uint16_t step_size) {
uint16_t nb_rb,i_TBS,TBS; uint16_t nb_rb,i_TBS,TBS;
i_TBS=get_I_TBS(mcs); i_TBS=get_I_TBS(mcs);
...@@ -193,7 +190,6 @@ int dl_dtch_num; ...@@ -193,7 +190,6 @@ int dl_dtch_num;
} }
} }
#endif
int cc_id_end(uint8_t *cc_id_flag ) { int cc_id_end(uint8_t *cc_id_flag ) {
int end_flag = 1; int end_flag = 1;
...@@ -1038,12 +1034,11 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -1038,12 +1034,11 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
// uint16_t r1=0; // uint16_t r1=0;
uint8_t CC_id; uint8_t CC_id;
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
eNB_MAC_INST *eNB = RC.mac[Mod_id];
int N_RB_DL; int N_RB_DL;
#if defined(PRE_SCD_THREAD)
eNB_UE_STATS *eNB_UE_stats; eNB_UE_STATS *eNB_UE_stats;
uint16_t step_size; uint16_t step_size;
uint64_t dl_buffer; uint64_t dl_buffer;
#endif
UE_sched_ctrl_t *ue_sched_ctl; UE_sched_ctrl_t *ue_sched_ctl;
// int rrc_status = RRC_IDLE; // int rrc_status = RRC_IDLE;
COMMON_channels_t *cc; COMMON_channels_t *cc;
...@@ -1098,13 +1093,13 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -1098,13 +1093,13 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
} }
} }
#if (!defined(PRE_SCD_THREAD)) if (eNB->scheduler_mode == SCHED_MODE_DEFAULT) {
// Store the DLSCH buffer for each logical channel // Store the DLSCH buffer for each logical channel
store_dlsch_buffer(Mod_id,0, frameP, subframeP); store_dlsch_buffer(Mod_id,0, frameP, subframeP);
// Calculate the number of RBs required by each UE on the basis of logical channel's buffer // Calculate the number of RBs required by each UE on the basis of logical channel's buffer
assign_rbs_required(Mod_id, 0, frameP, subframeP, nb_rbs_required, assign_rbs_required(Mod_id, 0, frameP, subframeP, nb_rbs_required,
min_rb_unit); min_rb_unit);
#else } else if (eNB->scheduler_mode == SCHED_MODE_FAIR_RR) {
for (CC_id = 0; CC_id <MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id <MAX_NUM_CCs; CC_id++) {
N_RB_DL = to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth); N_RB_DL = to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
if (N_RB_DL==50) { if (N_RB_DL==50) {
...@@ -1136,7 +1131,8 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -1136,7 +1131,8 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
} }
} }
} }
#endif }
dlsch_scheduler_pre_ue_select_fairRR(Mod_id,frameP,subframeP, mbsfn_flag,nb_rbs_required,dlsch_ue_select); dlsch_scheduler_pre_ue_select_fairRR(Mod_id,frameP,subframeP, mbsfn_flag,nb_rbs_required,dlsch_ue_select);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
average_rbs_per_user[CC_id] = 0; average_rbs_per_user[CC_id] = 0;
......
...@@ -76,12 +76,9 @@ extern uint32_t RRC_CONNECTION_FLAG; ...@@ -76,12 +76,9 @@ extern uint32_t RRC_CONNECTION_FLAG;
extern uint8_t rb_table[34]; extern uint8_t rb_table[34];
#if defined(PRE_SCD_THREAD)
extern uint64_t dl_buffer_total[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern uint64_t dl_buffer_total[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
extern boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX]; extern boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX];
extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
#endif
extern mac_rlc_am_muilist_t rlc_am_mui; extern mac_rlc_am_muilist_t rlc_am_mui;
extern SCHEDULER_MODES global_scheduler_mode; extern SCHEDULER_MODES global_scheduler_mode;
......
...@@ -1321,12 +1321,11 @@ int32_t get_uldl_offset(int eutra_bandP); ...@@ -1321,12 +1321,11 @@ int32_t get_uldl_offset(int eutra_bandP);
int l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, int l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,
uint8_t HO_active); uint8_t HO_active);
void sort_lcid_priority(module_id_t module_id, int UE_id, int dl_dtch_num, int *dl_dtch_list); void sort_lcid_priority(module_id_t module_id, int UE_id, int dl_dtch_num, int *dl_dtch_list);
#if defined(PRE_SCD_THREAD)
void pre_scd_nb_rbs_required( module_id_t module_idP, void pre_scd_nb_rbs_required( module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int min_rb_unit[MAX_NUM_CCs]); int min_rb_unit[MAX_NUM_CCs]);
#endif
/* Slice related functions */ /* Slice related functions */
uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs); uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs);
......
...@@ -352,11 +352,9 @@ void *rrc_enb_process_itti_msg(void *); ...@@ -352,11 +352,9 @@ void *rrc_enb_process_itti_msg(void *);
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
void *rrc_enb_task(void *args_p); void *rrc_enb_task(void *args_p);
#if defined(PRE_SCD_THREAD)
/**\brief MAC eNB Pre SCD task. /**\brief MAC eNB Pre SCD task.
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
void *pre_scd_task(void *args_p); void *pre_scd_task(void *args_p);
#endif
/**\brief RRC UE task. /**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
......
...@@ -226,13 +226,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name ...@@ -226,13 +226,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, 1 );
#if defined(PRE_SCD_THREAD)
if(global_scheduler_mode == SCHED_MODE_FAIR_RR) {
if (NFAPI_MODE==NFAPI_MODE_VNF) { if (NFAPI_MODE==NFAPI_MODE_VNF) {
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX); memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX); memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
} }
#endif }
if ((ret= pthread_mutex_lock(&eNB->UL_INFO_mutex))!=0) { if ((ret= pthread_mutex_lock(&eNB->UL_INFO_mutex))!=0) {
LOG_E(PHY,"error locking UL_INFO_mutex, return %d\n",ret); LOG_E(PHY,"error locking UL_INFO_mutex, return %d\n",ret);
return -1; return -1;
...@@ -1520,7 +1521,6 @@ void stop_eNB(int nb_inst) { ...@@ -1520,7 +1521,6 @@ void stop_eNB(int nb_inst) {
} }
} }
#if defined(PRE_SCD_THREAD)
void *pre_scd_task( void *param ) { void *pre_scd_task( void *param ) {
static int eNB_pre_scd_status; static int eNB_pre_scd_status;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
...@@ -1593,5 +1593,4 @@ void *pre_scd_task( void *param ) { ...@@ -1593,5 +1593,4 @@ void *pre_scd_task( void *param ) {
eNB_pre_scd_status = 0; eNB_pre_scd_status = 0;
return &eNB_pre_scd_status; return &eNB_pre_scd_status;
} }
#endif
...@@ -130,9 +130,7 @@ const char ru_states[6][9] = {"RU_IDLE","RU_CONFIG","RU_READY","RU_RUN","RU_ERRO ...@@ -130,9 +130,7 @@ const char ru_states[6][9] = {"RU_IDLE","RU_CONFIG","RU_READY","RU_RUN","RU_ERRO
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
#if defined(PRE_SCD_THREAD) void init_ru_vnf(void);
void init_ru_vnf(void);
#endif
/*************************************************************/ /*************************************************************/
...@@ -2914,7 +2912,6 @@ void stop_RU(int nb_ru) ...@@ -2914,7 +2912,6 @@ void stop_RU(int nb_ru)
//Some of the member of ru pointer is used in pre_scd. //Some of the member of ru pointer is used in pre_scd.
//This funtion is for initializing ru pointer for L2 FAPI simulator. //This funtion is for initializing ru pointer for L2 FAPI simulator.
#if defined(PRE_SCD_THREAD)
void init_ru_vnf(void) { void init_ru_vnf(void) {
int ru_id; int ru_id;
RU_t *ru; RU_t *ru;
...@@ -2990,7 +2987,6 @@ void init_ru_vnf(void) { ...@@ -2990,7 +2987,6 @@ void init_ru_vnf(void) {
// sleep(1); // sleep(1);
LOG_D(HW,"[lte-softmodem.c] RU threads created\n"); LOG_D(HW,"[lte-softmodem.c] RU threads created\n");
} }
#endif
/* --------------------------------------------------------*/ /* --------------------------------------------------------*/
......
...@@ -471,14 +471,15 @@ int restart_L1L2(module_id_t enb_id) { ...@@ -471,14 +471,15 @@ int restart_L1L2(module_id_t enb_id) {
LOG_I(RRC, "Re-created task for RRC eNB successfully\n"); LOG_I(RRC, "Re-created task for RRC eNB successfully\n");
} }
#if defined(PRE_SCD_THREAD)
if(global_scheduler_mode == SCHED_MODE_FAIR_RR) {
if (itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL) < 0) { if (itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL) < 0) {
LOG_E(MAC,"Create task for MAC eNB PreSCD failed\n"); LOG_E(MAC,"Create task for MAC eNB PreSCD failed\n");
return -1; return -1;
} else { } else {
LOG_I(RRC, "Re-created task for MAC eNB PreSCD successfully\n"); LOG_I(RRC, "Re-created task for MAC eNB PreSCD successfully\n");
} }
#endif }
/* pass a reconfiguration request which will configure everything down to /* pass a reconfiguration request which will configure everything down to
* RC.eNB[i][j]->frame_parms, too */ * RC.eNB[i][j]->frame_parms, too */
...@@ -655,13 +656,13 @@ int main( int argc, char **argv ) { ...@@ -655,13 +656,13 @@ int main( int argc, char **argv ) {
} }
if (NFAPI_MODE==NFAPI_MODE_VNF) {// VNF if (NFAPI_MODE==NFAPI_MODE_VNF) {// VNF
#if defined(PRE_SCD_THREAD) if(global_scheduler_mode == SCHED_MODE_FAIR_RR) {
init_ru_vnf(); // ru pointer is necessary for pre_scd. init_ru_vnf(); // ru pointer is necessary for pre_scd.
int rc; int rc;
LOG_I(MAC,"Creating MAC eNB PreSCD Task\n"); LOG_I(MAC,"Creating MAC eNB PreSCD Task\n");
rc = itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL); rc = itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL);
AssertFatal(rc >= 0, "Create task for MAC eNB PreSCD failed\n"); AssertFatal(rc >= 0, "Create task for MAC eNB PreSCD failed\n");
#endif }
wait_nfapi_init("main?"); wait_nfapi_init("main?");
} }
...@@ -694,14 +695,14 @@ int main( int argc, char **argv ) { ...@@ -694,14 +695,14 @@ int main( int argc, char **argv ) {
printf("Initializing RU threads\n"); printf("Initializing RU threads\n");
init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->clock_source,get_softmodem_params()->timing_source,get_softmodem_params()->send_dmrs_sync); init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->clock_source,get_softmodem_params()->timing_source,get_softmodem_params()->send_dmrs_sync);
#if defined(PRE_SCD_THREAD) if(global_scheduler_mode == SCHED_MODE_FAIR_RR) {
if (NFAPI_MODE == NFAPI_MONOLITHIC) { if (NFAPI_MODE == NFAPI_MONOLITHIC) {
int rc; int rc;
LOG_I(MAC,"Creating MAC eNB PreSCD Task\n"); LOG_I(MAC,"Creating MAC eNB PreSCD Task\n");
rc = itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL); rc = itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL);
AssertFatal(rc >= 0, "Create task for MAC eNB PreSCD failed\n"); AssertFatal(rc >= 0, "Create task for MAC eNB PreSCD failed\n");
} }
#endif }
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
RC.ru[ru_id]->rf_map.card=0; RC.ru[ru_id]->rf_map.card=0;
......
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