[Task-ID: ODUHIGH-459] EGTP DL issue during UE deletion 98/8598/1
authorlal.harshita <Harshita.Lal@radisys.com>
Mon, 20 Jun 2022 09:01:36 +0000 (14:31 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Mon, 20 Jun 2022 09:02:12 +0000 (14:32 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: If296e39a64adbebb9507cfcc298e670ed333ea98

src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_stub.c

index 2c73356..76e6578 100644 (file)
@@ -8741,7 +8741,7 @@ uint8_t fillCuToDuContainer(CuUeCb *ueCb, CUtoDURRCInformation_t *rrcMsg)
 {
    uint8_t elementCnt = 0;
    uint8_t ret = ROK;
-   uint8_t idx, idx2, rrcBufLen;
+   uint8_t idx;
 
    /* UE Capabulity RAT Container List */
    CU_ALLOC(rrcMsg->uE_CapabilityRAT_ContainerList, sizeof(UE_CapabilityRAT_ContainerList_t));
@@ -9214,9 +9214,9 @@ uint8_t addDrbTunnels(uint32_t duId, uint8_t teId)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t procDrbSetupList(uint32_t duId, DRBs_Setup_List_t *drbSetupList)
+uint8_t procDrbSetupList(uint32_t duId, CuUeCb *ueCb, DRBs_Setup_List_t *drbSetupList)
 {
-   uint8_t arrIdx = 0;
+   uint8_t arrIdx = 0, drbIdx = 0;
    uint32_t teId = 0;
    DRBs_Setup_ItemIEs_t *drbItemIe = NULLP;
 
@@ -9231,10 +9231,21 @@ uint8_t procDrbSetupList(uint32_t duId, DRBs_Setup_List_t *drbSetupList)
             teId  = extractTeId(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List);
             if(teId > 0)
             {
-              if(addDrbTunnels(duId, teId)== ROK)
-              {
-                DU_LOG("\nDEBUG  --> EGTP: Tunnel Added for TeId %d", teId);
-              }
+               if(addDrbTunnels(duId, teId)== ROK)
+               {
+                  DU_LOG("\nDEBUG  --> EGTP: Tunnel Added for TeId %d", teId);
+               }
+               /* As per Spec 38.473, in UE COntext Response, Tunnel information
+                * are sent to CU for setting up of Tunnels in DL direction.
+                * Search for DRB ID in CU databse */
+               for(drbIdx = 0; drbIdx < ueCb->numDrb; drbIdx++)
+               {
+                  if(ueCb->drbList[drbIdx].drbId == drbItemIe->value.choice.DRBs_Setup_Item.dRBID)
+                  {
+                     fillTeIdString(3, teId, ueCb->drbList[drbIdx].dlUpTnlInfo.teId);
+                     break;
+                  }
+               }
             }
             else
                return RFAILED;
@@ -9311,7 +9322,7 @@ uint8_t procUeContextSetupResponse(uint32_t duId, F1AP_PDU_t *f1apMsg)
           case ProtocolIE_ID_id_DRBs_Setup_List:
              {
                 /* Adding Tunnels for successful DRB */
-                procDrbSetupList(duId, &ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List);
+                procDrbSetupList(duId, ueCb, &ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List);
                 break; 
              }
          case ProtocolIE_ID_id_DUtoCURRCInformation:
@@ -11583,7 +11594,7 @@ void procF1SetupReq(uint32_t *destDuId, F1AP_PDU_t *f1apMsg)
 * ****************************************************************/
 void procUeContextReleaseComplete(uint32_t duId, F1AP_PDU_t *f1apMsg)
 {
-   uint8_t duIdx = 0, ieIdx = 0, ueIdx = 0;
+   uint8_t duIdx = 0, ieIdx = 0, ueIdx = 0, drbIdx = 0;
    uint8_t gnbDuUeF1apId = 0, gnbCuUeF1apId = 0;
    DuDb *duDb = NULLP;
    CuUeCb *ueCb = NULLP;
@@ -11617,6 +11628,10 @@ void procUeContextReleaseComplete(uint32_t duId, F1AP_PDU_t *f1apMsg)
                      if((ueCb->cellCb->ueCb[ueIdx]->gnbCuUeF1apId == gnbCuUeF1apId) &&
                            (ueCb->cellCb->ueCb[ueIdx]->gnbDuUeF1apId == gnbDuUeF1apId))
                      {
+                        for(drbIdx = 0; drbIdx < ueCb->numDrb; drbIdx++)
+                        {
+                           deleteEgtpTunnel(duId, ueCb->drbList[drbIdx].dlUpTnlInfo.teId);
+                        }
                         ueCb->cellCb->ueCb[ueIdx] = NULLP;
                         ueCb->cellCb->numUe--;
                         if((ueCb->cellCb->numUe == 0) && (ueCb->cellCb->cellStatus == CELL_DELETION_IN_PROGRESS))
index a57bf06..2be3a45 100644 (file)
@@ -279,14 +279,6 @@ void *cuConsoleHandler(void *args)
    uint8_t cnt = 0;
    EgtpTeIdCb *teidCb = NULLP;
 
-   /* This variable is taken for sending specific number of downlink data packet. 
-    * Presently the code is supporting total 4500 data packets trasfer for 3 UEs only with sleep(1).
-    * If you wants to pump data for 3 UE change the following macro values
-    * 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(true) 
    {
       ch = getchar();
@@ -321,17 +313,26 @@ void *cuConsoleHandler(void *args)
          }
 #else
 
+         /* This variable is taken for sending specific number of downlink data packet. 
+          * Presently the code is supporting total 4500 data packets trasfer for 3 UEs only with sleep(1).
+          * If you wants to pump data for 3 UE change the following macro values
+          * 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++)
                {
-                  DU_LOG("\nDEBUG  -->  EGTP: Sending DL User Data(duId %d, teId:%d)\n", duId, 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);      
@@ -346,6 +347,10 @@ void *cuConsoleHandler(void *args)
                         cnt++;
                      }
                   }
+                  else
+                  {
+                     DU_LOG("\nDEBUG  -->  EGTP: TunnelId Not Found for (duId %d, teId:%d)\n", duId, teId);
+                  }
                }
             }
             totalNumOfTestFlow--;