|
|
@ -439,7 +439,7 @@ int get_required_prb_dl(const sched_ue_cell& cell,
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t get_required_prb_ul(const sched_ue_cell& cell, uint32_t req_bytes)
|
|
|
|
uint32_t get_required_prb_ul(const sched_ue_cell& cell, uint32_t req_bytes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const static int MIN_ALLOC_BYTES = 10;
|
|
|
|
const static int MIN_ALLOC_BYTES = 10; /// There should be enough space for RLC header + BSR + some payload
|
|
|
|
if (req_bytes == 0) {
|
|
|
|
if (req_bytes == 0) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -458,9 +458,7 @@ uint32_t get_required_prb_ul(const sched_ue_cell& cell, uint32_t req_bytes)
|
|
|
|
uint32_t final_tbs = std::get<3>(ret);
|
|
|
|
uint32_t final_tbs = std::get<3>(ret);
|
|
|
|
while (final_tbs < MIN_ALLOC_BYTES and req_prbs < cell.cell_cfg->nof_prb()) {
|
|
|
|
while (final_tbs < MIN_ALLOC_BYTES and req_prbs < cell.cell_cfg->nof_prb()) {
|
|
|
|
// Note: If PHR<0 is limiting the max nof PRBs per UL grant, the UL grant may become too small to fit any
|
|
|
|
// Note: If PHR<0 is limiting the max nof PRBs per UL grant, the UL grant may become too small to fit any
|
|
|
|
// data other than headers + BSR. Besides, forcing unnecessary segmentation, it may additionally
|
|
|
|
// data other than headers + BSR. In this edge-case, force an increase the nof required PRBs.
|
|
|
|
// forbid the UE from fitting small RRC messages (e.g. RRCReconfComplete) in the UL grants.
|
|
|
|
|
|
|
|
// To avoid TBS<10, we force an increase the nof required PRBs.
|
|
|
|
|
|
|
|
req_prbs++;
|
|
|
|
req_prbs++;
|
|
|
|
final_tbs = compute_tbs_approx(req_prbs);
|
|
|
|
final_tbs = compute_tbs_approx(req_prbs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|