[Issue Id-ODUHIGH-457] Fixes related to slice configuration in Ue Context Setup 54/8554/2
authorbarveankit <anbarve@radisys.com>
Mon, 13 Jun 2022 07:20:05 +0000 (12:50 +0530)
committerbarveankit <anbarve@radisys.com>
Mon, 13 Jun 2022 08:43:24 +0000 (14:13 +0530)
Signed-off-by: barveankit <anbarve@radisys.com>
Change-Id: I717cfda2b815bb1218a081c41abaa594f8a366d6
Signed-off-by: barveankit <anbarve@radisys.com>
src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_stub.c
src/cu_stub/cu_stub_egtp.c
src/cu_stub/cu_stub_egtp.h
src/phy_stub/phy_stub_msg_hdl.c

index aef220d..2c73356 100644 (file)
@@ -2660,6 +2660,7 @@ uint8_t BuildULTnlInfo(uint8_t duId, TnlInfo *ulUpTnlInfo, ULUPTNLInformation_To
  * ****************************************************************/
 uint8_t BuildDRBSetup(uint32_t duId, CuUeCb *ueCb, DRBs_ToBeSetup_List_t *drbSet)
 {
+   uint16_t snssaiIdx=0;
    uint8_t idx = 0, extIeIdx = 0;
    uint8_t elementCnt = 0, drbCnt = 0;
    uint8_t BuildQOSInforet = 0,BuildSNSSAIret = 0;
@@ -2728,12 +2729,13 @@ uint8_t BuildDRBSetup(uint32_t duId, CuUeCb *ueCb, DRBs_ToBeSetup_List_t *drbSet
       }
 
       /*SNSSAI*/
+      snssaiIdx = (idx% cuCb.numSnssaiSupported);
       if(ueCb->state != UE_HANDOVER_IN_PROGRESS)
          BuildSNSSAIret = BuildSNSSAI(&ueCb->drbList[ueCb->numDrb], &drbSetItem->qoSInformation.choice.\
-               choice_extension->value.choice.DRB_Information.sNSSAI, cuCb.snssaiList[0], FALSE);
+               choice_extension->value.choice.DRB_Information.sNSSAI, cuCb.snssaiList[snssaiIdx], FALSE);
       else
          BuildSNSSAIret = BuildSNSSAI(&ueCb->drbList[idx], &drbSetItem->qoSInformation.choice.\
-               choice_extension->value.choice.DRB_Information.sNSSAI, cuCb.snssaiList[0], TRUE);
+               choice_extension->value.choice.DRB_Information.sNSSAI, NULLP, TRUE);
       if(BuildSNSSAIret != ROK)
       {
          DU_LOG("\nERROR  -->  F1AP : Failed to build SNSSAI Info in BuildDRBSetup");
index 4224201..a57bf06 100644 (file)
@@ -273,9 +273,11 @@ void initiateInterDuHandover(uint32_t sourceDuId, uint32_t targetDuId, uint32_t
 void *cuConsoleHandler(void *args)
 {
    char ch;
-   uint8_t teId = 0;
+   uint32_t teId = 0;
+   uint32_t duId;
    uint8_t ret = ROK;
    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).
@@ -283,7 +285,7 @@ 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 = 5
+   int32_t totalNumOfTestFlow = 2
 
    while(true) 
    {
@@ -318,24 +320,32 @@ void *cuConsoleHandler(void *args)
             cnt++;
          }
 #else
+
          while(totalNumOfTestFlow)
          {
-            for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++)
+            for(duId = 1; duId<=MAX_DU_SUPPORTED; duId++)
             {
-               DU_LOG("\nDEBUG  -->  EGTP: Sending DL User Data(teId:%d)\n",teId);
-               cnt =0;
-               while(cnt < NUM_DL_PACKETS)
+               for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++)
                {
-                  ret =  cuEgtpDatReq(teId);      
-                  if(ret != ROK)
+                  DU_LOG("\nDEBUG  -->  EGTP: Sending DL User Data(duId %d, teId:%d)\n", duId, teId);
+                  cmHashListFind(&(egtpCb.dstCb[duId-1].teIdLst), (uint8_t *)&(teId), sizeof(uint32_t), 0, (PTR *)&teidCb);
+                  if(teidCb)
                   {
-                     DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
-                     break;
+                     cnt =0;
+                     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++;
+                     }
                   }
-                  /* TODO : sleep(1) will be removed later once we will be able to
-                   * support the continuous data pack transfer */
-                  sleep(1);
-                  cnt++;
                }
             }
             totalNumOfTestFlow--;
