Commit 13122a27 authored by laurent's avatar laurent

ul in parallel monolithic case, ul in parallel memory leak fix

parent f0759d6e
...@@ -84,7 +84,7 @@ void *one_thread(void *arg) { ...@@ -84,7 +84,7 @@ void *one_thread(void *arg) {
delNotifiedFIFO_elt(elt); delNotifiedFIFO_elt(elt);
else else
pushNotifiedFIFO(elt->reponseFifo, elt); pushNotifiedFIFO(elt->reponseFifo, elt);
myThread->runningOnKey=-1;
mutexunlock(tp->incomingFifo.lockF); mutexunlock(tp->incomingFifo.lockF);
} }
} while (true); } while (true);
...@@ -116,7 +116,7 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) { ...@@ -116,7 +116,7 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
pool->nbThreads=0; pool->nbThreads=0;
pool->restrictRNTI=false; pool->restrictRNTI=false;
curptr=strtok_r(params,",",&saveptr); curptr=strtok_r(params,",",&saveptr);
struct one_thread * ptr;
while ( curptr!=NULL ) { while ( curptr!=NULL ) {
int c=toupper(curptr[0]); int c=toupper(curptr[0]);
...@@ -130,8 +130,9 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) { ...@@ -130,8 +130,9 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
break; break;
default: default:
ptr=pool->allthreads;
pool->allthreads=(struct one_thread *)malloc(sizeof(struct one_thread)); pool->allthreads=(struct one_thread *)malloc(sizeof(struct one_thread));
pool->allthreads->next=pool->allthreads; pool->allthreads->next=ptr;
printf("create a thread for core %d\n", atoi(curptr)); printf("create a thread for core %d\n", atoi(curptr));
pool->allthreads->coreID=atoi(curptr); pool->allthreads->coreID=atoi(curptr);
pool->allthreads->id=pool->nbThreads; pool->allthreads->id=pool->nbThreads;
......
...@@ -137,8 +137,9 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) { ...@@ -137,8 +137,9 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) {
// This function aborts all messages matching the key // This function aborts all messages matching the key
// If the queue is used in thread pools, it doesn't cancels already running processing // If the queue is used in thread pools, it doesn't cancels already running processing
// because the message has already been picked // because the message has already been picked
static inline void abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) { static inline int abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) {
mutexlock(nf->lockF); mutexlock(nf->lockF);
int nbDeleted=0;
notifiedFIFO_elt_t **start=&nf->outF; notifiedFIFO_elt_t **start=&nf->outF;
while(*start!=NULL) { while(*start!=NULL) {
...@@ -146,13 +147,15 @@ static inline void abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) { ...@@ -146,13 +147,15 @@ static inline void abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) {
notifiedFIFO_elt_t *request=*start; notifiedFIFO_elt_t *request=*start;
*start=(*start)->next; *start=(*start)->next;
delNotifiedFIFO_elt(request); delNotifiedFIFO_elt(request);
} nbDeleted++;
} else
if (*start != NULL)
start=&(*start)->next; start=&(*start)->next;
} }
if (nf->outF == NULL)
nf->inF=NULL;
mutexunlock(nf->lockF); mutexunlock(nf->lockF);
return nbDeleted;
} }
struct one_thread { struct one_thread {
...@@ -181,8 +184,17 @@ typedef struct thread_pool { ...@@ -181,8 +184,17 @@ typedef struct thread_pool {
static inline void pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg) { static inline void pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg) {
if (t->measurePerf) msg->creationTime=rdtsc(); if (t->measurePerf) msg->creationTime=rdtsc();
if ( t->activated)
pushNotifiedFIFO(&t->incomingFifo, msg); pushNotifiedFIFO(&t->incomingFifo, msg);
else {
if (t->measurePerf)
msg->startProcessingTime=rdtsc();
msg->processingFunc(NotifiedFifoData(msg));
if (t->measurePerf)
msg->endProcessingTime=rdtsc();
if (msg->reponseFifo)
pushNotifiedFIFO(msg->reponseFifo, msg);
}
} }
static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_t *t) { static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_t *t) {
...@@ -212,7 +224,8 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo ...@@ -212,7 +224,8 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo
return msg; return msg;
} }
static inline void abortTpool(tpool_t *t, uint64_t key) { static inline int abortTpool(tpool_t *t, uint64_t key) {
int nbRemoved=0;
notifiedFIFO_t *nf=&t->incomingFifo; notifiedFIFO_t *nf=&t->incomingFifo;
mutexlock(nf->lockF); mutexlock(nf->lockF);
notifiedFIFO_elt_t **start=&nf->outF; notifiedFIFO_elt_t **start=&nf->outF;
...@@ -222,22 +235,26 @@ static inline void abortTpool(tpool_t *t, uint64_t key) { ...@@ -222,22 +235,26 @@ static inline void abortTpool(tpool_t *t, uint64_t key) {
notifiedFIFO_elt_t *request=*start; notifiedFIFO_elt_t *request=*start;
*start=(*start)->next; *start=(*start)->next;
delNotifiedFIFO_elt(request); delNotifiedFIFO_elt(request);
} nbRemoved++;
} else
if (*start != NULL)
start=&(*start)->next; start=&(*start)->next;
} }
if (t->incomingFifo.outF==NULL)
t->incomingFifo.inF=NULL;
struct one_thread *ptr=t->allthreads; struct one_thread *ptr=t->allthreads;
while(ptr!=NULL) { while(ptr!=NULL) {
if (ptr->runningOnKey==key) if (ptr->runningOnKey==key) {
ptr->abortFlag=true; ptr->abortFlag=true;
nbRemoved++;
}
ptr=ptr->next; ptr=ptr->next;
} }
mutexunlock(nf->lockF); mutexunlock(nf->lockF);
return nbRemoved;
} }
void initTpool(char *params,tpool_t *pool, bool performanceMeas); void initTpool(char *params,tpool_t *pool, bool performanceMeas);
......
...@@ -615,7 +615,7 @@ void pusch_procedures_fromsplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB * ...@@ -615,7 +615,7 @@ void pusch_procedures_fromsplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *
&ulsch_harq->Kplus, &ulsch_harq->Kplus,
&ulsch_harq->Kminus, &ulsch_harq->Kminus,
&ulsch_harq->F); &ulsch_harq->F);
int ret = ulsch_decoding_data(eNB, i, harq_pid, int ret = ulsch_decoding_data(eNB, proc, i, harq_pid,
ulsch_harq->nb_rb>20 ? 1 : 0); ulsch_harq->nb_rb>20 ? 1 : 0);
stop_meas(&eNB->ulsch_decoding_stats); stop_meas(&eNB->ulsch_decoding_stats);
LOG_D(PHY, LOG_D(PHY,
......
...@@ -692,13 +692,14 @@ static void *ru_thread( void *param ) { ...@@ -692,13 +692,14 @@ static void *ru_thread( void *param ) {
L1_rxtx_proc_t L1proc; L1_rxtx_proc_t L1proc;
L1_rxtx_proc_t *proc=&L1proc; L1_rxtx_proc_t *proc=&L1proc;
if ( strlen(get_softmodem_params()->threadPoolConfig) > 0 ) { if ( strlen(get_softmodem_params()->threadPoolConfig) > 0 )
initTpool(get_softmodem_params()->threadPoolConfig, &L1proc.threadPool, true); initTpool(get_softmodem_params()->threadPoolConfig, &L1proc.threadPool, true);
initNotifiedFIFO(&L1proc.respEncode); else
initNotifiedFIFO(&L1proc.respDecode);
} else
initTpool("n", &L1proc.threadPool, true); initTpool("n", &L1proc.threadPool, true);
initNotifiedFIFO(&L1proc.respEncode);
initNotifiedFIFO(&L1proc.respDecode);
if (ru->if_south == LOCAL_RF) { // configure RF parameters only if (ru->if_south == LOCAL_RF) { // configure RF parameters only
fill_rf_config(ru,ru->rf_config_file); fill_rf_config(ru,ru->rf_config_file);
init_frame_parms(&ru->frame_parms,1); init_frame_parms(&ru->frame_parms,1);
......
...@@ -398,6 +398,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -398,6 +398,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
proc->nbEncode++; proc->nbEncode++;
} else { } else {
TPencode(rdata); TPencode(rdata);
delNotifiedFIFO_elt(req);
} }
int Qm=hadlsch->Qm; int Qm=hadlsch->Qm;
......
...@@ -288,6 +288,7 @@ typedef struct { ...@@ -288,6 +288,7 @@ typedef struct {
uint8_t rvidx; uint8_t rvidx;
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
int16_t w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)]; int16_t w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)];
int16_t pusch_rep_buffer[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)];
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
//TBD //TBD
int16_t *d[MAX_NUM_ULSCH_SEGMENTS]; int16_t *d[MAX_NUM_ULSCH_SEGMENTS];
......
...@@ -469,6 +469,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB, ...@@ -469,6 +469,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
int ulsch_decoding_data_all(PHY_VARS_eNB *eNB, int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,
L1_rxtx_proc_t *proc,
int UE_id, int UE_id,
int harq_pid, int harq_pid,
int llr8_flag); int llr8_flag);
...@@ -513,6 +514,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB, ...@@ -513,6 +514,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,
@returns 0 on success @returns 0 on success
*/ */
int ulsch_decoding_data(PHY_VARS_eNB *eNB, int ulsch_decoding_data(PHY_VARS_eNB *eNB,
L1_rxtx_proc_t *proc,
int UE_id, int UE_id,
int harq_pid, int harq_pid,
int llr8_flag); int llr8_flag);
......
This diff is collapsed.
...@@ -871,20 +871,19 @@ union turboReqUnion { ...@@ -871,20 +871,19 @@ union turboReqUnion {
}; };
typedef struct TurboDecode_s { typedef struct TurboDecode_s {
decoder_if_t *function; PHY_VARS_eNB *eNB;
int16_t soft_bits[3*8*6144+12+96] __attribute__((aligned(32))); decoder_if_t *function;
uint8_t decoded_bytes[3+768] __attribute__((aligned(32))); uint8_t decoded_bytes[3+1768] __attribute__((aligned(32)));
int UEid; int UEid;
int harq_pid; int harq_pid;
int frame; int frame;
int subframe; int subframe;
int iind;
int Fbits; int Fbits;
int Kr; int Kr;
LTE_UL_eNB_HARQ_t *ulsch_harq; LTE_UL_eNB_HARQ_t *ulsch_harq;
PHY_VARS_eNB *eNB;
int nbSegments; int nbSegments;
int segment_r; int segment_r;
int r_offset;
int offset; int offset;
int maxIterations; int maxIterations;
int decodeIterations; int decodeIterations;
......
This diff is collapsed.
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