From 9eb621804acfc1798221e10cd96edf3fa9ea897c Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Fri, 2 Dec 2022 16:18:38 +0530 Subject: [PATCH] [Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-481] Adding Trigger for Ul/Dl data Signed-off-by: lal.harshita Change-Id: Ide3a28b37ab8d2bf413cd2b7cfde21da9e58fa5a Signed-off-by: lal.harshita --- build/odu/makefile | 2 +- src/5gnrmac/mac_harq_dl.c | 1 + src/5gnrmac/mac_ue_mgr.c | 2 - src/5gnrmac/mac_ue_mgr.h | 22 +++++++++ src/5gnrrlc/rlc_dl_ul_inf.c | 4 +- src/cu_stub/cu_f1ap_msg_hdl.c | 4 ++ src/cu_stub/cu_stub.c | 106 ++++++++++++++++++++++++---------------- src/du_app/du_f1ap_msg_hdl.c | 5 +- src/phy_stub/phy_stub_msg_hdl.c | 40 +++++++++++++++ 9 files changed, 138 insertions(+), 48 deletions(-) create mode 100644 src/5gnrmac/mac_ue_mgr.h diff --git a/build/odu/makefile b/build/odu/makefile index 892d38fc7..2a7efea2c 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 -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 diff --git a/src/5gnrmac/mac_harq_dl.c b/src/5gnrmac/mac_harq_dl.c index 8b3499fd3..1d62851c8 100644 --- a/src/5gnrmac/mac_harq_dl.c +++ b/src/5gnrmac/mac_harq_dl.c @@ -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 diff --git a/src/5gnrmac/mac_ue_mgr.c b/src/5gnrmac/mac_ue_mgr.c index fda65cf45..b247bb168 100644 --- a/src/5gnrmac/mac_ue_mgr.c +++ b/src/5gnrmac/mac_ue_mgr.c @@ -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 index 000000000..327eb3e05 --- /dev/null +++ b/src/5gnrmac/mac_ue_mgr.h @@ -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 + **********************************************************************/ diff --git a/src/5gnrrlc/rlc_dl_ul_inf.c b/src/5gnrrlc/rlc_dl_ul_inf.c index 851a0a13f..c3b567f8d 100755 --- a/src/5gnrrlc/rlc_dl_ul_inf.c +++ b/src/5gnrrlc/rlc_dl_ul_inf.c @@ -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: diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 50b2fe8c7..c510a5878 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -11832,6 +11832,10 @@ uint8_t procUeContextModificationResponse(uint32_t duId, F1AP_PDU_t *f1apMsg) } } +#ifdef START_DL_UL_DATA + startDlData(); +#endif + return ROK; } diff --git a/src/cu_stub/cu_stub.c b/src/cu_stub/cu_stub.c index d46ae0456..c518951dd 100644 --- a/src/cu_stub/cu_stub.c +++ b/src/cu_stub/cu_stub.c @@ -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; } diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index e96ebb509..4b43b0766 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -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; } diff --git a/src/phy_stub/phy_stub_msg_hdl.c b/src/phy_stub/phy_stub_msg_hdl.c index 8021a87cb..e08698279 100644 --- a/src/phy_stub/phy_stub_msg_hdl.c +++ b/src/phy_stub/phy_stub_msg_hdl.c @@ -36,6 +36,37 @@ #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; -- 2.16.6