From 393f30a2b1111ff24526cc3c2d9ea7062781a191 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Thu, 20 Dec 2018 11:51:22 +0100 Subject: [PATCH 1/9] triggering CI --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 95aa796992..1e6723e46d 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1185,14 +1185,12 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_list->first_rb_offset[CC_id][slice_idx] = cmin(n_rb_ul_val, sli->ul[slice_idx].first_rb); } - //LOG_D(MAC, "entering ulsch preprocesor\n"); ulsch_scheduler_pre_processor(module_idP, slice_idx, frameP, subframeP, sched_subframeP, first_rb); for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; ++CC_id) { first_rb_slice[CC_id] = first_rb[CC_id] + UE_list->first_rb_offset[CC_id][slice_idx]; } - //LOG_D(MAC, "exiting ulsch preprocesor\n"); hi_dci0_req->sfn_sf = (frameP << 4) + subframeP; // loop over all active UEs From ce7067c7b8b42b5f5a31d7c6e398eb0cf2b07252 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 10 Jan 2019 16:35:13 +0100 Subject: [PATCH 2/9] CI: fixing scp timeout failure like the ssh session timeout failure Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 104 +++++++++++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 41 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c5c30c8e20..710e06c2c2 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -203,59 +203,81 @@ class SSHConnection(): logging.debug('\u001B[1;37;41m Unexpected Others during closing\u001B[0m') def copyin(self, ipaddress, username, password, source, destination): + count = 0 + copy_status = False logging.debug('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination) - scp_spawn = pexpect.spawn('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination, timeout = 5) - scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT]) - if scp_response == 0: - scp_spawn.sendline('yes') - scp_spawn.expect('password:') - scp_spawn.sendline(password) - scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + while count < 4: + scp_spawn = pexpect.spawn('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination, timeout = 5) + scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT]) if scp_response == 0: - pass + scp_spawn.sendline('yes') + scp_spawn.expect('password:') + scp_spawn.sendline(password) + scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + if scp_response == 0: + count = 10 + copy_status = True + else: + logging.debug('1 - scp_response = ' + str(scp_response)) + elif scp_response == 1: + scp_spawn.sendline(password) + scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + if scp_response == 0 or scp_response == 3: + count = 10 + copy_status = True + else: + logging.debug('2 - scp_response = ' + str(scp_response)) + elif scp_response == 2: + count = 10 + copy_status = True else: - logging.debug('1 - scp_response = ' + str(scp_response)) - sys.exit('SCP failed') - elif scp_response == 1: - scp_spawn.sendline(password) - scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) - if scp_response == 0 or scp_response == 3: - pass - else: - logging.debug('2 - scp_response = ' + str(scp_response)) - sys.exit('SCP failed') - elif scp_response == 2: + logging.debug('3 - scp_response = ' + str(scp_response)) + # adding a tempo when failure + if not copy_status: + time.sleep(1) + count += 1 + if copy_status: pass else: - logging.debug('3 - scp_response = ' + str(scp_response)) sys.exit('SCP failed') def copyout(self, ipaddress, username, password, source, destination): + count = 0 + copy_status = False logging.debug('scp ' + source + ' ' + username + '@' + ipaddress + ':' + destination) - scp_spawn = pexpect.spawn('scp ' + source + ' ' + username + '@' + ipaddress + ':' + destination, timeout = 5) - scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT]) - if scp_response == 0: - scp_spawn.sendline('yes') - scp_spawn.expect('password:') - scp_spawn.sendline(password) - scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + while count < 4: + scp_spawn = pexpect.spawn('scp ' + source + ' ' + username + '@' + ipaddress + ':' + destination, timeout = 5) + scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT]) if scp_response == 0: - pass + scp_spawn.sendline('yes') + scp_spawn.expect('password:') + scp_spawn.sendline(password) + scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + if scp_response == 0: + count = 10 + copy_status = True + else: + logging.debug('1 - scp_response = ' + str(scp_response)) + elif scp_response == 1: + scp_spawn.sendline(password) + scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + if scp_response == 0 or scp_response == 3: + count = 10 + copy_status = True + else: + logging.debug('2 - scp_response = ' + str(scp_response)) + elif scp_response == 2: + count = 10 + copy_status = True else: - logging.debug('1 - scp_response = ' + str(scp_response)) - sys.exit('SCP failed') - elif scp_response == 1: - scp_spawn.sendline(password) - scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) - if scp_response == 0 or scp_response == 3: - pass - else: - logging.debug('2 - scp_response = ' + str(scp_response)) - sys.exit('SCP failed') - elif scp_response == 2: + logging.debug('3 - scp_response = ' + str(scp_response)) + # adding a tempo when failure + if not copy_status: + time.sleep(1) + count += 1 + if copy_status: pass else: - logging.debug('3 - scp_response = ' + str(scp_response)) sys.exit('SCP failed') def BuildeNB(self): @@ -2061,7 +2083,7 @@ class SSHConnection(): def CreateHtmlTabFooter(self, passStatus): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' Final Tab Status\n') if passStatus: self.htmlFile.write(' PASS \n') From 8bc548a22c705a1150570e05d35faaced347a56d Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 11 Jan 2019 08:48:06 +0100 Subject: [PATCH 3/9] no modifications before pull --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 4b64ffd359..00868719e2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -128,7 +128,6 @@ rx_sdu(const module_id_t enb_mod_idP, mac = RC.mac[enb_mod_idP]; harq_pid = subframe2harqpid(&mac->common_channels[CC_idP], frameP, subframeP); UE_list = &mac->UE_list; - //ra = (RA_t *) &RC.mac[enb_mod_idP]->common_channels[CC_idP].ra[0]; ra = RC.mac[enb_mod_idP]->common_channels[CC_idP].ra; memset(rx_ces, 0, MAX_NUM_CE * sizeof(unsigned char)); memset(rx_lcids, 0, NB_RB_MAX * sizeof(unsigned char)); @@ -141,7 +140,7 @@ rx_sdu(const module_id_t enb_mod_idP, if (opt_enabled == 1) { trace_pdu(DIRECTION_UPLINK, sduP, sdu_lenP, 0, WS_C_RNTI, current_rnti, frameP, subframeP, 0, 0); - LOG_D(OPT, "[eNB %d][ULSCH] Frame %d rnti %x with size %d\n", + LOG_D(OPT, "[eNB %d][ULSCH] Frame %d rnti %x with size %d\n", enb_mod_idP, frameP, current_rnti, @@ -179,7 +178,6 @@ rx_sdu(const module_id_t enb_mod_idP, if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 0; - // mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, subframeP, UE_RNTI(enb_mod_idP, UE_id)); // replace UE_RNTI(enb_mod_idP, UE_id) by current_rnti ?? mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, subframeP, current_rnti); } From f99d40c10e4ca212bda7116cac3985c7d650a0bb Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 11 Jan 2019 10:14:56 +0100 Subject: [PATCH 4/9] add debug in eNB_scheduler_ulsch.c --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 60 +++++++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 00868719e2..549b36cdd7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -133,6 +133,16 @@ rx_sdu(const module_id_t enb_mod_idP, memset(rx_lcids, 0, NB_RB_MAX * sizeof(unsigned char)); memset(rx_lengths, 0, NB_RB_MAX * sizeof(unsigned short)); + // LAD + if (UE_id == -1) { + LOG_W(MAC, "[MAC] UE_id = -1 ; RNTI = %x ; frame = %d ; subframe = %d ; sdu_length = %d ; sdu = %d\n", + rntiP, + frameP, + subframeP, + sdu_lenP, + *sduP); + } + start_meas(&mac->rx_ulsch_sdu); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU, 1); @@ -182,6 +192,13 @@ rx_sdu(const module_id_t enb_mod_idP, } /* update bytes to schedule */ + + // LAD + LOG_W(MAC, "[MAC] UE_id != -1 and sduP != NULL : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d\n", + first_rb, + UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, + UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]); + UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes -= UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]; if (UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes < 0) { @@ -189,14 +206,16 @@ rx_sdu(const module_id_t enb_mod_idP, } } else { // sduP == NULL => error - LOG_I(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d\n", + LOG_W(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d, UE_id %d, RNTI %x\n", enb_mod_idP, harq_pid, CC_idP, frameP, subframeP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], - ul_cqi); + ul_cqi, + UE_id, + current_rnti); if (ul_cqi > 200) { // too high energy pattern UE_list->UE_sched_ctrl[UE_id].pusch_snr[CC_idP] = ul_cqi; @@ -271,9 +290,14 @@ rx_sdu(const module_id_t enb_mod_idP, RA_id, ul_cqi); - // first_rb = ra->msg3_first_rb; // Should it be ra[RA_id]??? first_rb = ra[RA_id].msg3_first_rb; + // LAD + LOG_W(MAC, "[MAC] UE_id == -1 : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d\n", + first_rb, + UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, + UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]); + if (sduP == NULL) { // we've got an error on Msg3 LOG_I(MAC, "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n", enb_mod_idP, @@ -287,6 +311,23 @@ rx_sdu(const module_id_t enb_mod_idP, } else { first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; // UE_id = -1 !? ra[RA_id].msg3_round++; + + // LAD + LOG_W(MAC, "[MAC] [UEINFO] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x\n", + UE_id, + UE_list->UE_template[CC_idP][UE_id].rnti, + current_rnti); + + // LAD + LOG_W(MAC, "[MAC] UE_id == -1 and sduP == NULL : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d\n", + first_rb, + UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, + UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]); + + // LAD + LOG_W(MAC, "[MAC] [RAPROC] msg3_subframe = %d ; msg3_frame = %d\n", + ra[RA_id].Msg3_subframe, + ra[RA_id].Msg3_frame); /* Prepare handling of retransmission */ get_Msg3allocret(&mac->common_channels[CC_idP], @@ -295,6 +336,11 @@ rx_sdu(const module_id_t enb_mod_idP, &ra[RA_id].Msg3_frame, &ra[RA_id].Msg3_subframe); + // LAD + LOG_W(MAC, "[MAC] [RAPROC] After update: msg3_subframe = %d ; msg3_frame = %d\n", + ra[RA_id].Msg3_subframe, + ra[RA_id].Msg3_frame); + add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP, subframeP); } @@ -348,6 +394,12 @@ rx_sdu(const module_id_t enb_mod_idP, mac->eNB_stats[CC_idP].total_ulsch_pdus_rx += 1; UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; // can UE_id = -1 !? + // LAD + LOG_W(MAC, "[MAC] [UEINFO] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x\n", + UE_id, + UE_list->UE_template[CC_idP][UE_id].rnti, + current_rnti); + /* Control element */ for (int i = 0; i < num_ce; i++) { T(T_ENB_MAC_UE_UL_CE, @@ -451,7 +503,7 @@ rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_template[CC_idP][UE_id].ul_SR = 1; UE_list->UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 1; - break; + // break; } } else { cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti); From 6614916bc4bc3c9eebad3f60a9b51a6520507cd1 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 11 Jan 2019 11:25:01 +0100 Subject: [PATCH 5/9] debug for test --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 549b36cdd7..e3748d87e6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -135,6 +135,7 @@ rx_sdu(const module_id_t enb_mod_idP, // LAD if (UE_id == -1) { + LOG_E(MAC, "Step 1\n"); LOG_W(MAC, "[MAC] UE_id = -1 ; RNTI = %x ; frame = %d ; subframe = %d ; sdu_length = %d ; sdu = %d\n", rntiP, frameP, @@ -194,6 +195,7 @@ rx_sdu(const module_id_t enb_mod_idP, /* update bytes to schedule */ // LAD + LOG_E(MAC, "Step 2\n"); LOG_W(MAC, "[MAC] UE_id != -1 and sduP != NULL : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d\n", first_rb, UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, @@ -293,13 +295,14 @@ rx_sdu(const module_id_t enb_mod_idP, first_rb = ra[RA_id].msg3_first_rb; // LAD + LOG_E(MAC, "Step 3\n"); LOG_W(MAC, "[MAC] UE_id == -1 : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d\n", first_rb, UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]); if (sduP == NULL) { // we've got an error on Msg3 - LOG_I(MAC, "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n", + LOG_W(MAC, "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n", enb_mod_idP, CC_idP, RA_id, @@ -313,7 +316,8 @@ rx_sdu(const module_id_t enb_mod_idP, ra[RA_id].msg3_round++; // LAD - LOG_W(MAC, "[MAC] [UEINFO] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x\n", + LOG_E(MAC, "Step 4\n"); + LOG_W(MAC, "[MAC] [UEINFO1] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x\n", UE_id, UE_list->UE_template[CC_idP][UE_id].rnti, current_rnti); @@ -395,10 +399,13 @@ rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; // can UE_id = -1 !? // LAD - LOG_W(MAC, "[MAC] [UEINFO] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x\n", + LOG_E(MAC, "Step 5\n"); + LOG_W(MAC, "[MAC] [UEINFO2] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x ; frame = %d ; subframe = %d\n", UE_id, UE_list->UE_template[CC_idP][UE_id].rnti, - current_rnti); + current_rnti, + frameP, + subframeP); /* Control element */ for (int i = 0; i < num_ce; i++) { From a2ef8b7b50aedccb7895cf1251adb5b927243e18 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 11 Jan 2019 17:25:13 +0100 Subject: [PATCH 6/9] Some formatting + RAPROC fix (to test) --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 25 +++++++++++++++++++++++ openair2/LAYER2/MAC/mac.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index a52403cac4..825a6f255e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -112,7 +112,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, nfapi_hi_dci0_request_body_t *hi_dci0_req_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; uint8_t sf_ahead_dl; - uint8_t rvseq[4] = { 0, 2, 3, 1 }; + uint8_t rvseq[4] = {0, 2, 3, 1}; ul_req = &mac->UL_req_tmp[CC_id][ra->Msg3_subframe]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index e3748d87e6..87a95e59da 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1142,11 +1142,18 @@ schedule_ulsch(module_id_t module_idP, /* Second setup step */ int sched_subframe = 0; + int sched_frame = 0; + int n_rb_ul_tab = 0; /* Second init step */ sched_subframe = (subframeP + 4) % 10; + sched_frame = frameP; cc = mac->common_channels; + if (sched_subframe < subframeP) { + sched_frame++; + } + /* For TDD: check subframes where we have to act and return if nothing should be done now */ if (cc->tdd_Config) { // Done only for CC_id = 0, assume tdd_Config for all CC_id int tdd_sfa = cc->tdd_Config->subframeAssignment; @@ -1261,6 +1268,24 @@ schedule_ulsch(module_id_t module_idP, // break; } } + + /* Louis-Adrien: Only set for FDD (for the moment) + * Hard coded for prach-ConfigIndex = 0 and prach-Freqoffset = 2 + * ToDo: The PRACH resources should be added with modularity (here?) + */ + if (cc[CC_id].tdd_Config == NULL) { // FDD + if (((sched_frame %2) == 0) && sched_subframe == 1) { // RACH frame and subframe + if (first_rb[CC_id] < 8) { + n_rb_ul_tab = to_prb(cc[CC_id].ul_Bandwidth); // return total number of PRB + + if (n_rb_ul_tab >= 8) { + first_rb[CC_id] = 8; + } else { + return; + } + } + } + } } /* Run each enabled slice-specific schedulers one by one */ diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index 7785abd16f..60496424b5 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -997,6 +997,7 @@ typedef struct { uint8_t crnti_reconfigurationcomplete_flag; uint8_t cqi_req_flag; } UE_sched_ctrl; + /*! \brief eNB template for the Random access information */ typedef struct { /// Flag to indicate this process is active From a748262e0a84b5c3c61bfebd40ece65ff6c3e24d Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 11 Jan 2019 17:40:01 +0100 Subject: [PATCH 7/9] remove some debug before merge develop --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 87a95e59da..774d7e3e64 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -134,6 +134,7 @@ rx_sdu(const module_id_t enb_mod_idP, memset(rx_lengths, 0, NB_RB_MAX * sizeof(unsigned short)); // LAD + /* if (UE_id == -1) { LOG_E(MAC, "Step 1\n"); LOG_W(MAC, "[MAC] UE_id = -1 ; RNTI = %x ; frame = %d ; subframe = %d ; sdu_length = %d ; sdu = %d\n", @@ -143,6 +144,7 @@ rx_sdu(const module_id_t enb_mod_idP, sdu_lenP, *sduP); } + */ start_meas(&mac->rx_ulsch_sdu); @@ -195,11 +197,13 @@ rx_sdu(const module_id_t enb_mod_idP, /* update bytes to schedule */ // LAD + /* LOG_E(MAC, "Step 2\n"); LOG_W(MAC, "[MAC] UE_id != -1 and sduP != NULL : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d\n", first_rb, UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]); + */ UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes -= UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]; @@ -295,11 +299,13 @@ rx_sdu(const module_id_t enb_mod_idP, first_rb = ra[RA_id].msg3_first_rb; // LAD + /* LOG_E(MAC, "Step 3\n"); LOG_W(MAC, "[MAC] UE_id == -1 : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d\n", first_rb, UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]); + */ if (sduP == NULL) { // we've got an error on Msg3 LOG_W(MAC, "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n", @@ -316,6 +322,7 @@ rx_sdu(const module_id_t enb_mod_idP, ra[RA_id].msg3_round++; // LAD + /* LOG_E(MAC, "Step 4\n"); LOG_W(MAC, "[MAC] [UEINFO1] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x\n", UE_id, @@ -332,7 +339,8 @@ rx_sdu(const module_id_t enb_mod_idP, LOG_W(MAC, "[MAC] [RAPROC] msg3_subframe = %d ; msg3_frame = %d\n", ra[RA_id].Msg3_subframe, ra[RA_id].Msg3_frame); - + */ + /* Prepare handling of retransmission */ get_Msg3allocret(&mac->common_channels[CC_idP], ra[RA_id].Msg3_subframe, @@ -341,9 +349,11 @@ rx_sdu(const module_id_t enb_mod_idP, &ra[RA_id].Msg3_subframe); // LAD + /* LOG_W(MAC, "[MAC] [RAPROC] After update: msg3_subframe = %d ; msg3_frame = %d\n", ra[RA_id].Msg3_subframe, ra[RA_id].Msg3_frame); + */ add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP, subframeP); } @@ -399,6 +409,7 @@ rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; // can UE_id = -1 !? // LAD + /* LOG_E(MAC, "Step 5\n"); LOG_W(MAC, "[MAC] [UEINFO2] UE_id = %d ; RNTI_ue_template = %x ; RNTI_sdu = %x ; frame = %d ; subframe = %d\n", UE_id, @@ -406,7 +417,8 @@ rx_sdu(const module_id_t enb_mod_idP, current_rnti, frameP, subframeP); - + */ + /* Control element */ for (int i = 0; i < num_ce; i++) { T(T_ENB_MAC_UE_UL_CE, From 28902bcd57ea69d6f293c6241351f3c37a452a1c Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Mon, 14 Jan 2019 11:59:15 +0100 Subject: [PATCH 8/9] add some debug --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 774d7e3e64..b8a000bf8b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -146,6 +146,17 @@ rx_sdu(const module_id_t enb_mod_idP, } */ + + // LAD + first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; + LOG_W(MAC, "[MAC] UE_id = %d : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d ; frame = %d ; subframe = %d\n", + UE_id, + first_rb, + UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes, + UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid], + frameP, + subframeP); + start_meas(&mac->rx_ulsch_sdu); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU, 1); From fb1ccbaf6bda4ef920b278a1b2b6b0707117f1fa Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Mon, 14 Jan 2019 16:43:04 +0100 Subject: [PATCH 9/9] prach taken into account in ulsch scheduler + resolve UE_id = -1 in rx_sdu (to test before push) --- openair1/PHY/LTE_TRANSPORT/prach_common.c | 11 ++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 70 +++++++++++++++-------- 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/prach_common.c b/openair1/PHY/LTE_TRANSPORT/prach_common.c index 4962f6a7f9..7e38d6a590 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach_common.c +++ b/openair1/PHY/LTE_TRANSPORT/prach_common.c @@ -565,17 +565,16 @@ int is_prach_subframe0(LTE_DL_FRAME_PARMS *frame_parms,uint8_t prach_ConfigIndex return(prach_mask); } -int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t subframe) { +int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t subframe) { uint8_t prach_ConfigIndex = frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex; - int prach_mask = is_prach_subframe0(frame_parms,prach_ConfigIndex,frame,subframe); + int prach_mask = is_prach_subframe0(frame_parms, prach_ConfigIndex, frame, subframe); #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - int i; - - for (i=0;i<4;i++) { + for (int i=0; i<4; i++) { if (frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] == 1) - prach_mask|=(is_prach_subframe0(frame_parms,frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i],frame,subframe)<<(i+1)); + prach_mask |= (is_prach_subframe0(frame_parms, frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i], + frame, subframe) << (i+1)); } #endif return(prach_mask); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index b8a000bf8b..a43b227def 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -146,8 +146,8 @@ rx_sdu(const module_id_t enb_mod_idP, } */ - // LAD + /* first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; LOG_W(MAC, "[MAC] UE_id = %d : first_rb = %d ; scheduled_ul_bytes = %d ; TBS_UL = %d ; frame = %d ; subframe = %d\n", UE_id, @@ -156,6 +156,7 @@ rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid], frameP, subframeP); + */ start_meas(&mac->rx_ulsch_sdu); @@ -329,7 +330,7 @@ rx_sdu(const module_id_t enb_mod_idP, if (ra[RA_id].msg3_round >= mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx - 1) { cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti); } else { - first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; // UE_id = -1 !? + // first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; // UE_id = -1 !!!! ra[RA_id].msg3_round++; // LAD @@ -417,7 +418,9 @@ rx_sdu(const module_id_t enb_mod_idP, mac->eNB_stats[CC_idP].ulsch_bytes_rx = sdu_lenP; mac->eNB_stats[CC_idP].total_ulsch_bytes_rx += sdu_lenP; mac->eNB_stats[CC_idP].total_ulsch_pdus_rx += 1; - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; // can UE_id = -1 !? + if (UE_id != -1) { + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; + } // LAD /* @@ -1166,7 +1169,6 @@ schedule_ulsch(module_id_t module_idP, /* Second setup step */ int sched_subframe = 0; int sched_frame = 0; - int n_rb_ul_tab = 0; /* Second init step */ sched_subframe = (subframeP + 4) % 10; @@ -1271,9 +1273,49 @@ schedule_ulsch(module_id_t module_idP, for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) { first_rb[CC_id] = 1; // leave out first RB for PUCCH + int start_rb = 0; + int nb_rb = 6; + LTE_DL_FRAME_PARMS *frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms); RA_t *ra_ptr = cc->ra; - /* + /* Louis-Adrien: Only set for FDD (for the moment) + * Hard coded for prach-ConfigIndex = 0 and prach-Freqoffset = 2 + * ToDo: The PRACH resources should be added with modularity (here?) + */ + /* + if (cc->tdd_Config == NULL) { // FDD + if (((sched_frame %2) == 0) && sched_subframe == 1) { // RACH frame and subframe + if (first_rb[CC_id] < 8) { + n_rb_ul_tab = to_prb(cc->ul_Bandwidth); // return total number of PRB + + if (n_rb_ul_tab >= 8) { + first_rb[CC_id] = 8; + } else { + return; + } + } + } + } + */ + if (is_prach_subframe(frame_parms, sched_frame, sched_subframe) == 1) { + start_rb = get_prach_prb_offset(frame_parms, + frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset, + 0, // tdd_mapindex + frameP); // Nf --> shouldn't it be sched_frame ??? + + first_rb[CC_id] = start_rb + nb_rb; + + // LAD + LOG_W(MAC, "[MAC] Config Index = %d ; Freq_offset = %d ; first_rb = %d ; subframe = %d ; sched_subframe = %d\n", + frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset, + first_rb[CC_id], + subframeP, + sched_subframe); + } + + /* * Check if RA (Msg3) is active in this subframeP, if so skip the PRB used for Msg3 * Msg3 is using 1 PRB so we need to increase first_rb accordingly * Not sure about the break (can there be more than 1 active RA procedure per CC_id and per subframe?) @@ -1291,24 +1333,6 @@ schedule_ulsch(module_id_t module_idP, // break; } } - - /* Louis-Adrien: Only set for FDD (for the moment) - * Hard coded for prach-ConfigIndex = 0 and prach-Freqoffset = 2 - * ToDo: The PRACH resources should be added with modularity (here?) - */ - if (cc[CC_id].tdd_Config == NULL) { // FDD - if (((sched_frame %2) == 0) && sched_subframe == 1) { // RACH frame and subframe - if (first_rb[CC_id] < 8) { - n_rb_ul_tab = to_prb(cc[CC_id].ul_Bandwidth); // return total number of PRB - - if (n_rb_ul_tab >= 8) { - first_rb[CC_id] = 8; - } else { - return; - } - } - } - } } /* Run each enabled slice-specific schedulers one by one */