Commit 027cb33b authored by Melissa Elkadi's avatar Melissa Elkadi

Modifying how we handle the UCI multiplexing.

In this commit, we changed the UCI handling.
When the UL_TTI_REQ arrives at the NRUE it
has info related to how many UCIs we should
pull from the queue and send to the gNB. If
we do not have that many UCIs available (likely
becasue a DL_TTI_REQ is late), then we will
requeue the UL_TTI_REQ and wait until we have
all the UCI indications before multiplexing.
This change makes it easier to handle multiple
UCIs becasue previously we would send what we
had and then try again later which made keeping
track of the UL_TTI_REQ and second UCI more
difficult.
parent 81b4412c
...@@ -497,54 +497,48 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n ...@@ -497,54 +497,48 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n
dl_info->slot = ul_dci_req->Slot; dl_info->slot = ul_dci_req->Slot;
} }
static void copy_uci_inds_to_single_uci_ind(NR_UE_MAC_INST_t *mac, static nfapi_nr_uci_indication_t *multiplex_uci_ind(NR_UE_MAC_INST_t *mac, int num_active_harqs)
nfapi_nr_uci_indication_t *uci_from_queue,
nfapi_nr_uci_indication_t *new_uci,
int index)
{ {
if (num_active_harqs <= 0)
{
return NULL;
}
if (num_active_harqs != nr_uci_ind_queue.num_items)
{
LOG_I(NR_MAC, "The number of active harqs %d doesn't match the number of UCIs in the queue %lu\n",
num_active_harqs, nr_uci_ind_queue.num_items);
return NULL;
}
nfapi_nr_uci_indication_t *uci_ind = MALLOC(sizeof(*uci_ind));
uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION;
uci_ind->sfn = NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot);
uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot);
uci_ind->num_ucis = num_active_harqs;
uci_ind->uci_list = MALLOC(uci_ind->num_ucis * sizeof(*uci_ind->uci_list));
for (int i = 0; i < num_active_harqs; i++)
{
nfapi_nr_uci_indication_t *queued_uci_ind = get_queue(&nr_uci_ind_queue);
/* In openair1/SCHED_NR_UE/fapi_nr_ue_l1.c nr_ue_schedule_response_stub(), the /* In openair1/SCHED_NR_UE/fapi_nr_ue_l1.c nr_ue_schedule_response_stub(), the
number of UCIs is hard coded to 1. This is why we always use index 0 of the number of UCIs is hard coded to 1. This is why we always use index 0 of the
queued UCI indication to fill the new multiplexed UCI indication */ queued UCI indication to fill the new multiplexed UCI indication */
if (!uci_from_queue) { AssertFatal(queued_uci_ind, "There was not a UCI in the queue!\n");
LOG_E(NR_MAC, "There was not a UCI in the queue!\n");
return; nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[i].pucch_pdu_format_0_1;
}
nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &new_uci->uci_list[index].pucch_pdu_format_0_1;
memset(pdu_0_1, 0, sizeof(*pdu_0_1)); memset(pdu_0_1, 0, sizeof(*pdu_0_1));
AssertFatal(index <= new_uci->num_ucis || uci_from_queue->num_ucis == 1, AssertFatal(i < uci_ind->num_ucis,
"Attempting to index past end of uci_list array. Index = %d\n", "Attempting to index past end of uci_list array. Index = %d\n",
index); i);
new_uci->uci_list[index].pdu_type = uci_from_queue->uci_list[0].pdu_type; uci_ind->uci_list[i].pdu_type = queued_uci_ind->uci_list[0].pdu_type;
new_uci->uci_list[index].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); uci_ind->uci_list[i].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t);
nfapi_nr_uci_pucch_pdu_format_0_1_t *queued_pdu_0_1 = &uci_from_queue->uci_list[0].pucch_pdu_format_0_1; nfapi_nr_uci_pucch_pdu_format_0_1_t *queued_pdu_0_1 = &queued_uci_ind->uci_list[0].pucch_pdu_format_0_1;
pdu_0_1->handle = queued_pdu_0_1->handle; pdu_0_1->handle = queued_pdu_0_1->handle;
pdu_0_1->rnti = queued_pdu_0_1->rnti; pdu_0_1->rnti = queued_pdu_0_1->rnti;
pdu_0_1->pucch_format = queued_pdu_0_1->pucch_format; pdu_0_1->pucch_format = queued_pdu_0_1->pucch_format;
pdu_0_1->ul_cqi = queued_pdu_0_1->ul_cqi; pdu_0_1->ul_cqi = queued_pdu_0_1->ul_cqi;
pdu_0_1->timing_advance = queued_pdu_0_1->timing_advance; pdu_0_1->timing_advance = queued_pdu_0_1->timing_advance;
pdu_0_1->rssi = queued_pdu_0_1->rssi; pdu_0_1->rssi = queued_pdu_0_1->rssi;
return;
}
static nfapi_nr_uci_indication_t *multiplex_uci_ind(NR_UE_MAC_INST_t *mac, int num_active_harqs)
{
nfapi_nr_uci_indication_t *uci_ind = MALLOC(sizeof(*uci_ind));
uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION;
uci_ind->sfn = NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot);
uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot);
uci_ind->num_ucis = num_active_harqs;
uci_ind->uci_list = MALLOC(uci_ind->num_ucis * sizeof(*uci_ind->uci_list));
if (num_active_harqs != nr_uci_ind_queue.num_items)
{
LOG_I(NR_MAC, "The number of active harqs %d doesn't match the number of UCIs in the queue %lu\n",
num_active_harqs, nr_uci_ind_queue.num_items);
}
for (int j = 0; j < num_active_harqs; j++)
{
nfapi_nr_uci_indication_t *queued_uci_ind = get_queue(&nr_uci_ind_queue);
copy_uci_inds_to_single_uci_ind(mac, queued_uci_ind, uci_ind, j);
} }
return uci_ind; return uci_ind;
} }
...@@ -561,6 +555,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n ...@@ -561,6 +555,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n
AssertFatal(num_pdus <= sizeof(ul_tti_req->pdus_list) / sizeof(ul_tti_req->pdus_list[0]), AssertFatal(num_pdus <= sizeof(ul_tti_req->pdus_list) / sizeof(ul_tti_req->pdus_list[0]),
"Too many pdus %d in ul_tti_req\n", num_pdus); "Too many pdus %d in ul_tti_req\n", num_pdus);
bool sent_uci = false;
for (int i = 0; i < num_pdus; i++) for (int i = 0; i < num_pdus; i++)
{ {
nfapi_nr_ul_tti_request_number_of_pdus_t *pdu_list = &ul_tti_req->pdus_list[i]; nfapi_nr_ul_tti_request_number_of_pdus_t *pdu_list = &ul_tti_req->pdus_list[i];
...@@ -614,6 +609,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n ...@@ -614,6 +609,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n
.uci_ind = *uci_ind, .uci_ind = *uci_ind,
}; };
send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id);
sent_uci = true;
for (int k = 0; k < uci_ind->num_ucis; k++) for (int k = 0; k < uci_ind->num_ucis; k++)
{ {
...@@ -631,15 +627,16 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n ...@@ -631,15 +627,16 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n
pdu_0_1->harq = NULL; pdu_0_1->harq = NULL;
} }
} }
free(uci_ind->uci_list);
uci_ind->uci_list = NULL;
free(uci_ind);
uci_ind = NULL;
} }
LOG_D(NR_MAC, "The num_active_harqs %d and uci_ind->num_ucis %d\n", }
num_active_harqs, uci_ind->num_ucis); }
if (num_active_harqs > uci_ind->num_ucis) if (!sent_uci)
{ {
LOG_E(NR_MAC, "The num_active_harqs %d > uci_ind->num_ucis %d" LOG_E(NR_MAC, "The UL_TTI_REQ did not sent a UCI to the gNB. \n");
"Which means that the incoming dl_tti_req to build the UCI is late. "
"So we will requeue the ul_tti_req to capture the upcoming UCI\n",
num_active_harqs, uci_ind->num_ucis);
if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req)) if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req))
{ {
LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n"); LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n");
...@@ -647,12 +644,6 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n ...@@ -647,12 +644,6 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n
ul_tti_req = NULL; ul_tti_req = NULL;
} }
} }
free(uci_ind->uci_list);
uci_ind->uci_list = NULL;
free(uci_ind);
uci_ind = NULL;
}
}
} }
static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_config_request_t *dl_config) static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_config_request_t *dl_config)
...@@ -1116,6 +1107,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ ...@@ -1116,6 +1107,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
dl_info->dci_ind->dci_list+i); dl_info->dci_ind->dci_list+i);
fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i;
/* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */
if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) {
LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n");
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment