Commit cabb4561 authored by Wang Tsu-Han's avatar Wang Tsu-Han

seperating rx tx process and fixixng coding threads on different cores

parent 409eadc9
...@@ -555,8 +555,8 @@ void *te_thread(void *param) { ...@@ -555,8 +555,8 @@ void *te_thread(void *param) {
pthread_setname_np( pthread_self(),"te processing"); pthread_setname_np( pthread_self(),"te processing");
LOG_I(PHY,"thread te created id=%ld\n", syscall(__NR_gettid)); LOG_I(PHY,"thread te created id=%ld\n", syscall(__NR_gettid));
//CPU_SET(4, &cpuset); CPU_SET(4, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
PHY_VARS_eNB *eNB = ((te_params *)param)->eNB; PHY_VARS_eNB *eNB = ((te_params *)param)->eNB;
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
...@@ -592,8 +592,8 @@ void *te_thread1(void *param) { ...@@ -592,8 +592,8 @@ void *te_thread1(void *param) {
pthread_setname_np( pthread_self(),"te processing 1"); pthread_setname_np( pthread_self(),"te processing 1");
LOG_I(PHY,"thread te 1 created id=%ld\n", syscall(__NR_gettid)); LOG_I(PHY,"thread te 1 created id=%ld\n", syscall(__NR_gettid));
//CPU_SET(7, &cpuset); CPU_SET(7, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
PHY_VARS_eNB *eNB = ((te_params *)param)->eNB; PHY_VARS_eNB *eNB = ((te_params *)param)->eNB;
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
...@@ -630,8 +630,8 @@ void *te_thread2(void *param) { ...@@ -630,8 +630,8 @@ void *te_thread2(void *param) {
pthread_setname_np( pthread_self(),"te processing 2"); pthread_setname_np( pthread_self(),"te processing 2");
LOG_I(PHY,"thread te 2 created id=%ld\n", syscall(__NR_gettid)); LOG_I(PHY,"thread te 2 created id=%ld\n", syscall(__NR_gettid));
//CPU_SET(7, &cpuset); CPU_SET(8, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
PHY_VARS_eNB *eNB = ((te_params *)param)->eNB; PHY_VARS_eNB *eNB = ((te_params *)param)->eNB;
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
...@@ -665,6 +665,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -665,6 +665,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats, time_stats_t *rm_stats,
time_stats_t *te_stats, time_stats_t *te_stats,
time_stats_t *te_wait_stats, time_stats_t *te_wait_stats,
time_stats_t *te_main_stats,
time_stats_t *te_wakeup_stats0, time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1, time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats) time_stats_t *i_stats)
...@@ -787,6 +788,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -787,6 +788,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
pthread_mutex_unlock( &proc->mutex_te[2] ); pthread_mutex_unlock( &proc->mutex_te[2] );
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
start_meas(te_main_stats);
for (r=(dlsch->harq_processes[harq_pid]->C>>2)*3; r<dlsch->harq_processes[harq_pid]->C; r++) { for (r=(dlsch->harq_processes[harq_pid]->C>>2)*3; r<dlsch->harq_processes[harq_pid]->C; r++) {
if (r<dlsch->harq_processes[harq_pid]->Cminus) if (r<dlsch->harq_processes[harq_pid]->Cminus)
...@@ -840,6 +842,10 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -840,6 +842,10 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
proc->tep[1].dlsch = dlsch; proc->tep[1].dlsch = dlsch;
proc->tep[1].G = G; proc->tep[1].G = G;
proc->tep[2].eNB = eNB;
proc->tep[2].dlsch = dlsch;
proc->tep[2].G = G;
// wakeup worker to do second half segments // wakeup worker to do second half segments
if (pthread_cond_signal(&proc->cond_te[0]) != 0) { if (pthread_cond_signal(&proc->cond_te[0]) != 0) {
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n"); printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
...@@ -851,6 +857,11 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -851,6 +857,11 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return (-1); return (-1);
} }
if (pthread_cond_signal(&proc->cond_te[2]) != 0) {
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
exit_fun( "ERROR pthread_cond_signal" );
return (-1);
}
} }
// Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the // Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the
...@@ -889,6 +900,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -889,6 +900,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
stop_meas(rm_stats); stop_meas(rm_stats);
} }
} }
stop_meas(te_main_stats);
// wait for worker to finish // wait for worker to finish
start_meas(te_wait_stats); start_meas(te_wait_stats);
...@@ -915,6 +927,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -915,6 +927,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats, time_stats_t *rm_stats,
time_stats_t *te_stats, time_stats_t *te_stats,
time_stats_t *te_wait_stats, time_stats_t *te_wait_stats,
time_stats_t *te_main_stats,
time_stats_t *te_wakeup_stats0, time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1, time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats) time_stats_t *i_stats)
...@@ -950,6 +963,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -950,6 +963,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
rm_stats, rm_stats,
te_stats, te_stats,
te_wait_stats, te_wait_stats,
te_main_stats,
te_wakeup_stats0, te_wakeup_stats0,
te_wakeup_stats1, te_wakeup_stats1,
i_stats); i_stats);
......
...@@ -131,6 +131,7 @@ int32_t dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -131,6 +131,7 @@ int32_t dlsch_encoding_all(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats, time_stats_t *rm_stats,
time_stats_t *te_stats, time_stats_t *te_stats,
time_stats_t *te_wait_stats, time_stats_t *te_wait_stats,
time_stats_t *te_main_stats,
time_stats_t *te_wakeup_stats0, time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1, time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats); time_stats_t *i_stats);
...@@ -179,6 +180,7 @@ int32_t dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -179,6 +180,7 @@ int32_t dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats, time_stats_t *rm_stats,
time_stats_t *te_stats, time_stats_t *te_stats,
time_stats_t *te_wait_stats, time_stats_t *te_wait_stats,
time_stats_t *te_main_stats,
time_stats_t *te_wakeup_stats0, time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1, time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats); time_stats_t *i_stats);
......
...@@ -965,7 +965,7 @@ typedef struct PHY_VARS_eNB_s { ...@@ -965,7 +965,7 @@ typedef struct PHY_VARS_eNB_s {
eth_params_t eth_params; eth_params_t eth_params;
int rx_total_gain_dB; int rx_total_gain_dB;
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag); int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *); int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *);
int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB); int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB);
uint8_t local_flag; uint8_t local_flag;
LTE_DL_FRAME_PARMS frame_parms; LTE_DL_FRAME_PARMS frame_parms;
...@@ -1145,6 +1145,7 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1145,6 +1145,7 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t dlsch_rate_matching_stats; time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_turbo_encoding_stats; time_stats_t dlsch_turbo_encoding_stats;
time_stats_t dlsch_turbo_encoding_waiting_stats; time_stats_t dlsch_turbo_encoding_waiting_stats;
time_stats_t dlsch_turbo_encoding_main_stats;
time_stats_t dlsch_turbo_encoding_wakeup_stats0; time_stats_t dlsch_turbo_encoding_wakeup_stats0;
time_stats_t dlsch_turbo_encoding_wakeup_stats1; time_stats_t dlsch_turbo_encoding_wakeup_stats1;
time_stats_t dlsch_interleaving_stats; time_stats_t dlsch_interleaving_stats;
......
...@@ -346,6 +346,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, ...@@ -346,6 +346,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
&eNB->dlsch_rate_matching_stats, &eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats, &eNB->dlsch_turbo_encoding_stats,
&eNB->dlsch_turbo_encoding_waiting_stats, &eNB->dlsch_turbo_encoding_waiting_stats,
&eNB->dlsch_turbo_encoding_main_stats,
&eNB->dlsch_turbo_encoding_wakeup_stats0, &eNB->dlsch_turbo_encoding_wakeup_stats0,
&eNB->dlsch_turbo_encoding_wakeup_stats1, &eNB->dlsch_turbo_encoding_wakeup_stats1,
&eNB->dlsch_interleaving_stats); &eNB->dlsch_interleaving_stats);
......
...@@ -182,14 +182,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -182,14 +182,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
// wakeup_tx(eNB,eNB->proc.ru_proc); wakeup_tx(eNB,eNB->proc.ru_proc);
if(oai_exit) return(-1); //if(oai_exit) return(-1);
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1); //phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
//
pthread_mutex_lock(&eNB->proc.ru_proc->mutex_eNBs); //pthread_mutex_lock(&eNB->proc.ru_proc->mutex_eNBs);
++eNB->proc.ru_proc->instance_cnt_eNBs; //++eNB->proc.ru_proc->instance_cnt_eNBs;
pthread_cond_signal(&eNB->proc.ru_proc->cond_eNBs); //pthread_cond_signal(&eNB->proc.ru_proc->cond_eNBs);
pthread_mutex_unlock(&eNB->proc.ru_proc->mutex_eNBs); //pthread_mutex_unlock(&eNB->proc.ru_proc->mutex_eNBs);
stop_meas( &softmodem_stats_rxtx_sf ); stop_meas( &softmodem_stats_rxtx_sf );
...@@ -707,6 +707,8 @@ static void* process_stats_thread(void* param) { ...@@ -707,6 +707,8 @@ static void* process_stats_thread(void* param) {
if (eNB->te) if (eNB->te)
{ {
print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL); print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_main_stats,"coding_main",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_waiting_stats,"coding_wait",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL); print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL); print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL);
} }
......
...@@ -1474,8 +1474,8 @@ static void* ru_thread( void* param ) { ...@@ -1474,8 +1474,8 @@ static void* ru_thread( void* param ) {
// set default return value // set default return value
thread_top_init("ru_thread",1,400000,500000,500000); thread_top_init("ru_thread",1,400000,500000,500000);
//CPU_SET(1, &cpuset); CPU_SET(1, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
pthread_setname_np( pthread_self(),"ru thread"); pthread_setname_np( pthread_self(),"ru thread");
LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid)); LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid));
......
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