Removed EGTP_TEST flag and Modified algorithm for pumping DL data [Issue-ID: ODUHIGH... 04/6804/6
authorlal.harshita <Harshita.Lal@radisys.com>
Thu, 30 Sep 2021 12:03:21 +0000 (17:33 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Mon, 4 Oct 2021 07:04:37 +0000 (12:34 +0530)
Change-Id: I4886b9ce6957f3940babf40a4446c93cc2aeda88
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
build/odu/makefile
docs/README
src/5gnrmac/mac_msg_hdl.c
src/5gnrmac/mac_mux.c
src/5gnrsch/sch_slot_ind.c
src/cu_stub/cu_stub.c
src/cu_stub/cu_stub_egtp.h
src/du_app/du_cfg.h
src/du_app/du_msg_hdl.c

index 193760d..03284ec 100644 (file)
@@ -74,7 +74,7 @@ endif
 # macro for output file name and makefile name
 #
 
-PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DCALL_FLOW_DEBUG_LOG #-DODU_MEMORY_DEBUG_LOG #-DODU_SLOT_IND_DEBUG_LOG -DEGTP_TEST
+PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DCALL_FLOW_DEBUG_LOG -DODU_MEMORY_DEBUG_LOG -DODU_SLOT_IND_DEBUG_LOG
 
 ifeq ($(MODE),TDD)
    PLTFRM_FLAGS += -DNR_TDD
index 741ec5e..bd57bec 100644 (file)
@@ -18,7 +18,7 @@ A. Directory Structure :
    f. mt       : wrapper functions over OS
    g. phy_stub : Stub code for Physical layer
    h. rlog     : logging module
-   i. o1       : o1 module
+   i. O1       : O1 module
 
 
 B. Pre-requisite for Compilation :
index 76547de..f34810b 100644 (file)
 
 MacCb  macCb;
 
-uint16_t buildMacPdu(RlcData *dlData);
-#ifdef EGTP_TEST
-void macStubBuildUlData(Buffer *mBuf);
-#endif
-
 /* Function pointer for sending crc ind from MAC to SCH */
 MacSchCrcIndFunc macSchCrcIndOpts[]=
 {
index affdac2..d0b4340 100644 (file)
@@ -311,7 +311,7 @@ void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *txPdu, uint16_t
 {
    uint16_t bytePos = 0;
    uint8_t bitPos = 7;
-   uint8_t idx = 0;
+   uint8_t pduIdx = 0;
    uint8_t macPdu[tbSize];
    memset(macPdu, 0, (tbSize * sizeof(uint8_t)));
 
@@ -330,62 +330,62 @@ void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *txPdu, uint16_t
    /* PACK ALL MAC CE */
    if(macCeData != NULLP)
    {
-      for(idx = 0; idx < macCeData->numCes; idx++)
+      for(pduIdx = 0; pduIdx < macCeData->numCes; pduIdx++)
       {
-        lcid = macCeData->macCe[idx].macCeLcid;
-        switch(lcid)
-        {
-           case MAC_LCID_CRI:
-              {
-                 /* Packing fields into MAC PDU R/R/LCID */
-                 packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
-                 packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
-                 memcpy(&macPdu[bytePos], macCeData->macCe[idx].macCeValue,\
-                       MAX_CRI_SIZE);
-                 bytePos += MAX_CRI_SIZE;
-                 break;
-              }
-           default:
-              DU_LOG("\nERROR  -->  MAC: Invalid LCID %d in mac pdu",lcid);
-              break;
-        }
+         lcid = macCeData->macCe[pduIdx].macCeLcid;
+         switch(lcid)
+         {
+            case MAC_LCID_CRI:
+               {
+                  /* Packing fields into MAC PDU R/R/LCID */
+                  packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
+                  packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
+                  memcpy(&macPdu[bytePos], macCeData->macCe[pduIdx].macCeValue,\
+                        MAX_CRI_SIZE);
+                  bytePos += MAX_CRI_SIZE;
+                  break;
+               }
+            default:
+               DU_LOG("\nERROR  -->  MAC: Invalid LCID %d in mac pdu",lcid);
+               break;
+         }
       }
    }
 
    /* PACK ALL MAC SDUs */
-   for(idx = 0; idx < dlData->numPdu; idx++)
+   for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
    {
-      lcid = dlData->pduInfo[idx].lcId;
+      lcid = dlData->pduInfo[pduIdx].lcId;
       switch(lcid)
       {
-        case MAC_LCID_CCCH:
-        case MAC_LCID_MIN ... MAC_LCID_MAX :
-           {
-              lenField = dlData->pduInfo[idx].pduLen;
-              if(dlData->pduInfo[idx].pduLen > 255)
-              {
-                 FBit = 1;
-                 lenFieldSize = 16;
-
-              }
-              else
-              {
-                 FBit = 0;
-                 lenFieldSize = 8;
-              }
-              /* Packing fields into MAC PDU R/F/LCID/L */
-              packBytes(macPdu, &bytePos, &bitPos, RBit, RBitSize);
-              packBytes(macPdu, &bytePos, &bitPos, FBit, FBitSize);
-              packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
-              packBytes(macPdu, &bytePos, &bitPos, lenField, lenFieldSize);
-              memcpy(&macPdu[bytePos], dlData->pduInfo[idx].dlPdu, lenField);
-              bytePos += lenField;
-              break;
-           }
-
-        default:
-           DU_LOG("\nERROR  -->  MAC: Invalid LCID %d in mac pdu",lcid);
-           break;
+         case MAC_LCID_CCCH:
+         case MAC_LCID_MIN ... MAC_LCID_MAX :
+            {
+               lenField = dlData->pduInfo[pduIdx].pduLen;
+               if(dlData->pduInfo[pduIdx].pduLen > 255)
+               {
+                  FBit = 1;
+                  lenFieldSize = 16;
+
+               }
+               else
+               {
+                  FBit = 0;
+                  lenFieldSize = 8;
+               }
+               /* Packing fields into MAC PDU R/F/LCID/L */
+               packBytes(macPdu, &bytePos, &bitPos, RBit, RBitSize);
+               packBytes(macPdu, &bytePos, &bitPos, FBit, FBitSize);
+               packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
+               packBytes(macPdu, &bytePos, &bitPos, lenField, lenFieldSize);
+               memcpy(&macPdu[bytePos], dlData->pduInfo[pduIdx].dlPdu, lenField);
+               bytePos += lenField;
+               break;
+            }
+
+         default:
+            DU_LOG("\nERROR  -->  MAC: Invalid LCID %d in mac pdu",lcid);
+            break;
       }
    }
    if(bytePos < tbSize && (tbSize-bytePos >= 1))
index a29faaf..7b7a1f7 100644 (file)
@@ -264,12 +264,16 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM
 
       /* pdcch and pdsch data is filled */
       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
+
+      /* TODO : Update the scheduling byte report for multiple LC based on QCI
        * and Priority */
-      dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc -1].schBytes = accumalatedSize;
+      /* As of now, the total number of bytes scheduled for a slot is divided
+       * equally amongst all LC with pending data. This is avoid starving of any
+       * LC 
+       * */
+      accumalatedSize = accumalatedSize/dlMsgAlloc->numLc;
+      for(lcIdx = 0; lcIdx < dlMsgAlloc->numLc; lcIdx ++)
+         dlMsgAlloc->lcSchInfo[lcIdx].schBytes = accumalatedSize;
 
       /* PUCCH resource */
       schAllocPucchResource(cell, dlMsgAlloc->crnti, slot);
index 4460c03..e9ae4ef 100644 (file)
@@ -241,6 +241,7 @@ void *cuConsoleHandler(void *args)
    char ch;
    uint8_t teId = 0;
    uint8_t ret = ROK;
+   uint8_t cnt = 0;
 
    while(true) 
    {
@@ -248,7 +249,8 @@ void *cuConsoleHandler(void *args)
       if((ch = getchar()) == 'd')
       {
 
-         uint8_t cnt =0;
+      /* Change #if 0 to #if 1 to take input from user */
+#if 0
          DU_LOG("\n EGTP --> : Enter TEID id(1..10) where DL Data to be sent\n");
          scanf("%d",&teId);
          
@@ -260,17 +262,35 @@ void *cuConsoleHandler(void *args)
          }
          /* Start Pumping data from CU to DU */
          DU_LOG("\nDEBUG  -->  EGTP: Sending DL User Data(teId:%d)\n",teId);
-         
+
+         cnt =0;
          while(cnt < NUM_DL_PACKETS)
          {
-           ret =  cuEgtpDatReq(teId);      
-           if(ret != ROK)
-           {
-             DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
-             break;
-           }
-           cnt++;
+            ret =  cuEgtpDatReq(teId);
+            if(ret != ROK)
+            {
+               DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
+               break;
+            }
+            cnt++;
+         }
+#else
+         for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++)
+         {
+            DU_LOG("\nDEBUG  -->  EGTP: Sending DL User Data(teId:%d)\n",teId);
+            cnt =0;
+            while(cnt < NUM_DL_PACKETS)
+            {
+               ret =  cuEgtpDatReq(teId);      
+               if(ret != ROK)
+               {
+                  DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
+                  break;
+               }
+               cnt++;
+            }
          }
+#endif
          continue;
       } 
    }
index 5addcb0..993e4ad 100644 (file)
@@ -47,6 +47,7 @@
 #define EGTP_MASK_BIT7                   0x40
 #define EGTP_MASK_BIT8                   0x80
 
+#define NUM_TUNNEL_TO_PUMP_DATA 3
 #define NUM_DL_PACKETS 4
 
 uint8_t         sockType;
index 168b22d..9a7029d 100644 (file)
 /* Events */
 #define EVTCFG 0
 
-#ifdef EGTP_TEST
-/* Macro definitions for EGTP procedures */
-#define EGTP_LCL_TEID 1     /* EGTP local tunnel id */
-#define EGTP_REM_TEID 10    /* EGTP remote tinnel id */
-#endif
-
-
 /* Macro definitions for F1 procedures */
 #define CU_DU_NAME_LEN_MAX 30      /* Max length of CU/DU name string */
 #define MAX_F1_CONNECTIONS 65536    /* Max num of F1 connections */
 #define DMRS_ADDITIONAL_POS  0          /* DMRS Additional poistion */
 #define RES_ALLOC_TYPE       1          /* Resource allocation type */
 
-#ifdef EGTP_TEST
-#define UE_ID 1
-#define RB_ID 1
-#define LC_ID 1
-#endif
-
 /* MACRO definitions for modulcation order */
 #define MOD_ORDER_QPSK  2
 #define MOD_ORDER_QAM16 4
index fd1fe65..7a31fa8 100644 (file)
@@ -1071,9 +1071,7 @@ uint8_t duHdlEgtpCfgComplete(CmStatus cfm)
    if(cfm.status == LCM_PRIM_OK)
    {
       DU_LOG("\nDEBUG   -->  DU_APP : EGTP configuraton complete");
-#ifdef EGTP_TEST
       duSendEgtpSrvOpenReq();
-#endif
    }
    else
    {