Merge "Cell and Network slicing configuration over o1. IssueID: ODUHIGH-383"
authorHariomGupta(HCL) <hariom.g@hcl.com>
Wed, 8 Dec 2021 08:59:11 +0000 (08:59 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Wed, 8 Dec 2021 08:59:11 +0000 (08:59 +0000)
1  2 
src/du_app/du_mgr_main.c

diff --combined src/du_app/du_mgr_main.c
@@@ -33,8 -33,7 +33,7 @@@
  #ifdef O1_ENABLE
  
  #include "O1Interface.h"
- #include "ConfigInterface.h"
+ #include "CmInterface.h"
  #endif
  
  uint8_t rlcUlActvTsk (Pst *, Buffer *);
@@@ -53,6 -52,10 +52,10 @@@ uint8_t phyStubActvInit(Ent, Inst, Regi
  /* Global variable */
  DuCfgParams duCfgParam;
  
+ #ifdef O1_ENABLE
+ extern NRCellDU cellParams;
+ #endif
  /*******************************************************************
   *
   * @brief Initializes DU APP
@@@ -97,7 -100,7 +100,7 @@@ uint8_t duAppInit(SSTskId sysTskId
   *
   * @details
   *
-  *    Function : updateRrmPolicy 
+  *    Function : setRrmPolicy 
   *
   *    Functionality:
   *       - update Rrm Policy at DU and process the slice cfg request
   *         false    - failure
   *
   * ****************************************************************/
- uint8_t updateRrmPolicy(RrmPolicy rrmPolicy[], uint8_t policyNum, \
           uint8_t memberList)
uint8_t setRrmPolicy(RrmPolicyList rrmPolicy[], uint8_t policyNum)
  {
-     DuCellCb *cellCb = NULLP;
+    DU_LOG("\nINFO   -->  DU_APP : DU APP RRM number of policy %d,", \
+         policyNum);
+    for(uint8_t i=0; i<policyNum ; i++)
+    {
+       DU_LOG("\nINFO   -->  DU_APP : DU APP  id = %s",rrmPolicy[i].id);
+       DU_LOG("\nINFO   -->  DU_APP : DU APP  resourceType = %d", \
+               rrmPolicy[i].resourceType);
+       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMPolicyMaxRatio = %d", \
+               rrmPolicy[i].rRMPolicyMaxRatio);
+       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMPolicyMinRatio = %d", \
+               rrmPolicy[i].rRMPolicyMinRatio);
+       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMPolicyDedicatedRatio = %d", \
+               rrmPolicy[i].rRMPolicyDedicatedRatio);
+       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMMemberNum = %d", \
+               rrmPolicy[i].rRMMemberNum);
+       for(uint8_t j=0; j<rrmPolicy[i].rRMMemberNum ; j++)
+       {
+          DU_LOG("\nINFO   -->  DU_APP : DU APP  mcc = %d%d%d", \
+                  rrmPolicy[i].rRMPolicyMemberList[j].mcc[0], \
+                rrmPolicy[i].rRMPolicyMemberList[j].mcc[1], \
+                rrmPolicy[i].rRMPolicyMemberList[j].mcc[2]);
+          DU_LOG("\nINFO   -->  DU_APP : DU APP  mnc = %d%d%d", \
+                  rrmPolicy[i].rRMPolicyMemberList[j].mnc[0], \
+                  rrmPolicy[i].rRMPolicyMemberList[j].mnc[1], \
+                  rrmPolicy[i].rRMPolicyMemberList[j].mnc[2]);
+          DU_LOG("\nINFO   -->  DU_APP : DU APP  sd = %d%d%d", \
+                  rrmPolicy[i].rRMPolicyMemberList[j].sd[0], \
+                  rrmPolicy[i].rRMPolicyMemberList[j].sd[1], \
+                  rrmPolicy[i].rRMPolicyMemberList[j].sd[2]);
+          DU_LOG("\nINFO   -->  DU_APP : DU APP  sst = %d\n", \
+                  rrmPolicy[i].rRMPolicyMemberList[j].sst);
+       }
+    }
+    DuCellCb *cellCb = NULLP;
  
-     cpyRrmPolicyInDuCfgParams(rrmPolicy, policyNum, memberList, &duCfgParam.tempSliceCfg);
+     cpyRrmPolicyInDuCfgParams(rrmPolicy, policyNum, &duCfgParam.tempSliceCfg);
      cellCb = duCb.actvCellLst[0];
  
      if(cellCb)
             }
         }
      }
