Commit 6eb6f496 authored by Raymond's avatar Raymond

logging of O-RAN statistics

parent 148e3b72
......@@ -620,7 +620,7 @@ target_link_libraries(benetel_5g PRIVATE asn1_nr_rrc asn1_lte_rrc)
# ORAN 5G library
######################################################################
add_boolean_option(ORAN_BRONZE OFF "Build support for Bronze version of ORAN FHI")
add_boolean_option(ORAN_BRONZE ON "Build support for Bronze version of ORAN FHI")
if (ORAN_BRONZE)
set(ORAN_FHLIB_5G_SOURCE
${OPENAIR_DIR}/radio/ETHERNET/oran/5g/sample-app-bronze.c
......@@ -648,7 +648,11 @@ target_include_directories(oran_fhlib_5g PRIVATE ${INTEL_LIB})
target_include_directories(oran_fhlib_5g PRIVATE ${XRAN_COMMON_DIR})
target_include_directories(oran_fhlib_5g PRIVATE ${XRAN_LIB_API_DIR})
if (ORAN_BRONZE)
set_target_properties(oran_fhlib_5g PROPERTIES COMPILE_FLAGS "-DORAN_BRONZE -fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include")
else()
set_target_properties(oran_fhlib_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include")
endif()
#SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive")
execute_process(
......
......@@ -91,6 +91,8 @@
#define KEY_SRS_ENABLE "srsEanble"
#define KEY_PRACH_CFGIDX "prachConfigIndex"
#define KEY_PRACH_FREQSTART "prachFreqStart"
#define KEY_PRACH_FREQOFFSET "prachFreqOffset"
#define KEY_SRS_SYM_IDX "srsSym"
#define KEY_MAX_FRAME_ID "maxFrameId"
......@@ -388,6 +390,12 @@ static int fillConfigStruct(RuntimeConfig *config, const char *key, const char *
} else if (strcmp(key, KEY_PRACH_CFGIDX) == 0) {
config->prachConfigIndex = atoi(value);
printf("Prach config index: %d\n",config->prachConfigIndex);
} else if (strcmp(key, KEY_PRACH_FREQSTART) == 0) {
config->prachOffset = atoi(value);
printf("Prach Frequency Start: %d\n",config->prachOffset);
} else if (strcmp(key, KEY_PRACH_FREQOFFSET) == 0) {
config->prachFreqOffset = atoi(value);
printf("Prach Frequency Offset: %d\n",config->prachFreqOffset);
} else if (strcmp(key, KEY_SRS_SYM_IDX) == 0) {
config->srsSymMask = atoi(value);
printf("Srs symbol [0-13]: %d\n",config->srsSymMask);
......
......@@ -75,6 +75,7 @@ typedef struct _RuntimeConfig
Set by SIB2, prach-FreqOffset in E-UTRA. */
uint8_t prachConfigIndex;/**< TS36.211 - Table 5.7.1-2 : PRACH Configuration Index */
int32_t prachFreqOffset;
uint8_t iqswap; /**< do swap of IQ before send to ETH */
uint8_t nebyteorderswap; /**< do swap of byte order from host byte order to network byte order. ETH */
uint8_t compression; /**< enable use case with compression */
......@@ -106,8 +107,8 @@ typedef struct _RuntimeConfig
uint16_t Ta4_max;
uint8_t enableCP; /**< enable C-plane */
uint8_t cp_vlan_tag; /**< C-plane vlan tag */
uint8_t up_vlan_tag; /**< U-plane vlan tag */
uint16_t cp_vlan_tag; /**< C-plane vlan tag */
uint16_t up_vlan_tag; /**< U-plane vlan tag */
int32_t debugStop;
int32_t debugStopCount;
......
......@@ -58,6 +58,7 @@ volatile uint32_t rx_cb_slot = 0;
//#define ORAN_BRONZE 1
#ifdef ORAN_BRONZE
extern struct xran_fh_config xranConf;
extern void * xranHandle;
int xran_is_prach_slot(uint32_t subframe_id, uint32_t slot_id);
#else
#include "app_io_fh_xran.h"
......@@ -77,7 +78,7 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status){
uint32_t frame;
uint32_t subframe;
uint32_t slot,slot2;
uint32_t rx_tti,rx_sym;
uint32_t rx_sym;
static int32_t last_slot=-1;
static int32_t last_frame=-1;
......@@ -88,7 +89,6 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status){
#endif
&frame,&subframe,&slot,&second);
rx_tti = callback_tag->slotiId;
rx_sym = callback_tag->symbol;
if (rx_sym == 7) {
if (first_call_set) {
......@@ -98,7 +98,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);
if (last_frame>0 && frame>0 && (slot2>0 && last_frame!=frame) || (slot2 ==0 && last_frame!=((1024+frame-1)&1023)))
if (last_frame>0 && frame>0 && ((slot2>0 && last_frame!=frame) || (slot2 ==0 && last_frame!=((1024+frame-1)&1023))))
LOG_E(PHY,"Jump in frame counter last_frame %d => %d, slot %d\n",last_frame,frame,slot2);
if (last_slot == -1 || slot2 != last_slot) {
#ifndef USE_POLLING
......@@ -219,8 +219,8 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot){
static int last_slot = -1;
first_read_set = 1;
long old_rx_counter[XRAN_PORTS_NUM] = {0,0,0,0,0,0,0,0};
long old_tx_counter[XRAN_PORTS_NUM] = {0,0,0,0,0,0,0,0};
static int64_t old_rx_counter[XRAN_PORTS_NUM] = {0};
static int64_t old_tx_counter[XRAN_PORTS_NUM] = {0};
struct xran_common_counters x_counters[XRAN_PORTS_NUM];
#ifndef USE_POLLING
......@@ -447,10 +447,14 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot){
}
}
}
if ((*frame&0x7f)==0 && *slot == 0 && xran_get_common_counters(app_io_xran_handle, &x_counters[0]) == XRAN_STATUS_SUCCESS) {
#ifdef ORAN_BRONZE
if ((*frame&0x7f)==0 && *slot == 0 && xran_get_common_counters(xranHandle, &x_counters[0]) == XRAN_STATUS_SUCCESS)
#else
if ((*frame&0x7f)==0 && *slot == 0 && xran_get_common_counters(app_io_xran_handle, &x_counters[0]) == XRAN_STATUS_SUCCESS)
#endif
{
for (int o_xu_id = 0; o_xu_id < 1 /*p_usecaseConfiguration->oXuNum*/; o_xu_id++) {
printf("[%s%d][rx %7ld pps %7ld kbps %7ld][tx %7ld pps %7ld kbps %7ld] [on_time %ld early %ld late %ld corrupt %ld pkt_dupl %ld Invalid_Ext1_packets %ld Total %ld]\n",
LOG_I(PHY,"[%s%d][rx %7ld pps %7ld kbps %7ld][tx %7ld pps %7ld kbps %7ld] [on_time %ld early %ld late %ld corrupt %ld pkt_dupl %ld Invalid_Ext1_packets %ld Total %ld]\n",
"o-du ",
o_xu_id,
x_counters[o_xu_id].rx_counter,
......@@ -464,9 +468,14 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot){
x_counters[o_xu_id].Rx_late,
x_counters[o_xu_id].Rx_corrupt,
x_counters[o_xu_id].Rx_pkt_dupl,
#ifndef ORAN_BRONZE
x_counters[o_xu_id].rx_invalid_ext1_packets,
#else
0L,
#endif
x_counters[o_xu_id].Total_msgs_rcvd);
for (int rxant=0;rxant<xran_max_antenna_nr && rxant<ru->nb_rx;rxant++)
LOG_I(PHY,"[%s%d][pusch%d %7ld prach%d %7ld]\n","o_du",o_xu_id,rxant,x_counters[o_xu_id].rx_pusch_packets[rxant],rxant,x_counters[o_xu_id].rx_prach_packets[rxant]);
if (x_counters[o_xu_id].rx_counter > old_rx_counter[o_xu_id])
old_rx_counter[o_xu_id] = x_counters[o_xu_id].rx_counter;
if (x_counters[o_xu_id].tx_counter > old_tx_counter[o_xu_id])
......@@ -626,53 +635,6 @@ return(0);
#if 0
int64_t count_sec =0;
struct xran_common_counters x_counters;
uint64_t nTotalTime;
uint64_t nUsedTime;
uint32_t nCoreUsed;
float nUsedPercent;
uint64_t old_rx_counter = 0;
uint64_t old_tx_counter = 0;
int compute_xran_statistics(void *xranlib_){
xranLibWraper *xranlib = ((xranLibWraper *) xranlib_);
if(xran_get_common_counters(xranlib->get_xranhandle(), &x_counters) == XRAN_STATUS_SUCCESS) {
xran_get_time_stats(&nTotalTime, &nUsedTime, &nCoreUsed, 1);
nUsedPercent = ((float)nUsedTime * 100.0) / (float)nTotalTime;
printf("[rx %7ld pps %7ld kbps %7ld][tx %7ld pps %7ld kbps %7ld] [on_time %ld early %ld late %ld corrupt %ld pkt_dupl %ld Total %ld] IO Util: %5.2f %%\n",
x_counters.rx_counter,
x_counters.rx_counter-old_rx_counter,
x_counters.rx_bytes_per_sec*8/1000L,
x_counters.tx_counter,
x_counters.tx_counter-old_tx_counter,
x_counters.tx_bytes_per_sec*8/1000L,
x_counters.Rx_on_time,
x_counters.Rx_early,
x_counters.Rx_late,
x_counters.Rx_corrupt,
x_counters.Rx_pkt_dupl,
x_counters.Total_msgs_rcvd,
nUsedPercent);
if(x_counters.rx_counter > old_rx_counter)
old_rx_counter = x_counters.rx_counter;
if(x_counters.tx_counter > old_tx_counter)
old_tx_counter = x_counters.tx_counter;
} else {
printf("error xran_get_common_counters\n");
return(1);
}
return (0);
}
#endif
void check_xran_ptp_sync(){
int res;
if ((res=xran_is_synchronized()) != 0)
......
......@@ -2224,10 +2224,10 @@ void *oai_main(int argc,char *argv[])
}
pXranConf->prach_conf.nPrachSubcSpacing = startupConfiguration.mu_number;
pXranConf->prach_conf.nPrachFreqStart = 0;
pXranConf->prach_conf.nPrachFreqStart = startupConfiguration.prachOffset;
pXranConf->prach_conf.nPrachFilterIdx = XRAN_FILTERINDEX_PRACH_ABC;
pXranConf->prach_conf.nPrachConfIdx = startupConfiguration.prachConfigIndex;
pXranConf->prach_conf.nPrachFreqOffset = -792;
pXranConf->prach_conf.nPrachFreqOffset = startupConfiguration.prachFreqOffset;
pXranConf->srs_conf.symbMask = startupConfiguration.srsSymMask;
pXranConf->srs_conf.eAxC_offset = 2 * startupConfiguration.numAxc; /* PUSCH, PRACH, SRS */
......
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