[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-481] Adding Trigger for Ul/Dl data 03/9903/4
authorlal.harshita <Harshita.Lal@radisys.com>
Fri, 2 Dec 2022 10:48:38 +0000 (16:18 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Fri, 2 Dec 2022 11:44:48 +0000 (17:14 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: Ide3a28b37ab8d2bf413cd2b7cfde21da9e58fa5a
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
build/odu/makefile
src/5gnrmac/mac_harq_dl.c
src/5gnrmac/mac_ue_mgr.c
src/5gnrmac/mac_ue_mgr.h [new file with mode: 0644]
src/5gnrrlc/rlc_dl_ul_inf.c
src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_stub.c
src/du_app/du_f1ap_msg_hdl.c
src/phy_stub/phy_stub_msg_hdl.c

index 892d38f..2a7efea 100644 (file)
@@ -74,7 +74,7 @@ endif
 # macro for output file name and makefile name
 #
 
-PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI -UODU_MEMORY_DEBUG_LOG -DDEBUG_ASN_PRINT -DDEBUG_PRINT -DERROR_PRINT #-DNR_DRX -DCALL_FLOW_DEBUG_LOG -DODU_SLOT_IND_DEBUG_LOG
+PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI -UODU_MEMORY_DEBUG_LOG -DDEBUG_ASN_PRINT -DDEBUG_PRINT -DERROR_PRINT -USTART_DL_UL_DATA -UNR_DRX -UCALL_FLOW_DEBUG_LOG -UODU_SLOT_IND_DEBUG_LOG
 
 ifeq ($(MODE),TDD)
    PLTFRM_FLAGS += -DNR_TDD
index 8b3499f..1d62851 100644 (file)
@@ -23,6 +23,7 @@
 #include "mac.h"
 #include "mac_utils.h"
 #include "mac_harq_dl.h"
+#include "mac_ue_mgr.h"
 
 /**
  * @brief Add HARQ process to UE's DL HARQ Entity
index fda65cf..b247bb1 100644 (file)
@@ -2093,11 +2093,9 @@ void deleteMacRaCb(uint16_t cellIdx, MacUeCb *ueCb)
 {
    uint8_t tbIdx;
    MacRaCbInfo *raCb = ueCb->raCb;
-   DlHarqProcCb *hqProcCb;
 
    if(raCb && (raCb->crnti == ueCb->crnti))
    {
-      hqProcCb = &raCb->msg4HqInfo;
       MAC_FREE(raCb->msg4Pdu, raCb->msg4PduLen);
       for(tbIdx = 0; tbIdx < raCb->msg4HqInfo.numTb; tbIdx++)
       {
diff --git a/src/5gnrmac/mac_ue_mgr.h b/src/5gnrmac/mac_ue_mgr.h
new file mode 100644 (file)
index 0000000..327eb3e
--- /dev/null
@@ -0,0 +1,22 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+ *******************************************************************************/
+
+void deleteMacRaCb(uint16_t cellIdx, MacUeCb *ueCb);
+/**********************************************************************
+  End of file
+ **********************************************************************/
index 851a0a1..c3b567f 100755 (executable)
@@ -959,16 +959,16 @@ S16 cmUnpkUdxCfgCfm(UdxCfgCfm func,Pst  *pst,Buffer *mBuf)
            }
 
           ret1 = cmUnpkUdxStruct(mBuf,0,(uint8_t *)cfgCfmInfo, sizeof(RlcCfgCfmInfo));
-#if(ERRCLASS & ERRCLS_DEBUG)
           if(ret1 != ROK)
           {
+#if(ERRCLASS & ERRCLS_DEBUG)
              ODU_PUT_MSG_BUF(mBuf);
              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
                   (ErrVal)EUDXXXX, (ErrVal)ret1, "Unpacking failure");
              return ( ret1 );
-          }
 #endif /* ERRCLASS & ERRCLS_DEBUG */
+          }
           break;
        }
        case UDX_SEL_LWLC:
index 50b2fe8..c510a58 100644 (file)
@@ -11832,6 +11832,10 @@ uint8_t procUeContextModificationResponse(uint32_t duId, F1AP_PDU_t *f1apMsg)
       }
    }
    
+#ifdef START_DL_UL_DATA
+   startDlData();
+#endif
+
    return ROK;
 }
 