+    return ROK;
  }
  
  /*******************************************************************
@@@ -157,6 -197,76 +197,76 @@@ bool bringCellUp(uint16_t cellId
     return true;
  }
  
+ /*******************************************************************
+  *
+  * @brief configure cell parameters
+  *
+  * @details
+  *
+  *    Function : configurecell
+  *
+  *    Functionality:
+  *       - configure cell parameters
+  *
+  * @params[in] Cell Id
+  * @return true     - success
+  *         false    - failure
+  *
+  * ****************************************************************/
+ uint8_t setCellParam()
+ {
+    //Read all the configs from smo edit-config into cellParams
+    DU_LOG("\nO1 configurecell du_app enterd");
+    DU_LOG("\nDU_APP configurecell cellLocalId value:%d",cellParams.cellLocalId);
+    DU_LOG("\nDU_APP configurecell operationalState value:%d", \
+              cellParams.operationalState);
+    DU_LOG("\nDU_APP configurecell administrativeState value:%d", \
+              cellParams.administrativeState);
+    DU_LOG("\nDU_APP configurecell cellState value:%d",cellParams.cellState);
+    DU_LOG("\nDU_APP configurecell nRPCI value:%d",cellParams.nRPCI);
+    DU_LOG("\nDU_APP configurecell nRTAC value:%d",cellParams.nRTAC);
+    DU_LOG("\nDU_APP configurecell arfcnDL value:%d",cellParams.arfcnDL);
+    DU_LOG("\nDU_APP configurecell arfcnUL value:%d",cellParams.arfcnUL);
+    DU_LOG("\nDU_APP configurecell arfcnSUL value:%d",cellParams.arfcnSUL);
+    DU_LOG("\nDU_APP configurecell ssbFrequency value:%d",cellParams.ssbFrequency);
+    DU_LOG("\nDU_APP configurecell ssbPeriodicity value:%d", \
+              cellParams.ssbPeriodicity);
+    DU_LOG("\nDU_APP configurecell ssbSubCarrierSpacing value:%d", \
+              cellParams.ssbSubCarrierSpacing);
+    DU_LOG("\nDU_APP configurecell ssbOffset value:%d",cellParams.ssbOffset);
+    DU_LOG("\nDU_APP configurecell ssbDuration value:%d",cellParams.ssbDuration);
+    DU_LOG("\nDU_APP configurecell bSChannelBwUL value:%d", \
+            cellParams.bSChannelBwUL);
+    DU_LOG("\nDU_APP configurecell bSChannelBwDL value:%d", \
+            cellParams.bSChannelBwDL);
+    DU_LOG("\nDU_APP configurecell bSChannelBwSUL value:%d", \
+            cellParams.bSChannelBwSUL);
+    for (int i=0 ; i<MAX_SUPPORTED_PLMN; i++)
+    {
+        DU_LOG("\nINFO   -->  DU_APP : DU APP  mcellParams.plmnList[%d].mcc = %d%d%d", i,\
+                  cellParams.plmnList[i].mcc[0], \
+                cellParams.plmnList[i].mcc[1], \
+                cellParams.plmnList[i].mcc[2]);
+          DU_LOG("\nINFO   -->  DU_APP : DU APP  cellParams.plmnList[%d].mnc = %d%d%d", i,\
+                  cellParams.plmnList[i].mnc[0], \
+                  cellParams.plmnList[i].mnc[1], \
+                  cellParams.plmnList[i].mnc[2]);
+          DU_LOG("\nINFO   -->  DU_APP : DU APP  cellParams.plmnList[%d].sd = %d%d%d", i,\
+                  cellParams.plmnList[i].sd[0], \
+                  cellParams.plmnList[i].sd[1], \
+                  cellParams.plmnList[i].sd[2]);
+          DU_LOG("\nINFO   -->  DU_APP : DU APP  cellParams.plmnList[%d].sst = %d\n", i,\
+                  cellParams.plmnList[i].sst);
+    }
+    duReadCfg();
+    return ROK;
+ }
  /*******************************************************************
   *
   * @brief Bring the cell Down
@@@ -438,7 -548,7 +548,7 @@@ uint8_t commonInit(
        DU_LOG("\nERROR  -->  DU_APP : System Task creation for DU APP failed");
        return RFAILED;
     }
 -   //ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
 +   ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
  
     /* system task for EGTP */
     if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK)
        DU_LOG("\nERROR  -->  DU_APP : System Task creation for EGTP failed");
        return RFAILED;
     }
 -   //ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0);
 +   ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0);
  
     /* system task for RLC_DL and MAC */
     if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK)
     }
     pthread_attr_init(&attr);
     pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 -   //ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
 +   ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
  
     /* system task for RLC UL */
     if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK)
        DU_LOG("\nERROR  -->  DU_APP : System Task creation for RLC UL failed");
        return RFAILED;
     }
 -   //ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0);
 +   ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0);
  
     /* system task for SCTP receiver thread */
     if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK)
        DU_LOG("\nERROR  -->  DU_APP : System Task creation for SCTP failed");
        return RFAILED;
     }
 -   //ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0);
 +   ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0);
  
     /* system task for lower-mac receiver thread */
     if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK)
        DU_LOG("\nERROR  -->  DU_APP : System Task creation for Lower MAC failed");
        return RFAILED;
     }
 -   //ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
 +   ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
  
  #ifndef INTEL_WLS_MEM
     /* system task for phy stub's slot indication generator thread */
     }
  #endif
  
     return ROK;
  }
  
@@@ -604,7 -715,9 +715,9 @@@ uint8_t tst(void
     } 
  
     //Read all the configs from du_utils.c into duCfgParams
+ #ifndef O1_ENABLE
     duReadCfg();
+ #endif
  
  #ifdef O1_ENABLE
     //Send VES PNF registration message to SMO