+ struct xran_prb_elm *pPrbElem = &config->p_PrbMapUl->prbMap[section_idx_ul];
+ sscanf(value, "%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd",
+ (int16_t*)&pPrbElem->nRBStart,
+ (int16_t*)&pPrbElem->nRBSize,
+ (int16_t*)&pPrbElem->nStartSymb,
+ (int16_t*)&pPrbElem->numSymb,
+ (int16_t*)&pPrbElem->nBeamIndex,
+ (int16_t*)&pPrbElem->bf_weight_update,
+ (int16_t*)&pPrbElem->compMethod,
+ (int16_t*)&pPrbElem->iqWidth,
+ (int16_t*)&pPrbElem->BeamFormingType);
+ printf("nPrbElemUl%d: ",section_idx_ul);
+ printf("nRBStart %d,nRBSize %d,nStartSymb %d,numSymb %d,nBeamIndex %d, bf_weight_update %d compMethod %d, iqWidth %d BeamFormingType %d\n",
+ pPrbElem->nRBStart,pPrbElem->nRBSize,pPrbElem->nStartSymb,pPrbElem->numSymb,pPrbElem->nBeamIndex, pPrbElem->bf_weight_update, pPrbElem->compMethod, pPrbElem->iqWidth, pPrbElem->BeamFormingType);
+ }
+ } else if(strncmp(key, KEY_EXTBFW_UL, strlen(KEY_EXTBFW_UL)) == 0) {
+ sscanf(key, "ExtBfwUl%u", §ion_idx_ul);
+ if(section_idx_ul >= config->p_PrbMapUl->nPrbElm) {
+ printf("section_idx %d of bfw exceeds nPrbElemUl\n",section_idx_ul);
+ }
+ else{
+ struct xran_prb_elm *pPrbElem = &config->p_PrbMapUl->prbMap[section_idx_ul];
+ sscanf(value, "%hhu,%hhu,%hhu,%hhu,%hhu,%hhu,%hhu",
+ (uint8_t*)&pPrbElem->bf_weight.numBundPrb,
+ (uint8_t*)&pPrbElem->bf_weight.numSetBFWs,
+ (uint8_t*)&pPrbElem->bf_weight.RAD,
+ (uint8_t*)&pPrbElem->bf_weight.disableBFWs,
+ (uint8_t*)&pPrbElem->bf_weight.bfwIqWidth,
+ (uint8_t*)&pPrbElem->bf_weight.bfwCompMeth,
+ (uint8_t*)&pPrbElem->bf_weight.extType);
+ printf(KEY_EXTBFW_UL"%d: ", section_idx_ul);
+ printf("numBundPrb %d, numSetBFW %d, RAD %d, disableBFW %d, bfwIqWidth %d, bfwCompMeth %d, extType %d\n",
+ pPrbElem->bf_weight.numBundPrb, pPrbElem->bf_weight.numSetBFWs, pPrbElem->bf_weight.RAD, pPrbElem->bf_weight.disableBFWs, pPrbElem->bf_weight.bfwIqWidth, pPrbElem->bf_weight.bfwCompMeth, pPrbElem->bf_weight.extType);
+ }
+ }else if (strcmp(key, KEY_NPRBELEM_DL ) == 0) {
+ config->p_PrbMapDl->nPrbElm = atoi(value);
+ if (config->p_PrbMapDl->nPrbElm > XRAN_MAX_SECTIONS_PER_SLOT)
+ {
+ printf("nPrbElm is larger than max allowed, invalid!\n");
+ config->p_PrbMapDl->nPrbElm = XRAN_MAX_SECTIONS_PER_SLOT;
+ }
+ printf("nPrbElemDl: %d\n",config->p_PrbMapDl->nPrbElm);
+ } else if (strncmp(key, KEY_PRBELEM_DL, strlen(KEY_PRBELEM_DL)) == 0) {
+ sscanf(key,"PrbElemDl%u",§ion_idx_dl);
+ if (section_idx_dl >= config->p_PrbMapDl->nPrbElm){
+ printf("section_idx %d exceeds nPrbElemDl\n",section_idx_dl);
+ }
+ else{
+ struct xran_prb_elm *pPrbElem = &config->p_PrbMapDl->prbMap[section_idx_dl];
+ sscanf(value, "%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd",
+ (int16_t*)&pPrbElem->nRBStart,
+ (int16_t*)&pPrbElem->nRBSize,
+ (int16_t*)&pPrbElem->nStartSymb,
+ (int16_t*)&pPrbElem->numSymb,
+ (int16_t*)&pPrbElem->nBeamIndex,
+ (int16_t*)&pPrbElem->bf_weight_update,
+ (int16_t*)&pPrbElem->compMethod,
+ (int16_t*)&pPrbElem->iqWidth,
+ (int16_t*)&pPrbElem->BeamFormingType,
+ (int16_t*)&pPrbElem->ScaleFactor,
+ (int16_t*)&pPrbElem->reMask);
+ printf("nPrbElemDl%d: ",section_idx_dl);
+ printf("nRBStart %d,nRBSize %d,nStartSymb %d,numSymb %d,nBeamIndex %d, bf_weight_update %d compMethod %d, iqWidth %d BeamFormingType %d ScaleFactor %d reMask %d\n",
+ pPrbElem->nRBStart,pPrbElem->nRBSize,pPrbElem->nStartSymb,pPrbElem->numSymb,pPrbElem->nBeamIndex, pPrbElem->bf_weight_update, pPrbElem->compMethod, pPrbElem->iqWidth, pPrbElem->BeamFormingType, pPrbElem->ScaleFactor, pPrbElem->reMask);
+ }
+ } else if(strncmp(key, KEY_EXTBFW_DL, strlen(KEY_EXTBFW_DL)) == 0) {
+ sscanf(key, "ExtBfwDl%u", §ion_idx_dl);
+ if(section_idx_dl >= config->p_PrbMapDl->nPrbElm) {
+ printf("section_idx %d of bfw exceeds nPrbElemUl\n",section_idx_dl);
+ }
+ else{
+ struct xran_prb_elm *pPrbElem = &config->p_PrbMapDl->prbMap[section_idx_dl];
+ sscanf(value, "%hhu,%hhu,%hhu,%hhu,%hhu,%hhu,%hhu",
+ (uint8_t*)&pPrbElem->bf_weight.numBundPrb,
+ (uint8_t*)&pPrbElem->bf_weight.numSetBFWs,
+ (uint8_t*)&pPrbElem->bf_weight.RAD,
+ (uint8_t*)&pPrbElem->bf_weight.disableBFWs,
+ (uint8_t*)&pPrbElem->bf_weight.bfwIqWidth,
+ (uint8_t*)&pPrbElem->bf_weight.bfwCompMeth,
+ (uint8_t*)&pPrbElem->bf_weight.extType);
+ printf(KEY_EXTBFW_DL"%d: ", section_idx_dl);
+ printf("numBundPrb %d, numSetBFW %d, RAD %d, disableBFW %d, bfwIqWidth %d, bfwCompMeth %d, extType %d\n",
+ pPrbElem->bf_weight.numBundPrb, pPrbElem->bf_weight.numSetBFWs, pPrbElem->bf_weight.RAD, pPrbElem->bf_weight.disableBFWs, pPrbElem->bf_weight.bfwIqWidth, pPrbElem->bf_weight.bfwCompMeth, pPrbElem->bf_weight.extType);
+ }
+ } else if (strcmp(key, KEY_NPRBELEM_SRS ) == 0) {
+ config->p_PrbMapSrs->nPrbElm = atoi(value);
+ if (config->p_PrbMapSrs->nPrbElm > XRAN_MAX_SECTIONS_PER_SLOT)
+ {
+ printf("nPrbElm is larger than max allowed, invalid!\n");
+ config->p_PrbMapSrs->nPrbElm = XRAN_MAX_SECTIONS_PER_SLOT;
+ }
+ printf("nPrbElemSrs: %d\n",config->p_PrbMapSrs->nPrbElm);
+ } else if (strncmp(key, KEY_PRBELEM_SRS, strlen(KEY_PRBELEM_SRS)) == 0) {
+ sscanf(key,"PrbElemSrs%u",§ion_idx_srs);
+ if (section_idx_srs >= config->p_PrbMapSrs->nPrbElm) {
+ printf("section_idx %d exceeds nPrbElemSrs\n",section_idx_srs);
+ }else {
+ struct xran_prb_elm *pPrbElem = &config->p_PrbMapSrs->prbMap[section_idx_srs];
+ sscanf(value, "%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd,%hd",
+ (int16_t*)&pPrbElem->nRBStart,
+ (int16_t*)&pPrbElem->nRBSize,
+ (int16_t*)&pPrbElem->nStartSymb,
+ (int16_t*)&pPrbElem->numSymb,
+ (int16_t*)&pPrbElem->nBeamIndex,
+ (int16_t*)&pPrbElem->bf_weight_update,
+ (int16_t*)&pPrbElem->compMethod,
+ (int16_t*)&pPrbElem->iqWidth,
+ (int16_t*)&pPrbElem->BeamFormingType);
+ printf("nPrbElemSrs%d: ",section_idx_srs);
+ printf("nRBStart %d,nRBSize %d,nStartSymb %d,numSymb %d,nBeamIndex %d, bf_weight_update %d compMethod %d, iqWidth %d BeamFormingType %d\n",
+ pPrbElem->nRBStart,pPrbElem->nRBSize,pPrbElem->nStartSymb,pPrbElem->numSymb,pPrbElem->nBeamIndex, pPrbElem->bf_weight_update, pPrbElem->compMethod, pPrbElem->iqWidth, pPrbElem->BeamFormingType);
+ }
+ } else if (strcmp(key, KEY_PRBMAP_BY_SYMB ) == 0) {
+ config->RunSlotPrbMapBySymbolEnable = atoi(value);
+ printf("RunSlotPrbMapBySymbolEnable: %d\n",config->RunSlotPrbMapBySymbolEnable);
+ } else if (strcmp(key, KEY_DSS_ENABLE ) == 0) {
+ config->dssEnable = atoi(value);
+ printf("dssEnable: %d\n",config->dssEnable);
+ } else if (strcmp(key, KEY_DSS_PERIOD ) == 0) {
+ config->dssPeriod = atoi(value);
+ printf("dssPeriod: %d\n",config->dssPeriod);
+ } else if (strcmp(key, KEY_TECHNOLOGY ) == 0) {
+ int i = 0;
+ sscanf(value, "%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx,%02hhx",
+ (uint8_t *)&config->technology[0],
+ (uint8_t *)&config->technology[1],
+ (uint8_t *)&config->technology[2],
+ (uint8_t *)&config->technology[3],
+ (uint8_t *)&config->technology[4],
+ (uint8_t *)&config->technology[5],
+ (uint8_t *)&config->technology[6],
+ (uint8_t *)&config->technology[7],
+ (uint8_t *)&config->technology[8],
+ (uint8_t *)&config->technology[9],
+ (uint8_t *)&config->technology[10],
+ (uint8_t *)&config->technology[11],
+ (uint8_t *)&config->technology[12],
+ (uint8_t *)&config->technology[13],
+ (uint8_t *)&config->technology[14]);
+ printf("technology:");
+ for( i=0; i<config->dssPeriod; i++) {
+ printf("%d ",config->technology[i]);
+ }
+ printf("\n");
+ }else {
+ printf("Unsupported configuration key [%s]\n", key);
+ return -1;
+ }
+ return 0;
+}
+
+static int
+fillUsecaseStruct(UsecaseConfig *config, const char *key, const char *value)
+{
+ if (strcmp(key, KEY_APP_MODE) == 0){
+ config->appMode = atoi(value);
+ printf("appMode %d \n", config->appMode);
+ } else if (strcmp(key, KEY_XU_NUM) == 0){
+ config->oXuNum = atoi(value);
+ printf("oXuNum %d \n", config->oXuNum);
+ } else if (strcmp(key, KEY_XU_ETH_LINK_SPD) == 0){
+ config->EthLinkSpeed = atoi(value);
+ printf("EthLinkSpeed %d \n", config->EthLinkSpeed);
+ } else if (strcmp(key, KEY_XU_ETH_LINE_NUM) == 0){
+ config->EthLinesNumber = atoi(value);
+ printf("EthLinkSpeed %d \n", config->EthLinesNumber);
+ } else if (strcmp(key, KEY_XU_RXQ_VF) == 0){
+ config->num_rxq = atoi(value);
+ printf("oXuRxqNumber %d \n", config->num_rxq);
+ } else if (strcmp(key, KEY_XU_CP_ON_ONE_VF) == 0) {
+ config->one_vf_cu_plane = atoi(value);
+ printf("oXuCPon1Vf %d \n", config->one_vf_cu_plane);
+ } else if (strcmp(key, KEY_IO_SLEEP) == 0) {
+ config->io_sleep = atoi(value);
+ printf("io_sleep %d \n", config->io_sleep);
+ } else if (strcmp(key, KEY_IO_CORE) == 0) {
+ config->io_core = atoi(value);
+ printf("io_core %d [core id]\n", config->io_core);
+ } else if (strcmp(key, KEY_MAIN_CORE) == 0) {
+ config->main_core = atoi(value);
+ printf("main_core %d [core id]\n", config->main_core);
+ } else if (strcmp(key, KEY_IO_WORKER) == 0) {
+ config->io_worker = strtoll(value, NULL, 0);
+ printf("io_worker 0x%lx [mask]\n", config->io_worker);
+ } else if (strcmp(key, KEY_IO_WORKER_64_127) == 0) {
+ config->io_worker_64_127 = strtoll(value, NULL, 0);
+ printf("io_worker_64_127 0x%lx [mask]\n", config->io_worker_64_127);
+ } else if (strcmp(key, KEY_SYSTEM_CORE) == 0) {
+ config->system_core = atoi(value);
+ printf("system core %d [core id]\n", config->system_core);
+ } else if (strcmp(key, KEY_IOVA_MODE) == 0) {
+ config->iova_mode = atoi(value);
+ printf("iova_mode %d\n", config->iova_mode);
+ } else if (strcmp(key, KEY_DPDK_MEM_SZ) == 0) {
+ config->dpdk_mem_sz = atoi(value);
+ printf("dpdk_mem_sz %d\n", config->dpdk_mem_sz);
+ } else if (strcmp(key, KEY_INSTANCE_ID) == 0) {
+ config->instance_id = atoi(value);
+ printf("instance_id %d\n", config->instance_id);
+ }else if (strncmp(key, KEY_FILE_O_XU_CFG, strlen(KEY_FILE_O_XU_CFG)) == 0) {
+ unsigned int o_xu_id = 0;
+ sscanf(key,"oXuCfgFile%02u",&o_xu_id);
+ if (o_xu_id >= XRAN_PORTS_NUM) {
+ printf("oXuCfgFile%d exceeds max O-XU supported\n",o_xu_id);
+ } else {
+ strncpy(&config->o_xu_cfg_file[o_xu_id][0], value, strlen(value));
+ printf("oXuCfgFile%d: %s\n",o_xu_id, config->o_xu_cfg_file[o_xu_id]);
+ }
+ } else if (strncmp(key, KEY_FILE_O_XU_BBU_CFG, strlen(KEY_FILE_O_XU_BBU_CFG)) == 0) {
+ strncpy(&config->o_xu_bbu_cfg_file[0], value, strlen(value));
+ printf("oXuBbuCfgFile: %s\n", config->o_xu_bbu_cfg_file);
+ } else if (strncmp(key, KEY_OWDM_INIT_EN, strlen(KEY_OWDM_INIT_EN)) == 0) {
+ config->owdmInitEn = atoi(value);
+ printf("owdmInitEn %d\n", config->owdmInitEn);
+ } else if (strncmp(key, KEY_OWDM_MEAS_METH, strlen(KEY_OWDM_MEAS_METH)) == 0) {
+ config->owdmMeasMeth = atoi(value);
+ printf("owdmMeasMeth %d\n", config->owdmMeasMeth);
+ } else if (strncmp(key, KEY_OWDM_NUM_SAMPS, strlen(KEY_OWDM_NUM_SAMPS)) == 0) {
+ config->owdmNumSamps = atoi(value);
+ printf("owdmNumSamps %d\n", config->owdmNumSamps);
+ } else if (strncmp(key, KEY_OWDM_FLTR_TYPE, strlen(KEY_OWDM_FLTR_TYPE)) == 0) {
+ config->owdmFltType = atoi(value);
+ printf("owdmFltType %d\n", config->owdmFltType);
+ } else if (strncmp(key, KEY_OWDM_RSP_TO, strlen(KEY_OWDM_RSP_TO)) == 0) {
+ config->owdmRspTo = atol(value);
+ printf("owdmRspTo %lu\n", config->owdmRspTo);
+ } else if (strncmp(key, KEY_OWDM_MEAS_ID, strlen(KEY_OWDM_MEAS_ID)) == 0) {
+ config->owdmMeasId = atoi(value);
+ printf("owdmMeasId %d\n", config->owdmMeasId);
+ } else if (strncmp(key, KEY_OWDM_EN, strlen(KEY_OWDM_EN)) == 0) {
+ config->owdmEnable = atoi(value);
+ printf("owdmEnable %d\n", config->owdmEnable);
+ } else if (strncmp(key, KEY_OWDM_PL_LENGTH, strlen(KEY_OWDM_PL_LENGTH)) == 0) {
+ config->owdmPlLength = atoi(value);
+ printf("owdmPlLength %d\n", config->owdmPlLength);
+ } else if (strncmp(key, KEY_OWDM_MEAS_ST, strlen(KEY_OWDM_MEAS_ST)) == 0) {
+ config->owdmMeasState = atoi(value);
+ printf("owdmMeasState %d\n", config->owdmMeasState);
+ } else if (strncmp(key, KEY_O_XU_PCIE_BUS, strlen(KEY_O_XU_PCIE_BUS)) == 0) {
+ unsigned int o_xu_id = 0;
+ unsigned int vf_num = 0;
+ sscanf(key,"PciBusAddoXu%02uVf%02u",&o_xu_id, &vf_num);
+ if (o_xu_id >= XRAN_PORTS_NUM || vf_num >= XRAN_VF_MAX){
+ printf("PciBusAddoXu%dVf%d exceeds max O-XU supported\n",o_xu_id, vf_num);
+ } else {
+ strncpy(&config->o_xu_pcie_bus_addr[o_xu_id][vf_num][0], value, strlen(value));
+ printf("PciBusAddoXu%dVf%d: %s\n",o_xu_id, vf_num, &config->o_xu_pcie_bus_addr[o_xu_id][vf_num][0]);
+ }
+ } else if (strncmp(key, KEY_O_XU_REM_MAC, strlen(KEY_O_XU_REM_MAC)) == 0) {
+ unsigned int xu_num = 0;
+ unsigned int vf_num = 0;
+
+ sscanf(key,"oXuRem%02uMac%02u",&xu_num, &vf_num);
+
+ if (xu_num >= XRAN_PORTS_NUM || vf_num >= XRAN_VF_MAX) {
+ printf("oXuRem%02uMac%02u exceeds max supported\n",xu_num, vf_num);
+ } else {
+ printf("oXuRem%02uMac%02u: %s\n",xu_num, vf_num, value);
+ sscanf(value, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", (uint8_t*)&config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[0],
+ (uint8_t*)&config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[1],
+ (uint8_t*)&config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[2],
+ (uint8_t*)&config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[3],
+ (uint8_t*)&config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[4],
+ (uint8_t*)&config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[5]);
+
+ printf("[xu %d vf %d]RU MAC address: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n",
+ xu_num,
+ vf_num,
+ config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[0],
+ config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[1],
+ config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[2],
+ config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[3],
+ config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[4],
+ config->remote_o_xu_addr[xu_num][vf_num].addr_bytes[5]);
+ }
+ }
+ else if (strncmp(key, KEY_DL_CP_BURST, strlen(KEY_DL_CP_BURST)) == 0) {
+ config->dlCpProcBurst = atoi(value);
+ printf("dlCpProcBurst %d\n", config->dlCpProcBurst);
+ } else if (strncmp(key, KEY_XRAN_MLOG_DIS, strlen(KEY_XRAN_MLOG_DIS)) == 0) {
+ config->mlogxrandisable = atoi(value);
+ printf("xranMlogDisable %d\n", config->mlogxrandisable);
+ } else {
+ printf("Unsupported configuration key [%s]\n", key);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+fillSlotStructAsCb(void* cbParam, const char *key, const char *value)
+{
+ struct slot_cfg_to_pars *p_slot_cfg = (struct slot_cfg_to_pars*) cbParam;
+ RuntimeConfig *config = p_slot_cfg->config;
+ int32_t direction = p_slot_cfg->direction;
+ int32_t slot_idx = p_slot_cfg->slot_idx;
+ uint32_t section_idx = 0;
+
+ //printf("Dir %d slot %d\n", direction, slot_idx);
+
+ if (strcmp(key, KEY_NPRBELEM_UL ) == 0) {
+ config->p_SlotPrbMap[direction][slot_idx]->nPrbElm = atoi(value);
+ if (config->p_SlotPrbMap[direction][slot_idx]->nPrbElm > XRAN_MAX_SECTIONS_PER_SLOT)
+ {
+ printf("nTddPeriod is larger than max allowed, invalid!\n");
+ config->p_SlotPrbMap[direction][slot_idx]->nPrbElm = XRAN_MAX_SECTIONS_PER_SLOT;
+ }
+ printf("nPrbElemUl: %d\n",config->p_SlotPrbMap[direction][slot_idx]->nPrbElm );
+ } else if (strncmp(key, KEY_PRBELEM_UL_ANT_M, strlen(KEY_PRBELEM_UL_ANT_M)) == 0) {
+ sscanf(key,"PrbElemUlAntCMask%u",§ion_idx);
+ if (section_idx >= config->p_SlotPrbMap[direction][slot_idx]->nPrbElm){
+ printf("section_idx %d exceeds nPrbElemul\n",section_idx);
+ }
+ else{
+ sscanf(value, "%lx",(uint64_t*)&config->SlotPrbAntCMask[direction][slot_idx][section_idx]);
+ printf("%s%u 0x%lx\n",KEY_PRBELEM_UL_ANT_M, section_idx, config->SlotPrbAntCMask[direction][slot_idx][section_idx]);
+ }
+ } else if (strncmp(key, KEY_PRBELEM_UL_CC_M, strlen(KEY_PRBELEM_UL_CC_M)) == 0) {
+ sscanf(key,"PrbElemUlCCMask%u",§ion_idx);
+ if (section_idx >= config->p_SlotPrbMap[direction][slot_idx]->nPrbElm){
+ printf("section_idx %d exceeds nPrbElemUL\n",section_idx);
+ }
+ else{
+ sscanf(value, "%02hx",(uint16_t*)&config->SlotPrbCCmask[direction][slot_idx][section_idx]);
+ printf("%s%u 0x%02x\n",KEY_PRBELEM_UL_CC_M, section_idx, config->SlotPrbCCmask[direction][slot_idx][section_idx]);
+ }
+ } else if (strncmp(key, KEY_PRBELEM_UL, strlen(KEY_PRBELEM_UL)) == 0) {
+ sscanf(key,"PrbElemUl%u",§ion_idx);
+ if (section_idx >= config->p_SlotPrbMap[direction][slot_idx]->nPrbElm) {
+ printf("section_idx %d exceeds nPrbElemUl\n",section_idx);
+ }
+ else {
+ struct xran_prb_elm *pPrbElem = &config->p_SlotPrbMap[direction][slot_idx]->prbMap[section_idx];