index d46ae04..c518951 100644 (file)
@@ -269,27 +269,85 @@ void initiateInterDuHandover(uint32_t sourceDuId, uint32_t targetDuId, uint32_t
 
 /*******************************************************************
  *
- * @brief Handles Console input
+ * @brief start Dl data
  *
  * @details
  *
- *    Function : cuConsoleHandler
+ *    Function : startDlData
  *
- *    Functionality: Handles Console input
+ *    Functionality: start the downlink data
  *
  * @params[in] 
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
-void *cuConsoleHandler(void *args)
+
+uint8_t startDlData()
 {
-   char ch;
    uint32_t teId = 0;
    uint32_t duId;
    uint8_t ret = ROK;
    uint8_t cnt = 0;
+   int32_t totalNumOfTestFlow = 20; 
    EgtpTeIdCb *teidCb = NULLP;
+   
+   while(totalNumOfTestFlow)
+   {
+      for(duId = 1; duId<=MAX_DU_SUPPORTED; duId++)
+      {
+         for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++)
+         {
+            teidCb = NULLP;
+            cmHashListFind(&(egtpCb.dstCb[duId-1].teIdLst), (uint8_t *)&(teId), sizeof(uint32_t), 0, (PTR *)&teidCb);
+            if(teidCb)
+            {
+               cnt =0;
+               DU_LOG("\nDEBUG  -->  EGTP: Sending DL User Data(duId %d, teId:%d)\n", duId, teId);
+               while(cnt < NUM_DL_PACKETS)
+               {
+                  ret =  cuEgtpDatReq(duId, teId);      
+                  if(ret != ROK)
+                  {
+                     DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
+                     break;
+                  }
+                  /* TODO : sleep(1) will be removed later once we will be able to
+                   * support the continuous data pack transfer */
+                  sleep(1);
+                  cnt++;
+               }
+            }
+            else
+            {
+               DU_LOG("\nDEBUG  -->  EGTP: TunnelId Not Found for (duId %d, teId:%d)\n", duId, teId);
+            }
+         }
+      }
+      totalNumOfTestFlow--;
+   }
+   
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Handles Console input
+ *
+ * @details
+ *
+ *    Function : cuConsoleHandler
+ *
+ *    Functionality: Handles Console input
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+void *cuConsoleHandler(void *args)
+{
+   char ch;
 
    while(true) 
    {
@@ -331,42 +389,8 @@ void *cuConsoleHandler(void *args)
           * NUM_TUNNEL_TO_PUMP_DATA = 9, NUM_DL_PACKETS = 1.
           * totalDataPacket = totalNumOfTestFlow * NUM_TUNNEL_TO_PUMP_DATA * NUM_DL_PACKETS 
           * totalDataPacket = [500*9*1] */
-         int32_t totalNumOfTestFlow = 2; 
-
-         while(totalNumOfTestFlow)
-         {
-            for(duId = 1; duId<=MAX_DU_SUPPORTED; duId++)
-            {
-               for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++)
-               {
-                  teidCb = NULLP;
-                  cmHashListFind(&(egtpCb.dstCb[duId-1].teIdLst), (uint8_t *)&(teId), sizeof(uint32_t), 0, (PTR *)&teidCb);
-                  if(teidCb)
-                  {
-                     cnt =0;
-                     DU_LOG("\nDEBUG  -->  EGTP: Sending DL User Data(duId %d, teId:%d)\n", duId, teId);
-                     while(cnt < NUM_DL_PACKETS)
-                     {
-                        ret =  cuEgtpDatReq(duId, teId);      
-                        if(ret != ROK)
-                        {
-                           DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
-                           break;
-                        }
-                        /* TODO : sleep(1) will be removed later once we will be able to
-                         * support the continuous data pack transfer */
-                        sleep(1);
-                        cnt++;
-                     }
-                  }
-                  else
-                  {
-                     DU_LOG("\nDEBUG  -->  EGTP: TunnelId Not Found for (duId %d, teId:%d)\n", duId, teId);
-                  }
-               }
-            }
-            totalNumOfTestFlow--;
-         }
+         
+         startDlData();
 #endif
          continue;
       } 
index e96ebb5..4b43b07 100644 (file)
@@ -13545,7 +13545,8 @@ void freeAperDecodeF1UeContextSetupReq(UEContextSetupRequest_t   *ueSetReq)
 uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
 {
    int8_t ueIdx = -1;
-   uint8_t  ret=0, ieIdx=0, ieExtIdx = 0, servCellIdx = 0;
+   uint8_t  ret=0, ieIdx=0, ieExtIdx = 0;
+   //uint8_t servCellIdx = 0;
    bool ueCbFound = false, hoInProgress = false;
    uint16_t cellIdx=0;
    uint64_t nrCellId = 0;
@@ -13591,7 +13592,7 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
 
          case ProtocolIE_ID_id_ServCellIndex:
             {
-               servCellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
+               //servCellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
                break;
             }
 
index 8021a87..e086982 100644 (file)
 #include "phy_stub_utils.h"
 #include "lwr_mac_phy_stub_inf.h"
 
+/*******************************************************************
+ *
+ * @brief start the uplink data
+ *
+ * @details
+ *
+ *    Function : startUlData 
+ *
+ *    Functionality: start the uplink data
+ *
+ * @params[in]   
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void startUlData()
+{
+   uint8_t ueIdx=0, drbIdx=0;
+
+   /* Start Pumping data from PHY stub to DU */
+   for(ueIdx=0; ueIdx < phyDb.ueDb.numActvUe; ueIdx++)
+   {
+      for(drbIdx = 0; drbIdx < NUM_DRB_TO_PUMP_DATA; drbIdx++) //Number of DRB times the loop will run
+      {
+         DU_LOG("\nDEBUG  --> PHY STUB: Sending UL User Data[DrbId:%d] for UEIdx %d\n",drbIdx,ueIdx);
+         l1SendUlUserData(drbIdx,ueIdx);
+      }
+   } 
+}
+
 /*******************************************************************
  *
  * @brief Builds and sends param response to MAC CL
@@ -667,6 +698,13 @@ break;
    if(pduInfo->pdu_length)
       MAC_FREE(pduInfo->pduData, pduInfo->pdu_length);
    MAC_FREE(rxDataInd, sizeof(fapi_rx_data_indication_t));
+
+#ifdef START_DL_UL_DATA 
+      if(phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp == true)
+      {
+         startUlData();
+      }
+#endif
    return ROK;
 }
 #endif
@@ -732,6 +770,7 @@ uint16_t l1BuildAndSendRachInd(uint16_t slot, uint16_t sfn, uint8_t raPreambleId
    return ROK;
 }
 
+
 /*******************************************************************
  *
  * @brief Builds and Send the Slot Indication message to MAC
@@ -799,6 +838,7 @@ uint16_t l1BuildAndSendSlotIndication()
       }
       CMCHKPK(oduPackPointer, (PTR)slotIndMsg, mBuf);
       ODU_POST_TASK(&pst, mBuf);
+
    }
 #endif
    return ROK;