Commit 37059770 authored by Cedric Roux's avatar Cedric Roux

bugfix: fix allocation of RBGs for retransmission

When there is a retransmission, we want to use the same number of RBs.

The RBs are allocated by groups (RBGs).

In some cases (like a cell with 25 PRBs), the last RBG contains less RBs.
So in case of a retransmission, if this last RBG was used before we need
to reuse it to have the same number of RBs. If not, we will use more RBs
for the retransmission than the previous transmission.

In an experiment with two UEs (quectel modules) it was seen that when a
retransmission happens with a different number of RBs then the UE is not
happy at all, leading to way more NACKs in the harq processes than should
happen (actually the first NACK was not a NACK at all, but the eNB did
interpret it as a NACK; so the next transmission should simply be discarded
by the UE that successfully received the first transmission; instead the UE
fails to decode the data and sends a NACK, a real one this time).

Maybe it's not the correct solution, but it improve things, there are
much less NACKs.
parent baacb350
......@@ -113,10 +113,29 @@ bool try_allocate_harq_retransmission(module_id_t Mod_id,
LOG_D(MAC, "cannot allocate UE %d: no CCE can be allocated\n", UE_id);
return false;
}
/* if nb_rb is not multiple of RBGsize, then last RBG must be free
* (it will be allocated just below)
*/
if (nb_rb % RBGsize && !rbgalloc_mask[N_RBG-1]) {
LOG_E(MAC, "retransmission: last RBG already allocated (this should not happen)\n");
return false;
}
ue_ctrl->pre_dci_dl_pdu_idx = idx;
// retransmissions: directly allocate
*n_rbg_sched -= nb_rbg;
ue_ctrl->pre_nb_available_rbs[CC_id] += nb_rb;
if (nb_rb % RBGsize) {
/* special case: if nb_rb is not multiple of RBGsize, then allocate last RBG.
* If we instead allocated another RBG then we will retransmit with more
* RBs and the UE will not accept it.
* (This has been seen in a test with cots UEs, if not true, then change
* code as needed.)
* At this point rbgalloc_mask[N_RBG-1] == 1 due to the test above.
*/
ue_ctrl->rballoc_sub_UE[CC_id][N_RBG-1] = 1;
rbgalloc_mask[N_RBG-1] = 0;
nb_rbg--;
}
for (; nb_rbg > 0; start_rbg++) {
if (!rbgalloc_mask[start_rbg])
continue;
......
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