From 1a985093f9f75a3cd4f5f6c705d8ac66bb363f7f Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 23 Nov 2021 12:07:40 +0000 Subject: [PATCH] nr,gnb,sched: avoid that ConRes CE gets allocated multiple times for the same Msg4 --- srsgnb/src/stack/mac/sched_nr_ue.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/srsgnb/src/stack/mac/sched_nr_ue.cc b/srsgnb/src/stack/mac/sched_nr_ue.cc index f498fc63e..d67dceb66 100644 --- a/srsgnb/src/stack/mac/sched_nr_ue.cc +++ b/srsgnb/src/stack/mac/sched_nr_ue.cc @@ -163,9 +163,11 @@ void ue::mac_buffer_state(uint32_t ce_lcid, uint32_t nof_cmds) void ue::rlc_buffer_state(uint32_t lcid, uint32_t newtx, uint32_t retx) { - if (lcid == 0) { + if (lcid == 0 and buffers.get_dl_tx_total(0) == 0) { // In case of DL-CCCH, schedule ConRes CE - // Note: use push_front because ConRes CE has priority + // Note1: rlc_buffer_state may be called multiple times for the same CCCH. Thus, we need to confirm lcid=0 buffer + // state is zero to avoid that multiple CEs being scheduled. + // Note2: use push_front because ConRes CE has priority buffers.pending_ces.push_front({srsran::mac_sch_subpdu_nr::CON_RES_ID, cfg().carriers[0].cc}); } buffers.dl_buffer_state(lcid, newtx, retx);