Commit b257734c authored by Laurent THOMAS's avatar Laurent THOMAS Committed by Robert Schmidt

Fix tPool calls: symmetric to pushing messages

Messages are pushed using pushNotifiedFIFO(), so we pullNotifiedFIFO()
parent 9a57514b
...@@ -290,7 +290,7 @@ void rx_func(void *param) ...@@ -290,7 +290,7 @@ void rx_func(void *param)
pushTpool(&gNB->threadPool, res); pushTpool(&gNB->threadPool, res);
} }
} else if (get_softmodem_params()->continuous_tx) { } else if (get_softmodem_params()->continuous_tx) {
notifiedFIFO_elt_t *res = pullTpool(&gNB->L1_tx_free, &gNB->threadPool); notifiedFIFO_elt_t *res = pullNotifiedFIFO(&gNB->L1_tx_free);
if (res == NULL) if (res == NULL)
return; // Tpool has been stopped return; // Tpool has been stopped
processingData_L1tx_t *syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res); processingData_L1tx_t *syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res);
...@@ -420,10 +420,8 @@ void *nrL1_stats_thread(void *param) { ...@@ -420,10 +420,8 @@ void *nrL1_stats_thread(void *param) {
// two parallel L1 tx threads. // two parallel L1 tx threads.
void *tx_reorder_thread(void* param) { void *tx_reorder_thread(void* param) {
PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param; PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param;
notifiedFIFO_elt_t *resL1Reserve = NULL;
notifiedFIFO_elt_t *resL1Reserve = pullNotifiedFIFO(&gNB->L1_tx_out);
resL1Reserve = pullTpool(&gNB->L1_tx_out, &gNB->threadPool);
AssertFatal(resL1Reserve != NULL, "pullTpool() did not return start message in %s\n", __func__); AssertFatal(resL1Reserve != NULL, "pullTpool() did not return start message in %s\n", __func__);
int next_tx_slot=((processingData_L1tx_t *)NotifiedFifoData(resL1Reserve))->slot; int next_tx_slot=((processingData_L1tx_t *)NotifiedFifoData(resL1Reserve))->slot;
...@@ -436,15 +434,15 @@ void *tx_reorder_thread(void* param) { ...@@ -436,15 +434,15 @@ void *tx_reorder_thread(void* param) {
if (((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) { if (((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) {
LOG_E(PHY,"order mistake\n"); LOG_E(PHY,"order mistake\n");
resL1Reserve = NULL; resL1Reserve = NULL;
resL1 = pullTpool(&gNB->L1_tx_out, &gNB->threadPool); resL1 = pullNotifiedFIFO(&gNB->L1_tx_out);
} }
} else { } else {
resL1 = pullTpool(&gNB->L1_tx_out, &gNB->threadPool); resL1 = pullNotifiedFIFO(&gNB->L1_tx_out);
if (resL1 != NULL && ((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) { if (resL1 != NULL && ((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) {
if (resL1Reserve) if (resL1Reserve)
LOG_E(PHY,"error, have a stored packet, then a second one\n"); LOG_E(PHY,"error, have a stored packet, then a second one\n");
resL1Reserve = resL1; resL1Reserve = resL1;
resL1 = pullTpool(&gNB->L1_tx_out, &gNB->threadPool); resL1 = pullNotifiedFIFO(&gNB->L1_tx_out);
if (((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) if (((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot)
LOG_E(PHY,"error, pull two msg, none is good\n"); LOG_E(PHY,"error, pull two msg, none is good\n");
} }
......
...@@ -1112,7 +1112,7 @@ notifiedFIFO_elt_t *l1tx_message_extract(PHY_VARS_gNB *gNB, int frame, int slot) ...@@ -1112,7 +1112,7 @@ notifiedFIFO_elt_t *l1tx_message_extract(PHY_VARS_gNB *gNB, int frame, int slot)
notifiedFIFO_elt_t *res; notifiedFIFO_elt_t *res;
//TODO: This needs to be reworked for nfapi to work //TODO: This needs to be reworked for nfapi to work
res = pullTpool(&gNB->L1_tx_free, &gNB->threadPool); res = pullNotifiedFIFO(&gNB->L1_tx_free);
return res; return res;
} }
......
...@@ -161,7 +161,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO) ...@@ -161,7 +161,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO)
notifiedFIFO_elt_t *res=NULL; notifiedFIFO_elt_t *res=NULL;
processingData_L1tx_t *msgTx=NULL; processingData_L1tx_t *msgTx=NULL;
if (!gNB->reorder_thread_disable) { if (!gNB->reorder_thread_disable) {
res = pullTpool(&gNB->L1_tx_free, &gNB->threadPool); res = pullNotifiedFIFO(&gNB->L1_tx_free);
if (res == NULL) if (res == NULL)
return; // Tpool has been stopped, nothing to process return; // Tpool has been stopped, nothing to process
msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
......
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