Use spsc_q to process PRACH jobs
Use two queues for PRACH processing: - prach_ru_queue: pass jobs from TX thread (scheduler) to RU thread. For split 8, the RU thread itself handles PRACH processing; for split 7.2, it is the library that is responsible for handling PRACH messages (see oran_fh_if4p5_south_in()) - prach_l1rx_queue: after jobs have been handled in RU thread, use this queue to pass jobs to the RX thread. There, preamble detection is performed, and RACH.indication FAPI messages are filled if a preamble has been detected. Together, these queues replace a linear search in a global array that has been modified by three threads at the same time. The design ensures that access now is thread-safe, and with less overhead. Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
+10
-4
@@ -15,6 +15,7 @@
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include "common/utils/assertions.h"
|
||||
#include "common/utils/system.h"
|
||||
#include "common/utils/fsn.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "radio/COMMON/common_lib.h"
|
||||
@@ -980,11 +981,16 @@ void *ru_thread(void *param)
|
||||
proc->tti_rx * gNB->frame_parms.samples_per_slot_wCP);
|
||||
|
||||
// Do PRACH RU processing
|
||||
prach_item_t *p =
|
||||
find_nr_prach(&gNB->prach_list, proc->frame_rx, proc->tti_rx, gNB->frame_parms.nb_antennas_rx, NR_SEARCH_EXIST);
|
||||
if (p) {
|
||||
fsn_t now = {.f = proc->frame_rx, .s = proc->tti_rx, .mu = fp->numerology_index};
|
||||
prach_item_t p;
|
||||
while (get_next_nr_prach(&gNB->prach_ru_queue, &now, &p)) {
|
||||
// need to extract RACH data for later processing by rx_nr_prach()
|
||||
rx_nr_prach_ru(p, ru->common.rxdata, ru->nr_frame_parms, ru->N_TA_offset);
|
||||
rx_nr_prach_ru(&p, ru->common.rxdata, ru->nr_frame_parms, ru->N_TA_offset);
|
||||
bool success = spsc_q_put(&gNB->prach_l1rx_queue, &p, sizeof(p));
|
||||
// assume prach_l1rx_queue never full: prach_ru_queue filled at
|
||||
// constant pace, but prach_l1rx_queue emptied as fast as possible,
|
||||
// see rx_func()
|
||||
DevAssert(success);
|
||||
} // end if (prach_id >= 0)
|
||||
} // end if (ru->feprx)
|
||||
} // end if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
|
||||
|
||||
Reference in New Issue
Block a user