index 0def93c..c53bc6d 100644 (file)
@@ -686,9 +686,9 @@ S16 cuEgtpDecodeHdr(Buffer *mBuf)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint16_t cuEgtpDatReq(uint8_t teId)
+uint16_t cuEgtpDatReq(uint32_t duId, uint8_t teId)
 {
-   uint8_t ret = ROK, cnt = 0, duId =0;
+   uint8_t ret = ROK, cnt = 0;
    EgtpMsg  egtpMsg;
 
    egtpMsg.msgHdr.teId = teId;
@@ -698,26 +698,23 @@ uint16_t cuEgtpDatReq(uint8_t teId)
       DU_LOG("\nERROR  -->  EGTP : DRB  not created");
       return RFAILED ;
    }
-   for(duId = 1; duId<=egtpCb.numDu; duId++)
+   /* Build Application message that is supposed to come from app to egtp */
+   ret = BuildAppMsg(duId, &egtpMsg);
+   if(ret != ROK)
    {
-      /* Build Application message that is supposed to come from app to egtp */
-      ret = BuildAppMsg(duId, &egtpMsg);
-      if(ret != ROK)
-      {
-         DU_LOG("\nERROR  -->  EGTP : Failed to build App Msg");
-         return RFAILED;
-      }
+      DU_LOG("\nERROR  -->  EGTP : Failed to build App Msg");
+      return RFAILED;
+   }
 
-      /* Encode EGTP header to build final EGTP message */
-      ret = BuildEgtpMsg(duId, &egtpMsg);
-      if(ret != ROK)
-      {
-         DU_LOG("\nERROR  -->  EGTP : Failed to build EGTP Msg");
-         return RFAILED;
-      }
-      cuEgtpSendMsg(duId, egtpMsg.msg);
-      ODU_PUT_MSG_BUF(egtpMsg.msg);
+   /* Encode EGTP header to build final EGTP message */
+   ret = BuildEgtpMsg(duId, &egtpMsg);
+   if(ret != ROK)
+   {
+      DU_LOG("\nERROR  -->  EGTP : Failed to build EGTP Msg");
+      return RFAILED;
    }
+   cuEgtpSendMsg(duId, egtpMsg.msg);
+   ODU_PUT_MSG_BUF(egtpMsg.msg);
    return ROK;
 }
 
index 0449598..4decfda 100644 (file)
@@ -44,7 +44,7 @@
 #define MIN_TEID 1   /*[Spec 29.281,Sec 5.1]: All Zero TEIDs are never assigned for setting up GTP-U Tunnel*/
 #define MAX_TEID MAX_NUM_DRB * MAX_NUM_UE /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */
 
-#define NUM_TUNNEL_TO_PUMP_DATA 9
+#define NUM_TUNNEL_TO_PUMP_DATA 4
 #define NUM_DL_PACKETS 1
 
 uint8_t         sockType;
@@ -155,7 +155,7 @@ S16 cuEgtpTnlMod(uint32_t duId,EgtpTnlEvt tnlEvt);
 S16 cuEgtpTnlDel(uint32_t duId,EgtpTnlEvt tnlEvt);
 S16 cuEgtpEncodeHdr(uint8_t *preEncodedHdr, EgtpMsgHdr *preDefHdr, uint8_t *hdrIdx);
 S16 cuEgtpHdlRecvMsg(Buffer *mBuf);
-uint16_t cuEgtpDatReq(uint8_t teId);
+uint16_t cuEgtpDatReq(uint32_t duId, uint8_t teId);
 S16 BuildAppMsg(uint32_t duId, EgtpMsg  *egtpMsg);
 S16 BuildEgtpMsg(uint32_t duId, EgtpMsg *egtpMsg);
 S16 cuEgtpSendMsg(uint32_t duId, Buffer *mBuf);
index c3d33ae..2c14f2b 100644 (file)
@@ -356,12 +356,17 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_
    GET_UE_ID(puschPdu.rnti, ueId);
    if(phyDb.ueDb.ueCb[ueId-1].isCFRA)
    {
-      /* In CF-RA in case of handover, RRC Reconfiguration Complete is sent
-       * by UE once RAR is received from DU */
-      phyDb.ueDb.ueCb[ueId-1].ueId = ueId;
-      phyDb.ueDb.ueCb[ueId-1].crnti = puschPdu.rnti;
-      phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp = true;
-      type = MSG_TYPE_RRC_RECONFIG_COMPLETE;
+      if(!phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp)
+      {
+         /* In CF-RA in case of handover, RRC Reconfiguration Complete is sent
+          * by UE once RAR is received from DU */
+         phyDb.ueDb.ueCb[ueId-1].ueId = ueId;
+         phyDb.ueDb.ueCb[ueId-1].crnti = puschPdu.rnti;
+         phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp = true;
+         type = MSG_TYPE_RRC_RECONFIG_COMPLETE;
+      }
+      else
+         return ROK; 
    }
    else
    {
@@ -399,7 +404,7 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_
          type = MSG_TYPE_RRC_RECONFIG_COMPLETE;
       }
       else
-         return RFAILED;
+         return ROK;
    }
 
    MAC_ALLOC(rxDataInd, sizeof(fapi_rx_data_indication_t));