mux_nr: fix tiny issue in mux unit when adding SDUs of different logical channels

this issue has a tiny affect when adding new SDUs from different logical channels
to an UL MAC PDU.

Since the MAC subPDU header is accounted for twice, less SDU payload may be packed.

The patch calculates the required header space and accounts for it in the scheduling.
Howerver, it is only substracted from the available space when an SDU was actually added.
master
Andre Puschmann 3 years ago
parent 51806982f7
commit d4a4da7ecc

@ -94,10 +94,10 @@ srsran::unique_byte_buffer_t mux_nr::get_pdu(uint32_t max_pdu_len)
uint8_t* rd = rlc_buff->msg;
// Determine space for RLC
remaining_len -= remaining_len >= srsran::mac_sch_subpdu_nr::MAC_SUBHEADER_LEN_THRESHOLD ? 3 : 2;
int32_t subpdu_header_len = (remaining_len >= srsran::mac_sch_subpdu_nr::MAC_SUBHEADER_LEN_THRESHOLD ? 3 : 2);
// Read PDU from RLC
int pdu_len = rlc->read_pdu(lc.lcid, rd, remaining_len);
// Read PDU from RLC (account for subPDU header)
int pdu_len = rlc->read_pdu(lc.lcid, rd, remaining_len - subpdu_header_len);
if (pdu_len > remaining_len) {
logger.error("Can't add SDU of %d B. Available space %d B", pdu_len, remaining_len);
@ -114,10 +114,11 @@ srsran::unique_byte_buffer_t mux_nr::get_pdu(uint32_t max_pdu_len)
break;
}
} else {
// couldn't read PDU from RLC
break;
}
remaining_len -= pdu_len;
remaining_len -= (pdu_len + subpdu_header_len);
logger.debug("%d B remaining PDU", remaining_len);
}
}

Loading…
Cancel
Save