Commit 713c84e4 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/stability-7.2-improv' into integration_2024_w06

parents 9890410a 3bb9e6b0
...@@ -107,6 +107,8 @@ if (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.0") ...@@ -107,6 +107,8 @@ if (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.0")
set(xran_VERSION 5.1.0) set(xran_VERSION 5.1.0)
elseif (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.1") elseif (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.1")
set(xran_VERSION 5.1.1) set(xran_VERSION 5.1.1)
elseif (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.2")
set(xran_VERSION 5.1.2)
endif() endif()
unset(xran_VERSION_LINE) unset(xran_VERSION_LINE)
unset(xran_VERSION_STRING) unset(xran_VERSION_STRING)
......
diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h
index 7508117..a93c085 100644 index 7508117..0dbe0bd 100644
--- a/fhi_lib/app/src/common.h --- a/fhi_lib/app/src/common.h
+++ b/fhi_lib/app/src/common.h +++ b/fhi_lib/app/src/common.h
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
...@@ -7,12 +7,12 @@ index 7508117..a93c085 100644 ...@@ -7,12 +7,12 @@ index 7508117..a93c085 100644
#include <rte_mbuf.h> #include <rte_mbuf.h>
-#define VERSIONX "oran_e_maintenance_release_v1.0" -#define VERSIONX "oran_e_maintenance_release_v1.0"
+#define VERSIONX "oran_e_maintenance_release_v1.1" +#define VERSIONX "oran_e_maintenance_release_v1.2"
#define APP_O_DU 0 #define APP_O_DU 0
#define APP_O_RU 1 #define APP_O_RU 1
diff --git a/fhi_lib/lib/Makefile b/fhi_lib/lib/Makefile diff --git a/fhi_lib/lib/Makefile b/fhi_lib/lib/Makefile
index de141bf..5bcde3d 100644 index de141bf..c12b912 100644
--- a/fhi_lib/lib/Makefile --- a/fhi_lib/lib/Makefile
+++ b/fhi_lib/lib/Makefile +++ b/fhi_lib/lib/Makefile
@@ -23,11 +23,11 @@ MYCUSTOMSPACE1='------------------------------------------------------------' @@ -23,11 +23,11 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
...@@ -30,6 +30,15 @@ index de141bf..5bcde3d 100644 ...@@ -30,6 +30,15 @@ index de141bf..5bcde3d 100644
OBJDUMP := objdump OBJDUMP := objdump
ifeq ($(SHELL),cmd.exe) ifeq ($(SHELL),cmd.exe)
@@ -57,7 +57,7 @@ endif
RTE_TARGET ?= x86_64-native-linux-icc
-RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
API_DIR := $(PROJECT_DIR)/api
SRC_DIR := $(PROJECT_DIR)/src
ETH_DIR := $(PROJECT_DIR)/ethernet
@@ -95,8 +95,7 @@ CPP_SRC = $(SRC_DIR)/xran_compression.cpp \ @@ -95,8 +95,7 @@ CPP_SRC = $(SRC_DIR)/xran_compression.cpp \
$(SRC_DIR)/xran_bfp_cplane32.cpp \ $(SRC_DIR)/xran_bfp_cplane32.cpp \
$(SRC_DIR)/xran_bfp_cplane64.cpp \ $(SRC_DIR)/xran_bfp_cplane64.cpp \
...@@ -117,10 +126,18 @@ index 7d3afc5..3e00c5a 100644 ...@@ -117,10 +126,18 @@ index 7d3afc5..3e00c5a 100644
uint16_t *num_prbu, uint16_t *num_prbu,
uint16_t *start_prbu, uint16_t *start_prbu,
diff --git a/fhi_lib/lib/ethernet/ethdi.c b/fhi_lib/lib/ethernet/ethdi.c diff --git a/fhi_lib/lib/ethernet/ethdi.c b/fhi_lib/lib/ethernet/ethdi.c
index b6ba257..74b3c26 100644 index b6ba257..b53325f 100644
--- a/fhi_lib/lib/ethernet/ethdi.c --- a/fhi_lib/lib/ethernet/ethdi.c
+++ b/fhi_lib/lib/ethernet/ethdi.c +++ b/fhi_lib/lib/ethernet/ethdi.c
@@ -479,11 +479,13 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg, @@ -335,6 +335,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
uint16_t count;
char *argv[] = { name, core_mask, "-n2", iova_mode, socket_mem, socket_limit, "--proc-type=auto",
+ "--no-telemetry",
"--file-prefix", name, "-a0000:00:00.0", bbdev_wdev, bbdev_vdev};
@@ -479,11 +480,13 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
ctx->tx_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING_TRX, ctx->tx_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING_TRX,
rte_lcore_to_socket_id(*lcore_id), RING_F_SC_DEQ); rte_lcore_to_socket_id(*lcore_id), RING_F_SC_DEQ);
PANIC_ON(ctx->tx_ring[i] == NULL, "failed to allocate rx ring"); PANIC_ON(ctx->tx_ring[i] == NULL, "failed to allocate rx ring");
...@@ -134,7 +151,7 @@ index b6ba257..74b3c26 100644 ...@@ -134,7 +151,7 @@ index b6ba257..74b3c26 100644
} }
} }
} else { } else {
@@ -553,7 +555,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg, @@ -553,7 +556,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
ctx->up_dl_pkt_gen_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING, ctx->up_dl_pkt_gen_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING,
rte_lcore_to_socket_id(*lcore_id), /*RING_F_SC_DEQ*/0); rte_lcore_to_socket_id(*lcore_id), /*RING_F_SC_DEQ*/0);
PANIC_ON(ctx->up_dl_pkt_gen_ring[i] == NULL, "failed to allocate dl gen ring"); PANIC_ON(ctx->up_dl_pkt_gen_ring[i] == NULL, "failed to allocate dl gen ring");
......
This diff is collapsed.
...@@ -1216,6 +1216,18 @@ void *ru_thread( void *param ) { ...@@ -1216,6 +1216,18 @@ void *ru_thread( void *param ) {
malloc_IF4p5_buffer(ru); malloc_IF4p5_buffer(ru);
} }
int cpu = sched_getcpu();
if (ru->ru_thread_core > -1 && cpu != ru->ru_thread_core) {
/* we start the ru_thread using threadCreate(), which already sets CPU
* affinity; let's force it here again as per feature request #732 */
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(ru->ru_thread_core, &cpuset);
int ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
AssertFatal(ret == 0, "Error in pthread_getaffinity_np(): ret: %d, errno: %d", ret, errno);
LOG_I(PHY, "RU %d: manually set CPU affinity to CPU %d\n", ru->idx, ru->ru_thread_core);
}
LOG_I(PHY,"Starting IF interface for RU %d, nb_rx %d\n",ru->idx,ru->nb_rx); LOG_I(PHY,"Starting IF interface for RU %d, nb_rx %d\n",ru->idx,ru->nb_rx);
AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n"); AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n");
......
...@@ -358,8 +358,20 @@ static uint32_t schedule_control_sib1(module_id_t module_id, ...@@ -358,8 +358,20 @@ static uint32_t schedule_control_sib1(module_id_t module_id,
rbSize, tda_info->nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3; rbSize, tda_info->nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3;
} while (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes); } while (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes);
AssertFatal(TBS>=gNB_mac->sched_ctrlCommon->num_total_bytes,"Couldn't allocate enough resources for %d bytes in SIB1 PDSCH\n", if (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes) {
gNB_mac->sched_ctrlCommon->num_total_bytes); for (int rb = 0; rb < bwpSize; rb++)
LOG_I(NR_MAC, "vrb_map[%d] %x\n", rbStart + rb, vrb_map[rbStart + rb]);
}
AssertFatal(
TBS >= gNB_mac->sched_ctrlCommon->num_total_bytes,
"Couldn't allocate enough resources for %d bytes in SIB1 PDSCH (rbStart %d, rbSize %d, bwpSize %d SLmask %x - [%d,%d])\n",
gNB_mac->sched_ctrlCommon->num_total_bytes,
rbStart,
rbSize,
bwpSize,
SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols),
tda_info->startSymbolIndex,
tda_info->nrOfSymbols);
pdsch->rbSize = rbSize; pdsch->rbSize = rbSize;
pdsch->rbStart = 0; pdsch->rbStart = 0;
......
...@@ -185,7 +185,16 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac, ...@@ -185,7 +185,16 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac,
NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[pucch_index]; NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[pucch_index];
if (!curr_pucch->active) if (!curr_pucch->active)
continue; continue;
DevAssert(frameP == curr_pucch->frame && slotP == curr_pucch->ul_slot); if (frameP != curr_pucch->frame || slotP != curr_pucch->ul_slot) {
LOG_E(NR_MAC,
"PUCCH frame/slot mismatch: current %4d.%2d vs. request %4d.%2d: not scheduling PUCCH\n",
curr_pucch->frame,
curr_pucch->ul_slot,
frameP,
slotP);
memset(curr_pucch, 0, sizeof(*curr_pucch));;
continue;
}
const uint16_t O_ack = curr_pucch->dai_c; const uint16_t O_ack = curr_pucch->dai_c;
const uint16_t O_csi = curr_pucch->csi_bits; const uint16_t O_csi = curr_pucch->csi_bits;
...@@ -1296,8 +1305,13 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac, ...@@ -1296,8 +1305,13 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac,
return pucch_index; // index of current PUCCH structure return pucch_index; // index of current PUCCH structure
} }
else if (curr_pucch->active) { else if (curr_pucch->active) {
AssertFatal(1==0, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n", LOG_E(NR_MAC,
curr_pucch->frame, curr_pucch->ul_slot, pucch_frame, pucch_slot); "current PUCCH inactive: curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n",
curr_pucch->frame,
curr_pucch->ul_slot,
pucch_frame,
pucch_slot);
memset(curr_pucch, 0, sizeof(*curr_pucch));
} }
else { // unoccupied occasion else { // unoccupied occasion
// checking if in ul_slot the resources potentially to be assigned to this PUCCH are available // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available
...@@ -1392,8 +1406,13 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) ...@@ -1392,8 +1406,13 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot)
curr_pucch->resource_indicator == idx) curr_pucch->resource_indicator == idx)
curr_pucch->sr_flag = true; curr_pucch->sr_flag = true;
else if (curr_pucch->active) { else if (curr_pucch->active) {
AssertFatal(1==0, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with SR function frame.slot %d.%d\n", LOG_E(NR_MAC,
curr_pucch->frame, curr_pucch->ul_slot, SFN, slot); "current PUCCH inactive: curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n",
curr_pucch->frame,
curr_pucch->ul_slot,
SFN,
slot);
memset(curr_pucch, 0, sizeof(*curr_pucch));
continue; continue;
} }
else { else {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
pkg_check_modules(dpdk REQUIRED libdpdk) pkg_check_modules(dpdk REQUIRED libdpdk)
pkg_check_modules(numa REQUIRED numa) 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 # 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 # alignment 1 of 'struct XYZ' is less than 2
......
...@@ -81,7 +81,11 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status) ...@@ -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(); struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
const struct xran_fh_init *fh_init = &xran_ctx->fh_init; const struct xran_fh_init *fh_init = &xran_ctx->fh_init;
int num_ports = fh_init->xran_ports; 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; uint32_t rx_tti = callback_tag->slotiId;
tti = xran_get_slot_idx_from_tti(rx_tti, &frame, &subframe, &slot, &second); 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) ...@@ -95,7 +99,7 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
} }
first_rx_set = 1; first_rx_set = 1;
if (first_read_set == 1) { if (first_read_set == 1) {
slot2 = slot + (subframe << 1); slot2 = slot + (subframe * slots_per_subframe);
rx_RU[ru_id][slot2] = 1; rx_RU[ru_id][slot2] = 1;
if (last_frame > 0 && frame > 0 if (last_frame > 0 && frame > 0
&& ((slot2 > 0 && last_frame != frame) || (slot2 == 0 && last_frame != ((1024 + frame - 1) & 1023)))) && ((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) ...@@ -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) int read_prach_data(ru_info_t *ru, int frame, int slot)
{ {
/* calculate tti and subframe_id from frame, slot num */ /* 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; int sym_idx = 0;
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx(); struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
struct xran_prach_cp_config *pPrachCPConfig = &(xran_ctx->PrachCPConfig); struct xran_prach_cp_config *pPrachCPConfig = &(xran_ctx->PrachCPConfig);
struct xran_ru_config *ru_conf = &(xran_ctx->fh_cfg.ru_conf); 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; 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 */ /* 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) ...@@ -275,17 +282,19 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
#endif #endif
// return(0); // 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); 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; const struct xran_fh_init *fh_init = &xran_ctx->fh_init;
int nPRBs = xran_ctx->fh_cfg.nULRBs; int nPRBs = xran_ctx->fh_cfg.nULRBs;
int fftsize = 1 << xran_ctx->fh_cfg.ru_conf.fftSize; int fftsize = 1 << xran_ctx->fh_cfg.ru_conf.fftSize;
int slot_offset_rxdata = 3 & (*slot); 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 *rx_data = (uint8_t *)ru->rxdataF[0];
uint8_t *start_ptr = NULL; uint8_t *start_ptr = NULL;
int nb_rx_per_ru = ru->nb_rx / fh_init->xran_ports; 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) ...@@ -324,77 +333,71 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
else else
pData = p_sec_desc->pData; pData = p_sec_desc->pData;
ptr = 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; 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;
LOG_D(PHY, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm); uint32_t idxElm = 0;
for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) { uint8_t *src = (uint8_t *)ptr;
LOG_D(PHY, int16_t payload_len = 0;
"prbMap[%d] : PRBstart %d nPRBs %d\n",
idxElm,
pRbMap->prbMap[idxElm].nRBStart, LOG_D(PHY, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm);
pRbMap->prbMap[idxElm].nRBSize); for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
pRbElm = &pRbMap->prbMap[idxElm]; LOG_D(PHY,
int pos_len = 0; "prbMap[%d] : PRBstart %d nPRBs %d\n",
int neg_len = 0; idxElm,
pRbMap->prbMap[idxElm].nRBStart,
if (pRbElm->nRBStart < (nPRBs >> 1)) // there are PRBs left of DC pRbMap->prbMap[idxElm].nRBSize);
neg_len = min((nPRBs * 6) - (pRbElm->nRBStart * 12), pRbElm->nRBSize * N_SC_PER_PRB); pRbElm = &pRbMap->prbMap[idxElm];
pos_len = (pRbElm->nRBSize * N_SC_PER_PRB) - neg_len; int pos_len = 0;
int neg_len = 0;
src = pData;
// Calculation of the pointer for the section in the buffer. if (pRbElm->nRBStart < (nPRBs >> 1)) // there are PRBs left of DC
// positive half neg_len = min((nPRBs * 6) - (pRbElm->nRBStart * 12), pRbElm->nRBSize * N_SC_PER_PRB);
uint8_t *dst1 = (uint8_t *)(pos + (neg_len == 0 ? ((pRbElm->nRBStart * N_SC_PER_PRB) - (nPRBs * 6)) : 0)); pos_len = (pRbElm->nRBSize * N_SC_PER_PRB) - neg_len;
// negative half
uint8_t *dst2 = (uint8_t *)(pos + (pRbElm->nRBStart * N_SC_PER_PRB) + fftsize - (nPRBs * 6)); src = pData;
int32_t local_dst[pRbElm->nRBSize * N_SC_PER_PRB] __attribute__((aligned(64))); // Calculation of the pointer for the section in the buffer.
if (pRbElm->compMethod == XRAN_COMPMETHOD_NONE) { // positive half
// NOTE: gcc 11 knows how to generate AVX2 for this! uint8_t *dst1 = (uint8_t *)(pos + (neg_len == 0 ? ((pRbElm->nRBStart * N_SC_PER_PRB) - (nPRBs * 6)) : 0));
for (idx = 0; idx < pRbElm->nRBSize * N_SC_PER_PRB * 2; idx++) // negative half
((int16_t *)local_dst)[idx] = ((int16_t)ntohs(((uint16_t *)src)[idx])) >> 2; uint8_t *dst2 = (uint8_t *)(pos + (pRbElm->nRBStart * N_SC_PER_PRB) + fftsize - (nPRBs * 6));
memcpy((void *)dst2, (void *)local_dst, neg_len * 4); int32_t local_dst[pRbElm->nRBSize * N_SC_PER_PRB] __attribute__((aligned(64)));
memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4); if (pRbElm->compMethod == XRAN_COMPMETHOD_NONE) {
} else if (pRbElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) { // NOTE: gcc 11 knows how to generate AVX2 for this!
struct xranlib_decompress_request bfp_decom_req; for (idx = 0; idx < pRbElm->nRBSize * N_SC_PER_PRB * 2; idx++)
struct xranlib_decompress_response bfp_decom_rsp; ((int16_t *)local_dst)[idx] = ((int16_t)ntohs(((uint16_t *)src)[idx])) >> 2;
memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
payload_len = (3 * pRbElm->iqWidth + 1) * pRbElm->nRBSize; memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
} else if (pRbElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) {
memset(&bfp_decom_req, 0, sizeof(struct xranlib_decompress_request)); struct xranlib_decompress_request bfp_decom_req;
memset(&bfp_decom_rsp, 0, sizeof(struct xranlib_decompress_response)); struct xranlib_decompress_response bfp_decom_rsp;
bfp_decom_req.data_in = (int8_t *)src; payload_len = (3 * pRbElm->iqWidth + 1) * pRbElm->nRBSize;
bfp_decom_req.numRBs = pRbElm->nRBSize;
bfp_decom_req.len = payload_len; memset(&bfp_decom_req, 0, sizeof(struct xranlib_decompress_request));
bfp_decom_req.compMethod = pRbElm->compMethod; memset(&bfp_decom_rsp, 0, sizeof(struct xranlib_decompress_response));
bfp_decom_req.iqWidth = pRbElm->iqWidth;
bfp_decom_req.data_in = (int8_t *)src;
bfp_decom_rsp.data_out = (int16_t *)local_dst; bfp_decom_req.numRBs = pRbElm->nRBSize;
bfp_decom_rsp.len = 0; bfp_decom_req.len = payload_len;
bfp_decom_req.compMethod = pRbElm->compMethod;
xranlib_decompress_avx512(&bfp_decom_req, &bfp_decom_rsp); bfp_decom_req.iqWidth = pRbElm->iqWidth;
memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4); bfp_decom_rsp.data_out = (int16_t *)local_dst;
outcnt++; bfp_decom_rsp.len = 0;
} else {
printf("pRbElm->compMethod == %d is not supported\n", pRbElm->compMethod); xranlib_decompress_avx512(&bfp_decom_req, &bfp_decom_rsp);
exit(-1); 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 } // sym_ind
} // ant_ind } // ant_ind
...@@ -457,9 +460,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp) ...@@ -457,9 +460,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
.sBufferList.pBuffers->pData; .sBufferList.pBuffers->pData;
struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData; struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData;
ptr = pData; ptr = pData;
pos = pos = &ru->txdataF_BF[ant_id][sym_idx * fftsize];
&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.
uint8_t *u8dptr; uint8_t *u8dptr;
struct xran_prb_map *pRbMap = pPrbMap; 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 ...@@ -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->dpdkIoVaMode = 0; /* IOVA mode */
io_cfg->dpdkMemorySize = 0; /* DPDK memory size */ io_cfg->dpdkMemorySize = 0; /* DPDK memory size */
io_cfg->core = *gpd(fhip, nump, ORAN_CONFIG_IO_CORE)->iptr; 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 = 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_proc_core_64_127 = 0x0; // bitmap 0 -> no core
io_cfg->pkt_aux_core = 0; /* sapmle app says 0 = "do not start" */ 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, ...@@ -684,9 +684,6 @@ static bool set_fh_prach_config(const openair0_config_t *oai0,
{ {
const split7_config_t *s7cfg = &oai0->split7; 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->nPrachConfIdx = s7cfg->prach_index;
prach_config->nPrachSubcSpacing = oai0->nr_scs_for_raster; prach_config->nPrachSubcSpacing = oai0->nr_scs_for_raster;
prach_config->nPrachZeroCorrConf = 0; prach_config->nPrachZeroCorrConf = 0;
...@@ -694,7 +691,10 @@ static bool set_fh_prach_config(const openair0_config_t *oai0, ...@@ -694,7 +691,10 @@ static bool set_fh_prach_config(const openair0_config_t *oai0,
prach_config->nPrachRootSeqIdx = 0; prach_config->nPrachRootSeqIdx = 0;
prach_config->nPrachFreqStart = s7cfg->prach_freq_start; prach_config->nPrachFreqStart = s7cfg->prach_freq_start;
prach_config->nPrachFreqOffset = (s7cfg->prach_freq_start * 12 - oai0->num_rb_dl * 6) * 2; 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->startSymId = 0;
prach_config->lastSymId = 0; prach_config->lastSymId = 0;
prach_config->startPrbc = 0; prach_config->startPrbc = 0;
......
...@@ -78,32 +78,6 @@ static uint32_t get_nFpgaToSW_FTH_RxBufferLen(int mu) ...@@ -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) static struct xran_prb_map get_xran_prb_map_dl(const struct xran_fh_config *f)
{ {
struct xran_prb_map prbmap = { struct xran_prb_map prbmap = {
...@@ -432,11 +406,6 @@ int *oai_oran_initialize(const openair0_config_t *openair0_cfg) ...@@ -432,11 +406,6 @@ int *oai_oran_initialize(const openair0_config_t *openair0_cfg)
print_fh_config(&xran_fh_config[o_xu_id]); 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); xret = xran_init(0, NULL, &init, NULL, &gxran_handle);
if (xret != XRAN_STATUS_SUCCESS) { if (xret != XRAN_STATUS_SUCCESS) {
printf("xran_init failed %d\n", xret); printf("xran_init failed %d\n", xret);
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#define CONFIG_STRING_ORAN "fhi_72" #define CONFIG_STRING_ORAN "fhi_72"
#define ORAN_CONFIG_DPDK_DEVICES "dpdk_devices" #define ORAN_CONFIG_DPDK_DEVICES "dpdk_devices"
#define ORAN_CONFIG_SYSTEM_CORE "system_core"
#define ORAN_CONFIG_IO_CORE "io_core" #define ORAN_CONFIG_IO_CORE "io_core"
#define ORAN_CONFIG_WORKER_CORES "worker_cores" #define ORAN_CONFIG_WORKER_CORES "worker_cores"
#define ORAN_CONFIG_DU_ADDR "du_addr" #define ORAN_CONFIG_DU_ADDR "du_addr"
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
// TODO: ethernet addr check // TODO: ethernet addr check
#define ORAN_GLOBALPARAMS_DESC { \ #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_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_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_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}, \ {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) ...@@ -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); 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->tti_rx = sl;
proc->frame_rx = f; proc->frame_rx = f;
proc->tti_tx = (sl + sl_ahead) % 20; proc->tti_tx = (sl + sl_ahead) % slots_per_frame;
proc->frame_tx = (sl > (19 - sl_ahead)) ? (f + 1) & 1023 : f; proc->frame_tx = (sl > (slots_per_frame - 1 - sl_ahead)) ? (f + 1) & 1023 : f;
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->tti_rx != *slot) { if (proc->tti_rx != *slot) {
......
...@@ -284,6 +284,7 @@ log_config : { ...@@ -284,6 +284,7 @@ log_config : {
fhi_72 = { fhi_72 = {
dpdk_devices = ("0000:31:06.0", "0000:31:06.1"); dpdk_devices = ("0000:31:06.0", "0000:31:06.1");
system_core = 0;
io_core = 4; io_core = 4;
worker_cores = (2); worker_cores = (2);
du_addr = ("76:76:64:6e:00:01", "76:76:64:6e:00:01"); du_addr = ("76:76:64:6e:00:01", "76:76:64:6e:00:01");
......
...@@ -272,6 +272,7 @@ log_config : ...@@ -272,6 +272,7 @@ log_config :
fhi_72 = { fhi_72 = {
dpdk_devices = ("0000:31:06.0", "0000:31:06.1"); dpdk_devices = ("0000:31:06.0", "0000:31:06.1");
system_core = 0;
io_core = 4; io_core = 4;
worker_cores = (2); worker_cores = (2);
du_addr = ("00:11:22:33:44:66", "00:11:22:33:44:67"); du_addr = ("00:11:22:33:44:66", "00:11:22:33:44:67");
......
...@@ -275,6 +275,7 @@ log_config : ...@@ -275,6 +275,7 @@ log_config :
fhi_72 = { fhi_72 = {
dpdk_devices = ("0000:31:06.0", "0000:31:06.1"); dpdk_devices = ("0000:31:06.0", "0000:31:06.1");
system_core = 0;
io_core = 4; io_core = 4;
worker_cores = (2); worker_cores = (2);
du_addr = ("00:11:22:33:44:99", "00:11:22:33:44:99"); du_addr = ("00:11:22:33:44:99", "00:11:22:33:44:99");
......
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