Fix for memory leak in UL data path at cu_stub [Issue-ID: ODUHIGH-398] 56/7456/2
authorbarveankit <anbarve@radisys.com>
Wed, 22 Dec 2021 11:53:08 +0000 (17:23 +0530)
committerbarveankit <anbarve@radisys.com>
Wed, 22 Dec 2021 13:56:40 +0000 (19:26 +0530)
Signed-off-by: barveankit <anbarve@radisys.com>
Change-Id: Iddf1ffcffdadefb3d9aeed103cf87b1c0ccc64b6
Signed-off-by: barveankit <anbarve@radisys.com>
src/cu_stub/cu_stub_egtp.c
src/cu_stub/cu_stub_sctp.c
src/du_app/du_egtp.c
src/du_app/du_egtp.h
src/phy_stub/phy_stub.h

index 65f19a2..cb3c5c8 100644 (file)
@@ -616,6 +616,8 @@ S16 cuEgtpDecodeHdr(Buffer *mBuf)
    DU_LOG("\nDEBUG  -->  EGTP : Message Buffer after decoding header [TEID:%d]",egtpMsg.msgHdr.teId);
    ODU_PRINT_MSG(mBuf, 0, 0);
 
+   SPutMsg(mBuf);
+
    return ROK;
      
 } /* End of cuEgtpDecodeHdr */
index 39874f6..fc0fe3b 100644 (file)
@@ -404,6 +404,7 @@ S16 sctpSockPoll()
    CmInetAddr    egtpFromAddr;
    CmInetMemInfo memInfo;
    sctpSockPollParams f1PollParams;
+   uint64_t      numMsgRcvd = 0;
 
    memset(&f1PollParams, 0, sizeof(sctpSockPollParams));
     
@@ -438,8 +439,9 @@ S16 sctpSockPoll()
       ret = cmInetRecvMsg(&(egtpCb.recvTptSrvr.sockFd), &egtpFromAddr, &memInfo, &egtpBuf, &egtpBufLen, CM_INET_NO_FLAG);
       if(ret == ROK && egtpBuf != NULLP)
       {
-         DU_LOG("\nINFO  -->  EGTP : Received message \n");
-         ODU_PRINT_MSG(egtpBuf, 0 ,0);
+         DU_LOG("\nINFO  -->  EGTP : Received UL Message [%ld]\n", numMsgRcvd+1);
+         numMsgRcvd++;
+         //ODU_PRINT_MSG(egtpBuf, 0 ,0);
          cuEgtpHdlRecvMsg(egtpBuf);
 
       }
index 075cd7c..76ec0cf 100644 (file)
@@ -29,8 +29,6 @@
 #include "du_egtp.h"
 #include "du_utils.h"
 
-/* Global variable declaration */
-EgtpGlobalCb egtpCb;
 
 /**************************************************************************
  * @brief Task Initiation callback function. 
@@ -874,6 +872,7 @@ uint8_t egtpSendMsg(Buffer *mBuf)
    uint16_t       txLen;
    CmInetMemInfo  info;
    CmInetAddr     dstAddr;
+   static uint64_t numDataSent = 0;
 
    info.region = DU_APP_MEM_REGION;
    info.pool = DU_POOL;
@@ -888,6 +887,11 @@ uint8_t egtpSendMsg(Buffer *mBuf)
       DU_LOG("\nERROR  -->  EGTP : Failed sending the message");
       return RFAILED;
    }
+   else
+   {
+      DU_LOG("\nDEBUG -->  EGTP : Sent UL Message [%ld]", numDataSent+1);
+      numDataSent++;
+   }
 
    return ROK;
 }
index 5fb3d65..2f158e2 100644 (file)
@@ -72,6 +72,7 @@ typedef struct egtpGlobalCb
    EgtpTptSrvr  recvTptSrvr;     /* Transport server for receiving UDP msg */
    EgtpDstCb    dstCb;           /* Destination endpoint */
 }EgtpGlobalCb;
+
 EgtpGlobalCb egtpCb;   /* EGTP global control block */
 
 uint8_t duHdlEgtpDlData(EgtpMsg  *egtpMsg);
index 6ee1a8f..ffa77bc 100644 (file)
@@ -26,7 +26,7 @@
 #define NR_PCI            1
 #define SLOT_DELAY       3
 #define NUM_DRB_TO_PUMP_DATA  3
-#define NUM_UL_PACKETS   4
+#define NUM_UL_PACKETS   1
 /*UE Ids for RACH IND*/
 #define UE_IDX_0     0
 #define UE_IDX_1     1