lib,rlc_am_nr: fix processing of ACKs

This commit is contained in:
Pedro Alvarez 2021-11-19 17:09:26 +00:00
parent b794593469
commit 5eaa56e6ba
1 changed files with 15 additions and 11 deletions

View File

@ -239,19 +239,23 @@ void rlc_am_nr_tx::handle_control_pdu(uint8_t* payload, uint32_t nof_bytes)
*/ */
// Process ACKs // Process ACKs
uint32_t stop_sn = status.N_nack == 0 uint32_t stop_sn = status.N_nack == 0
? st.tx_next ? status.ack_sn
: status.nacks[0].nack_sn; // Stop processing ACKs at the first NACK, if it exists. : status.nacks[0].nack_sn - 1; // Stop processing ACKs at the first NACK, if it exists.
if (status.ack_sn >= st.tx_next_ack) { if (stop_sn > st.tx_next) {
for (uint32_t sn = st.tx_next_ack; sn < stop_sn; sn++) { logger->error("Rx'ed ACK or NACK larger than TX_NEXT. Ignoring status report");
if (tx_window.has_sn(sn)) { return;
tx_window.remove_pdu(sn); }
st.tx_next_ack = sn + 1; for (uint32_t sn = st.tx_next_ack; sn < stop_sn; sn++) {
} else { if (tx_window.has_sn(sn)) {
logger->error("Missing ACKed SN from TX window"); tx_window.remove_pdu(sn);
break; st.tx_next_ack = sn + 1;
} // TODO notify PDCP
} else {
logger->error("Missing ACKed SN from TX window");
break;
} }
} }
// Process N_acks // Process N_acks
for (uint32_t nack_idx = 0; nack_idx < status.N_nack; nack_idx++) { for (uint32_t nack_idx = 0; nack_idx < status.N_nack; nack_idx++) {
if (st.tx_next_ack <= status.nacks[nack_idx].nack_sn && status.nacks[nack_idx].nack_sn <= st.tx_next) { if (st.tx_next_ack <= status.nacks[nack_idx].nack_sn && status.nacks[nack_idx].nack_sn <= st.tx_next) {