Commit 76e16362 authored by Louis Adrien Dufrene's avatar Louis Adrien Dufrene

RRC timer reset in scheduler: format of some functions before first test

parent d3f8f9d6
...@@ -1033,7 +1033,10 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP, ...@@ -1033,7 +1033,10 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP,
// TODO: check if the lcid is active // TODO: check if the lcid is active
LOG_D(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n", LOG_D(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
module_idP, frameP, lcid, TBS, module_idP,
frameP,
lcid,
TBS,
TBS - ta_len - header_length_total - sdu_length_total - 3); TBS - ta_len - header_length_total - sdu_length_total - 3);
if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) { if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) {
...@@ -1047,39 +1050,50 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP, ...@@ -1047,39 +1050,50 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP,
lcid, lcid,
TBS - ta_len - header_length_total - sdu_length_total - 3 TBS - ta_len - header_length_total - sdu_length_total - 3
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0, 0 , 0, 0
#endif #endif
); );
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
LOG_D(MAC, LOG_D(MAC, "[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n", module_idP,
module_idP, frameP, frameP,
TBS - ta_len - header_length_total - sdu_length_total - 3, TBS - ta_len - header_length_total - sdu_length_total - 3,
lcid, lcid,
header_length_total); header_length_total);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, lcid, sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
rnti,
module_idP,
frameP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
TBS, //not used TBS, //not used
(char *)&dlsch_buffer[sdu_length_total] (char *)&dlsch_buffer[sdu_length_total]
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0, 0 , 0, 0
#endif #endif
); );
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T(T_ENB_MAC_UE_DL_SDU,
T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(module_idP),
T_INT(subframeP), T_INT(harq_pid), T_INT(CC_id),
T_INT(lcid), T_INT(sdu_lengths[num_sdus])); T_INT(rnti),
T_INT(frameP),
LOG_D(MAC, T_INT(subframeP),
"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n", T_INT(harq_pid),
module_idP, sdu_lengths[num_sdus], lcid); T_INT(lcid),
T_INT(sdu_lengths[num_sdus]));
LOG_D(MAC, "[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
module_idP,
sdu_lengths[num_sdus],
lcid);
sdu_lcids[num_sdus] = lcid; sdu_lcids[num_sdus] = lcid;
sdu_length_total += sdu_lengths[num_sdus]; sdu_length_total += sdu_lengths[num_sdus];
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]++; UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]++;
UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = lcid; UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = lcid;
UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[lcid] = sdu_lengths[num_sdus]; UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[lcid] = sdu_lengths[num_sdus];
...@@ -1091,10 +1105,10 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP, ...@@ -1091,10 +1105,10 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP,
num_sdus++; num_sdus++;
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
}
} else { } // end if (rlc_status.bytes_in_buffer > 0)
// no TBS left } else { // no TBS left
break; break; // break for (lcid = NB_RB_MAX - 1; lcid >= DTCH; lcid--)
} }
} }
......
...@@ -1407,14 +1407,15 @@ schedule_ue_spec_fairRR(module_id_t module_idP, ...@@ -1407,14 +1407,15 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
/* TODO limited lcid for performance */ /* TODO limited lcid for performance */
for (lcid = DTCH; lcid >= DTCH; lcid--) { for (lcid = DTCH; lcid >= DTCH; lcid--) {
// TBD: check if the lcid is active // TBD: check if the lcid is active
header_len_dtch += 3; header_len_dtch += 3;
header_len_dtch_last = 3; header_len_dtch_last = 3;
LOG_D(MAC,
"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n", LOG_D(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
module_idP, frameP, lcid, TBS, module_idP,
TBS - ta_len - header_len_dcch - frameP,
sdu_length_total - header_len_dtch); lcid,
TBS,
TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch);
if (TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch > 0) { // NN: > 2 ? if (TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch > 0) { // NN: > 2 ?
rlc_status = mac_rlc_status_ind(module_idP, rlc_status = mac_rlc_status_ind(module_idP,
...@@ -1425,62 +1426,71 @@ schedule_ue_spec_fairRR(module_id_t module_idP, ...@@ -1425,62 +1426,71 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
TBS - ta_len - TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch
header_len_dcch -
sdu_length_total -
header_len_dtch
#ifdef Rel14 #ifdef Rel14
,0, 0 , 0, 0
#endif #endif
); );
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
LOG_D(MAC, module_idP,
"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n", frameP,
module_idP, frameP, TBS - header_len_dcch - sdu_length_total - header_len_dtch,
TBS - header_len_dcch - lcid,
sdu_length_total - header_len_dtch, lcid,
header_len_dtch); header_len_dtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, lcid, TBS, //not used
(char sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
*) rnti,
&dlsch_buffer module_idP,
[sdu_length_total] frameP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
TBS, //not used
(char *)&dlsch_buffer[sdu_length_total]
#ifdef Rel14 #ifdef Rel14
,0, 0 , 0, 0
#endif #endif
); );
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP),
T_INT(CC_id), T_INT(rnti), T_INT(frameP),
T_INT(subframeP), T_INT(harq_pid),
T_INT(lcid), T_INT(sdu_lengths[num_sdus]));
LOG_D(MAC, T(T_ENB_MAC_UE_DL_SDU,
"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n", T_INT(module_idP),
module_idP, sdu_lengths[num_sdus], lcid); T_INT(CC_id),
T_INT(rnti),
T_INT(frameP),
T_INT(subframeP),
T_INT(harq_pid),
T_INT(lcid),
T_INT(sdu_lengths[num_sdus]));
LOG_D(MAC, "[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
module_idP,
sdu_lengths[num_sdus],
lcid);
sdu_lcids[num_sdus] = lcid; sdu_lcids[num_sdus] = lcid;
sdu_length_total += sdu_lengths[num_sdus]; sdu_length_total += sdu_lengths[num_sdus];
UE_list-> UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] += 1;
eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[num_sdus];
+= 1;
UE_list->
eNB_UE_stats[CC_id][UE_id].num_bytes_tx
[lcid] += sdu_lengths[num_sdus];
if (sdu_lengths[num_sdus] < 128) { if (sdu_lengths[num_sdus] < 128) {
header_len_dtch--; header_len_dtch--;
header_len_dtch_last--; header_len_dtch_last--;
} }
num_sdus++; num_sdus++;
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
} // no data for this LCID
else { } else { // no data for this LCID
header_len_dtch -= 3; header_len_dtch -= 3;
} }
} // no TBS left
else { } else { // no TBS left
header_len_dtch -= 3; header_len_dtch -= 3;
break; break;
} }
} }
......
...@@ -671,66 +671,85 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -671,66 +671,85 @@ rx_sdu(const module_id_t enb_mod_idP,
// all the DRBS // all the DRBS
case DTCH: case DTCH:
default: default:
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_T(MAC, "offset: %d\n", LOG_T(MAC, "offset: %d\n",
(unsigned char) ((unsigned char *) payload_ptr - sduP)); (unsigned char) ((unsigned char *) payload_ptr - sduP));
for (j = 0; j < 32; j++) { for (j = 0; j < 32; j++) {
LOG_T(MAC, "%x ", payload_ptr[j]); LOG_T(MAC, "%x ", payload_ptr[j]);
} }
LOG_T(MAC, "\n"); LOG_T(MAC, "\n");
#endif #endif
if (rx_lcids[i] < NB_RB_MAX) { if (rx_lcids[i] < NB_RB_MAX) {
LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d\n", LOG_D(MAC, "[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d\n",
enb_mod_idP, CC_idP, frameP, rx_lengths[i], UE_id, enb_mod_idP,
CC_idP,
frameP,
rx_lengths[i],
UE_id,
rx_lcids[i]); rx_lcids[i]);
if (UE_id != -1) { if (UE_id != -1) {
// adjust buffer occupancy of the correponding logical channel group // adjust buffer occupancy of the correponding logical channel group
LOG_D(MAC, LOG_D(MAC, "[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %ld, %d\n",
"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %ld, %d\n", enb_mod_idP,
enb_mod_idP, CC_idP, frameP, rx_lengths[i], CC_idP,
UE_id, rx_lcids[i], frameP,
UE_list->UE_template[CC_idP][UE_id]. rx_lengths[i],
lcgidmap[rx_lcids[i]], UE_id,
UE_list->UE_template[CC_idP][UE_id]. rx_lcids[i],
ul_buffer_info[UE_list->UE_template[CC_idP] UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]],
[UE_id].lcgidmap[rx_lcids[i]]]); UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]);
if (lcgid_updated[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] == 0) { if (lcgid_updated[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] == 0) {
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) {
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i]; UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
else } else {
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
}
UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer = UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer =
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[0] + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[0] +
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[1] + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[1] +
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[2] + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[2] +
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[3]; UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[3];
//UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer += UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer / 4;
} }
if ((rx_lengths[i] < SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0)) { // MAX SIZE OF transport block if ((rx_lengths[i] < SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0)) { // MAX SIZE OF transport block
mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL); //(unsigned int*)crc_status); mac_rlc_data_ind(enb_mod_idP, current_rnti, enb_mod_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL);
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]] += 1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]] += 1;
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]] += rx_lengths[i]; UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]] += rx_lengths[i];
//clear uplane_inactivity_timer //clear uplane_inactivity_timer
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
} else { /* rx_length[i] */ } else { /* rx_length[i] */
UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx += 1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx += 1;
LOG_E(MAC,
"[eNB %d] CC_id %d Frame %d : Max size of transport block reached LCID %d from UE %d ", LOG_E(MAC, "[eNB %d] CC_id %d Frame %d : Max size of transport block reached LCID %d from UE %d ",
enb_mod_idP, CC_idP, frameP, rx_lcids[i], enb_mod_idP,
CC_idP,
frameP,
rx_lcids[i],
UE_id); UE_id);
} }
} else { /*(UE_id != -1 */ } else { /*(UE_id != -1 */
LOG_E(MAC, LOG_E(MAC,"[eNB %d] CC_id %d Frame %d : received unsupported or unknown LCID %d from UE %d ",
"[eNB %d] CC_id %d Frame %d : received unsupported or unknown LCID %d from UE %d ", enb_mod_idP,
enb_mod_idP, CC_idP, frameP, rx_lcids[i], UE_id); CC_idP,
frameP,
rx_lcids[i],
UE_id);
} }
} }
......
...@@ -256,7 +256,6 @@ rrc_eNB_S1AP_get_ue_ids( ...@@ -256,7 +256,6 @@ rrc_eNB_S1AP_get_ue_ids(
* This case is uncommon, but can happen when: * This case is uncommon, but can happen when:
* -> if the first NAS message was a Detach Request (non exhaustiv), the UE RRC context exist * -> if the first NAS message was a Detach Request (non exhaustiv), the UE RRC context exist
* but is not associated with eNB_ue_s1ap_id * but is not associated with eNB_ue_s1ap_id
* -> if the UE is in IDLE, hence no S1 context exist (in this case [h_rc != HASH_TABLE_OK] is normal)
* -> ... (?) * -> ... (?)
*/ */
LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", trying to find it through S1AP context\n", LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", trying to find it through S1AP context\n",
...@@ -267,9 +266,6 @@ rrc_eNB_S1AP_get_ue_ids( ...@@ -267,9 +266,6 @@ rrc_eNB_S1AP_get_ue_ids(
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance); // get s1ap_eNB_instance s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance); // get s1ap_eNB_instance
// s1ap_eNB_instance_p = s1ap_eNB_get_instance((uint8_t) rrc_instance_pP - RC.rrc[0]); // get s1ap_eNB_instance
// s1ap_eNB_instance_t *s1ap_eNB_get_instance(uint8_t mod_id);
ue_desc_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance_p, eNB_ue_s1ap_id); // get s1ap_eNB_ue_context ue_desc_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance_p, eNB_ue_s1ap_id); // get s1ap_eNB_ue_context
if (ue_desc_p != NULL) { if (ue_desc_p != NULL) {
......
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