Merge remote-tracking branch 'origin/stability-7.2-improv' into integration_2024_w06
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
pkg_check_modules(dpdk REQUIRED libdpdk)
|
||||
pkg_check_modules(numa REQUIRED numa)
|
||||
|
||||
find_package(xran 5.1.1 EXACT REQUIRED) # E release -> 5
|
||||
find_package(xran 5.1.2 EXACT REQUIRED) # E release -> 5
|
||||
|
||||
# Ignore xran-specific warning: we don't care/can't change the following warning, so suppress
|
||||
# alignment 1 of 'struct XYZ' is less than 2
|
||||
|
||||
+71
-70
@@ -81,7 +81,11 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
|
||||
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
|
||||
const struct xran_fh_init *fh_init = &xran_ctx->fh_init;
|
||||
int num_ports = fh_init->xran_ports;
|
||||
static int rx_RU[XRAN_PORTS_NUM][20] = {0};
|
||||
|
||||
const struct xran_fh_config *fh_config = &xran_ctx->fh_cfg;
|
||||
const int slots_per_subframe = 1 << fh_config->frame_conf.nNumerology;
|
||||
|
||||
static int rx_RU[XRAN_PORTS_NUM][160] = {0};
|
||||
uint32_t rx_tti = callback_tag->slotiId;
|
||||
|
||||
tti = xran_get_slot_idx_from_tti(rx_tti, &frame, &subframe, &slot, &second);
|
||||
@@ -95,7 +99,7 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
|
||||
}
|
||||
first_rx_set = 1;
|
||||
if (first_read_set == 1) {
|
||||
slot2 = slot + (subframe << 1);
|
||||
slot2 = slot + (subframe * slots_per_subframe);
|
||||
rx_RU[ru_id][slot2] = 1;
|
||||
if (last_frame > 0 && frame > 0
|
||||
&& ((slot2 > 0 && last_frame != frame) || (slot2 == 0 && last_frame != ((1024 + frame - 1) & 1023))))
|
||||
@@ -164,14 +168,17 @@ int oai_physide_ul_full_slot_call_back(void *param)
|
||||
int read_prach_data(ru_info_t *ru, int frame, int slot)
|
||||
{
|
||||
/* calculate tti and subframe_id from frame, slot num */
|
||||
int tti = 20 * (frame) + (slot);
|
||||
uint32_t subframe = XranGetSubFrameNum(tti, 2, 10);
|
||||
uint32_t is_prach_slot = xran_is_prach_slot(0, subframe, (slot % 2));
|
||||
int sym_idx = 0;
|
||||
|
||||
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
|
||||
struct xran_prach_cp_config *pPrachCPConfig = &(xran_ctx->PrachCPConfig);
|
||||
struct xran_ru_config *ru_conf = &(xran_ctx->fh_cfg.ru_conf);
|
||||
int slots_per_frame = 10 << xran_ctx->fh_cfg.frame_conf.nNumerology;
|
||||
int slots_per_subframe = 1 << xran_ctx->fh_cfg.frame_conf.nNumerology;
|
||||
|
||||
int tti = slots_per_frame * (frame) + (slot);
|
||||
uint32_t subframe = slot / slots_per_subframe;
|
||||
uint32_t is_prach_slot = xran_is_prach_slot(0, subframe, (slot % slots_per_subframe));
|
||||
|
||||
int nb_rx_per_ru = ru->nb_rx / xran_ctx->fh_init.xran_ports;
|
||||
/* If it is PRACH slot, copy prach IQ from XRAN PRACH buffer to OAI PRACH buffer */
|
||||
@@ -275,17 +282,19 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
|
||||
#endif
|
||||
// return(0);
|
||||
|
||||
int tti = (*frame * 20) + *slot;
|
||||
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
|
||||
int slots_per_frame = 10 << xran_ctx->fh_cfg.frame_conf.nNumerology;
|
||||
|
||||
int tti = slots_per_frame * (*frame) + (*slot);
|
||||
|
||||
read_prach_data(ru, *frame, *slot);
|
||||
|
||||
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
|
||||
const struct xran_fh_init *fh_init = &xran_ctx->fh_init;
|
||||
int nPRBs = xran_ctx->fh_cfg.nULRBs;
|
||||
int fftsize = 1 << xran_ctx->fh_cfg.ru_conf.fftSize;
|
||||
|
||||
int slot_offset_rxdata = 3 & (*slot);
|
||||
uint32_t slot_size = 4 * 14 * 4096;
|
||||
uint32_t slot_size = 4 * 14 * fftsize;
|
||||
uint8_t *rx_data = (uint8_t *)ru->rxdataF[0];
|
||||
uint8_t *start_ptr = NULL;
|
||||
int nb_rx_per_ru = ru->nb_rx / fh_init->xran_ports;
|
||||
@@ -324,77 +333,71 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
|
||||
else
|
||||
pData = p_sec_desc->pData;
|
||||
ptr = pData;
|
||||
pos = (int32_t *)(start_ptr + (4 * sym_idx * 4096));
|
||||
pos = (int32_t *)(start_ptr + (4 * sym_idx * fftsize));
|
||||
if (ptr == NULL || pos == NULL)
|
||||
continue;
|
||||
|
||||
uint8_t *u8dptr;
|
||||
struct xran_prb_map *pRbMap = pPrbMap;
|
||||
AssertFatal(ptr != NULL, "ptr NULL\n");
|
||||
AssertFatal(pos != NULL, "pos NULL\n");
|
||||
if (1) {
|
||||
uint32_t idxElm = 0;
|
||||
u8dptr = (uint8_t *)ptr;
|
||||
int16_t payload_len = 0;
|
||||
|
||||
uint8_t *src = (uint8_t *)u8dptr;
|
||||
uint32_t idxElm = 0;
|
||||
uint8_t *src = (uint8_t *)ptr;
|
||||
int16_t payload_len = 0;
|
||||
|
||||
LOG_D(PHY, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm);
|
||||
for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
|
||||
LOG_D(PHY,
|
||||
"prbMap[%d] : PRBstart %d nPRBs %d\n",
|
||||
idxElm,
|
||||
pRbMap->prbMap[idxElm].nRBStart,
|
||||
pRbMap->prbMap[idxElm].nRBSize);
|
||||
pRbElm = &pRbMap->prbMap[idxElm];
|
||||
int pos_len = 0;
|
||||
int neg_len = 0;
|
||||
|
||||
if (pRbElm->nRBStart < (nPRBs >> 1)) // there are PRBs left of DC
|
||||
neg_len = min((nPRBs * 6) - (pRbElm->nRBStart * 12), pRbElm->nRBSize * N_SC_PER_PRB);
|
||||
pos_len = (pRbElm->nRBSize * N_SC_PER_PRB) - neg_len;
|
||||
LOG_D(PHY, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm);
|
||||
for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
|
||||
LOG_D(PHY,
|
||||
"prbMap[%d] : PRBstart %d nPRBs %d\n",
|
||||
idxElm,
|
||||
pRbMap->prbMap[idxElm].nRBStart,
|
||||
pRbMap->prbMap[idxElm].nRBSize);
|
||||
pRbElm = &pRbMap->prbMap[idxElm];
|
||||
int pos_len = 0;
|
||||
int neg_len = 0;
|
||||
|
||||
src = pData;
|
||||
// Calculation of the pointer for the section in the buffer.
|
||||
// positive half
|
||||
uint8_t *dst1 = (uint8_t *)(pos + (neg_len == 0 ? ((pRbElm->nRBStart * N_SC_PER_PRB) - (nPRBs * 6)) : 0));
|
||||
// negative half
|
||||
uint8_t *dst2 = (uint8_t *)(pos + (pRbElm->nRBStart * N_SC_PER_PRB) + fftsize - (nPRBs * 6));
|
||||
int32_t local_dst[pRbElm->nRBSize * N_SC_PER_PRB] __attribute__((aligned(64)));
|
||||
if (pRbElm->compMethod == XRAN_COMPMETHOD_NONE) {
|
||||
// NOTE: gcc 11 knows how to generate AVX2 for this!
|
||||
for (idx = 0; idx < pRbElm->nRBSize * N_SC_PER_PRB * 2; idx++)
|
||||
((int16_t *)local_dst)[idx] = ((int16_t)ntohs(((uint16_t *)src)[idx])) >> 2;
|
||||
memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
|
||||
memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
|
||||
} else if (pRbElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) {
|
||||
struct xranlib_decompress_request bfp_decom_req;
|
||||
struct xranlib_decompress_response bfp_decom_rsp;
|
||||
if (pRbElm->nRBStart < (nPRBs >> 1)) // there are PRBs left of DC
|
||||
neg_len = min((nPRBs * 6) - (pRbElm->nRBStart * 12), pRbElm->nRBSize * N_SC_PER_PRB);
|
||||
pos_len = (pRbElm->nRBSize * N_SC_PER_PRB) - neg_len;
|
||||
|
||||
payload_len = (3 * pRbElm->iqWidth + 1) * pRbElm->nRBSize;
|
||||
src = pData;
|
||||
// Calculation of the pointer for the section in the buffer.
|
||||
// positive half
|
||||
uint8_t *dst1 = (uint8_t *)(pos + (neg_len == 0 ? ((pRbElm->nRBStart * N_SC_PER_PRB) - (nPRBs * 6)) : 0));
|
||||
// negative half
|
||||
uint8_t *dst2 = (uint8_t *)(pos + (pRbElm->nRBStart * N_SC_PER_PRB) + fftsize - (nPRBs * 6));
|
||||
int32_t local_dst[pRbElm->nRBSize * N_SC_PER_PRB] __attribute__((aligned(64)));
|
||||
if (pRbElm->compMethod == XRAN_COMPMETHOD_NONE) {
|
||||
// NOTE: gcc 11 knows how to generate AVX2 for this!
|
||||
for (idx = 0; idx < pRbElm->nRBSize * N_SC_PER_PRB * 2; idx++)
|
||||
((int16_t *)local_dst)[idx] = ((int16_t)ntohs(((uint16_t *)src)[idx])) >> 2;
|
||||
memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
|
||||
memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
|
||||
} else if (pRbElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) {
|
||||
struct xranlib_decompress_request bfp_decom_req;
|
||||
struct xranlib_decompress_response bfp_decom_rsp;
|
||||
|
||||
memset(&bfp_decom_req, 0, sizeof(struct xranlib_decompress_request));
|
||||
memset(&bfp_decom_rsp, 0, sizeof(struct xranlib_decompress_response));
|
||||
payload_len = (3 * pRbElm->iqWidth + 1) * pRbElm->nRBSize;
|
||||
|
||||
bfp_decom_req.data_in = (int8_t *)src;
|
||||
bfp_decom_req.numRBs = pRbElm->nRBSize;
|
||||
bfp_decom_req.len = payload_len;
|
||||
bfp_decom_req.compMethod = pRbElm->compMethod;
|
||||
bfp_decom_req.iqWidth = pRbElm->iqWidth;
|
||||
memset(&bfp_decom_req, 0, sizeof(struct xranlib_decompress_request));
|
||||
memset(&bfp_decom_rsp, 0, sizeof(struct xranlib_decompress_response));
|
||||
|
||||
bfp_decom_rsp.data_out = (int16_t *)local_dst;
|
||||
bfp_decom_rsp.len = 0;
|
||||
bfp_decom_req.data_in = (int8_t *)src;
|
||||
bfp_decom_req.numRBs = pRbElm->nRBSize;
|
||||
bfp_decom_req.len = payload_len;
|
||||
bfp_decom_req.compMethod = pRbElm->compMethod;
|
||||
bfp_decom_req.iqWidth = pRbElm->iqWidth;
|
||||
|
||||
xranlib_decompress_avx512(&bfp_decom_req, &bfp_decom_rsp);
|
||||
memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
|
||||
memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
|
||||
outcnt++;
|
||||
} else {
|
||||
printf("pRbElm->compMethod == %d is not supported\n", pRbElm->compMethod);
|
||||
exit(-1);
|
||||
}
|
||||
bfp_decom_rsp.data_out = (int16_t *)local_dst;
|
||||
bfp_decom_rsp.len = 0;
|
||||
|
||||
xranlib_decompress_avx512(&bfp_decom_req, &bfp_decom_rsp);
|
||||
memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
|
||||
memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
|
||||
outcnt++;
|
||||
} else {
|
||||
printf("pRbElm->compMethod == %d is not supported\n", pRbElm->compMethod);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} // sym_ind
|
||||
} // ant_ind
|
||||
@@ -457,9 +460,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
.sBufferList.pBuffers->pData;
|
||||
struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData;
|
||||
ptr = pData;
|
||||
pos =
|
||||
&ru->txdataF_BF[ant_id][sym_idx * 4096 /*fp->ofdm_symbol_size*/]; // We had to use a different ru structure than benetel
|
||||
// so the access to the buffer is not the same.
|
||||
pos = &ru->txdataF_BF[ant_id][sym_idx * fftsize];
|
||||
|
||||
uint8_t *u8dptr;
|
||||
struct xran_prb_map *pRbMap = pPrbMap;
|
||||
|
||||
@@ -500,7 +500,7 @@ static bool set_fh_io_cfg(struct xran_io_cfg *io_cfg, const paramdef_t *fhip, in
|
||||
io_cfg->dpdkIoVaMode = 0; /* IOVA mode */
|
||||
io_cfg->dpdkMemorySize = 0; /* DPDK memory size */
|
||||
io_cfg->core = *gpd(fhip, nump, ORAN_CONFIG_IO_CORE)->iptr;
|
||||
io_cfg->system_core = 0; /* TODO how called in sample app? */
|
||||
io_cfg->system_core = *gpd(fhip, nump, ORAN_CONFIG_SYSTEM_CORE)->iptr;
|
||||
io_cfg->pkt_proc_core = get_u64_mask(gpd(fhip, nump, ORAN_CONFIG_WORKER_CORES));
|
||||
io_cfg->pkt_proc_core_64_127 = 0x0; // bitmap 0 -> no core
|
||||
io_cfg->pkt_aux_core = 0; /* sapmle app says 0 = "do not start" */
|
||||
@@ -684,9 +684,6 @@ static bool set_fh_prach_config(const openair0_config_t *oai0,
|
||||
{
|
||||
const split7_config_t *s7cfg = &oai0->split7;
|
||||
|
||||
// for FR2, need at least to update nPrachFilterIdx
|
||||
AssertFatal(oai0->nr_band < 100, "can only handle FR1!\n");
|
||||
|
||||
prach_config->nPrachConfIdx = s7cfg->prach_index;
|
||||
prach_config->nPrachSubcSpacing = oai0->nr_scs_for_raster;
|
||||
prach_config->nPrachZeroCorrConf = 0;
|
||||
@@ -694,7 +691,10 @@ static bool set_fh_prach_config(const openair0_config_t *oai0,
|
||||
prach_config->nPrachRootSeqIdx = 0;
|
||||
prach_config->nPrachFreqStart = s7cfg->prach_freq_start;
|
||||
prach_config->nPrachFreqOffset = (s7cfg->prach_freq_start * 12 - oai0->num_rb_dl * 6) * 2;
|
||||
prach_config->nPrachFilterIdx = get_prach_filterindex_fr1(oai0->duplex_mode, s7cfg->prach_index);
|
||||
if (oai0->nr_band < 100)
|
||||
prach_config->nPrachFilterIdx = get_prach_filterindex_fr1(oai0->duplex_mode, s7cfg->prach_index);
|
||||
else
|
||||
prach_config->nPrachFilterIdx = XRAN_FILTERINDEX_PRACH_ABC;
|
||||
prach_config->startSymId = 0;
|
||||
prach_config->lastSymId = 0;
|
||||
prach_config->startPrbc = 0;
|
||||
|
||||
@@ -78,32 +78,6 @@ static uint32_t get_nFpgaToSW_FTH_RxBufferLen(int mu)
|
||||
}
|
||||
}
|
||||
|
||||
/* is this necessary?
|
||||
int32_t set_main_core(uint32_t main_core)
|
||||
{
|
||||
struct sched_param sched_param;
|
||||
cpu_set_t cpuset;
|
||||
int32_t result = 0;
|
||||
memset(&sched_param, 0, sizeof(struct sched_param));
|
||||
// set main thread affinity mask to CPU2
|
||||
sched_param.sched_priority = 99;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
||||
printf("This system has %d processors configured and %d processors available.\n", get_nprocs_conf(), get_nprocs());
|
||||
|
||||
if (main_core < get_nprocs_conf())
|
||||
CPU_SET(main_core, &cpuset);
|
||||
else
|
||||
return -1;
|
||||
|
||||
if ((result = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset))) {
|
||||
printf("pthread_setaffinity_np failed: coreId = 2, result = %d\n", result);
|
||||
}
|
||||
printf("%s [CPU %2d] [PID: %6d]\n", __FUNCTION__, sched_getcpu(), getpid());
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
|
||||
static struct xran_prb_map get_xran_prb_map_dl(const struct xran_fh_config *f)
|
||||
{
|
||||
struct xran_prb_map prbmap = {
|
||||
@@ -432,11 +406,6 @@ int *oai_oran_initialize(const openair0_config_t *openair0_cfg)
|
||||
print_fh_config(&xran_fh_config[o_xu_id]);
|
||||
}
|
||||
|
||||
// if ((xret = set_main_core(init.something)) < 0) {
|
||||
// printf("set_main_core() failed %d\n", xret);
|
||||
// exit(-1);
|
||||
// }
|
||||
|
||||
xret = xran_init(0, NULL, &init, NULL, &gxran_handle);
|
||||
if (xret != XRAN_STATUS_SUCCESS) {
|
||||
printf("xran_init failed %d\n", xret);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#define CONFIG_STRING_ORAN "fhi_72"
|
||||
|
||||
#define ORAN_CONFIG_DPDK_DEVICES "dpdk_devices"
|
||||
#define ORAN_CONFIG_SYSTEM_CORE "system_core"
|
||||
#define ORAN_CONFIG_IO_CORE "io_core"
|
||||
#define ORAN_CONFIG_WORKER_CORES "worker_cores"
|
||||
#define ORAN_CONFIG_DU_ADDR "du_addr"
|
||||
@@ -42,6 +43,7 @@
|
||||
// TODO: ethernet addr check
|
||||
#define ORAN_GLOBALPARAMS_DESC { \
|
||||
{ORAN_CONFIG_DPDK_DEVICES, "PCI addr of devices for DPDK\n", PARAMFLAG_MANDATORY, .strlistptr=NULL, .defstrlistval=NULL, TYPE_STRINGLIST, 0}, \
|
||||
{ORAN_CONFIG_SYSTEM_CORE, "DPDK control threads core\n", PARAMFLAG_MANDATORY, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
|
||||
{ORAN_CONFIG_IO_CORE, "DPDK Core used for IO\n", PARAMFLAG_MANDATORY, .iptr=NULL, .defintval=4, TYPE_INT, 0}, \
|
||||
{ORAN_CONFIG_WORKER_CORES, "CPU Cores to use for workers\n", PARAMFLAG_MANDATORY, .uptr=NULL, .defintarrayval=NULL,TYPE_UINTARRAY, 0}, \
|
||||
{ORAN_CONFIG_DU_ADDR, "Ether addr of DU\n", PARAMFLAG_MANDATORY, .strlistptr=NULL, .defstrlistval=NULL, TYPE_STRINGLIST, 0}, \
|
||||
|
||||
@@ -209,10 +209,11 @@ void oran_fh_if4p5_south_in(RU_t *ru, int *frame, int *slot)
|
||||
printf("ORAN: %d.%d ORAN_fh_if4p5_south_in ERROR in RX function \n", f, sl);
|
||||
}
|
||||
|
||||
int slots_per_frame = 10 << (ru->openair0_cfg.nr_scs_for_raster);
|
||||
proc->tti_rx = sl;
|
||||
proc->frame_rx = f;
|
||||
proc->tti_tx = (sl + sl_ahead) % 20;
|
||||
proc->frame_tx = (sl > (19 - sl_ahead)) ? (f + 1) & 1023 : f;
|
||||
proc->tti_tx = (sl + sl_ahead) % slots_per_frame;
|
||||
proc->frame_tx = (sl > (slots_per_frame - 1 - sl_ahead)) ? (f + 1) & 1023 : f;
|
||||
|
||||
if (proc->first_rx == 0) {
|
||||
if (proc->tti_rx != *slot) {
|
||||
|
||||
Reference in New Issue
Block a user