Starting to notify RLC upon PDCP discard (NR)

This commit is contained in:
Pedro Alvarez 2019-11-25 12:04:31 +00:00 committed by Andre Puschmann
parent 9870c73366
commit 7ccc7d1d20
2 changed files with 35 additions and 4 deletions

View File

@ -96,10 +96,12 @@ private:
void pass_to_upper_layers(unique_byte_buffer_t pdu);
// Reodering callback (t-Reordering)
class reordering_callback;
std::unique_ptr<reordering_callback> reordering_fnc;
// Discard callback (discardTimer)
class discard_callback;
// COUNT overflow protection
bool tx_overflow = false;
bool rx_overflow = false;
@ -119,6 +121,22 @@ private:
pdcp_entity_nr* parent;
};
// Discard callback (discardTimer)
class pdcp_entity_nr::discard_callback
{
public:
discard_callback(pdcp_entity_nr* parent_, uint32_t sn_)
{
parent = parent_;
discard_sn = sn_;
};
void operator()(uint32_t timer_id);
private:
pdcp_entity_nr* parent;
uint32_t sn;
};
/*
* Helpers
*/

View File

@ -307,9 +307,6 @@ void pdcp_entity_nr::append_mac(const unique_byte_buffer_t& sdu, uint8_t* mac)
sdu->N_bytes += 4;
}
/*
* Reordering Helpers
*/
// Deliver all consecutivly associated COUNTs.
// Update RX_NEXT after submitting to higher layers
void pdcp_entity_nr::deliver_all_consecutive_counts()
@ -336,6 +333,9 @@ void pdcp_entity_nr::deliver_all_consecutive_counts()
}
}
/*
* Reordering Timer Callback
*/
void pdcp_entity_nr::reordering_callback::operator()(uint32_t timer_id)
{
parent->log->debug("Reordering timer expired\n");
@ -357,4 +357,17 @@ void pdcp_entity_nr::reordering_callback::operator()(uint32_t timer_id)
}
return;
}
/*
* Discard Timer Callback
*/
void pdcp_entity_nr::discard_callback::operator()(uint32_t timer_id)
{
parent->log->debug("Discard timer expired for PDU with SN = %d\n", discard_sn);
// Notify the RLC of the discard. It's the RLC to actually discard, if no segment was transmitted yet.
parent->rlc->discard_sdu(discard_sn);
return;
}
} // namespace srslte