rlc: call PDCP notify without holding Tx lock

move notify_info_vec as stack variable and unlock mutex
before calling PDCP notify
This commit is contained in:
Andre Puschmann 2021-02-20 22:22:16 +01:00
parent 6404722b4b
commit 40d7934267
2 changed files with 10 additions and 7 deletions

View File

@ -134,7 +134,7 @@ private:
int build_retx_pdu(uint8_t* payload, uint32_t nof_bytes);
int build_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_retx_t retx);
int build_data_pdu(uint8_t* payload, uint32_t nof_bytes);
void update_notification_ack_info(const rlc_amd_tx_pdu_t& tx_pdu);
void update_notification_ack_info(const rlc_amd_tx_pdu_t& tx_pdu, std::vector<uint32_t>& notify_info_vec);
void debug_state();
@ -191,7 +191,6 @@ private:
// SDU info for PDCP notifications
std::unordered_map<uint32_t, pdcp_sdu_info_t> undelivered_sdu_info_queue;
std::unordered_map<uint32_t, std::vector<uint32_t> > rlc_sn_to_pdcp_sn_map;
std::vector<uint32_t> notify_info_vec;
// Callback function for buffer status report
bsr_callback_t bsr_callback;

View File

@ -1020,7 +1020,7 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
std::map<uint32_t, rlc_amd_tx_pdu_t>::iterator it;
bool update_vt_a = true;
uint32_t i = vt_a;
notify_info_vec.clear();
std::vector<uint32_t> notify_info_vec;
while (TX_MOD_BASE(i) < TX_MOD_BASE(status.ack_sn) && TX_MOD_BASE(i) < TX_MOD_BASE(vt_s)) {
bool nack = false;
@ -1078,7 +1078,7 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
if (tx_window.count(i) > 0) {
it = tx_window.find(i);
if (it != tx_window.end()) {
update_notification_ack_info(it->second);
update_notification_ack_info(it->second, notify_info_vec);
if (update_vt_a) {
tx_window.erase(it);
vt_a = (vt_a + 1) % MOD;
@ -1091,8 +1091,6 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
}
if (not notify_info_vec.empty()) {
parent->pdcp->notify_delivery(parent->lcid, notify_info_vec);
// Remove all SDUs that were fully acked
for (uint32_t acked_pdcp_sn : notify_info_vec) {
logger.debug("Erasing SDU info: PDCP_SN=%d", acked_pdcp_sn);
@ -1106,6 +1104,11 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
debug_state();
pthread_mutex_unlock(&mutex);
// Notify PDCP without holding Tx mutex
if (not notify_info_vec.empty()) {
parent->pdcp->notify_delivery(parent->lcid, notify_info_vec);
}
}
/*
@ -1113,7 +1116,8 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
* @tx_pdu: RLC PDU that was ack'ed.
* @notify_info_vec: Vector which will keep track of the PDCP PDU SNs that have been fully ack'ed.
*/
void rlc_am_lte::rlc_am_lte_tx::update_notification_ack_info(const rlc_amd_tx_pdu_t& tx_pdu)
void rlc_am_lte::rlc_am_lte_tx::update_notification_ack_info(const rlc_amd_tx_pdu_t& tx_pdu,
std::vector<uint32_t>& notify_info_vec)
{
logger.debug("Updating ACK info: RLC SN=%d, number of notified SDU=%ld, number of undelivered SDUs=%ld",
tx_pdu.header.sn,