Fixed issues in processing of large DL packets [Issue-ID: ODUHIGH-309] 67/5767/2
authorsphoorthi <sphoorthi.dayanand@radisys.com>
Mon, 15 Mar 2021 16:40:56 +0000 (22:10 +0530)
committersphoorthi <sphoorthi.dayanand@radisys.com>
Tue, 16 Mar 2021 08:12:04 +0000 (13:42 +0530)
Change-Id: I297c4dd8c8a3cc36356cfed17d74e13d440e462b
Signed-off-by: sphoorthi <sphoorthi.dayanand@radisys.com>
src/5gnrsch/sch.h
src/5gnrsch/sch_common.c
src/5gnrsch/sch_slot_ind.c
src/5gnrsch/sch_utils.c
src/5gnrsch/sch_utils.h
src/cm/mac_sch_interface.h
src/cm/rlc_mac_inf.h
src/codec_utils/common/odu_common_codec.c
src/du_app/du_egtp.c
src/ric_stub/ric_e2ap_msg_hdl.c

index 11ec501..d99f671 100644 (file)
@@ -142,7 +142,7 @@ typedef struct schLcCtxt
    uint8_t lcId;     // logical Channel ID
    uint8_t lcp;      // logical Channel Prioritization
    SchLcState lcState;
-   uint16_t bo;
+   uint32_t bo;
 }SchDlLcCtxt;
 
 typedef struct schDlCb
@@ -233,14 +233,14 @@ uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,uint16_t
 uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
 uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst);
 uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot);
-uint16_t schCalcTbSize(uint16_t payLoadSize);
+uint16_t schCalcTbSize(uint32_t payLoadSize);
 uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols);
 uint16_t schAllocPucchResource(SchCellCb *cell, uint16_t crnti, uint16_t slot);
 uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst);
 uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo puschInfo, DciInfo *dciInfo);
 uint8_t schFillPuschAlloc(SchUeCb *ueCb, uint16_t pdcchSlot, uint32_t dataVol, SchPuschInfo *puschInfo);
 uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t crnti,
-   uint16_t accumalatedSize, uint16_t slot);
+   uint32_t *accumalatedSize, uint16_t slot);
 uint16_t schAccumalateLcBoSize(SchCellCb *cell, uint16_t ueIdx);
 
 /**********************************************************************
index 019718b..83d3141 100644 (file)
@@ -710,7 +710,7 @@ uint16_t schAllocPucchResource(SchCellCb *cell, uint16_t crnti, uint16_t slot)
  *
  * ****************************************************************/
 uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t crnti,
-      uint16_t accumalatedSize, uint16_t slot)
+      uint32_t *accumalatedSize, uint16_t slot)
 {
    uint8_t ueIdx;
    uint16_t tbSize = 0;
@@ -777,7 +777,9 @@ uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t cr
       pdsch->codeword[cwCount].mcsIndex = ueCb.ueCfg.dlModInfo.mcsIndex;
       pdsch->codeword[cwCount].mcsTable = ueCb.ueCfg.dlModInfo.mcsTable;
       pdsch->codeword[cwCount].rvIndex = 0;
-      tbSize = schCalcTbSize(accumalatedSize);
+      tbSize = schCalcTbSize(*accumalatedSize);
+      if(tbSize < *accumalatedSize)
+         *accumalatedSize = tbSize;
       pdsch->codeword[cwCount].tbSize = tbSize;
    }
    pdsch->dataScramblingId = cell->cellCfg.phyCellId;
index 935d22c..3a23293 100644 (file)
@@ -140,7 +140,7 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
    uint8_t ueIdx, lcIdx;
    uint16_t slot;
    uint16_t crnti = 0;
-   uint16_t accumalatedSize = 0;
+   uint32_t accumalatedSize = 0;
    SchUeCb *ueCb = NULLP;
 
    while(cell->boIndBitMap)
@@ -184,7 +184,13 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
       }
 
       /* pdcch and pdsch data is filled */
-      schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, accumalatedSize, slot);
+      schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, &accumalatedSize, slot);
+      /* Calculated TB size could be less than the total size requested.
+       * Hence, updated the scheduled bytes report. Following is valid only for
+       * one LC.
+       * TODO : Update the scheduling byte report for multiple LC based on QCI
+       * and Priority */
+      dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc -1].schBytes = accumalatedSize;
 
       /* PUCCH resource */
       schAllocPucchResource(cell, dlMsgAlloc->crnti, slot);
index 713e2a8..97c6aa3 100644 (file)
@@ -470,11 +470,16 @@ uint8_t pucchResourceSet[MAX_PUCCH_RES_SET_IDX][4] = {
  *  @param[in]  payLoadSize - size of payload in bytes
  *  @return     TBsize from the Table in bytes
  **/
-uint16_t schCalcTbSize(uint16_t payLoadSize)
+uint16_t schCalcTbSize(uint32_t payLoadSize)
 {
    uint8_t tbsIndex = 0;
-   payLoadSize = payLoadSize*8;
+   uint16_t maxTbSize;
+
+   maxTbSize = tbSizeTable[TOTAL_TBSIZE_VALUES -1]/8;
+   if(payLoadSize >= maxTbSize)
+      return maxTbSize;
 
+   payLoadSize = payLoadSize*8;
    while(payLoadSize > tbSizeTable[tbsIndex])
    {
       tbsIndex++;
index 60c92ea..09ac4c9 100644 (file)
@@ -88,7 +88,7 @@ int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4];
 
 /* functions declarations */
 void freqDomRscAllocType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain);
-uint16_t schCalcTbSize(uint16_t payLoadSize);
+uint16_t schCalcTbSize(uint32_t payLoadSize);
 uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols);
 uint16_t schCalcTbSizeFromNPrb(uint16_t numPrb, uint16_t mcs, uint8_t numSymbols);
 SchUeCb* schGetUeCb(SchCellCb *cellCb, uint16_t crnti);
