removed temporary "USE_MSGQ" definition. Now, with
reorder_thread_disable we use the native message queue and L1_rx_thread instead of the thread-pool for the main L1 thread. There is a single TX thread (no slot parallelization)
This commit is contained in:
+27
-32
@@ -88,7 +88,6 @@
|
||||
#include <openair1/PHY/NR_TRANSPORT/nr_dlsch.h>
|
||||
#include <PHY/NR_ESTIMATION/nr_ul_estimation.h>
|
||||
|
||||
#define USE_MSGQ 1
|
||||
//#define USRP_DEBUG 1
|
||||
// Fix per CC openair rf/if device update
|
||||
// extern openair0_device openair0;
|
||||
@@ -264,24 +263,22 @@ void rx_func(void *param)
|
||||
processingData_L1tx_t *syncMsg;
|
||||
// Its a FIFO so it maitains the order in which the MAC fills the messages
|
||||
// so no need for checking for right slot
|
||||
#ifndef USE_MSGQ
|
||||
if (get_softmodem_params()->reorder_thread_disable)
|
||||
res = pullTpool(&gNB->L1_tx_out, &gNB->threadPool);
|
||||
else
|
||||
if (get_softmodem_params()->reorder_thread_disable) {
|
||||
// call the TX function directly from this thread
|
||||
syncMsg = gNB->msgDataTx;
|
||||
syncMsg->gNB = gNB;
|
||||
syncMsg->timestamp_tx = info->timestamp_tx;
|
||||
tx_func(syncMsg);
|
||||
} else {
|
||||
res = pullTpool(&gNB->L1_tx_filled, &gNB->threadPool);
|
||||
if (res == NULL)
|
||||
return; // Tpool has been stopped
|
||||
syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
syncMsg->gNB = gNB;
|
||||
syncMsg->timestamp_tx = info->timestamp_tx;
|
||||
res->key = slot_tx;
|
||||
pushTpool(&gNB->threadPool, res);
|
||||
#else
|
||||
syncMsg = gNB->msgDataTx;
|
||||
syncMsg->gNB = gNB;
|
||||
syncMsg->timestamp_tx = info->timestamp_tx;
|
||||
tx_func(syncMsg);
|
||||
#endif
|
||||
if (res == NULL)
|
||||
return; // Tpool has been stopped
|
||||
syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
syncMsg->gNB = gNB;
|
||||
syncMsg->timestamp_tx = info->timestamp_tx;
|
||||
res->key = slot_tx;
|
||||
pushTpool(&gNB->threadPool, res);
|
||||
}
|
||||
} else if (get_softmodem_params()->continuous_tx) {
|
||||
notifiedFIFO_elt_t *res = pullTpool(&gNB->L1_tx_free, &gNB->threadPool);
|
||||
if (res == NULL)
|
||||
@@ -476,32 +473,30 @@ void init_gNB_Tpool(int inst) {
|
||||
|
||||
// L1 RX result FIFO
|
||||
initNotifiedFIFO(&gNB->resp_L1);
|
||||
#ifndef USE_MSGQ
|
||||
notifiedFIFO_elt_t *msg = newNotifiedFIFO_elt(sizeof(processingData_L1_t), 0, &gNB->resp_L1, rx_func);
|
||||
pushNotifiedFIFO(&gNB->resp_L1, msg); // to unblock the process in the beginning
|
||||
#endif
|
||||
if (!get_softmodem_params()->reorder_thread_disable) {
|
||||
notifiedFIFO_elt_t *msg = newNotifiedFIFO_elt(sizeof(processingData_L1_t), 0, &gNB->resp_L1, rx_func);
|
||||
pushNotifiedFIFO(&gNB->resp_L1, msg); // to unblock the process in the beginning
|
||||
}
|
||||
// L1 TX result FIFO
|
||||
initNotifiedFIFO(&gNB->L1_tx_free);
|
||||
initNotifiedFIFO(&gNB->L1_tx_filled);
|
||||
initNotifiedFIFO(&gNB->L1_tx_out);
|
||||
|
||||
#ifdef USE_MSGQ
|
||||
threadCreate(&gNB->L1_rx_thread, L1_rx_thread, (void *)gNB, "L1_rx_thread",
|
||||
gNB->L1_rx_thread_core, OAI_PRIORITY_RT_MAX);
|
||||
// threadCreate(&gNB->L1_tx_thread, L1_tx_thread, (void *)gNB, "L1_tx_thread",
|
||||
// gNB->L1_tx_thread_core, OAI_PRIORITY_RT_MAX);
|
||||
#endif
|
||||
if (get_softmodem_params()->reorder_thread_disable) {
|
||||
// create the RX thread responsible for triggering RX processing and then TX processing if a single thread is used
|
||||
threadCreate(&gNB->L1_rx_thread, L1_rx_thread, (void *)gNB, "L1_rx_thread",
|
||||
gNB->L1_rx_thread_core, OAI_PRIORITY_RT_MAX);
|
||||
// if separate threads are used for RX and TX, create the TX thread
|
||||
// threadCreate(&gNB->L1_tx_thread, L1_tx_thread, (void *)gNB, "L1_tx_thread",
|
||||
// gNB->L1_tx_thread_core, OAI_PRIORITY_RT_MAX);
|
||||
|
||||
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t), 0, &gNB->L1_tx_out, tx_func);
|
||||
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
|
||||
memset(msgDataTx, 0, sizeof(processingData_L1tx_t));
|
||||
init_DLSCH_struct(gNB, msgDataTx);
|
||||
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
|
||||
#ifndef USE_MSGQ
|
||||
pushNotifiedFIFO(&gNB->L1_tx_out, msgL1Tx); // to unblock the process in the beginning
|
||||
#else
|
||||
// this will be removed when the msgDataTx is not necessary anymore
|
||||
gNB->msgDataTx = msgDataTx;
|
||||
#endif
|
||||
} else {
|
||||
// we create 2 threads for L1 tx processing
|
||||
for (int i=0; i < 2; i++) {
|
||||
|
||||
+11
-13
@@ -60,7 +60,6 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#endif
|
||||
|
||||
|
||||
#define USE_MSGQ 1
|
||||
|
||||
/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */
|
||||
static int DEFBANDS[] = {7};
|
||||
@@ -1285,13 +1284,13 @@ void *ru_thread( void *param ) {
|
||||
} // end if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
|
||||
|
||||
// At this point, all information for subframe has been received on FH interface
|
||||
#ifndef USE_MSGQ
|
||||
res = pullTpool(&gNB->resp_L1, &gNB->threadPool);
|
||||
if (res == NULL)
|
||||
break; // Tpool has been stopped
|
||||
#else
|
||||
res=newNotifiedFIFO_elt(sizeof(processingData_L1_t),0, &gNB->resp_L1,NULL);
|
||||
#endif
|
||||
if (!get_softmodem_params()->reorder_thread_disable) {
|
||||
res = pullTpool(&gNB->resp_L1, &gNB->threadPool);
|
||||
if (res == NULL)
|
||||
break; // Tpool has been stopped
|
||||
} else {
|
||||
res=newNotifiedFIFO_elt(sizeof(processingData_L1_t),0, &gNB->resp_L1,NULL);
|
||||
}
|
||||
syncMsg = (processingData_L1_t *)NotifiedFifoData(res);
|
||||
syncMsg->gNB = gNB;
|
||||
syncMsg->frame_rx = proc->frame_rx;
|
||||
@@ -1300,11 +1299,10 @@ void *ru_thread( void *param ) {
|
||||
syncMsg->slot_tx = proc->tti_tx;
|
||||
syncMsg->timestamp_tx = proc->timestamp_tx;
|
||||
res->key = proc->tti_rx;
|
||||
#ifndef USE_MSGQ
|
||||
pushTpool(&gNB->threadPool, res);
|
||||
#else
|
||||
pushNotifiedFIFO(&gNB->resp_L1, res);
|
||||
#endif
|
||||
if (!get_softmodem_params()->reorder_thread_disable)
|
||||
pushTpool(&gNB->threadPool, res);
|
||||
else
|
||||
pushNotifiedFIFO(&gNB->resp_L1, res);
|
||||
}
|
||||
|
||||
printf( "Exiting ru_thread \n");
|
||||
|
||||
Reference in New Issue
Block a user