Cleanup and some minor bugfixes
This commit is contained in:
@@ -3523,7 +3523,7 @@ static uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, ui
|
|||||||
|
|
||||||
if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) &&
|
if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) &&
|
||||||
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
|
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
|
||||||
push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end)
|
push8(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end)
|
||||||
))
|
))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -3748,11 +3748,11 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
|
||||||
result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end, config);
|
result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end, config);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
||||||
result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end, config);
|
result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end, config);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
|
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
|
||||||
|
|||||||
@@ -2214,11 +2214,11 @@ void vnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
|
||||||
vnf_handle_nr_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_nr_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
||||||
vnf_handle_nr_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
vnf_handle_nr_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_UE_RELEASE_RESPONSE:
|
case NFAPI_UE_RELEASE_RESPONSE:
|
||||||
|
|||||||
@@ -153,31 +153,8 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
|||||||
//struct timespec original_pselect_timeout;
|
//struct timespec original_pselect_timeout;
|
||||||
struct timespec pselect_timeout;
|
struct timespec pselect_timeout;
|
||||||
pselect_timeout.tv_sec = 100;
|
pselect_timeout.tv_sec = 100;
|
||||||
pselect_timeout.tv_nsec = 0; // ns in a 0.5 ms
|
pselect_timeout.tv_nsec = 0;
|
||||||
//pselect_timeout.tv_nsec = 500000;
|
|
||||||
|
|
||||||
struct timespec pselect_start;
|
|
||||||
struct timespec pselect_stop;
|
|
||||||
|
|
||||||
|
|
||||||
// struct timespec sf_duration; //Change to slot_duration?
|
|
||||||
// sf_duration.tv_sec = 0;
|
|
||||||
// sf_duration.tv_nsec = 0.5e6; // We want 1ms pause //We want 0.5 ms pause for NR
|
|
||||||
struct timespec slot_duration;
|
|
||||||
slot_duration.tv_sec = 0;
|
|
||||||
//slot_duration.tv_nsec = 0.5e6;
|
|
||||||
slot_duration.tv_nsec = 0.5e6;
|
|
||||||
|
|
||||||
|
|
||||||
// struct timespec sf_start; //Change to slot_start?
|
|
||||||
struct timespec slot_start;
|
|
||||||
// clock_gettime(CLOCK_MONOTONIC, &sf_start);
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &slot_start);
|
|
||||||
//long millisecond = slot_start.tv_nsec / 0.5e6;
|
|
||||||
// sf_start = timespec_add(sf_start, sf_duration);
|
|
||||||
slot_start = timespec_add(slot_start, slot_duration);
|
|
||||||
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "next slot will start at %d.%d\n", slot_start.tv_sec, slot_start.tv_nsec);
|
|
||||||
struct timespec ref_time;
|
struct timespec ref_time;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ref_time);
|
clock_gettime(CLOCK_MONOTONIC, &ref_time);
|
||||||
uint8_t setup_time;
|
uint8_t setup_time;
|
||||||
@@ -196,25 +173,7 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
|||||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||||
setup_time = curr_time.tv_sec - ref_time.tv_sec;
|
setup_time = curr_time.tv_sec - ref_time.tv_sec;
|
||||||
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
|
if(setup_time > 10 && prev_slot != gNB->UL_INFO.slot){ //Give the VNF sufficient time to setup before starting scheduling
|
||||||
|
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
|
|
||||||
|
|
||||||
if((pselect_start.tv_sec > slot_start.tv_sec) || ((pselect_start.tv_sec == slot_start.tv_sec) && (pselect_start.tv_nsec > slot_start.tv_nsec)))
|
|
||||||
{
|
|
||||||
// overran the end of the subframe we do not want to wait
|
|
||||||
pselect_timeout.tv_sec = 0;
|
|
||||||
pselect_timeout.tv_nsec = 0;
|
|
||||||
LOG_D(MAC, "Slot overrun detected \n");
|
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Slot overrun detected of %d.%d running to catchup\n", overrun.tv_sec, overrun.tv_nsec);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// still time before the end of the subframe wait
|
|
||||||
pselect_timeout = timespec_sub(slot_start, pselect_start);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(setup_time > 10 && prev_slot != gNB->UL_INFO.slot){
|
|
||||||
|
|
||||||
//Call the scheduler
|
//Call the scheduler
|
||||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||||
@@ -227,52 +186,11 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
|||||||
|
|
||||||
selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
|
selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
|
||||||
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &pselect_stop);
|
|
||||||
|
|
||||||
nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
|
nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
|
||||||
|
|
||||||
if(selectRetval == 0)
|
if(selectRetval == 0)
|
||||||
{
|
{
|
||||||
// pselect timed out
|
// pselect timed out, continue
|
||||||
|
|
||||||
// calculate the start of the next slot
|
|
||||||
|
|
||||||
slot_start = timespec_add(slot_start, slot_duration);
|
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
|
|
||||||
if (slot_start.tv_nsec > 1e9)
|
|
||||||
{
|
|
||||||
slot_start.tv_sec++;
|
|
||||||
slot_start.tv_nsec-=1e9;
|
|
||||||
}
|
|
||||||
else if (slot_start.tv_nsec < 0)
|
|
||||||
{
|
|
||||||
slot_start.tv_sec--;
|
|
||||||
slot_start.tv_nsec+=1e9;
|
|
||||||
}
|
|
||||||
|
|
||||||
vnf_p7->slot_start_time_hr = vnf_get_current_time_hr();
|
|
||||||
|
|
||||||
while(curr != 0)
|
|
||||||
{
|
|
||||||
if (curr->slot == 19)
|
|
||||||
{
|
|
||||||
curr->sfn = (curr->sfn + 1) % 1024;
|
|
||||||
curr->slot=0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
curr->slot++;
|
|
||||||
}
|
|
||||||
//printf("Frame = %d, slot = %d in VNF main loop. \n",curr->sfn,curr->slot);
|
|
||||||
|
|
||||||
//vnf_nr_sync(vnf_p7, curr);
|
|
||||||
|
|
||||||
(vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1); //hardcoded sync
|
|
||||||
|
|
||||||
curr = curr->next;
|
|
||||||
}
|
|
||||||
send_mac_slot_indications(vnf_p7);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(selectRetval > 0)
|
else if(selectRetval > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ void *gNB_app_task(void *args_p)
|
|||||||
//registered_gnb = 0;
|
//registered_gnb = 0;
|
||||||
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
|
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RC.nb_nr_inst > 0) {
|
if (RC.nb_nr_inst > 0) {
|
||||||
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ extern uint16_t sl_ahead;
|
|||||||
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||||
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||||
if (UL_info->rach_ind.number_of_pdus>0) {
|
if (UL_info->rach_ind.number_of_pdus>0) {
|
||||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
|
||||||
oai_nfapi_nr_rach_indication(&UL_info->rach_ind);
|
oai_nfapi_nr_rach_indication(&UL_info->rach_ind);
|
||||||
UL_info->rach_ind.number_of_pdus = 0;
|
UL_info->rach_ind.number_of_pdus = 0;
|
||||||
}
|
}
|
||||||
@@ -113,14 +113,12 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||||
//printf("handle uci format 0_1 \n");
|
|
||||||
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
|
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
|
||||||
handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu);
|
handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
|
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
|
||||||
//printf("handle uci format 2_3_4 \n");
|
|
||||||
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &uci_list[i].pucch_pdu_format_2_3_4;
|
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &uci_list[i].pucch_pdu_format_2_3_4;
|
||||||
handle_nr_uci_pucch_2_3_4(mod_id, frame, slot, uci_pdu);
|
handle_nr_uci_pucch_2_3_4(mod_id, frame, slot, uci_pdu);
|
||||||
break;
|
break;
|
||||||
@@ -137,13 +135,13 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
|
|||||||
{
|
{
|
||||||
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||||
if (UL_info->crc_ind.number_crcs>0) {
|
if (UL_info->crc_ind.number_crcs>0) {
|
||||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
LOG_D(PHY,"UL_info->UL_info->crc_ind.number_crcs:%d CRC_IND:SFN/Slot:%d.%d\n", UL_info->crc_ind.number_crcs, UL_info->crc_ind.sfn, UL_info->crc_ind.slot);
|
||||||
oai_nfapi_nr_crc_indication(&UL_info->crc_ind);
|
oai_nfapi_nr_crc_indication(&UL_info->crc_ind);
|
||||||
UL_info->crc_ind.number_crcs = 0;
|
UL_info->crc_ind.number_crcs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UL_info->rx_ind.number_of_pdus>0) {
|
if (UL_info->rx_ind.number_of_pdus>0) {
|
||||||
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
|
LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/Slot:%d.%d \n", UL_info->rx_ind.number_of_pdus, UL_info->rx_ind.sfn, UL_info->rx_ind.slot);
|
||||||
oai_nfapi_nr_rx_data_indication(&UL_info->rx_ind);
|
oai_nfapi_nr_rx_data_indication(&UL_info->rx_ind);
|
||||||
UL_info->rx_ind.number_of_pdus = 0;
|
UL_info->rx_ind.number_of_pdus = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user