Commit 25ab3a5e authored by Cedric Roux's avatar Cedric Roux

rlc v2: change time keeping

RLC has timers. We need to keep track of time. We chose to not use
realtime but 'processing time'. That is we send a tick to RLC for every
subframe when it is processed by the softmodem. Before this commit we
used to increase time in the function mac_rlc_status_ind which may not be
called every subframe (especially in TDD mode). So we need another way
to keep track of time.

We introduce rlc_tick() and call it in eNB_dlsch_ulsch_scheduler, which
is called every subframe, both in FDD and TDD.

We also call rlc_tick() in the function ru_thread_synch() because
pdcp_run() and rrc_rx_tx() are called there too.

It may not be the best solution. To be revised if needed.

Note: the UE has not been touched. Some modification is needed for the UE
too, most probably.
parent 2529c20b
...@@ -914,7 +914,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -914,7 +914,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
#if (!defined(PRE_SCD_THREAD)) #if (!defined(PRE_SCD_THREAD))
if (!NODE_IS_DU(RC.rrc[module_idP]->node_type)) { 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); 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_run(&ctxt);
pdcp_mbms_run(&ctxt); pdcp_mbms_run(&ctxt);
rrc_rx_tx(&ctxt, CC_id); rrc_rx_tx(&ctxt, CC_id);
......
...@@ -177,14 +177,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind( ...@@ -177,14 +177,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
mac_rlc_status_resp_t ret; mac_rlc_status_resp_t ret;
rlc_entity_t *rb; 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); rlc_manager_lock(rlc_ue_manager);
ue = rlc_manager_get_ue(rlc_ue_manager, rntiP); ue = rlc_manager_get_ue(rlc_ue_manager, rntiP);
...@@ -1028,3 +1020,27 @@ rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x) ...@@ -1028,3 +1020,27 @@ rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x)
return RLC_OP_STATUS_OK; 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) { ...@@ -2017,6 +2017,7 @@ void *ru_thread_synch(void *arg) {
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
void *pre_scd_thread( void *param ) { void *pre_scd_thread( void *param ) {
void rlc_tick(int, int);
static int eNB_pre_scd_status; static int eNB_pre_scd_status;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
int frame; int frame;
...@@ -2051,6 +2052,7 @@ void *pre_scd_thread( void *param ) { ...@@ -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); 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, PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, Mod_id, ENB_FLAG_YES,
NOT_A_RNTI, frame, subframe,Mod_id); NOT_A_RNTI, frame, subframe,Mod_id);
rlc_tick(frame, subframe);
pdcp_run(&ctxt); pdcp_run(&ctxt);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { 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