Commit 23ef597c authored by Noemi Giustini's avatar Noemi Giustini

Rework CARR.PDSCHMCSDist metric

CARR.PDSCHMCSDist (3GPP TS 28.552 §5.1.1.12.1) and its du_stats histogram
already existed, but the metric was never collected and the reader indexed
the histogram incorrectly. Rework it into a correct PRB-weighted 3D
histogram over (rank, MCS-table, MCS-index).

- gNB_scheduler_dlsch.c: add the missing collection hook in the DL
  scheduling path; increment the (rank, MCS-table, MCS) bin by the number of
  scheduled PRBs on each PDSCH. mcsTableIdx is 0-based (0..2), so it is used
  directly to index the MCS-table axis of the histogram.
- ran_func_kpm_subs.c: make fill_CARR_PDSCHMCSDist() fully label-driven;
  reject with NO_VALUE if any of distBinX/Y/Z is absent. distBinX (rank) and
  distBinY (MCS table) are 1-based on the wire and converted to 0-based
  indices; distBinZ (MCS index) is already 0-based and used directly, reading
  du_stats->pdsch_mcs_dist[rank-1][table-1][mcs].

Carried as E2SM-KPM Style 1 measurement (Indication Message Format 1) with
standard MeasurementLabel fields distBinX/Y/Z (INTEGER 1..65535).
Advertised by DU and monolithic gNB node types.
Signed-off-by: default avatarNoemi Giustini <giustini.n@northeastern.edu>
parent f3589d97
......@@ -219,19 +219,29 @@ static meas_record_lst_t fill_CARR_PDSCHMCSDist(const label_info_lst_t label,
__attribute__((unused)) const size_t ue_idx,
__attribute__((unused))e2_node_level_stats_t* node_stats)
{
meas_record_lst_t meas_record = {.value = INTEGER_MEAS_VALUE};
meas_record_lst_t meas_record = {0};
uint32_t bin_x = *label.distBinX, bin_y = *label.distBinY, bin_z = *label.distBinZ;
if (label.distBinX == NULL || label.distBinY == NULL || label.distBinZ == NULL) {
printf("[E2 AGENT][E2SM-KPM] CARR.PDSCHMCSDist requested without distBinX/Y/Z labels; "
"TS 28.552 5.1.1.12.1 defines no aggregate value, reporting NO_VALUE\n");
meas_record.value = NO_VALUE_MEAS_VALUE;
return meas_record;
}
NR_du_stats_t* du_stats = &RC.nrmac[0]->du_stats;
const uint32_t bin_x = *label.distBinX;
const uint32_t bin_y = *label.distBinY;
const uint32_t bin_z = *label.distBinZ;
if (bin_x <= 8 && bin_y <= 3 && bin_z <= 31) {
meas_record.int_val = du_stats->pdsch_mcs_dist[bin_x - 1][bin_y - 1][bin_z];
} else {
printf("[E2 AGENT] Unknown binX %d, binY %d, binZ %d for \"CARR.PDSCHMCSDist\" measurement\n", bin_x, bin_y, bin_z);
meas_record.int_val = 0;
if (bin_x < 1 || bin_x > NR_KPM_MAX_LAYERS || bin_y < 1 || bin_y > NR_KPM_NB_MCS_TABLE_DL || bin_z > NR_KPM_NB_MCS - 1) {
printf("[E2 AGENT][E2SM-KPM] CARR.PDSCHMCSDist: bin out of range (X=%u Y=%u Z=%u), reporting NO_VALUE\n",
bin_x, bin_y, bin_z);
meas_record.value = NO_VALUE_MEAS_VALUE;
return meas_record;
}
const NR_du_stats_t* du_stats = &RC.nrmac[0]->du_stats;
meas_record.value = INTEGER_MEAS_VALUE;
meas_record.int_val = du_stats->pdsch_mcs_dist[bin_x - 1][bin_y - 1][bin_z];
return meas_record;
}
#endif
......
......@@ -101,6 +101,7 @@ From 3GPP TS 28.552, we support the following list:
* `DRB.UEThpUl`
* `RRU.PrbTotDl`
* `RRU.PrbTotUl`
* `CARR.PDSCHMCSDist`
From `O-RAN.WG3.E2SM-KPM-version` specification, we implemented:
* REPORT Service Style 4 ("Common condition-based, UE-level" - section 7.4.5) - fetch above measurements per each UE based on the common S-NSSAI `(1, 0xffffff)` condition
......
......@@ -1261,6 +1261,11 @@ void post_process_dlsch(gNB_MAC_INST *nr_mac,
tpc);
DevAssert(sched_pdsch->rbSize > 0);
DevAssert(nrOfLayers >= 1 && nrOfLayers <= NR_KPM_MAX_LAYERS);
DevAssert(current_BWP->mcsTableIdx >= 0 && current_BWP->mcsTableIdx < NR_KPM_NB_MCS_TABLE_DL);
DevAssert(sched_pdsch->mcs < NR_KPM_NB_MCS);
nr_mac->du_stats.pdsch_mcs_dist[nrOfLayers - 1][current_BWP->mcsTableIdx][sched_pdsch->mcs] += sched_pdsch->rbSize;
const int bwp_id = current_BWP->bwp_id;
const int coresetid = sched_ctrl->coreset->controlResourceSetId;
......
......@@ -1139,6 +1139,11 @@ typedef struct {
NR_ControlResourceSet_t coreset;
} NR_sched_ctrl_sib1_t;
/* Dimensions of the per-cell MCS distribution histograms (3GPP TS 28.552 §5.1.1.12). */
#define NR_KPM_MAX_LAYERS 8 /* RI: 1..8 */
#define NR_KPM_NB_MCS_TABLE_DL 3 /* PDSCH MCS tables: 1..3 */
#define NR_KPM_NB_MCS 32 /* MCS index: 0..31 */
typedef struct NR_du_stats {
/// cell-wide wide-band CQI distribution, see 28.552 5.1.1.11.1;
/// 0-15 CQI, 1-8 RI, 1-3 CQI table
......@@ -1146,7 +1151,7 @@ typedef struct NR_du_stats {
/// cell-wide MCS distribution in PDSCH, see 28.552 5.1.1.12.1
/// 1-8 RI, 1-3 MCS table, 0-31 MCS value
uint32_t pdsch_mcs_dist[8][3][32];
uint32_t pdsch_mcs_dist[NR_KPM_MAX_LAYERS][NR_KPM_NB_MCS_TABLE_DL][NR_KPM_NB_MCS];
/// cell-wide MCS distribution in PUSCH, see 28.552 5.1.1.12.1
/// 1-8 RI, 1-2 MCS table, 0-31 MCS value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment