5G Userplane working 50% of the time
This commit includes several changes. First, it updates the way we fill the uplink UCI indication. This still has some todo comments since all the fields in this ind were hardcoded. It also updates the pack and unpack functions for the NR_UCI incations. Lastly, it includes updates to the gNB UCI scheduler. The updates in the gNB were cherry picked from develop. There are two updates to the VNF which allow the VNF timing/slots to be adjusted based on the received timing_info packets from the VNF. This adjustment was disabled in IISc's nFAPI code. For now, it is improving the timing between the VNF and PNF.
This commit is contained in:
@@ -3533,28 +3533,27 @@ static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint
|
||||
push16(value->rnti, ppWritePackedMsg, end) &&
|
||||
push8(value->pucch_format, ppWritePackedMsg, end) &&
|
||||
push8(value->ul_cqi, ppWritePackedMsg, end) &&
|
||||
push16(value->timing_advance, ppWritePackedMsg, end) &&
|
||||
push16(value->timing_advance, ppWritePackedMsg, end) &&
|
||||
push16(value->rssi, ppWritePackedMsg, end)
|
||||
))
|
||||
return 0;
|
||||
if (value->pduBitmap & 0x01) { //SR
|
||||
if(!(push8(value->sr->sr_indication, ppWritePackedMsg, end) &&
|
||||
push8(value->sr->sr_confidence_level, ppWritePackedMsg, end)
|
||||
if (!(push8(value->sr->sr_indication, ppWritePackedMsg, end) &&
|
||||
push8(value->sr->sr_confidence_level, ppWritePackedMsg, end)
|
||||
))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
|
||||
if(!(push8(value->harq->num_harq, ppWritePackedMsg, end) &&
|
||||
push8(value->harq->harq_confidence_level, ppWritePackedMsg, end)
|
||||
if (!(push8(value->harq->num_harq, ppWritePackedMsg, end) &&
|
||||
push8(value->harq->harq_confidence_level, ppWritePackedMsg, end)
|
||||
))
|
||||
return 0;
|
||||
|
||||
for(int i=0; i<value->harq->num_harq;i++)
|
||||
for (int i = 0; i < value->harq->num_harq; i++)
|
||||
{
|
||||
if(!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end)
|
||||
if (!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end)
|
||||
))
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3618,20 +3617,22 @@ static uint8_t pack_nr_uci_indication_body(void* tlv, uint8_t **ppWritePackedMsg
|
||||
return 0;
|
||||
|
||||
switch (value->pdu_type) {
|
||||
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
|
||||
break;
|
||||
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
|
||||
break;
|
||||
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &value->pucch_pdu_format_0_1;
|
||||
pack_nr_uci_pucch_0_1(uci_pdu, ppWritePackedMsg, end);
|
||||
break;
|
||||
}
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
|
||||
pack_nr_uci_pucch_2_3_4(uci_pdu, ppWritePackedMsg, end);
|
||||
break;
|
||||
}
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &value->pucch_pdu_format_0_1;
|
||||
if (!pack_nr_uci_pucch_0_1(uci_pdu, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
|
||||
if (!pack_nr_uci_pucch_2_3_4(uci_pdu, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -3647,10 +3648,10 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
))
|
||||
return 0;
|
||||
|
||||
for(int i=0; i<pNfapiMsg->num_ucis;i++)
|
||||
for (int i = 0; i < pNfapiMsg->num_ucis; i++)
|
||||
{
|
||||
if(!pack_nr_uci_indication_body(&(pNfapiMsg->uci_list[i]),ppWritePackedMsg,end))
|
||||
return 0;
|
||||
if (!pack_nr_uci_indication_body(&(pNfapiMsg->uci_list[i]), ppWritePackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -6529,7 +6530,7 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu
|
||||
uint8_t *end,
|
||||
nfapi_p7_codec_config_t *config) {
|
||||
|
||||
if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) &&
|
||||
if (!(pull8(ppReadPackedMsg, &value->pduBitmap, end) &&
|
||||
pull32(ppReadPackedMsg, &value->handle, end) &&
|
||||
pull16(ppReadPackedMsg, &value->rnti, end) &&
|
||||
pull8(ppReadPackedMsg, &value->pucch_format, end) &&
|
||||
@@ -6539,21 +6540,37 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu
|
||||
))
|
||||
return 0;
|
||||
if (value->pduBitmap & 0x01) { //SR
|
||||
if(!(pull8(ppReadPackedMsg, &value->sr->sr_indication, end) &&
|
||||
pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end)
|
||||
if (!(pull8(ppReadPackedMsg, &value->sr->sr_indication, end) &&
|
||||
pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end)
|
||||
))
|
||||
return 0;
|
||||
}
|
||||
if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
|
||||
|
||||
value->harq = nfapi_p7_allocate(sizeof(*value->harq), config);
|
||||
if (!(pull8(ppReadPackedMsg, &value->harq->harq_confidence_level, end) &&
|
||||
pull8(ppReadPackedMsg, &value->harq->num_harq, end)
|
||||
if (value->harq == NULL)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate nr_harq pdu\n", __FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
if (!(pull8(ppReadPackedMsg, &value->harq->num_harq, end) &&
|
||||
pull8(ppReadPackedMsg, &value->harq->harq_confidence_level, end)
|
||||
))
|
||||
return 0;
|
||||
value->harq->harq_list = nfapi_p7_allocate(sizeof(*value->harq->harq_list) * value->harq->num_harq, config);
|
||||
for (int i = 0; i < value->harq->num_harq; i++) {
|
||||
if (!pull8(ppReadPackedMsg, &value->harq->harq_list[i].harq_value, end))
|
||||
value->harq->harq_list = NULL;
|
||||
if (value->harq->num_harq > 0) {
|
||||
value->harq->harq_list = nfapi_p7_allocate(sizeof(*value->harq->harq_list) * value->harq->num_harq, config);
|
||||
if (value->harq->harq_list == NULL)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n",
|
||||
__FUNCTION__, value->harq->num_harq);
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < value->harq->num_harq; i++) {
|
||||
if (!pull8(ppReadPackedMsg, &value->harq->harq_list[i].harq_value, end)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6607,33 +6624,39 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(void* tlv, uint8_t **ppReadPackedMsg, u
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint8_t unpack_nr_uci_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
|
||||
static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value,
|
||||
uint8_t **ppReadPackedMsg,
|
||||
uint8_t *end,
|
||||
nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
nfapi_nr_uci_t* value = (nfapi_nr_uci_t*)tlv;
|
||||
|
||||
if(!(pull16(ppReadPackedMsg, &value->pdu_type, end) &&
|
||||
pull16(ppReadPackedMsg, &value->pdu_size, end)
|
||||
))
|
||||
return 0;
|
||||
|
||||
|
||||
switch (value->pdu_type) {
|
||||
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
|
||||
break;
|
||||
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
|
||||
break;
|
||||
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu = &value->pucch_pdu_format_0_1;
|
||||
unpack_nr_uci_pucch_0_1(&uci_pdu, ppReadPackedMsg, end);
|
||||
break;
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &value->pucch_pdu_format_0_1;
|
||||
if (!unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end, config))
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
|
||||
if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end))
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Unexpected pdu type %d\n", value->pdu_type);
|
||||
break;
|
||||
}
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
|
||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
|
||||
unpack_nr_uci_pucch_2_3_4(&uci_pdu, ppReadPackedMsg, end);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
|
||||
@@ -6646,11 +6669,11 @@ static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end,
|
||||
))
|
||||
return 0;
|
||||
|
||||
pNfapiMsg->uci_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->uci_list) * pNfapiMsg->num_ucis, config);
|
||||
pNfapiMsg->uci_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->uci_list) * pNfapiMsg->num_ucis, config);
|
||||
for (int i = 0; i < pNfapiMsg->num_ucis; i++)
|
||||
{
|
||||
if(!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config))
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -1154,7 +1154,7 @@ int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy
|
||||
|
||||
info->timing_window = 30; // This seems to override what gets set by the user - why??? //TODO: Change in NR in terms of microsecends,what should be the value?
|
||||
info->timing_info_mode = 0x03;
|
||||
info->timing_info_period = 128;
|
||||
info->timing_info_period = 12; // Melissa come back to this
|
||||
|
||||
nfapi_vnf_phy_info_list_add(config, info);
|
||||
|
||||
|
||||
@@ -2022,9 +2022,12 @@ void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
// Panos: Careful here!!! Modification of the original nfapi-code
|
||||
//if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
|
||||
//printf("VNF-PNF delta - %d", vnf_pnf_sfnslot_delta);
|
||||
if (vnf_pnf_sfnslot_delta>0 || vnf_pnf_sfnslot_delta < 0)
|
||||
if (vnf_pnf_sfnslot_delta != 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnslot_delta,NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot),NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot)) ;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF. Delta %d. PNF:%d.%d VNF:%d.%d\n\n\n\n\n\n\n\n\n",
|
||||
__FUNCTION__, vnf_pnf_sfnslot_delta,
|
||||
ind.last_sfn, ind.last_slot,
|
||||
vnf_p7->p7_connections[0].sfn, vnf_p7->p7_connections[0].slot);
|
||||
// Panos: Careful here!!! Modification of the original nfapi-code
|
||||
vnf_p7->p7_connections[0].sfn = ind.last_sfn;
|
||||
vnf_p7->p7_connections[0].slot = ind.last_slot;
|
||||
|
||||
@@ -170,7 +170,7 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
struct timespec slot_start;
|
||||
// clock_gettime(CLOCK_MONOTONIC, &sf_start);
|
||||
clock_gettime(CLOCK_MONOTONIC, &slot_start);
|
||||
long millisecond = slot_start.tv_nsec / 1e6; //Check if we have to change
|
||||
long millisecond = slot_start.tv_nsec / 0.5e6; //Check if we have to change
|
||||
//long millisecond = slot_start.tv_nsec / 0.5e6;
|
||||
// sf_start = timespec_add(sf_start, sf_duration);
|
||||
slot_start = timespec_add(slot_start, slot_duration);
|
||||
|
||||
Reference in New Issue
Block a user