Commit b0370f05 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/fixes-mac-scheduler-2019-w13' into...

Merge remote-tracking branch 'origin/fixes-mac-scheduler-2019-w13' into develop_integration_2019_w15

 Conflicts:
	openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
parents 2984fb76 1ca6ad3f
...@@ -676,6 +676,9 @@ typedef struct { ...@@ -676,6 +676,9 @@ typedef struct {
/// Number of Allocated RBs for UL after scheduling /// Number of Allocated RBs for UL after scheduling
uint16_t first_rb_ul[8]; // num_max_harq uint16_t first_rb_ul[8]; // num_max_harq
/// Is CQI requested for UL after scheduling 1st transmission
uint8_t cqi_req[8]; // num_max_harq
/// Cyclic shift for DMRS after scheduling /// Cyclic shift for DMRS after scheduling
uint16_t cshift[8]; // num_max_harq uint16_t cshift[8]; // num_max_harq
......
...@@ -2994,10 +2994,10 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, ...@@ -2994,10 +2994,10 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
last_ulsch_ue_id[CC_id] = ulsch_ue_select[CC_id].list[ulsch_ue_num].UE_id; last_ulsch_ue_id[CC_id] = ulsch_ue_select[CC_id].list[ulsch_ue_num].UE_id;
} }
} else if (ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_RETRANS) { // round > 0 => retransmission } else if (ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_RETRANS) { // round > 0 => retransmission
round = UE_sched_ctrl->round_UL[CC_id][harq_pid];
T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP),
T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb), T_INT(ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb),
T_INT(round)); T_INT(round));
round = UE_sched_ctrl->round_UL[CC_id][harq_pid];
UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power;
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power;
uint8_t mcs_rv = 0; uint8_t mcs_rv = 0;
......
This diff is collapsed.
...@@ -815,6 +815,9 @@ typedef struct { ...@@ -815,6 +815,9 @@ typedef struct {
/// Number of Allocated RBs for UL after scheduling /// Number of Allocated RBs for UL after scheduling
uint16_t first_rb_ul[8]; // num_max_harq uint16_t first_rb_ul[8]; // num_max_harq
/// Is CQI requested for UL after scheduling 1st transmission
uint8_t cqi_req[8]; // num_max_harq
/// Cyclic shift for DMRS after scheduling /// Cyclic shift for DMRS after scheduling
uint16_t cshift[8]; // num_max_harq uint16_t cshift[8]; // num_max_harq
......
...@@ -711,8 +711,6 @@ int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); ...@@ -711,8 +711,6 @@ int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);
void store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP); void store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP);
void assign_rbs_required(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], int min_rb_unit[NFAPI_CC_MAX]); void assign_rbs_required(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], int min_rb_unit[NFAPI_CC_MAX]);
int maxround(module_id_t Mod_id, uint16_t rnti, int frame,
sub_frame_t subframe, uint8_t ul_flag);
void swap_UEs(UE_list_t * listP, int nodeiP, int nodejP, int ul_flag); void swap_UEs(UE_list_t * listP, int nodeiP, int nodejP, int ul_flag);
int prev(UE_list_t * listP, int nodeP, int ul_flag); int prev(UE_list_t * listP, int nodeP, int ul_flag);
void dump_ue_list(UE_list_t * listP, int ul_flag); void dump_ue_list(UE_list_t * listP, int ul_flag);
...@@ -730,11 +728,11 @@ void set_ul_DAI(int module_idP, ...@@ -730,11 +728,11 @@ void set_ul_DAI(int module_idP,
void ulsch_scheduler_pre_processor(module_id_t module_idP, int slice_idx, int frameP, void ulsch_scheduler_pre_processor(module_id_t module_idP, int slice_idx, int frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int sched_frameP,
unsigned char sched_subframeP, unsigned char sched_subframeP,
uint16_t * first_rb); uint16_t * first_rb);
void store_ulsch_buffer(module_id_t module_idP, int frameP, void store_ulsch_buffer(module_id_t module_idP, int frameP,
sub_frame_t subframeP); sub_frame_t subframeP);
void sort_ue_ul(module_id_t module_idP, int slice_idx, int frameP, sub_frame_t subframeP, rnti_t *rntiTable);
void assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, void assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP,
sub_frame_t subframeP, uint16_t * first_rb); sub_frame_t subframeP, uint16_t * first_rb);
void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, void adjust_bsr_info(int buffer_occupancy, uint16_t TBS,
......
...@@ -56,6 +56,13 @@ extern RAN_CONTEXT_t RC; ...@@ -56,6 +56,13 @@ extern RAN_CONTEXT_t RC;
//#define ICIC 0 //#define ICIC 0
void
sort_ue_ul(module_id_t module_idP,
int slice_idx,
int sched_frameP,
sub_frame_t sched_subframeP,
rnti_t *rntiTable);
/* this function checks that get_eNB_UE_stats returns /* this function checks that get_eNB_UE_stats returns
* a non-NULL pointer for all the active CCs of an UE * a non-NULL pointer for all the active CCs of an UE
*/ */
...@@ -264,7 +271,7 @@ assign_rbs_required(module_id_t Mod_id, ...@@ -264,7 +271,7 @@ assign_rbs_required(module_id_t Mod_id,
// This function scans all CC_ids for a particular UE to find the maximum round index of its HARQ processes // This function scans all CC_ids for a particular UE to find the maximum round index of its HARQ processes
int int
maxround(module_id_t Mod_id, uint16_t rnti, int frame, maxround(module_id_t Mod_id, uint16_t rnti, int frame,
sub_frame_t subframe, uint8_t ul_flag) { sub_frame_t subframe) {
uint8_t round, round_max = 0, UE_id; uint8_t round, round_max = 0, UE_id;
int CC_id, harq_pid; int CC_id, harq_pid;
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
...@@ -284,6 +291,28 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame, ...@@ -284,6 +291,28 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame,
return round_max; return round_max;
} }
int
maxround_ul(module_id_t Mod_id, uint16_t rnti, int sched_frame,
sub_frame_t sched_subframe) {
uint8_t round, round_max = 0, UE_id;
int CC_id, harq_pid;
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
COMMON_channels_t *cc;
for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) {
cc = &RC.mac[Mod_id]->common_channels[CC_id];
UE_id = find_UE_id(Mod_id, rnti);
harq_pid = subframe2harqpid(cc, sched_frame, sched_subframe);
round = UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid];
if (round > round_max) {
round_max = round;
}
}
return round_max;
}
// This function scans all CC_ids for a particular UE to find the maximum DL CQI // This function scans all CC_ids for a particular UE to find the maximum DL CQI
// it returns -1 if the UE is not found in PHY layer (get_eNB_UE_stats gives NULL) // it returns -1 if the UE is not found in PHY layer (get_eNB_UE_stats gives NULL)
int maxcqi(module_id_t Mod_id, int32_t UE_id) { int maxcqi(module_id_t Mod_id, int32_t UE_id) {
...@@ -332,10 +361,10 @@ static int ue_dl_compare(const void *_a, const void *_b, void *_params) { ...@@ -332,10 +361,10 @@ static int ue_dl_compare(const void *_a, const void *_b, void *_params) {
int UE_id2 = *(const int *) _b; int UE_id2 = *(const int *) _b;
int rnti1 = UE_RNTI(params->Mod_idP, UE_id1); int rnti1 = UE_RNTI(params->Mod_idP, UE_id1);
int pCC_id1 = UE_PCCID(params->Mod_idP, UE_id1); int pCC_id1 = UE_PCCID(params->Mod_idP, UE_id1);
int round1 = maxround(params->Mod_idP, rnti1, params->frameP, params->subframeP, 1); int round1 = maxround(params->Mod_idP, rnti1, params->frameP, params->subframeP);
int rnti2 = UE_RNTI(params->Mod_idP, UE_id2); int rnti2 = UE_RNTI(params->Mod_idP, UE_id2);
int pCC_id2 = UE_PCCID(params->Mod_idP, UE_id2); int pCC_id2 = UE_PCCID(params->Mod_idP, UE_id2);
int round2 = maxround(params->Mod_idP, rnti2, params->frameP, params->subframeP, 1); int round2 = maxround(params->Mod_idP, rnti2, params->frameP, params->subframeP);
int cqi1 = maxcqi(params->Mod_idP, UE_id1); int cqi1 = maxcqi(params->Mod_idP, UE_id1);
int cqi2 = maxcqi(params->Mod_idP, UE_id2); int cqi2 = maxcqi(params->Mod_idP, UE_id2);
long lcgid1 = min_lcgidpriority(params->Mod_idP, UE_id1); long lcgid1 = min_lcgidpriority(params->Mod_idP, UE_id1);
...@@ -1626,6 +1655,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1626,6 +1655,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
int slice_idx, int slice_idx,
int frameP, int frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int sched_frameP,
unsigned char sched_subframeP, unsigned char sched_subframeP,
uint16_t *first_rb) { uint16_t *first_rb) {
int UE_id; int UE_id;
...@@ -1646,7 +1676,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1646,7 +1676,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
// sort ues // sort ues
LOG_D(MAC, "In ulsch_preprocessor: sort ue \n"); LOG_D(MAC, "In ulsch_preprocessor: sort ue \n");
sort_ue_ul(module_idP, slice_idx, frameP, subframeP, rntiTable); sort_ue_ul(module_idP, slice_idx, sched_frameP, sched_subframeP, rntiTable);
// maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB
LOG_D(MAC, "In ulsch_preprocessor: assign max mcs min rb\n"); LOG_D(MAC, "In ulsch_preprocessor: assign max mcs min rb\n");
assign_max_mcs_min_rb(module_idP, slice_idx, frameP, subframeP, first_rb); assign_max_mcs_min_rb(module_idP, slice_idx, frameP, subframeP, first_rb);
...@@ -1741,11 +1771,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1741,11 +1771,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
CC_id = UE_list->ordered_ULCCids[n][UE_id]; CC_id = UE_list->ordered_ULCCids[n][UE_id];
UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id];
harq_pid = subframe2harqpid(&RC.mac[module_idP]->common_channels[CC_id], harq_pid = subframe2harqpid(&RC.mac[module_idP]->common_channels[CC_id],
frameP, sched_subframeP); sched_frameP, sched_subframeP);
// mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL); // mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL);
if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id] > 0) { if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid] > 0) {
nb_allocated_rbs[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb_ul[harq_pid]; nb_allocated_rbs[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb_ul[harq_pid];
} else { } else {
nb_allocated_rbs[CC_id][UE_id] = nb_allocated_rbs[CC_id][UE_id] =
...@@ -1924,8 +1954,8 @@ assign_max_mcs_min_rb(module_id_t module_idP, ...@@ -1924,8 +1954,8 @@ assign_max_mcs_min_rb(module_id_t module_idP,
struct sort_ue_ul_params { struct sort_ue_ul_params {
int module_idP; int module_idP;
int frameP; int sched_frameP;
int subframeP; int sched_subframeP;
}; };
static int ue_ul_compare(const void *_a, const void *_b, void *_params) { static int ue_ul_compare(const void *_a, const void *_b, void *_params) {
...@@ -1935,12 +1965,12 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) { ...@@ -1935,12 +1965,12 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) {
int UE_id2 = *(const int *) _b; int UE_id2 = *(const int *) _b;
int rnti1 = UE_RNTI(params->module_idP, UE_id1); int rnti1 = UE_RNTI(params->module_idP, UE_id1);
int pCCid1 = UE_PCCID(params->module_idP, UE_id1); int pCCid1 = UE_PCCID(params->module_idP, UE_id1);
int round1 = maxround(params->module_idP, rnti1, params->frameP, int round1 = maxround_ul(params->module_idP, rnti1, params->sched_frameP,
params->subframeP, 1); params->sched_subframeP);
int rnti2 = UE_RNTI(params->module_idP, UE_id2); int rnti2 = UE_RNTI(params->module_idP, UE_id2);
int pCCid2 = UE_PCCID(params->module_idP, UE_id2); int pCCid2 = UE_PCCID(params->module_idP, UE_id2);
int round2 = maxround(params->module_idP, rnti2, params->frameP, int round2 = maxround_ul(params->module_idP, rnti2, params->sched_frameP,
params->subframeP, 1); params->sched_subframeP);
if (round1 > round2) if (round1 > round2)
return -1; return -1;
...@@ -1984,14 +2014,14 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) { ...@@ -1984,14 +2014,14 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) {
void void
sort_ue_ul(module_id_t module_idP, sort_ue_ul(module_id_t module_idP,
int slice_idx, int slice_idx,
int frameP, int sched_frameP,
sub_frame_t subframeP, sub_frame_t sched_subframeP,
rnti_t *rntiTable) rnti_t *rntiTable)
{ {
int i; int i;
int list[MAX_MOBILES_PER_ENB]; int list[MAX_MOBILES_PER_ENB];
int list_size = 0; int list_size = 0;
struct sort_ue_ul_params params = { module_idP, frameP, subframeP }; struct sort_ue_ul_params params = { module_idP, sched_frameP, sched_subframeP };
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
......
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