Commit d72e8da2 authored by Thomas Schlichter's avatar Thomas Schlichter Committed by Marwan Hammouda

improve tracking of in-flight UL data for better UL scheduling

parent 353d42a1
......@@ -166,7 +166,7 @@ static int nr_process_mac_pdu(instance_t module_idP,
NR_BSR_SHORT *bsr_s = (NR_BSR_SHORT *) ce_ptr;
sched_ctrl->estimated_ul_buffer = 0;
sched_ctrl->estimated_ul_buffer = NR_SHORT_BSR_TABLE[bsr_s->Buffer_size];
LOG_D(NR_MAC,
LOG_I(NR_MAC,
"SHORT BSR at %4d.%2d, LCG ID %d, BS Index %d, BS value < %d, est buf %d\n",
frameP,
slot,
......@@ -205,7 +205,7 @@ static int nr_process_mac_pdu(instance_t module_idP,
n, n_Lcg, pduP[mac_subheader_len + 1 + n],
NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]]);
sched_ctrl->estimated_ul_buffer += NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]];
LOG_D(NR_MAC,
LOG_I(NR_MAC,
"LONG BSR at %4d.%2d, %d/%d (n/n_Lcg), BS Index %d, BS value < %d, total %d\n",
frameP,
slot,
......@@ -605,7 +605,6 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
if (UE && UE_waiting_CFRA_msg3 == false) {
NR_UE_sched_ctrl_t *UE_scheduling_control = &UE->UE_sched_ctrl;
const int8_t harq_pid = UE_scheduling_control->feedback_ul_harq.head;
if (sduP)
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
......@@ -858,6 +857,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const frame_t frameP,
const sub_frame_t slotP,
const rnti_t rntiP,
const int8_t harq_pid,
uint8_t *sduP,
const uint16_t sdu_lenP,
const uint16_t timing_advance,
......@@ -2148,6 +2148,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n
sched_ctrl->sched_ul_bytes += sched_pusch->tb_size;
UE->mac_stats.ul.total_rbs += sched_pusch->rbSize;
if(sched_ctrl->sched_ul_bytes > 20000)
sched_ctrl->sched_ul_bytes = 20000;
} else {
LOG_D(NR_MAC,
"%d.%2d UL retransmission RNTI %04x sched %d.%2d HARQ PID %d round %d NDI %d\n",
......
......@@ -353,6 +353,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const frame_t frameP,
const sub_frame_t subframeP,
const rnti_t rntiP,
const int8_t harq_pid,
uint8_t * sduP,
const uint16_t sdu_lenP,
const uint16_t timing_advance,
......
......@@ -190,6 +190,9 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
AssertFatal(crc->rnti == rx->rnti, "mis-match between CRC RNTI %04x and RX RNTI %04x\n",
crc->rnti, rx->rnti);
AssertFatal(crc->harq_id == rx->harq_id, "mis-match between CRC HARQ ID %04x and RX HARQ ID %04x\n",
crc->harq_id, rx->harq_id);
LOG_D(NR_MAC,
"%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
UL_info->frame,
......@@ -203,6 +206,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
UL_info->rx_ind.sfn,
UL_info->rx_ind.slot,
rx->rnti,
rx->harq_id,
crc->tb_crc_status ? NULL : rx->pdu,
rx->pdu_length,
rx->timing_advance,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment