fixing remove ul_config_req pdu func
This commit is contained in:
@@ -710,13 +710,9 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_ue_same(int ue_id_1, int ue_id_2)
|
static bool is_ue_same(uint16_t ue_id_1, uint16_t ue_id_2)
|
||||||
{
|
{
|
||||||
if (ue_id_1 == ue_id_2)
|
return (ue_id_1 == ue_id_2);
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void analyze_cqi_pdus_for_duplicates(nfapi_cqi_indication_t *ind)
|
static void analyze_cqi_pdus_for_duplicates(nfapi_cqi_indication_t *ind)
|
||||||
@@ -731,8 +727,8 @@ static void analyze_cqi_pdus_for_duplicates(nfapi_cqi_indication_t *ind)
|
|||||||
|
|
||||||
for (int j = i + 1; j < num_cqis; j++)
|
for (int j = i + 1; j < num_cqis; j++)
|
||||||
{
|
{
|
||||||
int rnti_i = ind->cqi_indication_body.cqi_pdu_list[i].rx_ue_information.rnti;
|
uint16_t rnti_i = ind->cqi_indication_body.cqi_pdu_list[i].rx_ue_information.rnti;
|
||||||
int rnti_j = ind->cqi_indication_body.cqi_pdu_list[j].rx_ue_information.rnti;
|
uint16_t rnti_j = ind->cqi_indication_body.cqi_pdu_list[j].rx_ue_information.rnti;
|
||||||
if (is_ue_same(rnti_i, rnti_j))
|
if (is_ue_same(rnti_i, rnti_j))
|
||||||
{
|
{
|
||||||
LOG_E(MAC, "Problem, two cqis received from a single UE for rnti %x\n",
|
LOG_E(MAC, "Problem, two cqis received from a single UE for rnti %x\n",
|
||||||
@@ -1253,28 +1249,25 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool remove_ul_config_req_pdu(int index, nfapi_ul_config_request_t *ul_config_req)
|
static void remove_ul_config_req_pdu(int index, nfapi_ul_config_request_t *ul_config_req)
|
||||||
{
|
{
|
||||||
uint8_t num_pdus = ul_config_req->ul_config_request_body.number_of_pdus;
|
int num_pdus = ul_config_req->ul_config_request_body.number_of_pdus;
|
||||||
nfapi_ul_config_request_pdu_t *pdu_list = ul_config_req->ul_config_request_body.ul_config_pdu_list;
|
nfapi_ul_config_request_pdu_t *pdu_list = ul_config_req->ul_config_request_body.ul_config_pdu_list;
|
||||||
|
|
||||||
if (index > num_pdus)
|
if (index >= num_pdus || index < 0)
|
||||||
{
|
{
|
||||||
return false;
|
LOG_E(MAC, "%s() Unable to drop bad ul_config_req PDU\n", __FUNCTION__);
|
||||||
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = index; i < num_pdus; i++)
|
for(int i = index; i + 1 < num_pdus; i++)
|
||||||
{
|
{
|
||||||
pdu_list[i] = pdu_list[i + 1];
|
pdu_list[i] = pdu_list[i + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
ul_config_req->ul_config_request_body.number_of_pdus--;
|
ul_config_req->ul_config_request_body.number_of_pdus--;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_DROPPED_INDICIES 10
|
|
||||||
|
|
||||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
|
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
|
||||||
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
|
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
|
||||||
ul_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
ul_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
@@ -1284,43 +1277,39 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
|
|||||||
__FUNCTION__, NFAPI_SFNSF2SFN(ul_config_req->sfn_sf), NFAPI_SFNSF2SF(ul_config_req->sfn_sf), ul_config_req->ul_config_request_body.number_of_pdus,
|
__FUNCTION__, NFAPI_SFNSF2SFN(ul_config_req->sfn_sf), NFAPI_SFNSF2SF(ul_config_req->sfn_sf), ul_config_req->ul_config_request_body.number_of_pdus,
|
||||||
ul_config_req->ul_config_request_body.rach_prach_frequency_resources, ul_config_req->ul_config_request_body.srs_present);
|
ul_config_req->ul_config_request_body.rach_prach_frequency_resources, ul_config_req->ul_config_request_body.srs_present);
|
||||||
|
|
||||||
uint16_t num_dropped_indicies = 0;
|
int num_pdus = ul_config_req->ul_config_request_body.number_of_pdus;
|
||||||
int dropped_indicies[MAX_DROPPED_INDICIES];
|
nfapi_ul_config_request_pdu_t *pdu_list = ul_config_req->ul_config_request_body.ul_config_pdu_list;
|
||||||
uint8_t num_pdus = ul_config_req->ul_config_request_body.number_of_pdus;
|
|
||||||
for (int i = 0; i < num_pdus; i++)
|
for (int i = 0; i < num_pdus; i++)
|
||||||
{
|
{
|
||||||
uint8_t pdu_type = ul_config_req->ul_config_request_body.ul_config_pdu_list[i].pdu_type;
|
uint8_t pdu_type = pdu_list[i].pdu_type;
|
||||||
if (pdu_type != 1)
|
if (pdu_type != NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(MAC, "ul_config_req num_pdus: %u pdu_number: %d pdu_type: %u SFN.SF: %d.%d\n",
|
LOG_I(MAC, "ul_config_req num_pdus: %u pdu_number: %d pdu_type: %u SFN.SF: %d.%d\n",
|
||||||
num_pdus, i, pdu_type, ul_config_req->sfn_sf >> 4, ul_config_req->sfn_sf & 15);
|
num_pdus, i, pdu_type, ul_config_req->sfn_sf >> 4, ul_config_req->sfn_sf & 15);
|
||||||
|
|
||||||
for (int j = i + 1; j < num_pdus; j++)
|
for (int j = i + 1; j < num_pdus; j++)
|
||||||
{
|
{
|
||||||
uint8_t pdu_type2 = ul_config_req->ul_config_request_body.ul_config_pdu_list[j].pdu_type;
|
uint8_t pdu_type2 = pdu_list[j].pdu_type;
|
||||||
if (pdu_type == pdu_type2)
|
if (pdu_type != pdu_type2)
|
||||||
{
|
{
|
||||||
uint16_t rnti_i = ul_config_req->ul_config_request_body.ul_config_pdu_list[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
|
continue;
|
||||||
uint16_t rnti_j = ul_config_req->ul_config_request_body.ul_config_pdu_list[j].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
|
|
||||||
if (is_ue_same(rnti_i, rnti_j))
|
|
||||||
{
|
|
||||||
assert (num_dropped_indicies < MAX_DROPPED_INDICIES);
|
|
||||||
dropped_indicies[num_dropped_indicies] = j;
|
|
||||||
num_dropped_indicies++;
|
|
||||||
LOG_E(MAC, "Problem, two cqis being sent to a single UE for rnti %x dropping one\n",
|
|
||||||
rnti_i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < num_dropped_indicies; i++)
|
uint16_t rnti_i = pdu_list[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
|
||||||
{
|
uint16_t rnti_j = pdu_list[j].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
|
||||||
if (!remove_ul_config_req_pdu(dropped_indicies[i], ul_config_req))
|
if (!is_ue_same(rnti_i, rnti_j))
|
||||||
{
|
{
|
||||||
LOG_E(MAC, "%s() Unable to drop bad ul_config_req PDU\n", __FUNCTION__);
|
continue;
|
||||||
abort();
|
}
|
||||||
|
remove_ul_config_req_pdu(j, ul_config_req);
|
||||||
|
j--;
|
||||||
|
num_pdus--;
|
||||||
|
|
||||||
|
LOG_E(MAC, "Problem, two cqis being sent to a single UE for rnti %x dropping one\n",
|
||||||
|
rnti_i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6144,8 +6144,6 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
|
|||||||
nfapi_p7_message_header_t *pMessageHeader = (nfapi_p7_message_header_t*)pUnpackedBuf;
|
nfapi_p7_message_header_t *pMessageHeader = (nfapi_p7_message_header_t*)pUnpackedBuf;
|
||||||
uint8_t *pReadPackedMessage = pMessageBuf;
|
uint8_t *pReadPackedMessage = pMessageBuf;
|
||||||
uint8_t *end = pMessageBuf + messageBufLen;
|
uint8_t *end = pMessageBuf + messageBufLen;
|
||||||
uint8_t *end_unpacked_buf = pUnpackedBuf + unpackedBufLen;
|
|
||||||
uint8_t *start_unpacked_buf = pUnpackedBuf;
|
|
||||||
|
|
||||||
if (pMessageBuf == NULL || pUnpackedBuf == NULL)
|
if (pMessageBuf == NULL || pUnpackedBuf == NULL)
|
||||||
{
|
{
|
||||||
@@ -6354,16 +6352,9 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMessageHeader->message_id == NFAPI_RX_ULSCH_INDICATION)
|
|
||||||
{
|
|
||||||
char foobar[1024];
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Biden %s:%d: %s\n", __FUNCTION__,
|
|
||||||
__LINE__, hexdump(pUnpackedBuf, end_unpacked_buf - start_unpacked_buf, foobar, sizeof(foobar)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(result == 0)
|
if(result == 0)
|
||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,8 +85,6 @@
|
|||||||
#define MAX_gNB 2
|
#define MAX_gNB 2
|
||||||
#else
|
#else
|
||||||
// TODO: Change after gaining stability on 20 UES or less
|
// TODO: Change after gaining stability on 20 UES or less
|
||||||
// Make sure when changing these two fields to also change
|
|
||||||
// "NUMBER_OF_UE_MAX" constant in targets/COMMON/openairinterface5g_limits.h - Andrew
|
|
||||||
#define MAX_MOBILES_PER_ENB 20
|
#define MAX_MOBILES_PER_ENB 20
|
||||||
#define MAX_MOBILES_PER_ENB_NB_IoT 20
|
#define MAX_MOBILES_PER_ENB_NB_IoT 20
|
||||||
#define MAX_MOBILES_PER_GNB 2//16
|
#define MAX_MOBILES_PER_GNB 2//16
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef OPENAIRINTERFACE5G_LIMITS_H_
|
#ifndef OPENAIRINTERFACE5G_LIMITS_H_
|
||||||
#define OPENAIRINTERFACE5G_LIMITS_H_
|
#define OPENAIRINTERFACE5G_LIMITS_H_
|
||||||
|
|
||||||
|
#include "platform_constants.h"
|
||||||
|
|
||||||
#if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)*/
|
#if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)*/
|
||||||
# define NUMBER_OF_eNB_MAX 1
|
# define NUMBER_OF_eNB_MAX 1
|
||||||
# define NUMBER_OF_gNB_MAX 1
|
# define NUMBER_OF_gNB_MAX 1
|
||||||
@@ -107,4 +109,12 @@ and the other are using MAX_MOBILES_PER_ENB in for-loop.
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MAX_MOBILES_PER_ENB != NUMBER_OF_UE_MAX
|
||||||
|
#error "Invalid configuration of UE's"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MAX_MOBILES_PER_ENB_NB_IoT != NUMBER_OF_UE_MAX
|
||||||
|
#error "Invalid configuration of UE's"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* OPENAIRINTERFACE5G_LIMITS_H_ */
|
#endif /* OPENAIRINTERFACE5G_LIMITS_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user