Commit af37d967 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/rlc-v2-tick' into integration_2020_wk49

parents 8d0ffd73 dd5eb139
......@@ -914,7 +914,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
#if (!defined(PRE_SCD_THREAD))
if (!NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
void rlc_tick(int, int);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP, module_idP);
rlc_tick(frameP, subframeP);
pdcp_run(&ctxt);
pdcp_mbms_run(&ctxt);
rrc_rx_tx(&ctxt, CC_id);
......
......@@ -3099,6 +3099,9 @@ ue_scheduler(const module_id_t module_idP,
}
}
void rlc_tick(int, int);
rlc_tick(rxFrameP % 1024, rxSubframeP);
//#endif
UE_mac_inst[module_idP].txFrame = txFrameP;
UE_mac_inst[module_idP].txSubframe = txSubframeP;
......
......@@ -923,3 +923,13 @@ void nr_rlc_tick(int frame, int subframe)
nr_rlc_current_time++;
}
}
/* This is a hack, to compile the gNB.
* TODO: remove it. The solution is to cleanup cmake_targets/CMakeLists.txt
*/
void rlc_tick(int a, int b)
{
LOG_E(RLC, "%s:%d:%s: this code should not be reached\n",
__FILE__, __LINE__, __FUNCTION__);
exit(1);
}
......@@ -177,14 +177,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
mac_rlc_status_resp_t ret;
rlc_entity_t *rb;
/* TODO: handle time a bit more properly */
if (rlc_current_time_last_frame != frameP ||
rlc_current_time_last_subframe != subframeP) {
rlc_current_time++;
rlc_current_time_last_frame = frameP;
rlc_current_time_last_subframe = subframeP;
}
rlc_manager_lock(rlc_ue_manager);
ue = rlc_manager_get_ue(rlc_ue_manager, rntiP);
......@@ -244,14 +236,6 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(
exit(1);
}
/* TODO: handle time a bit more properly */
if (rlc_current_time_last_frame != frameP ||
rlc_current_time_last_subframe != subframeP) {
rlc_current_time++;
rlc_current_time_last_frame = frameP;
rlc_current_time_last_subframe = subframeP;
}
rlc_manager_lock(rlc_ue_manager);
ue = rlc_manager_get_ue(rlc_ue_manager, rntiP);
......@@ -1028,3 +1012,27 @@ rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x)
return RLC_OP_STATUS_OK;
}
void rlc_tick(int frame, int subframe)
{
int expected_next_frame;
int expected_next_subframe;
if (frame != rlc_current_time_last_frame ||
subframe != rlc_current_time_last_subframe) {
/* warn if discontinuity in ticks */
expected_next_subframe = (rlc_current_time_last_subframe + 1) % 10;
if (expected_next_subframe == 0)
expected_next_frame = (rlc_current_time_last_frame + 1) % 1024;
else
expected_next_frame = rlc_current_time_last_frame;
if (expected_next_frame != frame || expected_next_subframe != subframe)
LOG_W(RLC, "rlc_tick: discontinuity (expected %d.%d, got %d.%d)\n",
expected_next_frame, expected_next_subframe,
frame, subframe);
rlc_current_time++;
rlc_current_time_last_frame = frame;
rlc_current_time_last_subframe = subframe;
}
}
......@@ -2017,6 +2017,7 @@ void *ru_thread_synch(void *arg) {
#if defined(PRE_SCD_THREAD)
void *pre_scd_thread( void *param ) {
void rlc_tick(int, int);
static int eNB_pre_scd_status;
protocol_ctxt_t ctxt;
int frame;
......@@ -2051,6 +2052,7 @@ void *pre_scd_thread( void *param ) {
AssertFatal((ret=pthread_mutex_unlock(&ru->proc.mutex_pre_scd))==0,"mutex_unlock returns %d\n",ret);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, Mod_id, ENB_FLAG_YES,
NOT_A_RNTI, frame, subframe,Mod_id);
rlc_tick(frame, subframe);
pdcp_run(&ctxt);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
......
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