Commit c61df12f authored by Cedric Roux's avatar Cedric Roux

bugfix: fix find_uci problem

In some situations (a lot of UEs with a lot of traffic), we see
the following crash of the eNB:

Assertion ((UE_id = find_uci(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti, proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0) failed!
In handle_nfapi_ul_pdu() /home/oai-gnb/test1/openairinterface5g/openair1/SCHED/fapi_l1.c:722
No available UE UCI for rnti 5e05

The array uci_vars is too small. If too much UEs have to use PUCCH
at the same time over a few TTIs, we will exhaust the array.

The solution proposed by this commit is to increase the size of this
array. We now make it a matrix and the first dimension is the subframe.

That seems to solve the problem.

A better solution may be found at some point.
parent 5ddad9bd
......@@ -1107,7 +1107,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
eNB->pucch1_stats_thres[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres;
eNB->pucch1_stats_cnt[UE_id][subframe] = (eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023;
T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(frame), T_INT(subframe),
T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[subframe][UE_id].rnti), T_INT(frame), T_INT(subframe),
T_INT(stat_max), T_INT(sigma2_dB+pucch1_thres));
/*
......@@ -1370,7 +1370,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
/* frame not available here - set to -1 for the moment */
T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im));
T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[subframe][UE_id].rnti), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im));
*payload = (stat_re<0) ? 1 : 2; // 1 == ACK, 2 == NAK
......
......@@ -42,11 +42,11 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
int16_t first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n");
for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) {
if ((eNB->uci_vars[i].active >0) &&
(eNB->uci_vars[i].rnti==rnti) &&
(eNB->uci_vars[i].frame==frame) &&
(eNB->uci_vars[i].subframe==subframe)) return(i);
else if ((eNB->uci_vars[i].active == 0) && (first_free_index==-1)) first_free_index=i;
if ((eNB->uci_vars[subframe][i].active >0) &&
(eNB->uci_vars[subframe][i].rnti==rnti) &&
(eNB->uci_vars[subframe][i].frame==frame) &&
(eNB->uci_vars[subframe][i].subframe==subframe)) return(i);
else if ((eNB->uci_vars[subframe][i].active == 0) && (first_free_index==-1)) first_free_index=i;
}
if (type == SEARCH_EXIST) return(-1);
else return(first_free_index);
......
......@@ -1051,7 +1051,7 @@ typedef struct PHY_VARS_eNB_s {
LTE_eNB_PRACH prach_vars_br;
#endif
LTE_eNB_COMMON common_vars;
LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_VARS_MAX];
LTE_eNB_UCI uci_vars[10][NUMBER_OF_UCI_VARS_MAX]; /* first index: subframe */
LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
LTE_eNB_PBCH pbch;
LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
......
......@@ -571,7 +571,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,
uint8_t subframe,
uint8_t srs_active)
{
LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id];
LTE_eNB_UCI *uci = &eNB->uci_vars[subframe][UE_id];
if (NFAPI_MODE==NFAPI_MODE_VNF) return;
......@@ -599,7 +599,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,
}
void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) {
LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id];
LTE_eNB_UCI *uci = &eNB->uci_vars[subframe][UE_id];
if (NFAPI_MODE==NFAPI_MODE_VNF) return;
......@@ -622,7 +622,7 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
}
void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) {
LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id];
LTE_eNB_UCI *uci = &eNB->uci_vars[subframe][UE_id];
if (NFAPI_MODE==NFAPI_MODE_VNF) return;
......
......@@ -635,7 +635,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *fp = &(eNB->frame_parms);
for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++) {
uci = &(eNB->uci_vars[i]);
uci = &(eNB->uci_vars[subframe][i]);
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
LOG_D(PHY,"Frame %d, subframe %d: Running uci procedures (type %d) for %d \n",
......@@ -2034,12 +2034,13 @@ void release_rnti_of_phy(module_id_t mod_id){
LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
clean_eNb_ulsch(ulsch);
}
for(j=0; j<NUMBER_OF_UCI_VARS_MAX; j++) {
if(eNB_PHY->uci_vars[j].rnti == rnti){
LOG_I(PHY, "clean eNb uci_vars[%d] UE %x \n",j, rnti);
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
for (int sf = 0; sf < 10; sf++) {
for(j=0; j<NUMBER_OF_UCI_VARS_MAX; j++) {
if(eNB_PHY->uci_vars[sf][j].rnti == rnti){
LOG_I(PHY, "clean eNb uci_vars[%d][%d] UE %x \n", sf, j, rnti);
memset(&eNB_PHY->uci_vars[sf][i],0,sizeof(LTE_eNB_UCI));
}
}
}
}
}
......
......@@ -1180,10 +1180,12 @@ void release_UE_in_freeList(module_id_t mod_id) {
clean_eNb_ulsch(ulsch);
}
for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) {
if(eNB_PHY->uci_vars[i].rnti == rnti) {
LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n",i, rnti);
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
for (int sf = 0; sf < 10; sf++) {
for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) {
if(eNB_PHY->uci_vars[sf][i].rnti == rnti) {
LOG_I(MAC, "clean eNb uci_vars[%d][%d] UE %x \n", sf, i, rnti);
memset(&eNB_PHY->uci_vars[sf][i],0,sizeof(LTE_eNB_UCI));
}
}
}
......
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