index 14ea26a..7fd0d6d 100644 (file)
@@ -730,7 +730,7 @@ typedef struct dlMsgInfo
 typedef struct lcSchInfo
 {
    uint8_t   lcId;
-   uint16_t  schBytes; /* Number of scheduled bytes */
+   uint32_t  schBytes; /* Number of scheduled bytes */
 }LcSchInfo;
 
 typedef struct dlMsgAlloc
index 97f3fc7..45fc1ee 100644 (file)
@@ -37,7 +37,7 @@ typedef struct rlcBoStatus
    uint16_t   ueIdx;      /*!< UE ID */
    bool       commCh;     /*!< Common or Dedicated Channel */
    uint8_t    lcId;       /*!< Logical channel ID */
-   uint16_t   bo;         /*!< Buffer occupancy reported by RLC */
+   uint32_t   bo;         /*!< Buffer occupancy reported by RLC */
 }RlcBoStatus;
 
 /* Scheduled logical channel info */
@@ -45,7 +45,7 @@ typedef struct rlcLcSchInfo
 {
    bool      commCh;      /* Common or dedicated channel */
    uint8_t   lcId;        /*!< Logical channel ID */
-   uint16_t  bufSize;  /*!< Total buffer size in bytes scheduled by MAC */
+   uint32_t  bufSize;  /*!< Total buffer size in bytes scheduled by MAC */
 }RlcLcSchInfo;
 
 /* Schedule result report */
index 9439554..cb302f4 100644 (file)
@@ -56,10 +56,7 @@ uint8_t fillBitString(BIT_STRING_t *id, uint8_t unusedBits, uint8_t byteSize, ui
       return RFAILED;
    }
 
-   for (tmp = 0 ; tmp < (byteSize-1); tmp++)
-   {
-      id->buf[tmp] = tmp;
-   }
+   memset(id->buf, 0, byteSize-1);
    id->buf[byteSize-1]   = val;
    id->bits_unused = unusedBits;
    return ROK;
index 90f67bc..03befe8 100644 (file)
@@ -824,8 +824,8 @@ uint8_t egtpRecvMsg()
          &recvBuf, (int16_t *)&bufLen, CM_INET_NO_FLAG);
       if(ret == ROK && recvBuf != NULLP)
       {  
-         DU_LOG("\nDEBUG  -->  EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1);
-         ODU_PRINT_MSG(recvBuf, 0 ,0);
+         //DU_LOG("\nDEBUG  -->  EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1);
+         //ODU_PRINT_MSG(recvBuf, 0 ,0);
          egtpHdlRecvData(recvBuf);
          gDlDataRcvdCnt++;
       }
@@ -895,11 +895,11 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
    /* Extracting version fro 1st byte */
    version = tmpByte[0] >> 5;
    
-   DU_LOG("\nDEBUG   -->  EGTP : Version %d", version);
+   //DU_LOG("\nDEBUG   -->  EGTP : Version %d", version);
  
    /* Decode message type */
    ODU_REM_PRE_MSG((Data*)&(egtpMsg->msgHdr.msgType), mBuf);
-   DU_LOG("\nDEBUG   -->  EGTP : msgType %d", egtpMsg->msgHdr.msgType);
+   //DU_LOG("\nDEBUG   -->  EGTP : msgType %d", egtpMsg->msgHdr.msgType);
 
    /****************************************************************************
     * Message length param is 2 bytes. So decode next 2 bytes from msg hdr and
@@ -908,7 +908,7 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
    ODU_REM_PRE_MSG(&tmpByte[1], mBuf);
    ODU_REM_PRE_MSG(&tmpByte[2], mBuf);
    msgLen = (tmpByte[1] << 8) | tmpByte[2];
-   DU_LOG("\nDEBUG   -->  EGTP : msgLen %d", msgLen);
+   //DU_LOG("\nDEBUG   -->  EGTP : msgLen %d", msgLen);
 
 
    /****************************************************************************
@@ -920,7 +920,7 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
    ODU_REM_PRE_MSG(&tmpByte[3], mBuf);
    ODU_REM_PRE_MSG(&tmpByte[4], mBuf);
    egtpMsg->msgHdr.teId = (tmpByte[1] << 24) | (tmpByte[2] << 16) | (tmpByte[3] << 8) | tmpByte[4];
-   DU_LOG("\nDEBUG   -->  EGTP : teId %d",egtpMsg->msgHdr.teId);
+   //DU_LOG("\nDEBUG   -->  EGTP : teId %d",egtpMsg->msgHdr.teId);
 
 
    /* If any one of S, E or PN flag is set, set extension present as true. */
@@ -1032,8 +1032,8 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
 
    egtpMsg->msg = mBuf;
 
-   DU_LOG("\nDEBUG   -->  EGTP : DL Data Buffer after decoding header ");
-   ODU_PRINT_MSG(mBuf, 0, 0);
+   //DU_LOG("\nDEBUG   -->  EGTP : DL Data Buffer after decoding header ");
+   //ODU_PRINT_MSG(mBuf, 0, 0);
 
    /* Forward the data to duApp/RLC */
  
index e48ac4e..851fb5d 100644 (file)
@@ -104,7 +104,7 @@ S16 BuildGlobalRicId(GlobalRIC_ID_t *ricId)
 {
    uint8_t unused = 4;
    uint8_t byteSize = 3;
-   uint8_t val = 1;
+   uint8_t val = 16;
    if(ricId != NULLP)
    {
       ricId->pLMN_Identity.size = byteSize * sizeof(uint8_t);