X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_utils.h;h=dfdc3127769c99e16201c9173be99975be8a0554;hb=refs%2Fchanges%2F49%2F12949%2F3;hp=3645a8565da2210758cdc539366bc0e556d4373d;hpb=1d6200fae3b85714f8d9ddec062a01c8b9faca23;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_utils.h b/src/5gnrrlc/rlc_utils.h index 3645a8565..dfdc31277 100755 --- a/src/5gnrrlc/rlc_utils.h +++ b/src/5gnrrlc/rlc_utils.h @@ -39,6 +39,7 @@ extern "C" { #endif /* __cplusplus */ #include "du_log.h" +#include "du_app_rlc_inf.h" #define EKWxxx 1 @@ -103,11 +104,20 @@ extern "C" { * Memory related Defines ******************************************************************************/ /* Allocate function */ +#ifdef MEM_SIZE_CHECK +#define RLC_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) \ +{\ + DU_LOG("\nRLC line = %d, func = %s, _size= %d ", _line, _func, _size); \ +} +#else +#define RLC_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) {} +#endif + #ifdef ODU_MEMORY_DEBUG_LOG #define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ {\ - printf("\n%s=== %s +%d, %s, %d, %p\n", \ - _macro, _file, _line, _func, _size, _datPtr); \ + printf("\n%s,=== %s +%d, %s, %lu, %p \n", \ + _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \ } #else #define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {} @@ -115,10 +125,11 @@ extern "C" { #define RLC_ALLOC(_cb,_buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if (SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, \ (Size) _size) == ROK) \ { \ - RLC_MEM_LOG("RLC_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ memset((_buf), 0, _size); \ } \ else \ @@ -131,7 +142,7 @@ extern "C" { { \ if (_buf != NULLP) \ { \ - RLC_MEM_LOG("RLC_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ (Void) SPutSBuf(_cb->init.region, _cb->init.pool, \ (Data *) _buf, (Size) _size); \ _buf = NULLP; \ @@ -142,7 +153,7 @@ extern "C" { { \ if (_buf != NULLP) \ { \ - RLC_MEM_LOG("RLC_FREE_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,FREE_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ (Void) SPutStaticBuffer(_region, _pool, \ (Data *) _buf, (Size) _size, 0); \ _buf = NULLP; \ @@ -152,7 +163,7 @@ extern "C" { #define RLC_FREE_SHRABL_BUF_WC(_region, _pool,_buf, _size) \ { \ if (_buf != NULLP){\ - RLC_MEM_LOG("RLC_FREE_SHRABL_BUF_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,FREE_SHRABL_BUF_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ (Void) SPutStaticBuffer(_region, _pool, \ (Data *) _buf, (Size) _size, 0); \ _buf = NULLP; \ @@ -161,10 +172,11 @@ extern "C" { #define RLC_ALLOC_SHRABL_BUF_WC(_region, _pool,_buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if(SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ (Size) _size, 0)==ROK) \ {\ - RLC_MEM_LOG("RLC_ALLOC_SHRABL_BUF_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,ALLOC_SHRABL_BUF_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ }\ else\ {\ @@ -174,10 +186,11 @@ extern "C" { #define RLC_ALLOC_SHRABL_BUF(_region, _pool,_buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if (SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ (Size) _size, 0) == ROK) \ { \ - RLC_MEM_LOG("RLC_ALLOC_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,ALLOC_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ memset((_buf), 0, _size); \ } \ else \ @@ -188,9 +201,10 @@ extern "C" { #define RLC_ALLOC_WC(_cb,_buf, _size) \ {\ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if(SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, (Size) _size) == ROK)\ {\ - RLC_MEM_LOG("RLC_ALLOC_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,ALLOC_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ }\ } @@ -198,7 +212,7 @@ extern "C" { { \ if(_sdu->mBuf) \ { \ - RLC_MEM_LOG("RLC_REMOVE_SDU", __FILE__, __LINE__, __FUNCTION__, _sdu->sduSz, _sdu->mBuf);\ + RLC_MEM_LOG("RLC,REMOVE_SDU", __FILE__, __LINE__, __FUNCTION__, _sdu->sduSz, _sdu->mBuf);\ ODU_PUT_MSG_BUF(_sdu->mBuf); \ } \ cmLListDelFrm(_sduQ,&_sdu->lstEnt); \ @@ -210,7 +224,7 @@ extern "C" { { \ if (_buf != NULLP) \ { \ - RLC_MEM_LOG("RLC_PST_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,PST_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ (Void) SPutSBuf(_region, _pool, \ (Data *) _buf, (Size) _size); \ _buf = NULLP; \ @@ -260,7 +274,7 @@ extern "C" { { \ if (_buf != NULLP) \ { \ - RLC_MEM_LOG("RLC_SHRABL_STATIC_BUF_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,SHRABL_STATIC_BUF_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ (Void) SPutStaticBuffer(_region, _pool, \ (Data *) _buf, (Size) _size, 0); \ _buf = NULLP; \ @@ -269,9 +283,10 @@ extern "C" { #define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ (Size) _size, 0); \ - RLC_MEM_LOG("RLC_SHRABL_STATIC_BUF_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ + RLC_MEM_LOG("RLC,SHRABL_STATIC_BUF_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ } #endif @@ -465,8 +480,9 @@ extern "C" { #ifdef LTE_L2_MEAS #define EVENT_RLC_L2_TMR 6 #endif /* LTE_L2_MEAS */ -#define EVENT_RLC_THROUGHPUT_TMR 7 +#define EVENT_RLC_UE_THROUGHPUT_TMR 7 #define EVENT_RLC_UE_DELETE_TMR 8 +#define EVENT_RLC_SNSSAI_THROUGHPUT_TMR 9 /* Wait time for RLC Timers */ #define RLC_UE_DELETE_WAIT_TIME 5 /*in milliseconds */ @@ -1114,7 +1130,6 @@ do \ #define RLC_DL_INST 1 #define PDCP_SN 1 -#define RLC_REASSEMBLY_TMR_BASE 5 /* Used to calculate timer value from enum values */ /* Fill Pst structure for sending msg from RLC to DUAPP */ #define FILL_PST_RLC_TO_DUAPP(_pst, _srcInst, _event) \ @@ -1217,7 +1232,7 @@ typedef struct _rlcStats UMRLCStats umRlcStats; }RLCStats; -RLCStats gRlcStats; +extern RLCStats gRlcStats; /* kw005.201 added support for L2 Measurement */ #ifdef LTE_L2_MEAS @@ -1713,16 +1728,36 @@ typedef struct rlcThptPerUe uint64_t dataVol; }RlcThptPerUe; +typedef struct rlcTptPerSnssai +{ + Snssai *snssai; + uint64_t dataVol; + double tpt; +}RlcTptPerSnssai; + + +typedef struct rlcSnssaiTputInfo +{ + CmTimer snssaiThptTmr; /* Throughput Timer */ + CmLListCp *dlTputPerSnssaiList; + CmLListCp *ulTputPerSnssaiList; +}RlcSnssaiTputInfo; + +typedef struct rlcUeTputInfo +{ + CmTimer ueThptTmr; /* Throughput Timer */ + uint8_t numActvUe; /* Number of Active UEs */ + RlcThptPerUe thptPerUe[MAX_NUM_UE]; /* Throughput calculated per UE */ +}RlcUeTputInfo; /** * @brief Structure to hold information about throughput at RLC * */ typedef struct rlcThpt { - Inst inst; /* RLC instance */ - CmTimer thptTmr; /* Throughput Timer */ - uint8_t numActvUe; /* Number of Active UEs */ - RlcThptPerUe thptPerUe[MAX_NUM_UE]; /* Throughput calculated per UE */ + Inst inst; /* RLC instance */ + RlcUeTputInfo ueTputInfo; + RlcSnssaiTputInfo snssaiTputInfo; }RlcThpt; /** @@ -1758,8 +1793,9 @@ typedef struct rlcCb RlcThpt rlcThpt; /*!< Throughput at RLC*/ }RlcCb; -RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */ +extern RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */ +extern CmLListCp *arrTputPerSnssai[DIR_BOTH]; /*Stores the address of Througput LL*/ /**************************************************************************** * Declarations ***************************************************************************/ @@ -1775,10 +1811,19 @@ void rlcStopTmr ARGS((RlcCb *gCb, PTR cb, uint8_t tmrType)); bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt)); -void rlcThptTmrExpiry(PTR cb); +void rlcUeThptTmrExpiry(PTR cb); uint8_t rlcUeDeleteTmrExpiry(PTR cb); +void rlcSnssaiThptTmrExpiry(PTR cb); +RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai,\ + ActionTypeLL action, Direction dir); +uint8_t rlcCalculateTputPerSnssai(CmLListCp *snssaiList, Direction dir); +uint8_t rlcDelTputSnssaiList(RlcCb *gCb, Direction dir); +uint8_t BuildSliceReportToDu(uint8_t snssaiCnt); +bool rlcFindSliceEntry(SliceIdentifier snssaiVal, uint8_t *snssaiIdx,\ + SlicePmList *sliceStats); + #ifdef LTE_L2_MEAS Void rlcLmmSendAlarm ARGS (( RlcCb *gCb, uint16_t category,