From a32ada76c71a85c40582bcdab1fdde58e9fcac9b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 17 Feb 2024 11:48:32 +0100 Subject: [PATCH] Workaround for sched_response in PNF In monolithic, the sched_response mechanism ensures that FAPI messages for one slot are not overwritten by scheduler instructions for the following slots (i.e., it is like a memory allocation pool). The allocation happens in nr_schedule_response(), not used by the PNF. Hence, only deallocate when in monolithic. The PNF uses a big ring buffer over all slots in a frame to ensure the same. --- executables/nr-gnb.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index a2f9fb202a..242220fe38 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -147,9 +147,14 @@ static void tx_func(processingData_L1tx_t *info) ru_tx_func((void *)&syncMsgRU); stop_meas(&info->gNB->phy_proc_tx); } - /* this thread is done with the sched_info, decrease the reference counter */ - LOG_D(NR_PHY, "Calling deref_sched_response for id %d (tx_func) in %d.%d\n", info->sched_response_id, frame_tx, slot_tx); - deref_sched_response(info->sched_response_id); + + if (NFAPI_MODE == NFAPI_MONOLITHIC) { + /* this thread is done with the sched_info, decrease the reference counter. + * This only applies for monolithic; in the PNF, the memory is allocated in + * a ring buffer that should never be overwritten (one frame duration). */ + LOG_D(NR_PHY, "Calling deref_sched_response for id %d (tx_func) in %d.%d\n", info->sched_response_id, frame_tx, slot_tx); + deref_sched_response(info->sched_response_id); + } } void *L1_rx_thread(void *arg)