From: lal.harshita Date: Thu, 30 Sep 2021 12:03:21 +0000 (+0530) Subject: Removed EGTP_TEST flag and Modified algorithm for pumping DL data [Issue-ID: ODUHIGH... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=eae02ffcdfa215eb3ad990e2b0718d7a62eaa84a;p=o-du%2Fl2.git Removed EGTP_TEST flag and Modified algorithm for pumping DL data [Issue-ID: ODUHIGH-359] Change-Id: I4886b9ce6957f3940babf40a4446c93cc2aeda88 Signed-off-by: lal.harshita --- diff --git a/build/odu/makefile b/build/odu/makefile index 193760dae..03284ec49 100644 --- a/build/odu/makefile +++ b/build/odu/makefile @@ -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 diff --git a/docs/README b/docs/README index 741ec5e3b..bd57bec0a 100644 --- a/docs/README +++ b/docs/README @@ -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 : diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index 76547de65..f34810ba2 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -37,11 +37,6 @@ 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[]= { diff --git a/src/5gnrmac/mac_mux.c b/src/5gnrmac/mac_mux.c index affdac2e7..d0b434001 100644 --- a/src/5gnrmac/mac_mux.c +++ b/src/5gnrmac/mac_mux.c @@ -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)) diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index a29faaf5b..7b7a1f7fa 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -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); diff --git a/src/cu_stub/cu_stub.c b/src/cu_stub/cu_stub.c index 4460c033c..e9ae4ef86 100644 --- a/src/cu_stub/cu_stub.c +++ b/src/cu_stub/cu_stub.c @@ -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; } } diff --git a/src/cu_stub/cu_stub_egtp.h b/src/cu_stub/cu_stub_egtp.h index 5addcb0f6..993e4ad00 100644 --- a/src/cu_stub/cu_stub_egtp.h +++ b/src/cu_stub/cu_stub_egtp.h @@ -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; diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 168b22dee..9a7029df1 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -208,13 +208,6 @@ /* 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 */ @@ -283,12 +276,6 @@ #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 diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index fd1fe653a..7a31fa895 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -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 {