Fronthaul xran library F release support
Major improvements:
1) bbu_offload - enable packet handling on BBU cores
2) dlCpProcBurst - DL CP processing on one or more symbols
3) SRS CP processing - depends on the RU capabilities that can be
retreived via M-plane (if RU is CAT B)
4) nSecDesc - the number of section descriptors per symbol; it was hardcoded to 0 in E release;
depends on the RU capabilities that can be retreived via M-plane
5) RunSlotPrbMapBySymbolEnable - enable PRB mapping by symbol with multisection;
depends on the RU capabilities that can be retreived via M-plane
6) DSS (Dynamic Spectrum Sharing) support - depends on the RU capabilities that can be retreived via M-plane
Minor fixes in F that exist in E:
1) prach_config->nPrachFilterIdx - explained in commit ID f3045396
2) T1a_min_cp_dl - explained in the commit under title "Clarification on DU delay profile"
3) fh_config->nULRBs - explained in commit under title "Further clarification on xran E release parameters"
Removed const for prb_conf argument in oran_allocate_cplane_buffers()
function, as F release requires the not const struct for
xran_init_PrbMap_by_symbol_from_cfg() and xran_init_PrbMap_from_cfg()
even though the struct is not modified inside of these functions.
This commit is contained in:
@@ -0,0 +1,493 @@
|
||||
diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h
|
||||
index ac5f471..bbd39fe 100644
|
||||
--- a/fhi_lib/app/src/common.h
|
||||
+++ b/fhi_lib/app/src/common.h
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <rte_common.h>
|
||||
#include <rte_mbuf.h>
|
||||
|
||||
-#define VERSIONX "oran_f_release_v1.0"
|
||||
+#define VERSIONX "oran_f_release_v1.1"
|
||||
|
||||
#define APP_O_DU 0
|
||||
#define APP_O_RU 1
|
||||
diff --git a/fhi_lib/lib/Makefile b/fhi_lib/lib/Makefile
|
||||
index eccc4ae..8ddb22e 100644
|
||||
--- a/fhi_lib/lib/Makefile
|
||||
+++ b/fhi_lib/lib/Makefile
|
||||
@@ -23,12 +23,18 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
|
||||
##############################################################
|
||||
# Tools configuration
|
||||
##############################################################
|
||||
-ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
|
||||
-CC := icc
|
||||
-CPP := icpc
|
||||
-AS := as
|
||||
-AR := ar
|
||||
-LD := icc
|
||||
+ifeq ($(WIRELESS_SDK_TOOLCHAIN),gcc)
|
||||
+ CC := gcc
|
||||
+ CPP := g++
|
||||
+ AS := as
|
||||
+ AR := ar
|
||||
+ LD := gcc
|
||||
+else ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
|
||||
+ CC := icc
|
||||
+ CPP := icpc
|
||||
+ AS := as
|
||||
+ AR := ar
|
||||
+ LD := icc
|
||||
else ifeq ($(WIRELESS_SDK_TOOLCHAIN),icx)
|
||||
CC := icx
|
||||
CPP := icpx
|
||||
@@ -72,7 +78,7 @@ ifeq ($(RTE_SDK),)
|
||||
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
|
||||
@@ -110,8 +116,7 @@ CPP_SRC = $(SRC_DIR)/xran_compression.cpp \
|
||||
$(SRC_DIR)/xran_bfp_cplane32.cpp \
|
||||
$(SRC_DIR)/xran_bfp_cplane64.cpp \
|
||||
$(SRC_DIR)/xran_bfp_uplane_9b16rb.cpp \
|
||||
- $(SRC_DIR)/xran_bfp_uplane.cpp \
|
||||
- $(SRC_DIR)/xran_mod_compression.cpp
|
||||
+ $(SRC_DIR)/xran_bfp_uplane.cpp
|
||||
|
||||
CPP_SRC_SNC = $(SRC_DIR)/xran_compression_snc.cpp \
|
||||
$(SRC_DIR)/xran_bfp_cplane8_snc.cpp \
|
||||
@@ -127,7 +132,7 @@ CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
|
||||
-fPIC \
|
||||
-Wall \
|
||||
-Wimplicit-function-declaration \
|
||||
- -g -O3 -mcmodel=large
|
||||
+ -g -O -mavx512bw -march=skylake-avx512 -mtune=skylake-avx512#--wd1786 -mcmodel=large
|
||||
|
||||
ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
|
||||
CC_FLAGS += -wd1786 -restrict
|
||||
@@ -138,8 +143,9 @@ CC_FLAGS += -march=icelake-server -mintrinsic-promote -Wno-unused-function -Wno-
|
||||
endif
|
||||
|
||||
CPP_FLAGS := -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -D_REENTRANT -pipe \
|
||||
- -falign-functions=16 \
|
||||
- -Werror -Wno-unused-variable -std=c++14 -mcmodel=large -fPIC
|
||||
+ -fPIC \
|
||||
+ -falign-functions=16 \
|
||||
+ -Werror -Wno-unused-variable -std=c++14 -mcmodel=large -mavx512bw -march=skylake-avx512 -mtune=skylake-avx512
|
||||
|
||||
ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
|
||||
CPP_FLAGS += -fp-model fast=2 -no-prec-div -no-prec-sqrt -fast-transcendentals -restrict
|
||||
@@ -186,8 +192,8 @@ CPP_SNC_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(CPP_OBJS_SNC))
|
||||
|
||||
AS_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(AS_OBJS))
|
||||
#-qopt-report=5 -qopt-matmul -qopt-report-phase=all
|
||||
-CPP_COMP := -O3 -DNDEBUG -xcore-avx512 -fPIE -fasm-blocks
|
||||
-CPP_COMP_SNC := -O3 -DNDEBUG -march=icelake-server -fPIE -fasm-blocks
|
||||
+CPP_COMP := -O3 -DNDEBUG -fPIE
|
||||
+CPP_COMP_SNC := -O3 -DNDEBUG -march=icelake-server -fPIE
|
||||
CC_FLAGS_FULL := $(CC_FLAGS) $(INC) $(DEF)
|
||||
CPP_FLAGS_FULL := $(CPP_FLAGS) $(CPP_COMP) $(INC) $(DEF)
|
||||
CPP_FLAGS_FULL_SNC := $(CPP_FLAGS) $(CPP_COMP_SNC) $(INC) $(DEF)
|
||||
diff --git a/fhi_lib/lib/api/xran_fh_o_du.h b/fhi_lib/lib/api/xran_fh_o_du.h
|
||||
index bacf597..90a42a2 100644
|
||||
--- a/fhi_lib/lib/api/xran_fh_o_du.h
|
||||
+++ b/fhi_lib/lib/api/xran_fh_o_du.h
|
||||
@@ -1193,6 +1193,31 @@ int32_t xran_reg_physide_cb_by_dev_id(void *pHandle, xran_fh_tti_callback_fn Cb,
|
||||
*/
|
||||
int32_t xran_get_slot_idx (uint32_t PortId, uint32_t *nFrameIdx, uint32_t *nSubframeIdx, uint32_t *nSlotIdx, uint64_t *nSecond);
|
||||
|
||||
+/**
|
||||
+ * @ingroup xran
|
||||
+ *
|
||||
+ * Function returns Frame, Subframe, Slot Number based on rx_tti
|
||||
+ *
|
||||
+ * @param tti
|
||||
+ * tti for which to compute Frame, Subframe, Slot
|
||||
+ *
|
||||
+ * @param nFrameIdx
|
||||
+ * Pointer to Frame number [0-99]
|
||||
+ *
|
||||
+ * @param nSubframeIdx
|
||||
+ * Pointer to Subframe number [0-10]
|
||||
+ *
|
||||
+ * @param nSlotIdx
|
||||
+ * Pointer to Slot number [0-7]
|
||||
+ *
|
||||
+ * @param nSecond
|
||||
+ * Pointer to current UTC second
|
||||
+ *
|
||||
+ * @return
|
||||
+ * current TTI number [0-7999]
|
||||
+ */
|
||||
+int32_t xran_get_slot_idx_from_tti(uint32_t tti, uint32_t *nFrameIdx, uint32_t *nSubframeIdx, uint32_t *nSlotIdx, uint64_t *nSecond);
|
||||
+
|
||||
/**
|
||||
* @ingroup xran
|
||||
*
|
||||
diff --git a/fhi_lib/lib/api/xran_up_api.h b/fhi_lib/lib/api/xran_up_api.h
|
||||
index 46e0e1d..409ef4b 100644
|
||||
--- a/fhi_lib/lib/api/xran_up_api.h
|
||||
+++ b/fhi_lib/lib/api/xran_up_api.h
|
||||
@@ -80,6 +80,7 @@ int32_t xran_extract_iq_samples(struct rte_mbuf *mbuf,
|
||||
uint8_t *subframe_id,
|
||||
uint8_t *slot_id,
|
||||
uint8_t *symb_id,
|
||||
+ uint8_t *filter_id,
|
||||
union ecpri_seq_id *seq_id,
|
||||
uint16_t *num_prbu,
|
||||
uint16_t *start_prbu,
|
||||
@@ -89,7 +90,8 @@ int32_t xran_extract_iq_samples(struct rte_mbuf *mbuf,
|
||||
int8_t expect_comp,
|
||||
enum xran_comp_hdr_type staticComp,
|
||||
uint8_t *compMeth,
|
||||
- uint8_t *iqWidth);
|
||||
+ uint8_t *iqWidth,
|
||||
+ uint8_t *is_prach);
|
||||
|
||||
int xran_prepare_iq_symbol_portion(
|
||||
struct rte_mbuf *mbuf,
|
||||
diff --git a/fhi_lib/lib/ethernet/ethdi.c b/fhi_lib/lib/ethernet/ethdi.c
|
||||
index f5b2fd6..e949fe7 100644
|
||||
--- a/fhi_lib/lib/ethernet/ethdi.c
|
||||
+++ b/fhi_lib/lib/ethernet/ethdi.c
|
||||
@@ -325,8 +325,8 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
char bbdev_wdev[32] = "";
|
||||
char bbdev_vdev[32] = "";
|
||||
char iova_mode[32] = "--iova-mode=pa";
|
||||
- char socket_mem[32] = "--socket-mem=8192";
|
||||
- char socket_limit[32] = "--socket-limit=8192";
|
||||
+ char socket_mem[32] = "--socket-mem=0";
|
||||
+ char socket_limit[32] = "--socket-limit=0";
|
||||
char ring_name[32] = "";
|
||||
int32_t xran_port = -1;
|
||||
queueid_t qi = 0;
|
||||
@@ -336,7 +336,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
|
||||
cpu = sched_getcpu();
|
||||
node = numa_node_of_cpu(cpu);
|
||||
|
||||
- char *argv[] = { name, core_mask, "-n2", iova_mode, socket_mem, socket_limit, "--proc-type=auto",
|
||||
+ 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};
|
||||
|
||||
if (io_cfg == NULL)
|
||||
@@ -481,11 +481,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,
|
||||
rte_lcore_to_socket_id(*lcore_id), RING_F_SC_DEQ);
|
||||
PANIC_ON(ctx->tx_ring[i] == NULL, "failed to allocate rx ring");
|
||||
+ printf("Created ring %s on core %d\n",ring_name,*lcore_id);
|
||||
for(qi = 0; qi < io_cfg->num_rxq; qi++) {
|
||||
snprintf(ring_name, RTE_DIM(ring_name), "%s_%d_%d", "rx_ring_cp", i, qi);
|
||||
ctx->rx_ring[i][qi] = rte_ring_create(ring_name, NUM_MBUFS_RING_TRX,
|
||||
rte_lcore_to_socket_id(*lcore_id), RING_F_SP_ENQ);
|
||||
PANIC_ON(ctx->rx_ring[i][qi] == NULL, "failed to allocate rx ring");
|
||||
+ printf("Created ring %s on core %d\n",ring_name,*lcore_id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -555,7 +557,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,
|
||||
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");
|
||||
- printf("created %s\n", ring_name);
|
||||
+ printf("created %s on core %d\n", ring_name, *lcore_id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
diff --git a/fhi_lib/lib/src/xran_bfp_ref.cpp b/fhi_lib/lib/src/xran_bfp_ref.cpp
|
||||
index e6d3067..8e0abee 100644
|
||||
--- a/fhi_lib/lib/src/xran_bfp_ref.cpp
|
||||
+++ b/fhi_lib/lib/src/xran_bfp_ref.cpp
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <complex>
|
||||
#include <algorithm>
|
||||
#include <limits.h>
|
||||
+#include <limits>
|
||||
|
||||
static int16_t saturateAbs(int16_t inVal)
|
||||
{
|
||||
diff --git a/fhi_lib/lib/src/xran_bfp_uplane.cpp b/fhi_lib/lib/src/xran_bfp_uplane.cpp
|
||||
index 59b6850..322d238 100644
|
||||
--- a/fhi_lib/lib/src/xran_bfp_uplane.cpp
|
||||
+++ b/fhi_lib/lib/src/xran_bfp_uplane.cpp
|
||||
@@ -90,7 +90,7 @@ namespace BFP_UPlane
|
||||
{
|
||||
const __m512i* rawData = reinterpret_cast<const __m512i*>(dataIn.dataExpanded);
|
||||
/// Abs
|
||||
- const auto rawDataAbs = _mm512_abs_epi16(rawData[0]);
|
||||
+ const auto rawDataAbs = _mm512_abs_epi16(_mm512_loadu_epi16(rawData));
|
||||
/// No need to do a full horizontal max operation here, just do a max IQ step,
|
||||
/// compute the exponents and then use a reduce max over all exponent values. This
|
||||
/// is the fastest way to handle a single RB.
|
||||
@@ -116,7 +116,7 @@ namespace BFP_UPlane
|
||||
/// Get AVX512 pointer aligned to desired RB
|
||||
const __m512i* rawDataIn = reinterpret_cast<const __m512i*>(dataIn.dataExpanded + numREOffset);
|
||||
/// Apply the exponent shift
|
||||
- const auto compData = _mm512_srai_epi16(*rawDataIn, thisExp);
|
||||
+ const auto compData = _mm512_srai_epi16(_mm512_loadu_epi16(rawDataIn), thisExp);
|
||||
/// Pack compressed data network byte order
|
||||
const auto compDataBytePacked = networkBytePack(compData);
|
||||
/// Store exponent first
|
||||
@@ -201,7 +201,7 @@ namespace BFP_UPlane
|
||||
/// Get AVX512 pointer aligned to desired RB
|
||||
const __m512i* rawDataIn = reinterpret_cast<const __m512i*>(dataIn.dataExpanded + numREOffset);
|
||||
/// Apply the exponent shift
|
||||
- const auto compData = _mm512_srai_epi16(*rawDataIn, thisExp);
|
||||
+ const auto compData = _mm512_srai_epi16(_mm512_loadu_epi16(rawDataIn), thisExp);
|
||||
/// Store exponent first
|
||||
dataOut->dataCompressed[thisRBExpAddr] = thisExp;
|
||||
/// Now have 1 RB worth of bytes separated into 3 chunks (1 per lane)
|
||||
@@ -432,4 +432,4 @@ BlockFloatCompander::BFPExpandUserPlaneAvx512(const CompressedData& dataIn, Expa
|
||||
BFP_UPlane::expandByAllocN<BlockFloatCompander::networkByteUnpack12b>(dataIn, dataOut, k_totNumBytesPerRB12, k_maxExpShift12);
|
||||
break;
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
diff --git a/fhi_lib/lib/src/xran_common.c b/fhi_lib/lib/src/xran_common.c
|
||||
index dc40ad9..4ac1fbf 100644
|
||||
--- a/fhi_lib/lib/src/xran_common.c
|
||||
+++ b/fhi_lib/lib/src/xran_common.c
|
||||
@@ -714,11 +714,14 @@ process_mbuf(struct rte_mbuf *pkt, void* handle, struct xran_eaxc_info *p_cid)
|
||||
uint8_t compMeth = 0;
|
||||
uint8_t iqWidth = 0;
|
||||
|
||||
+ uint8_t is_prach = 0;
|
||||
+
|
||||
int ret = MBUF_FREE;
|
||||
uint32_t mb_free = 0;
|
||||
int32_t valid_res = 0;
|
||||
int expect_comp = (p_dev_ctx->fh_cfg.ru_conf.compMeth != XRAN_COMPMETHOD_NONE);
|
||||
enum xran_comp_hdr_type staticComp = p_dev_ctx->fh_cfg.ru_conf.xranCompHdrType;
|
||||
+ uint8_t filter_id;
|
||||
|
||||
if(first_call == 0)
|
||||
return ret;
|
||||
@@ -733,9 +736,9 @@ process_mbuf(struct rte_mbuf *pkt, void* handle, struct xran_eaxc_info *p_cid)
|
||||
return MBUF_FREE;
|
||||
|
||||
num_bytes = xran_extract_iq_samples(pkt, &iq_samp_buf,
|
||||
- &CC_ID, &Ant_ID, &frame_id, &subframe_id, &slot_id, &symb_id, &seq,
|
||||
+ &CC_ID, &Ant_ID, &frame_id, &subframe_id, &slot_id, &symb_id, &filter_id, &seq,
|
||||
&num_prbu, &start_prbu, &sym_inc, &rb, §_id,
|
||||
- expect_comp, staticComp, &compMeth, &iqWidth);
|
||||
+ expect_comp, staticComp, &compMeth, &iqWidth, &is_prach);
|
||||
if (num_bytes <= 0)
|
||||
{
|
||||
print_err("num_bytes is wrong [%d]\n", num_bytes);
|
||||
@@ -781,10 +784,9 @@ process_mbuf(struct rte_mbuf *pkt, void* handle, struct xran_eaxc_info *p_cid)
|
||||
|
||||
else
|
||||
{
|
||||
- valid_res = xran_pkt_validate(p_dev_ctx,
|
||||
- pkt, iq_samp_buf, num_bytes,
|
||||
- CC_ID, Ant_ID, frame_id, subframe_id, slot_id, symb_id,
|
||||
- &seq, num_prbu, start_prbu, sym_inc, rb, sect_id);
|
||||
+ pCnt->rx_counter++;
|
||||
+ pCnt->Rx_on_time++;
|
||||
+ pCnt->Total_msgs_rcvd++;
|
||||
#ifndef FCN_ADAPT
|
||||
if(valid_res != 0)
|
||||
{
|
||||
@@ -807,8 +809,7 @@ process_mbuf(struct rte_mbuf *pkt, void* handle, struct xran_eaxc_info *p_cid)
|
||||
PrachCfg = &(p_dev_ctx->PrachCPConfig);
|
||||
}
|
||||
|
||||
- if (Ant_ID >= PrachCfg->eAxC_offset && p_dev_ctx->fh_cfg.prachEnable)
|
||||
- {
|
||||
+ if (/*Ant_ID >= PrachCfg->eAxC_offset &&*/p_dev_ctx->fh_cfg.prachEnable && is_prach) {
|
||||
/* PRACH packet has ruportid = num_eAxc + ant_id */
|
||||
Ant_ID -= PrachCfg->eAxC_offset;
|
||||
symbol_total_bytes[p_dev_ctx->xran_port_id][CC_ID][Ant_ID] += num_bytes;
|
||||
@@ -1412,7 +1413,7 @@ int generate_cpmsg_prach(void *pHandle, struct xran_cp_gen_params *params, struc
|
||||
if(XRAN_FILTERINDEX_PRACH_ABC == pPrachCPConfig->filterIdx)
|
||||
{
|
||||
timeOffset = timeOffset >> nNumerology; //original number is Tc, convert to Ts based on mu
|
||||
- if ((slot_id == 0) || (slot_id == (SLOTNUM_PER_SUBFRAME(pxran_lib_ctx->interval_us_local) >> 1)))
|
||||
+ if (startSymId > 0 && ((slot_id == 0) || (slot_id == (SLOTNUM_PER_SUBFRAME(pxran_lib_ctx->interval_us_local) >> 1))))
|
||||
timeOffset += 16;
|
||||
}
|
||||
else
|
||||
@@ -1547,8 +1548,7 @@ int32_t ring_processing_func(void* args)
|
||||
|
||||
for (i = 0; i < ctx->io_cfg.num_vfs && i < XRAN_VF_MAX; i++){
|
||||
for(qi = 0; qi < ctx->rxq_per_port[i]; qi++) {
|
||||
- if (process_ring(ctx->rx_ring[i][qi], i, qi))
|
||||
- return 0;
|
||||
+ process_ring(ctx->rx_ring[i][qi],i,qi);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/fhi_lib/lib/src/xran_compression.cpp b/fhi_lib/lib/src/xran_compression.cpp
|
||||
index 112caae..7c74342 100644
|
||||
--- a/fhi_lib/lib/src/xran_compression.cpp
|
||||
+++ b/fhi_lib/lib/src/xran_compression.cpp
|
||||
@@ -62,7 +62,7 @@ xranlib_compress(const struct xranlib_compress_request *request,
|
||||
return xranlib_5gnr_mod_compression(&mod_request, &mod_response);
|
||||
}
|
||||
else{
|
||||
- if(_may_i_use_cpu_feature(_FEATURE_AVX512IFMA52)) {
|
||||
+ if(false) {
|
||||
return xranlib_compress_avxsnc(request,response);
|
||||
} else {
|
||||
return xranlib_compress_avx512(request,response);
|
||||
@@ -89,7 +89,7 @@ xranlib_decompress(const struct xranlib_decompress_request *request,
|
||||
return xranlib_5gnr_mod_decompression(&mod_request, &mod_response);
|
||||
}
|
||||
else{
|
||||
- if(_may_i_use_cpu_feature(_FEATURE_AVX512IFMA52)) {
|
||||
+ if(false) {
|
||||
return xranlib_decompress_avxsnc(request,response);
|
||||
} else {
|
||||
return xranlib_decompress_avx512(request,response);
|
||||
@@ -101,7 +101,7 @@ int32_t
|
||||
xranlib_compress_bfw(const struct xranlib_compress_request *request,
|
||||
struct xranlib_compress_response *response)
|
||||
{
|
||||
- if(_may_i_use_cpu_feature(_FEATURE_AVX512IFMA52)) {
|
||||
+ if(false) {
|
||||
return xranlib_compress_avxsnc_bfw(request,response);
|
||||
} else {
|
||||
return xranlib_compress_avx512_bfw(request,response);
|
||||
@@ -112,7 +112,7 @@ int32_t
|
||||
xranlib_decompress_bfw(const struct xranlib_decompress_request *request,
|
||||
struct xranlib_decompress_response *response)
|
||||
{
|
||||
- if(_may_i_use_cpu_feature(_FEATURE_AVX512IFMA52)) {
|
||||
+ if(false) {
|
||||
return xranlib_decompress_avxsnc_bfw(request,response);
|
||||
} else {
|
||||
return xranlib_decompress_avx512_bfw(request,response);
|
||||
diff --git a/fhi_lib/lib/src/xran_main.c b/fhi_lib/lib/src/xran_main.c
|
||||
index 7c472d7..7bab6a8 100644
|
||||
--- a/fhi_lib/lib/src/xran_main.c
|
||||
+++ b/fhi_lib/lib/src/xran_main.c
|
||||
@@ -306,7 +306,7 @@ xran_init_prach(struct xran_fh_config* pConf, struct xran_device_ctx * p_xran_de
|
||||
printf("PRACH start symbol %u lastsymbol %u\n", p_xran_dev_ctx->prach_start_symbol[0], p_xran_dev_ctx->prach_last_symbol[0]);
|
||||
}
|
||||
|
||||
- pPrachCPConfig->eAxC_offset = xran_get_num_eAxc(p_xran_dev_ctx);
|
||||
+ pPrachCPConfig->eAxC_offset = pPRACHConfig->eAxC_offset;
|
||||
print_dbg("PRACH eAxC_offset %d\n", pPrachCPConfig->eAxC_offset);
|
||||
|
||||
/* Save some configs for app */
|
||||
@@ -1570,6 +1570,7 @@ int32_t handle_ecpri_ethertype(struct rte_mbuf* pkt_q[], uint16_t xport_id, stru
|
||||
{
|
||||
case ECPRI_IQ_DATA:
|
||||
pkt_data[num_data++] = pkt;
|
||||
+ uint8_t *pkt_bytes=rte_pktmbuf_mtod(pkt,uint8_t*);
|
||||
break;
|
||||
// For RU emulation
|
||||
case ECPRI_RT_CONTROL_DATA:
|
||||
@@ -1587,7 +1588,7 @@ int32_t handle_ecpri_ethertype(struct rte_mbuf* pkt_q[], uint16_t xport_id, stru
|
||||
break;
|
||||
default:
|
||||
if (p_dev_ctx->fh_init.io_cfg.id == O_DU) {
|
||||
- print_err("Invalid eCPRI message type - %d", ecpri_hdr->cmnhdr.bits.ecpri_mesg_type);
|
||||
+ rte_pktmbuf_free(pkt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2347,8 +2348,7 @@ ring_processing_func_per_port(void* args)
|
||||
for (i = 0; i < ctx->io_cfg.num_vfs && i < XRAN_VF_MAX; i = i+1) {
|
||||
if (ctx->vf2xran_port[i] == port_id) {
|
||||
for(qi = 0; qi < ctx->rxq_per_port[port_id]; qi++){
|
||||
- if (process_ring(ctx->rx_ring[i][qi], i, qi))
|
||||
- return 0;
|
||||
+ process_ring(ctx->rx_ring[i][qi],i,qi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2414,9 +2414,6 @@ xran_spawn_workers(void)
|
||||
nWorkerCore = nWorkerCore << 1;
|
||||
}
|
||||
|
||||
- extern int _may_i_use_cpu_feature(unsigned __int64);
|
||||
- icx_cpu = _may_i_use_cpu_feature(_FEATURE_AVX512IFMA52);
|
||||
-
|
||||
printf("O-XU %d\n", eth_ctx->io_cfg.id);
|
||||
printf("HW %d\n", icx_cpu);
|
||||
printf("Num cores %d\n", total_num_cores);
|
||||
@@ -4034,6 +4031,24 @@ xran_get_slot_idx (uint32_t PortId, uint32_t *nFrameIdx, uint32_t *nSubframeIdx,
|
||||
return tti;
|
||||
}
|
||||
|
||||
+int32_t
|
||||
+xran_get_slot_idx_from_tti(uint32_t tti, uint32_t *nFrameIdx, uint32_t *nSubframeIdx, uint32_t *nSlotIdx, uint64_t *nSecond)
|
||||
+{
|
||||
+ struct xran_device_ctx * p_xran_dev_ctx = xran_dev_get_ctx_by_id(0);
|
||||
+ if (!p_xran_dev_ctx)
|
||||
+ {
|
||||
+ print_err("Null xRAN context on port id %u!!\n", 0);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ *nSlotIdx = (uint32_t)XranGetSlotNum(tti, SLOTNUM_PER_SUBFRAME(p_xran_dev_ctx->interval_us_local));
|
||||
+ *nSubframeIdx = (uint32_t)XranGetSubFrameNum(tti,SLOTNUM_PER_SUBFRAME(p_xran_dev_ctx->interval_us_local), SUBFRAMES_PER_SYSTEMFRAME);
|
||||
+ *nFrameIdx = (uint32_t)XranGetFrameNum(tti,0/*xran_getSfnSecStart()*/,SUBFRAMES_PER_SYSTEMFRAME, SLOTNUM_PER_SUBFRAME(p_xran_dev_ctx->interval_us_local));
|
||||
+ *nSecond = timing_get_current_second();
|
||||
+
|
||||
+ return tti;
|
||||
+}
|
||||
+
|
||||
int32_t
|
||||
xran_set_debug_stop(int32_t value, int32_t count)
|
||||
{
|
||||
diff --git a/fhi_lib/lib/src/xran_mod_compression.cpp b/fhi_lib/lib/src/xran_mod_compression.cpp
|
||||
index 7d4a5d0..b9b44ac 100644
|
||||
--- a/fhi_lib/lib/src/xran_mod_compression.cpp
|
||||
+++ b/fhi_lib/lib/src/xran_mod_compression.cpp
|
||||
@@ -747,9 +747,9 @@ int xranlib_5gnr_mod_compression(const struct xranlib_5gnr_mod_compression_reque
|
||||
#ifdef C_Module_Used
|
||||
return (xranlib_5gnr_mod_compression_c(request, response));
|
||||
#else
|
||||
- if(_may_i_use_cpu_feature(_FEATURE_AVX512IFMA52))
|
||||
+ if (false) {
|
||||
return (xranlib_5gnr_mod_compression_snc(request, response));
|
||||
- else
|
||||
+ } else {
|
||||
return (xranlib_5gnr_mod_compression_avx512(request, response));
|
||||
#endif
|
||||
}
|
||||
diff --git a/fhi_lib/lib/src/xran_up_api.c b/fhi_lib/lib/src/xran_up_api.c
|
||||
index fe22a1f..f6c4830 100644
|
||||
--- a/fhi_lib/lib/src/xran_up_api.c
|
||||
+++ b/fhi_lib/lib/src/xran_up_api.c
|
||||
@@ -336,6 +336,7 @@ int32_t xran_extract_iq_samples(struct rte_mbuf *mbuf,
|
||||
uint8_t *subframe_id,
|
||||
uint8_t *slot_id,
|
||||
uint8_t *symb_id,
|
||||
+ uint8_t *filter_id,
|
||||
union ecpri_seq_id *seq_id,
|
||||
uint16_t *num_prbu,
|
||||
uint16_t *start_prbu,
|
||||
@@ -345,7 +346,8 @@ int32_t xran_extract_iq_samples(struct rte_mbuf *mbuf,
|
||||
int8_t expect_comp,
|
||||
enum xran_comp_hdr_type staticComp,
|
||||
uint8_t *compMeth,
|
||||
- uint8_t *iqWidth)
|
||||
+ uint8_t *iqWidth,
|
||||
+ uint8_t *is_prach)
|
||||
{
|
||||
#if XRAN_MLOG_VAR
|
||||
uint32_t mlogVar[10];
|
||||
@@ -381,6 +383,7 @@ int32_t xran_extract_iq_samples(struct rte_mbuf *mbuf,
|
||||
return 0; /* packet too short */
|
||||
|
||||
radio_hdr->sf_slot_sym.value = rte_be_to_cpu_16(radio_hdr->sf_slot_sym.value);
|
||||
+ *is_prach = (radio_hdr->data_feature.filter_id > 0);
|
||||
|
||||
if (frame_id)
|
||||
*frame_id = radio_hdr->frame_id;
|
||||
@@ -394,6 +397,9 @@ int32_t xran_extract_iq_samples(struct rte_mbuf *mbuf,
|
||||
if (symb_id)
|
||||
*symb_id = radio_hdr->sf_slot_sym.symb_id;
|
||||
|
||||
+ if (filter_id)
|
||||
+ *filter_id = radio_hdr->data_feature.filter_id;
|
||||
+
|
||||
/* Process data section hdr */
|
||||
struct data_section_hdr *data_hdr =
|
||||
(void *)rte_pktmbuf_adj(mbuf, sizeof(*radio_hdr));
|
||||
@@ -9,12 +9,6 @@ endif()
|
||||
pkg_check_modules(dpdk REQUIRED libdpdk)
|
||||
pkg_check_modules(numa REQUIRED numa)
|
||||
|
||||
find_package(xran 5.1.4 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
|
||||
add_compile_options(-Wno-packed-not-aligned)
|
||||
|
||||
add_library(oran_fhlib_5g MODULE
|
||||
oran_isolate.c
|
||||
oaioran.c
|
||||
@@ -22,6 +16,19 @@ add_library(oran_fhlib_5g MODULE
|
||||
oran-init.c
|
||||
)
|
||||
|
||||
find_package(xran REQUIRED)
|
||||
if(xran_VERSION VERSION_EQUAL 5.1.4)
|
||||
target_compile_definitions(oran_fhlib_5g PRIVATE E_RELEASE)
|
||||
elseif(xran_VERSION VERSION_EQUAL 6.1.1)
|
||||
target_compile_definitions(oran_fhlib_5g PRIVATE F_RELEASE)
|
||||
else()
|
||||
message(FATAL_ERROR "Found xran version ${xran_VERSION} but needed 5.1.4 (E release) or 6.1.1 (F release)")
|
||||
endif()
|
||||
|
||||
# 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
|
||||
add_compile_options(-Wno-packed-not-aligned)
|
||||
|
||||
set_target_properties(oran_fhlib_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native")
|
||||
target_link_libraries(oran_fhlib_5g PRIVATE xran::xran)
|
||||
target_link_libraries(oran_fhlib_5g PRIVATE ${dpdk_LINK_LIBRARIES})
|
||||
|
||||
+28
-5
@@ -90,7 +90,7 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
|
||||
|
||||
tti = xran_get_slot_idx_from_tti(rx_tti, &frame, &subframe, &slot, &second);
|
||||
|
||||
rx_sym = callback_tag->symbol;
|
||||
rx_sym = callback_tag->symbol & 0xFF;
|
||||
uint32_t ru_id = callback_tag->oXuId;
|
||||
|
||||
LOG_D(NR_PHY,
|
||||
@@ -101,7 +101,23 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
|
||||
(unsigned long long)second,
|
||||
rx_sym,
|
||||
ru_id);
|
||||
if (rx_sym == 7) {
|
||||
if (rx_sym == 7) { // in F release this value is defined as XRAN_FULL_CB_SYM (full slot (offset + 7))
|
||||
#ifdef F_RELEASE
|
||||
int32_t nCellIdx = callback_tag->cellId;
|
||||
int32_t ntti = (rx_tti + XRAN_N_FE_BUF_LEN - 1) % XRAN_N_FE_BUF_LEN;
|
||||
|
||||
for(uint32_t ant_id = 0; ant_id < fh_config->neAxc; ant_id++) {
|
||||
struct xran_prb_map *pRbMap = (struct xran_prb_map *)xran_ctx->sFrontHaulRxPrbMapBbuIoBufCtrl[ntti][nCellIdx][ant_id].sBufferList.pBuffers->pData;
|
||||
AssertFatal(pRbMap != NULL, "(%d:%d:%d)pRbMap == NULL. Aborting.\n", nCellIdx, ntti, ant_id);
|
||||
|
||||
for (uint32_t sym_id = 0; sym_id < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_id++) {
|
||||
for (uint32_t idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++ ) {
|
||||
struct xran_prb_elm *pRbElm = &pRbMap->prbMap[idxElm];
|
||||
pRbElm->nSecDesc[sym_id] = 0; // number of section descriptors per symbol; M-plane info <supported-section-types>
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (first_call_set) {
|
||||
if (!first_rx_set) {
|
||||
LOG_I(NR_PHY, "first_rx is set (num_ports %d), first_read_set %d\n", num_ports, first_read_set);
|
||||
@@ -332,7 +348,11 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
|
||||
struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData;
|
||||
|
||||
struct xran_prb_elm *pRbElm = &pPrbMap->prbMap[0];
|
||||
#ifdef E_RELEASE
|
||||
struct xran_section_desc *p_sec_desc = pRbElm->p_sec_desc[sym_idx][0];
|
||||
#elif defined F_RELEASE
|
||||
struct xran_section_desc *p_sec_desc = &pRbElm->sec_desc[sym_idx][0];
|
||||
#endif
|
||||
uint32_t one_rb_size =
|
||||
(((pRbElm->iqWidth == 0) || (pRbElm->iqWidth == 16)) ? (N_SC_PER_PRB * 2 * 2) : (3 * pRbElm->iqWidth + 1));
|
||||
if (fh_init->mtu < pRbElm->nRBSize * one_rb_size)
|
||||
@@ -486,9 +506,12 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
|
||||
struct xran_section_desc *p_sec_desc = NULL;
|
||||
p_prbMapElm = &pRbMap->prbMap[idxElm];
|
||||
p_sec_desc =
|
||||
// assumes one fragment per symbol
|
||||
p_prbMapElm->p_sec_desc[sym_id][0];
|
||||
// assumes one fragment per symbol
|
||||
#ifdef E_RELEASE
|
||||
p_sec_desc = p_prbMapElm->p_sec_desc[sym_id][0];
|
||||
#elif F_RELEASE
|
||||
p_sec_desc = &p_prbMapElm->sec_desc[sym_id][0];
|
||||
#endif
|
||||
|
||||
dst = xran_add_hdr_offset(dst, p_prbMapElm->compMethod);
|
||||
|
||||
|
||||
@@ -120,6 +120,11 @@ static void print_fh_init_io_cfg(const struct xran_io_cfg *io_cfg)
|
||||
io_cfg->one_vf_cu_plane);
|
||||
print_fh_eowd_cmn(io_cfg->id, &io_cfg->eowd_cmn[io_cfg->id]);
|
||||
printf("eowd_port (filled within xran library)\n");
|
||||
#ifdef F_RELEASE
|
||||
printf("\
|
||||
bbu_offload %d\n",
|
||||
io_cfg->bbu_offload);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void print_fh_init_eaxcid_conf(const struct xran_eaxcid_config *eaxcid_conf)
|
||||
@@ -179,6 +184,13 @@ void print_fh_init(const struct xran_fh_init *fh_init)
|
||||
printf("\
|
||||
totalBfWeights %d\n",
|
||||
fh_init->totalBfWeights);
|
||||
#ifdef F_RELEASE
|
||||
printf("\
|
||||
mlogxranenable %d\n\
|
||||
dlCpProcBurst %d\n",
|
||||
fh_init->mlogxranenable,
|
||||
fh_init->dlCpProcBurst);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void print_prach_config(const struct xran_prach_config *prach_conf)
|
||||
@@ -215,6 +227,11 @@ static void print_prach_config(const struct xran_prach_config *prach_conf)
|
||||
prach_conf->timeOffset,
|
||||
prach_conf->freqOffset,
|
||||
prach_conf->eAxC_offset);
|
||||
#ifdef F_RELEASE
|
||||
printf("\
|
||||
nPrachConfIdxLTE %d\n",
|
||||
prach_conf->nPrachConfIdxLTE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void print_srs_config(const struct xran_srs_config *srs_conf)
|
||||
@@ -374,6 +391,14 @@ void print_fh_config(const struct xran_fh_config *fh_config)
|
||||
fh_config->GPS_Alpha,
|
||||
fh_config->GPS_Beta);
|
||||
|
||||
#ifdef F_RELEASE
|
||||
printf("\
|
||||
srsEnableCp %d\n\
|
||||
SrsDelaySym %d\n",
|
||||
fh_config->srsEnableCp,
|
||||
fh_config->SrsDelaySym);
|
||||
#endif
|
||||
|
||||
print_prach_config(&fh_config->prach_conf);
|
||||
print_srs_config(&fh_config->srs_conf);
|
||||
print_frame_config(&fh_config->frame_conf);
|
||||
@@ -398,6 +423,17 @@ void print_fh_config(const struct xran_fh_config *fh_config)
|
||||
fh_config->log_level,
|
||||
fh_config->max_sections_per_slot,
|
||||
fh_config->max_sections_per_symbol);
|
||||
|
||||
#ifdef F_RELEASE
|
||||
printf("\
|
||||
RunSlotPrbMapBySymbolEnable %d\n\
|
||||
dssEnable %d\n\
|
||||
dssPeriod %d\n\
|
||||
technology[XRAN_MAX_DSS_PERIODICITY] (not filled as DSS disabled)\n",
|
||||
fh_config->RunSlotPrbMapBySymbolEnable,
|
||||
fh_config->dssEnable,
|
||||
fh_config->dssPeriod);
|
||||
#endif
|
||||
}
|
||||
|
||||
static const paramdef_t *gpd(const paramdef_t *pd, int num, const char *name)
|
||||
@@ -477,6 +513,10 @@ static bool set_fh_io_cfg(struct xran_io_cfg *io_cfg, const paramdef_t *fhip, in
|
||||
/* eCPRI OWDM per port variables for O-DU; this parameter is filled within xran library */
|
||||
// eowd_port[0][XRAN_VF_MAX]
|
||||
|
||||
#ifdef F_RELEASE
|
||||
io_cfg->bbu_offload = 0; // enable packet handling on BBU cores
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -594,6 +634,12 @@ static bool set_fh_init(struct xran_fh_init *fh_init, enum xran_category xran_ca
|
||||
|
||||
fh_init->totalBfWeights = 0; // only used if id = O_RU (for emulation); C-plane extension types; section 5.4.6 of CUS spec
|
||||
|
||||
#ifdef F_RELEASE
|
||||
fh_init->mlogxranenable = 0; // enable mlog; 0 -> disabled
|
||||
fh_init->dlCpProcBurst = 0; /* 1 -> DL CP processing will be done on single symbol,
|
||||
0 -> DL CP processing will be spread across all allowed symbols and multiple cores to reduce burstiness */
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -631,6 +677,9 @@ static bool set_fh_prach_config(const openair0_config_t *oai0,
|
||||
prach_config->numPrbc = 0;
|
||||
prach_config->timeOffset = 0;
|
||||
prach_config->freqOffset = 0;
|
||||
#ifdef F_RELEASE
|
||||
prach_config->nPrachConfIdxLTE = 0; // used only if DSS enabled and technology is XRAN_RAN_LTE
|
||||
#endif
|
||||
|
||||
/* xran defines PDSCH eAxC IDs as [0...Ntx-1];
|
||||
xran defines PUSCH eAxC IDs as [0...Nrx-1];
|
||||
@@ -779,6 +828,10 @@ static bool set_fh_config(int ru_idx, int num_rus, enum xran_category xran_cat,
|
||||
fh_config->enableCP = 1; // enable C-plane
|
||||
fh_config->prachEnable = 1; // enable PRACH
|
||||
fh_config->srsEnable = 0; // enable SRS; used only if XRAN_CATEGORY_B
|
||||
#ifdef F_RELEASE
|
||||
fh_config->srsEnableCp = 0; // enable SRS CP; used only if XRAN_CATEGORY_B
|
||||
fh_config->SrsDelaySym = 0; // number of SRS delay symbols; used only if XRAN_CATEGORY_B
|
||||
#endif
|
||||
fh_config->puschMaskEnable = 0; // enable PUSCH mask; only used if id = O_RU
|
||||
fh_config->puschMaskSlot = 0; // specific which slot PUSCH channel masked; only used if id = O_RU
|
||||
fh_config->cp_vlan_tag = *gpd(fhp, nfh, ORAN_FH_CONFIG_CP_VLAN_TAG)->uptr; // C-plane VLAN tag; not used in xran; needed for M-plane
|
||||
@@ -820,6 +873,14 @@ static bool set_fh_config(int ru_idx, int num_rus, enum xran_category xran_cat,
|
||||
fh_config->max_sections_per_slot = 0; // not used in xran
|
||||
fh_config->max_sections_per_symbol = 0; // not used in xran
|
||||
|
||||
#ifdef F_RELEASE
|
||||
fh_config->RunSlotPrbMapBySymbolEnable = 0; // enable PRB mapping by symbol with multisection
|
||||
|
||||
fh_config->dssEnable = 0; // enable DSS (extension-9)
|
||||
fh_config->dssPeriod = 0; // DSS pattern period for LTE/NR
|
||||
// fh_config->technology[XRAN_MAX_DSS_PERIODICITY] // technology array represents slot is LTE(0)/NR(1); used only if DSS enabled
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+54
-14
@@ -140,10 +140,10 @@ static uint32_t oran_allocate_uplane_buffers(
|
||||
{
|
||||
xran_status_t status;
|
||||
uint32_t pool;
|
||||
// we need at least XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT
|
||||
// buffers, but xran_bm_init() uses rte_pktmbuf_pool_create() which
|
||||
// recommends to use a power of two for the buffers
|
||||
uint32_t numBufs = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT);
|
||||
/* xran_bm_init() uses rte_pktmbuf_pool_create() which recommends to use a power of two for the buffers;
|
||||
the E release sample app didn't take this into account, but we introduced it ourselves;
|
||||
the F release sample app took this into account, so we can proudly say we assumed correctly */
|
||||
uint32_t numBufs = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT) - 1;
|
||||
status = xran_bm_init(instHandle, &pool, numBufs, bufSize);
|
||||
AssertFatal(XRAN_STATUS_SUCCESS == status, "Failed at xran_bm_init(), status %d\n", status);
|
||||
printf("xran_bm_init() hInstance %p poolIdx %u elements %u size %u\n", instHandle, pool, numBufs, bufSize);
|
||||
@@ -217,26 +217,33 @@ static void oran_allocate_cplane_buffers(void *instHandle,
|
||||
struct xran_flat_buffer buf[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN],
|
||||
uint32_t ant,
|
||||
uint32_t sect,
|
||||
#ifdef F_RELEASE
|
||||
uint32_t mtu,
|
||||
const struct xran_fh_config *fh_config,
|
||||
#endif
|
||||
uint32_t size_of_prb_map,
|
||||
const oran_cplane_prb_config *prb_conf)
|
||||
oran_cplane_prb_config *prb_conf)
|
||||
{
|
||||
xran_status_t status;
|
||||
uint32_t count1 = 0;
|
||||
|
||||
#ifdef E_RELEASE
|
||||
uint32_t count2 = 0;
|
||||
uint32_t poolSec;
|
||||
uint32_t numBufsSec = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT * sect * XRAN_MAX_FRAGMENT);
|
||||
uint32_t bufSizeSec = sizeof(struct xran_section_desc);
|
||||
status = xran_bm_init(instHandle, &poolSec, numBufsSec, bufSizeSec);
|
||||
AssertFatal(XRAN_STATUS_SUCCESS == status, "Failed at xran_bm_init(), status %d\n", status);
|
||||
printf("xran_bm_init() hInstance %p poolIdx %u elements %u size %u\n", instHandle, poolSec, numBufsSec, bufSizeSec);
|
||||
#endif
|
||||
|
||||
uint32_t poolPrb;
|
||||
uint32_t numBufsPrb = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT);
|
||||
uint32_t numBufsPrb = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT) - 1;
|
||||
uint32_t bufSizePrb = size_of_prb_map;
|
||||
status = xran_bm_init(instHandle, &poolPrb, numBufsPrb, bufSizePrb);
|
||||
AssertFatal(XRAN_STATUS_SUCCESS == status, "Failed at xran_bm_init(), status %d\n", status);
|
||||
printf("xran_bm_init() hInstance %p poolIdx %u elements %u size %u\n", instHandle, poolPrb, numBufsPrb, bufSizePrb);
|
||||
|
||||
uint32_t count1 = 0;
|
||||
uint32_t count2 = 0;
|
||||
for (uint32_t a = 0; a < ant; a++) {
|
||||
for (uint32_t j = 0; j < XRAN_N_FE_BUF_LEN; ++j) {
|
||||
list[a][j].pBuffers = &buf[a][j];
|
||||
@@ -254,13 +261,15 @@ static void oran_allocate_cplane_buffers(void *instHandle,
|
||||
fb->pData = ptr;
|
||||
fb->pCtrl = mb;
|
||||
|
||||
// the original sample app code copies up to size_of_prb_map, but I think
|
||||
// this is wrong because the way it is computed leads to a number larger
|
||||
// than sizeof(map)
|
||||
struct xran_prb_map *p_rb_map = (struct xran_prb_map *)ptr;
|
||||
const struct xran_prb_map *src = &prb_conf->slotMap;
|
||||
struct xran_prb_map *src = &prb_conf->slotMap;
|
||||
if ((j % prb_conf->nTddPeriod) == prb_conf->mixed_slot_index)
|
||||
src = &prb_conf->mixedSlotMap;
|
||||
#ifdef E_RELEASE
|
||||
/* as per E release sample app, the memory is copied up to size_of_prb_map
|
||||
which translates to >= sizeof(struct xran_prb_map) + sizeof(struct xran_prb_elm)*5,
|
||||
but we assume that RB allocation is done as 1 RE/UE so the total memory size is sizeof(struct xran_prb_map);
|
||||
this is improved in F release */
|
||||
struct xran_prb_map *p_rb_map = (struct xran_prb_map *)ptr;
|
||||
memcpy(p_rb_map, src, sizeof(*src));
|
||||
|
||||
for (uint32_t elm_id = 0; elm_id < p_rb_map->nPrbElm; ++elm_id) {
|
||||
@@ -282,10 +291,19 @@ static void oran_allocate_cplane_buffers(void *instHandle,
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif defined F_RELEASE
|
||||
if (fh_config->RunSlotPrbMapBySymbolEnable) {
|
||||
xran_init_PrbMap_by_symbol_from_cfg(src, ptr, mtu, fh_config->nDLRBs);
|
||||
} else {
|
||||
xran_init_PrbMap_from_cfg(src, ptr, mtu);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
printf("xran_bm_allocate_buffer() hInstance %p poolIdx %u count %u\n", instHandle, poolPrb, count1);
|
||||
#ifdef E_RELEASE
|
||||
printf("xran_bm_allocate_buffer() hInstance %p poolIdx %u count %u\n", instHandle, poolSec, count2);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* callback not actively used */
|
||||
@@ -298,6 +316,9 @@ static void oran_allocate_buffers(void *handle,
|
||||
int xran_inst,
|
||||
int num_sectors,
|
||||
oran_port_instance_t *portInstances,
|
||||
#ifdef F_RELEASE
|
||||
uint32_t mtu,
|
||||
#endif
|
||||
const struct xran_fh_config *fh_config)
|
||||
{
|
||||
AssertFatal(num_sectors == 1, "only support one sector at the moment\n");
|
||||
@@ -305,7 +326,6 @@ static void oran_allocate_buffers(void *handle,
|
||||
AssertFatal(handle != NULL, "no handle provided\n");
|
||||
uint32_t xran_max_antenna_nr = RTE_MAX(fh_config->neAxc, fh_config->neAxcUl);
|
||||
uint32_t xran_max_sections_per_slot = RTE_MAX(fh_config->max_sections_per_slot, XRAN_MIN_SECTIONS_PER_SLOT);
|
||||
uint32_t size_of_prb_map = sizeof(struct xran_prb_map) + sizeof(struct xran_prb_elm) * (xran_max_sections_per_slot - 1);
|
||||
|
||||
pi->buf_list = _mm_malloc(sizeof(*pi->buf_list), 256);
|
||||
AssertFatal(pi->buf_list != NULL, "out of memory\n");
|
||||
@@ -331,11 +351,23 @@ static void oran_allocate_buffers(void *handle,
|
||||
.slotMap = dlPm,
|
||||
.mixedSlotMap = dlPmMixed,
|
||||
};
|
||||
|
||||
#ifdef E_RELEASE
|
||||
uint32_t size_of_prb_map = sizeof(struct xran_prb_map) + sizeof(struct xran_prb_elm) * (xran_max_sections_per_slot - 1);
|
||||
#elif defined F_RELEASE
|
||||
uint32_t numPrbElm = xran_get_num_prb_elm(&dlPmMixed, mtu);
|
||||
uint32_t size_of_prb_map = sizeof(struct xran_prb_map) + sizeof(struct xran_prb_elm) * (numPrbElm);
|
||||
#endif
|
||||
|
||||
oran_allocate_cplane_buffers(pi->instanceHandle,
|
||||
bl->srccp,
|
||||
bl->bufs.tx_prbmap,
|
||||
xran_max_antenna_nr,
|
||||
xran_max_sections_per_slot,
|
||||
#ifdef F_RELEASE
|
||||
mtu,
|
||||
fh_config,
|
||||
#endif
|
||||
size_of_prb_map,
|
||||
&dlConf);
|
||||
|
||||
@@ -357,6 +389,10 @@ static void oran_allocate_buffers(void *handle,
|
||||
bl->bufs.rx_prbmap,
|
||||
xran_max_antenna_nr,
|
||||
xran_max_sections_per_slot,
|
||||
#ifdef F_RELEASE
|
||||
mtu,
|
||||
fh_config,
|
||||
#endif
|
||||
size_of_prb_map,
|
||||
&ulConf);
|
||||
|
||||
@@ -422,7 +458,11 @@ int *oai_oran_initialize(struct xran_fh_init *xran_fh_init, struct xran_fh_confi
|
||||
struct xran_cb_tag tag = {.cellId = sector, .oXuId = o_xu_id};
|
||||
pi->prach_tag = tag;
|
||||
pi->pusch_tag = tag;
|
||||
#ifdef E_RELEASE
|
||||
oran_allocate_buffers(gxran_handle, o_xu_id, 1, pi, &xran_fh_config[o_xu_id]);
|
||||
#elif defined F_RELEASE
|
||||
oran_allocate_buffers(gxran_handle, o_xu_id, 1, pi, xran_fh_init->mtu, &xran_fh_config[o_xu_id]);
|
||||
#endif
|
||||
|
||||
if ((xret = xran_reg_physide_cb(gxran_handle, oai_physide_dl_tti_call_back, NULL, 10, XRAN_CB_TTI)) != XRAN_STATUS_SUCCESS) {
|
||||
printf("xran_reg_physide_cb failed %d\n", xret);
|
||||
|
||||
Reference in New Issue
Block a user