Use spsc_q for SRS processing

Use the spsc queue to pass jobs from TX thread (scheduler) to RX thread
(handling those jobs), reducing the amount spent searching for SRS jobs,
clarifying the design, and making it thread-safe.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
Robert Schmidt
2026-04-16 11:53:19 +02:00
parent a5696562da
commit f5989abd0d
6 changed files with 62 additions and 68 deletions
+5 -10
View File
@@ -435,11 +435,7 @@ int main(int argc, char *argv[])
.beamforming.num_prgs = m_SRS[srs_pdu.config_index],
.beamforming.prg_size = 1};
gNB->srs->srs_pdu = srs_pdu;
gNB->srs->active = true;
gNB->srs->beam_nb = 0;
gNB->srs->frame = frame;
gNB->srs->slot = slot;
NR_gNB_SRS_job_t srs_job = {.frame = frame, .slot = slot, .srs_pdu = srs_pdu};
// Configure SRS parameters at UE
fapi_nr_ul_config_srs_pdu srs_config_pdu = {.rnti = srs_pdu.rnti,
@@ -559,10 +555,9 @@ int main(int argc, char *argv[])
//----------- UE RX SRS procedures ---------------------
start_meas(&gNB->rx_srs_stats);
NR_gNB_SRS_t *srs = &gNB->srs[0];
uint8_t N_symb_SRS = 1 << srs->srs_pdu.num_symbols;
uint8_t N_ap = 1 << srs->srs_pdu.num_ant_ports;
int16_t snr_per_rb[srs->srs_pdu.bwp_size];
uint8_t N_symb_SRS = 1 << srs_pdu.num_symbols;
uint8_t N_ap = 1 << srs_pdu.num_ant_ports;
int16_t snr_per_rb[srs_pdu.bwp_size];
uint16_t timing_advance_offset;
int16_t timing_advance_offset_nsec[n_rx];
int srs_est;
@@ -576,7 +571,7 @@ int main(int argc, char *argv[])
N_ap,
N_symb_SRS,
ofdm_symbol_size,
srs,
&srs_job,
&srs_est,
&snr,
srs_estimated_channel_freq,