Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[ JIRA Id - ODUHIGH-606 ] Fixing null memory size allocation issue
[o-du/l2.git]
/
src
/
5gnrrlc
/
rlc_utils.h
diff --git
a/src/5gnrrlc/rlc_utils.h
b/src/5gnrrlc/rlc_utils.h
index
edc32d8
..
dfdc312
100755
(executable)
--- a/
src/5gnrrlc/rlc_utils.h
+++ b/
src/5gnrrlc/rlc_utils.h
@@
-104,11
+104,20
@@
extern "C" {
* Memory related Defines
******************************************************************************/
/* Allocate function */
* 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)\
{\
#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) {}
}
#else
#define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {}
@@
-116,10
+125,11
@@
extern "C" {
#define RLC_ALLOC(_cb,_buf, _size) \
{ \
#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) \
{ \
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 \
memset((_buf), 0, _size); \
} \
else \
@@
-132,7
+142,7
@@
extern "C" {
{ \
if (_buf != NULLP) \
{ \
{ \
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; \
(Void) SPutSBuf(_cb->init.region, _cb->init.pool, \
(Data *) _buf, (Size) _size); \
_buf = NULLP; \
@@
-143,7
+153,7
@@
extern "C" {
{ \
if (_buf != NULLP) \
{ \
{ \
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; \
(Void) SPutStaticBuffer(_region, _pool, \
(Data *) _buf, (Size) _size, 0); \
_buf = NULLP; \
@@
-153,7
+163,7
@@
extern "C" {
#define RLC_FREE_SHRABL_BUF_WC(_region, _pool,_buf, _size) \
{ \
if (_buf != NULLP){\
#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; \
(Void) SPutStaticBuffer(_region, _pool, \
(Data *) _buf, (Size) _size, 0); \
_buf = NULLP; \
@@
-162,10
+172,11
@@
extern "C" {
#define RLC_ALLOC_SHRABL_BUF_WC(_region, _pool,_buf, _size) \
{ \
#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) \
{\
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\
{\
}\
else\
{\
@@
-175,10
+186,11
@@
extern "C" {
#define RLC_ALLOC_SHRABL_BUF(_region, _pool,_buf, _size) \
{ \
#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) \
{ \
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 \
memset((_buf), 0, _size); \
} \
else \
@@
-189,9
+201,10
@@
extern "C" {
#define RLC_ALLOC_WC(_cb,_buf, _size) \
{\
#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)\
{\
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);\
}\
}
}\
}
@@
-199,7
+212,7
@@
extern "C" {
{ \
if(_sdu->mBuf) \
{ \
{ \
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); \
ODU_PUT_MSG_BUF(_sdu->mBuf); \
} \
cmLListDelFrm(_sduQ,&_sdu->lstEnt); \
@@
-211,7
+224,7
@@
extern "C" {
{ \
if (_buf != NULLP) \
{ \
{ \
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; \
(Void) SPutSBuf(_region, _pool, \
(Data *) _buf, (Size) _size); \
_buf = NULLP; \
@@
-261,7
+274,7
@@
extern "C" {
{ \
if (_buf != NULLP) \
{ \
{ \
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; \
(Void) SPutStaticBuffer(_region, _pool, \
(Data *) _buf, (Size) _size, 0); \
_buf = NULLP; \
@@
-270,9
+283,10
@@
extern "C" {
#define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \
{ \
#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); \
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
}
#endif
@@
-1218,7
+1232,7
@@
typedef struct _rlcStats
UMRLCStats umRlcStats;
}RLCStats;
UMRLCStats umRlcStats;
}RLCStats;
-RLCStats gRlcStats;
+
extern
RLCStats gRlcStats;
/* kw005.201 added support for L2 Measurement */
#ifdef LTE_L2_MEAS
/* kw005.201 added support for L2 Measurement */
#ifdef LTE_L2_MEAS
@@
-1708,13
+1722,6
@@
typedef struct rlcUlCb
#endif /* LTE_L2_MEAS */
}RlcUlCb;
#endif /* LTE_L2_MEAS */
}RlcUlCb;
-typedef enum
-{
- SEARCH,
- CREATE,
- DELETE
-}RlcSnssaiActionType;
-
typedef struct rlcThptPerUe
{
uint16_t ueId;
typedef struct rlcThptPerUe
{
uint16_t ueId;
@@
-1786,9
+1793,9
@@
typedef struct rlcCb
RlcThpt rlcThpt; /*!< Throughput at RLC*/
}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 */
-CmLListCp *arrTputPerSnssai[DIR_BOTH]; /*Stores the address of Througput LL*/
+
extern
CmLListCp *arrTputPerSnssai[DIR_BOTH]; /*Stores the address of Througput LL*/
/****************************************************************************
* Declarations
***************************************************************************/
/****************************************************************************
* Declarations
***************************************************************************/
@@
-1810,7
+1817,7
@@
uint8_t rlcUeDeleteTmrExpiry(PTR cb);
void rlcSnssaiThptTmrExpiry(PTR cb);
RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai,\
void rlcSnssaiThptTmrExpiry(PTR cb);
RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai,\
-
RlcSnssaiActionType
action, Direction dir);
+
ActionTypeLL
action, Direction dir);
uint8_t rlcCalculateTputPerSnssai(CmLListCp *snssaiList, Direction dir);
uint8_t rlcDelTputSnssaiList(RlcCb *gCb, Direction dir);
uint8_t BuildSliceReportToDu(uint8_t snssaiCnt);
uint8_t rlcCalculateTputPerSnssai(CmLListCp *snssaiList, Direction dir);
uint8_t rlcDelTputSnssaiList(RlcCb *gCb, Direction dir);
uint8_t BuildSliceReportToDu(uint8_t snssaiCnt);