Commit 99301f43 authored by Robert Schmidt's avatar Robert Schmidt

Call schedule_ue_spec() once for each CC

parent 81fb7628
...@@ -420,17 +420,8 @@ set_ul_DAI(int module_idP, ...@@ -420,17 +420,8 @@ set_ul_DAI(int module_idP,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, int *mbsfn_flag) { schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, int *mbsfn_flag) {
int i = 0; for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) {
slice_info_t *sli = &RC.mac[module_idP]->slice_info; schedule_ue_spec(module_idP, CC_id, frameP, subframeP, mbsfn_flag);
memset(sli->rballoc_sub, 0, sizeof(sli->rballoc_sub));
for (i = 0; i < sli->n_dl; i++) {
// Run each enabled slice-specific schedulers one by one
sli->dl[i].sched_cb(module_idP,
i,
frameP,
subframeP,
mbsfn_flag/*, dl_info*/);
} }
} }
...@@ -454,13 +445,12 @@ void getRepetition(UE_TEMPLATE *pue_template,unsigned int *maxRep, unsigned int ...@@ -454,13 +445,12 @@ void getRepetition(UE_TEMPLATE *pue_template,unsigned int *maxRep, unsigned int
*/ */
void void
schedule_ue_spec(module_id_t module_idP, schedule_ue_spec(module_id_t module_idP,
int slice_idxP, int CC_id,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int *mbsfn_flag) int *mbsfn_flag)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
int CC_id;
int UE_id; int UE_id;
int aggregation; int aggregation;
mac_rlc_status_resp_t rlc_status; mac_rlc_status_resp_t rlc_status;
...@@ -478,7 +468,6 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -478,7 +468,6 @@ schedule_ue_spec(module_id_t module_idP,
uint8_t ra_ii; uint8_t ra_ii;
eNB_UE_STATS *eNB_UE_stats = NULL; eNB_UE_STATS *eNB_UE_stats = NULL;
UE_TEMPLATE *ue_template = NULL; UE_TEMPLATE *ue_template = NULL;
eNB_STATS *eNB_stats = NULL;
RRC_release_ctrl_t *release_ctrl = NULL; RRC_release_ctrl_t *release_ctrl = NULL;
DLSCH_PDU *dlsch_pdu = NULL; DLSCH_PDU *dlsch_pdu = NULL;
RA_t *ra = NULL; RA_t *ra = NULL;
...@@ -491,11 +480,11 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -491,11 +480,11 @@ schedule_ue_spec(module_id_t module_idP,
int tpc = 1; int tpc = 1;
UE_sched_ctrl_t *ue_sched_ctrl; UE_sched_ctrl_t *ue_sched_ctrl;
int mcs; int mcs;
int i; const int min_rb_unit = get_min_rb_unit(module_idP, CC_id);
int min_rb_unit[NFAPI_CC_MAX]; const int dl_Bandwidth = cc[CC_id].mib->message.dl_Bandwidth;
int N_RB_DL[NFAPI_CC_MAX]; const int N_RB_DL = to_prb(dl_Bandwidth);
int total_nb_available_rb[NFAPI_CC_MAX]; const int N_RBG = to_rbg(dl_Bandwidth);
int N_RBG[NFAPI_CC_MAX]; int total_nb_available_rb = N_RB_DL;
nfapi_dl_config_request_body_t *dl_req; nfapi_dl_config_request_body_t *dl_req;
nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_dl_config_request_pdu_t *dl_config_pdu;
int tdd_sfa; int tdd_sfa;
...@@ -503,22 +492,19 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -503,22 +492,19 @@ schedule_ue_spec(module_id_t module_idP,
int header_length_last; int header_length_last;
int header_length_total; int header_length_total;
rrc_eNB_ue_context_t *ue_contextP = NULL; rrc_eNB_ue_context_t *ue_contextP = NULL;
int nb_mac_CC = RC.nb_mac_CC[module_idP];
long dl_Bandwidth;
if(is_pmch_subframe(frameP,subframeP,&RC.eNB[module_idP][0]->frame_parms)){ if(is_pmch_subframe(frameP,subframeP,&RC.eNB[module_idP][0]->frame_parms)){
//LOG_E(MAC,"Frame[%d] SF:%d This SF should not be allocated\n",frameP,subframeP); //LOG_E(MAC,"Frame[%d] SF:%d This SF should not be allocated\n",frameP,subframeP);
return ; return ;
} }
start_meas(&eNB->schedule_dlsch); start_meas(&eNB->schedule_dlsch);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,
VCD_FUNCTION_IN); VCD_FUNCTION_IN);
// for TDD: check that we have to act here, otherwise return // for TDD: check that we have to act here, otherwise return
if (cc[0].tdd_Config) { if (cc[CC_id].tdd_Config) {
tdd_sfa = cc[0].tdd_Config->subframeAssignment; tdd_sfa = cc[CC_id].tdd_Config->subframeAssignment;
switch (subframeP) { switch (subframeP) {
case 0: case 0:
...@@ -567,33 +553,25 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -567,33 +553,25 @@ schedule_ue_spec(module_id_t module_idP,
aggregation = 2; aggregation = 2;
for (CC_id = 0, eNB_stats = &eNB->eNB_stats[0]; CC_id < nb_mac_CC; CC_id++, eNB_stats++) { for (int i = 0; i < N_RB_DL; i++)
dl_Bandwidth = cc[CC_id].mib->message.dl_Bandwidth;
N_RB_DL[CC_id] = to_prb(dl_Bandwidth);
min_rb_unit[CC_id] = get_min_rb_unit(module_idP, CC_id);
// get number of PRBs less those used by common channels
total_nb_available_rb[CC_id] = N_RB_DL[CC_id];
for (i = 0; i < N_RB_DL[CC_id]; i++)
if (cc[CC_id].vrb_map[i] != 0) if (cc[CC_id].vrb_map[i] != 0)
total_nb_available_rb[CC_id]--; total_nb_available_rb--;
N_RBG[CC_id] = to_rbg(dl_Bandwidth);
// store the global enb stats: // store the global enb stats:
eNB_stats->num_dlactive_UEs = UE_list->num_UEs; eNB->eNB_stats[CC_id].num_dlactive_UEs = UE_list->num_UEs;
eNB_stats->available_prbs = total_nb_available_rb[CC_id]; eNB->eNB_stats[CC_id].available_prbs = total_nb_available_rb;
eNB_stats->total_available_prbs += total_nb_available_rb[CC_id]; eNB->eNB_stats[CC_id].total_available_prbs += total_nb_available_rb;
eNB_stats->dlsch_bytes_tx = 0; eNB->eNB_stats[CC_id].dlsch_bytes_tx = 0;
eNB_stats->dlsch_pdus_tx = 0; eNB->eNB_stats[CC_id].dlsch_pdus_tx = 0;
}
// CALLING Pre_Processor for downlink scheduling // CALLING Pre_Processor for downlink scheduling
// (Returns estimation of RBs required by each UE and the allocation on sub-band) // (Returns estimation of RBs required by each UE and the allocation on sub-band)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,
VCD_FUNCTION_IN); VCD_FUNCTION_IN);
start_meas(&eNB->schedule_dlsch_preprocessor); start_meas(&eNB->schedule_dlsch_preprocessor);
memset(eNB->slice_info.rballoc_sub, 0, sizeof(eNB->slice_info.rballoc_sub));
dlsch_scheduler_pre_processor(module_idP, dlsch_scheduler_pre_processor(module_idP,
slice_idxP, 0, //slice_idxP,
frameP, frameP,
subframeP, subframeP,
mbsfn_flag, mbsfn_flag,
...@@ -610,18 +588,17 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -610,18 +588,17 @@ schedule_ue_spec(module_id_t module_idP,
/* the interslice multiplexing re-sorts the UE_list for the slices it tries /* the interslice multiplexing re-sorts the UE_list for the slices it tries
* to multiplex, so we need to sort it for the current slice again */ * to multiplex, so we need to sort it for the current slice again */
sort_UEs(module_idP, sort_UEs(module_idP,
slice_idxP, 0,//slice_idxP,
frameP, frameP,
subframeP); subframeP);
} }
for (CC_id = 0; CC_id < nb_mac_CC; CC_id++) {
LOG_D(MAC, "doing schedule_ue_spec for CC_id %d\n", LOG_D(MAC, "doing schedule_ue_spec for CC_id %d\n",
CC_id); CC_id);
dl_req = &eNB->DL_req[CC_id].dl_config_request_body; dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
if (mbsfn_flag[CC_id] > 0) //if (mbsfn_flag[CC_id] > 0)
continue; // return;
for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
LOG_D(MAC, "doing schedule_ue_spec for CC_id %d UE %d\n", LOG_D(MAC, "doing schedule_ue_spec for CC_id %d UE %d\n",
...@@ -743,14 +720,14 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -743,14 +720,14 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[ue_sched_ctrl->dl_cqi[CC_id]]; eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[ue_sched_ctrl->dl_cqi[CC_id]];
} else { // this operation is also done in the preprocessor } else { // this operation is also done in the preprocessor
eNB_UE_stats->dlsch_mcs1 = cmin(eNB_UE_stats->dlsch_mcs1, eNB_UE_stats->dlsch_mcs1 = cmin(eNB_UE_stats->dlsch_mcs1,
eNB->slice_info.dl[slice_idxP].maxmcs); // cmin(eNB_UE_stats->dlsch_mcs1, openair_daq_vars.target_ue_dl_mcs); eNB->slice_info.dl[0/*slice_idxP*/].maxmcs); // cmin(eNB_UE_stats->dlsch_mcs1, openair_daq_vars.target_ue_dl_mcs);
} }
// Store stats // Store stats
// eNB_UE_stats->dl_cqi= eNB_UE_stats->dl_cqi; // eNB_UE_stats->dl_cqi= eNB_UE_stats->dl_cqi;
// Initializing the rb allocation indicator for each UE // Initializing the rb allocation indicator for each UE
for (j = 0; j < N_RBG[CC_id]; j++) { for (j = 0; j < N_RBG; j++) {
ue_template->rballoc_subband[harq_pid][j] = 0; ue_template->rballoc_subband[harq_pid][j] = 0;
} }
...@@ -804,22 +781,22 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -804,22 +781,22 @@ schedule_ue_spec(module_id_t module_idP,
} }
if (nb_rb == ue_sched_ctrl->pre_nb_available_rbs[CC_id]) { if (nb_rb == ue_sched_ctrl->pre_nb_available_rbs[CC_id]) {
for (j = 0; j < N_RBG[CC_id]; j++) { // for indicating the rballoc for each sub-band for (j = 0; j < N_RBG; j++) { // for indicating the rballoc for each sub-band
ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j]; ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j];
} }
} else { } else {
nb_rb_temp = nb_rb; nb_rb_temp = nb_rb;
j = 0; j = 0;
while ((nb_rb_temp > 0) && (j < N_RBG[CC_id])) { while ((nb_rb_temp > 0) && (j < N_RBG)) {
if (ue_sched_ctrl->rballoc_sub_UE[CC_id][j] == 1) { if (ue_sched_ctrl->rballoc_sub_UE[CC_id][j] == 1) {
if (ue_template->rballoc_subband[harq_pid][j]) if (ue_template->rballoc_subband[harq_pid][j])
LOG_W(MAC, "WARN: rballoc_subband not free for retrans?\n"); LOG_W(MAC, "WARN: rballoc_subband not free for retrans?\n");
ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j]; ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j];
nb_rb_temp -= min_rb_unit[CC_id]; nb_rb_temp -= min_rb_unit;
if ((j == N_RBG[CC_id] - 1) && (N_RB_DL[CC_id] == 25 || N_RB_DL[CC_id] == 50)) if ((j == N_RBG - 1) && (N_RB_DL == 25 || N_RB_DL == 50))
nb_rb_temp++; nb_rb_temp++;
} }
...@@ -985,7 +962,9 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -985,7 +962,9 @@ schedule_ue_spec(module_id_t module_idP,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
DCCH, DCCH,
TBS - ta_len - header_length_total - sdu_length_total - 3, 0, 0 TBS - ta_len - header_length_total - sdu_length_total - 3,
0,
0
); );
sdu_lengths[0] = 0; sdu_lengths[0] = 0;
...@@ -1004,7 +983,9 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1004,7 +983,9 @@ schedule_ue_spec(module_id_t module_idP,
MBMS_FLAG_NO, MBMS_FLAG_NO,
DCCH, DCCH,
TBS, //not used TBS, //not used
(char *)&dlsch_buffer[0], 0, 0 (char *)&dlsch_buffer[0],
0,
0
); );
if((rrc_release_info.num_UEs > 0) && (rlc_am_mui.rrc_mui_num > 0)) { if((rrc_release_info.num_UEs > 0) && (rlc_am_mui.rrc_mui_num > 0)) {
...@@ -1122,7 +1103,9 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1122,7 +1103,9 @@ schedule_ue_spec(module_id_t module_idP,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
DCCH + 1, DCCH + 1,
TBS - ta_len - header_length_total - sdu_length_total - 3, 0, 0 TBS - ta_len - header_length_total - sdu_length_total - 3,
0,
0
); );
// DCCH SDU // DCCH SDU
sdu_lengths[num_sdus] = 0; sdu_lengths[num_sdus] = 0;
...@@ -1138,7 +1121,9 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1138,7 +1121,9 @@ schedule_ue_spec(module_id_t module_idP,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, DCCH + 1, MBMS_FLAG_NO, DCCH + 1,
TBS, //not used TBS, //not used
(char *) &dlsch_buffer[sdu_length_total], 0, 0 (char *) &dlsch_buffer[sdu_length_total],
0,
0
); );
T(T_ENB_MAC_UE_DL_SDU, T(T_ENB_MAC_UE_DL_SDU,
T_INT(module_idP), T_INT(module_idP),
...@@ -1211,7 +1196,9 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1211,7 +1196,9 @@ schedule_ue_spec(module_id_t module_idP,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
TBS, //not used TBS, //not used
(char *) &dlsch_buffer[sdu_length_total], 0, 0 (char *) &dlsch_buffer[sdu_length_total],
0,
0
); );
T(T_ENB_MAC_UE_DL_SDU, T(T_ENB_MAC_UE_DL_SDU,
T_INT(module_idP), T_INT(module_idP),
...@@ -1269,13 +1256,13 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1269,13 +1256,13 @@ schedule_ue_spec(module_id_t module_idP,
if (mcs == 0) { if (mcs == 0) {
nb_rb = 4; // don't let the TBS get too small nb_rb = 4; // don't let the TBS get too small
} else { } else {
nb_rb = min_rb_unit[CC_id]; nb_rb = min_rb_unit;
} }
TBS = get_TBS_DL(mcs, nb_rb); TBS = get_TBS_DL(mcs, nb_rb);
while (TBS < sdu_length_total + header_length_total + ta_len) { while (TBS < sdu_length_total + header_length_total + ta_len) {
nb_rb += min_rb_unit[CC_id]; // nb_rb += min_rb_unit; //
if (nb_rb > nb_available_rb) { // if we've gone beyond the maximum number of RBs if (nb_rb > nb_available_rb) { // if we've gone beyond the maximum number of RBs
// (can happen if N_RB_DL is odd) // (can happen if N_RB_DL is odd)
...@@ -1290,21 +1277,21 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1290,21 +1277,21 @@ schedule_ue_spec(module_id_t module_idP,
} }
if (nb_rb == ue_sched_ctrl->pre_nb_available_rbs[CC_id]) { if (nb_rb == ue_sched_ctrl->pre_nb_available_rbs[CC_id]) {
for (j = 0; j < N_RBG[CC_id]; ++j) { // for indicating the rballoc for each sub-band for (j = 0; j < N_RBG; ++j) { // for indicating the rballoc for each sub-band
ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j]; ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j];
} }
} else { } else {
nb_rb_temp = nb_rb; nb_rb_temp = nb_rb;
j = 0; j = 0;
while ((nb_rb_temp > 0) && (j < N_RBG[CC_id])) { while ((nb_rb_temp > 0) && (j < N_RBG)) {
if (ue_sched_ctrl->rballoc_sub_UE[CC_id][j] == 1) { if (ue_sched_ctrl->rballoc_sub_UE[CC_id][j] == 1) {
ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j]; ue_template->rballoc_subband[harq_pid][j] = ue_sched_ctrl->rballoc_sub_UE[CC_id][j];
if ((j == N_RBG[CC_id] - 1) && ((N_RB_DL[CC_id] == 25) || (N_RB_DL[CC_id] == 50))) { if ((j == N_RBG - 1) && ((N_RB_DL == 25) || (N_RB_DL == 50))) {
nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id] + 1; nb_rb_temp = nb_rb_temp - min_rb_unit + 1;
} else { } else {
nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id]; nb_rb_temp = nb_rb_temp - min_rb_unit;
} }
} }
...@@ -1384,7 +1371,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1384,7 +1371,7 @@ schedule_ue_spec(module_id_t module_idP,
#ifdef DEBUG_eNB_SCHEDULER #ifdef DEBUG_eNB_SCHEDULER
LOG_T(MAC, "[eNB %d] First 16 bytes of DLSCH : \n"); LOG_T(MAC, "[eNB %d] First 16 bytes of DLSCH : \n");
for (i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
LOG_T(MAC, "%x.", LOG_T(MAC, "%x.",
dlsch_buffer[i]); dlsch_buffer[i]);
} }
...@@ -1637,7 +1624,6 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1637,7 +1624,6 @@ schedule_ue_spec(module_id_t module_idP,
subframeP); subframeP);
} }
} // UE_id loop } // UE_id loop
} // CC_id loop
fill_DLSCH_dci(module_idP, fill_DLSCH_dci(module_idP,
frameP, frameP,
......
...@@ -156,8 +156,11 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,i ...@@ -156,8 +156,11 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,i
void schedule_dlsch(module_id_t module_idP, frame_t frameP, void schedule_dlsch(module_id_t module_idP, frame_t frameP,
sub_frame_t subframe, int *mbsfn_flag); sub_frame_t subframe, int *mbsfn_flag);
void schedule_ue_spec(module_id_t module_idP, int slice_idxP, void schedule_ue_spec(module_id_t module_idP,
frame_t frameP,sub_frame_t subframe, int *mbsfn_flag); int CC_id,
frame_t frameP,
sub_frame_t subframe,
int *mbsfn_flag);
void schedule_ue_spec_br(module_id_t module_idP, void schedule_ue_spec_br(module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP); sub_frame_t subframeP);
......
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