Merge remote-tracking branch 'origin/refactor-dlsch' into integration_2025_w44 (!3682)

Refactor DLSCH scheduler

Refactor the DLSCH post processor similarly to what has been done in
!3521  with the goal of saving an additional iteration through all UEs,
hopefully making the DLSCH scheduler faster.

It further includes changes to make working with and debugging multi-UE
operation easier:

- add some measurements in L1 (for total TX/RX time)
- a new option MACRLCs.[0].stats_max_ue to limit the number of UEs in
  the periodic output (default: 8, 0=disable)
- avoid stack overflow in the MAC
- fix the writing of stats to nrMAC_stats.log and nrL1_stats.log when
  the written output reduces by truncating the files
- avoid to schedule retransmission with 0 RBs.
This commit is contained in:
Robert Schmidt
2025-10-30 23:14:08 +01:00
19 changed files with 795 additions and 768 deletions
+12 -1
View File
@@ -150,7 +150,9 @@ void *L1_rx_thread(void *arg)
if (res == NULL)
break;
processingData_L1_t *info = (processingData_L1_t *)NotifiedFifoData(res);
start_meas(&gNB->l1_rx_proc);
rx_func(info);
stop_meas(&gNB->l1_rx_proc);
delNotifiedFIFO_elt(res);
}
return NULL;
@@ -164,7 +166,9 @@ void *L1_tx_thread(void *arg) {
if (res == NULL) // stopping condition, happens only when queue is freed
break;
processingData_L1tx_t *info = (processingData_L1tx_t *)NotifiedFifoData(res);
start_meas(&gNB->l1_tx_proc);
tx_func(info);
stop_meas(&gNB->l1_tx_proc);
delNotifiedFIFO_elt(res);
}
return NULL;
@@ -229,6 +233,8 @@ static void rx_func(processingData_L1_t *info)
static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size_t outputlen) {
const char *begin = output;
const char *end = output + outputlen;
output += print_meas_log(&gNB->l1_tx_proc, "L1 Tx job", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->l1_rx_proc, "L1 Rx job", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->phy_proc_tx, "L1 Tx processing", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output, end - output);
output += print_meas_log(&gNB->dlsch_scrambling_stats, "DLSCH scrambling", NULL, NULL, output, end-output);
@@ -293,6 +299,8 @@ void *nrL1_stats_thread(void *param) {
return NULL;
}
reset_meas(&gNB->l1_tx_proc);
reset_meas(&gNB->l1_rx_proc);
reset_meas(&gNB->phy_proc_tx);
reset_meas(&gNB->dlsch_encoding_stats);
reset_meas(&gNB->phy_proc_rx);
@@ -309,13 +317,16 @@ void *nrL1_stats_thread(void *param) {
reset_meas(&gNB->dlsch_precoding_stats);
while (!oai_exit) {
sleep(1);
if (ftruncate(fileno(fd), 0) != 0 || fseek(fd, 0, SEEK_SET) != 0) {
LOG_E(NR_MAC, "error while writing nrL1_stats.log: %d, %s\n", errno, strerror(errno));
break;
}
dump_nr_I0_stats(fd,gNB);
dump_pdsch_stats(fd,gNB);
dump_pusch_stats(fd,gNB);
dump_L1_meas_stats(gNB, ru, output, L1STATSSTRLEN);
fprintf(fd,"%s\n",output);
fflush(fd);
fseek(fd,0,SEEK_SET);
}
fclose(fd);
return(NULL);