VNF clock dependency removed

This commit is contained in:
Rahul Gottipati
2021-08-05 17:30:12 +05:30
parent 4ec3434128
commit 74c5816c72
19 changed files with 186 additions and 93 deletions
+29 -2
View File
@@ -23,7 +23,6 @@
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include "vnf_p7.h"
#define SYNC_CYCLE_COUNT 2
@@ -1455,7 +1454,31 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
}
//NR HANDLES FOR UPLINK MESSAGES
void vnf_handle_nr_slot_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
// ensure it's valid
if (pRecvMsg == NULL || vnf_p7 == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
}
else
{
nfapi_nr_slot_indication_scf_t ind;
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
else
{
if(vnf_p7->_public.nr_slot_indication)
{
(vnf_p7->_public.nr_slot_indication)(&ind); //gokul
}
}
}
}
void vnf_handle_nr_rx_data_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
// ensure it's valid
@@ -2179,7 +2202,11 @@ void vnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
case NFAPI_TIMING_INFO:
vnf_nr_handle_timing_info(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
vnf_handle_nr_slot_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
vnf_handle_nr_rx_data_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
+10 -12
View File
@@ -25,6 +25,7 @@
#include <errno.h>
#include "vnf_p7.h"
#include "nfapi_vnf.h"
#include "common/ran_context.h"
@@ -96,8 +97,10 @@ struct timespec timespec_sub(struct timespec lhs, struct timespec rhs)
// monitor the p7 endpoints and the timing loop and
// send indications to mac
int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
{
uint16_t vnf_frame; uint8_t vnf_slot; uint16_t slot_scheduled;
{
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
uint8_t temp_slot;
uint16_t vnf_frame; uint8_t vnf_slot;
if(config == 0)
return -1;
@@ -150,8 +153,8 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
//struct timespec original_pselect_timeout;
struct timespec pselect_timeout;
pselect_timeout.tv_sec = 0;
pselect_timeout.tv_nsec = 500000; // ns in a 0.5 ms
pselect_timeout.tv_sec = 100;
pselect_timeout.tv_nsec = 0; // ns in a 0.5 ms
//pselect_timeout.tv_nsec = 500000;
struct timespec pselect_start;
@@ -213,19 +216,15 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
pselect_timeout = timespec_sub(slot_start, pselect_start);
}
if(setup_time > 10 && slot_scheduled == 0){
if(setup_time > 10 && temp_slot != gNB->UL_INFO.slot){
// Call the scheduler
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
//Call the scheduler
pthread_mutex_lock(&gNB->UL_INFO_mutex);
gNB->UL_INFO.frame = vnf_frame;
gNB->UL_INFO.slot = vnf_slot;
gNB->UL_INFO.module_id = gNB->Mod_id;
gNB->UL_INFO.CC_id = gNB->CC_id;
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
slot_scheduled = 1;
temp_slot = gNB->UL_INFO.slot;
}
selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
@@ -277,7 +276,6 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
curr = curr->next;
}
send_mac_slot_indications(vnf_p7);
slot_scheduled = 0;
}
else if(selectRetval > 0)