Commit 60a9d41b authored by Melissa Elkadi's avatar Melissa Elkadi

UCI ACK/NACK most of the way working

We have gotten rid of filling the ACK/NACK with
the DLSCH and now only fill with the PUCCH. This
assumes that the MAC layer is properly decoding the
dl_tti_req and tx_data_req and allows us to
simply use the MAC layers scheduled SNF/Slot
to return the ACK NACK. There are some hacks added
in this commit which ensure that the PDCP packet
has the correct header (1st byte = 80) and now with
15Mbps we are seeing about 20% packet loss and
a gNB bug on the edge case (current frame is 1023
and the gNB schduler wants an ACK in frame 0 but the
scheduled UL_TTI_REQ has a frame of 1023).
parent f336cbc6
......@@ -32,6 +32,7 @@
#include "LAYER2/nr_pdcp/nr_pdcp_entity.h"
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include <pthread.h>
/*
* NR SLOT PROCESSING SEQUENCE
......@@ -199,32 +200,17 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue);
nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue);
LOG_D(NR_MAC, "Try to get a ul_tti_req for HARQ sfn/slot %d %d from queue with %lu items\n",
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot),
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot), nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request_harq = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_harq_sfn_slot);
if (ul_tti_request_harq && ul_tti_request_harq->n_pdus > 0)
{
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_harq);
}
LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CSI active SFN %d/SLOT %d from queue with %lu items\n",
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_uci_sfn_slot),
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_uci_sfn_slot), nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request_uci = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_uci_sfn_slot);
if (ul_tti_request_uci && ul_tti_request_uci->n_pdus > 0)
{
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_uci);
}
for (int i = 0; i < 16; i++) {
LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n",
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot),
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot), nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot);
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot),
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot), nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot);
if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0)
{
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc);
}
}
if (rach_ind && rach_ind->number_of_pdus > 0)
{
......@@ -389,6 +375,8 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
ul_info.slot_tx = (slot + slot_ahead) % slots_per_frame;
ul_info.frame_tx = (ul_info.slot_rx + slot_ahead >= slots_per_frame) ? ul_info.frame_rx + 1 : ul_info.frame_rx;
ul_info.ue_sched_mode = SCHED_ALL;
LOG_I(NR_MAC, "frame_rx %d, slot rx %d, frame tx %d, slot tx %d, slot_ahead %d\n",
ul_info.frame_rx, ul_info.slot_rx, ul_info.frame_tx, ul_info.slot_tx, slot_ahead);
if (pthread_mutex_lock(&mac->mutex_dl_info)) abort();
......@@ -417,8 +405,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
mac->scc_SIB->tdd_UL_DL_ConfigurationCommon,
ul_info.slot_tx, mac->frame_type))
{
LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__);
LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() and nr_ue_pucch_scheduler from %s\n", ul_info.slot_tx, __FUNCTION__);
nr_ue_ul_indication(&ul_info);
nr_ue_pucch_scheduler(0, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id);
check_nr_prach(mac, &ul_info, &prach_resources);
}
if (!IS_SOFTMODEM_NOS1 && get_softmodem_params()->sa) {
......
This diff is collapsed.
......@@ -264,6 +264,17 @@ typedef struct {
uint8_t nbits;
} dci_field_t;
typedef struct {
/* The active harq sfn/slot field was created to save the
scheduled SFN/Slot transmission for the ACK/NAK. If we
do not save it, then we have to calculate it again as the
NRUE MAC layer already does in get_downlink_ack(). */
int active_harq_sfn;
int active_harq_slot;
int crc_rx_ind_sfn_slot;
bool active;
} emul_l1_harq_t;
typedef struct {
bool expected_sib;
bool index_has_sib[16];
......@@ -271,9 +282,8 @@ typedef struct {
bool index_has_rar[16];
bool expected_dci;
bool index_has_dci[16];
int active_harq_sfn_slot;
emul_l1_harq_t harq[16];
int active_uci_sfn_slot;
int crc_rx_ind_sfn_slot;
int num_srs;
int num_harqs;
int num_csi_reports;
......
......@@ -220,6 +220,9 @@ int nr_process_mac_pdu(module_id_t module_idP,
LOG_D(NR_MAC, "In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n", __func__, rx_lcid, frameP, slot, pdu_len);
if (pdu_len < 7) {
break;
}
unsigned char *ce_ptr;
int n_Lcg = 0;
......
This diff is collapsed.
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