Commit 4fe4f6cd authored by Melissa's avatar Melissa Committed by Michael Cook

dl_config_Req and tx_reqs are queued together

Additionally, combined many of the individual
dl_config_req and tx_req handle functions.
Also removed some unused functions we added.
Futhermore, removed our additions to the
dl_config_req and tx_req memcpy functions.
parent b209f2ff
...@@ -1169,8 +1169,11 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { ...@@ -1169,8 +1169,11 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_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;
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!! dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
dl_config_req->header.message_id = NFAPI_DL_CONFIG_REQUEST; dl_config_req->header.message_id = NFAPI_DL_CONFIG_REQUEST;
LOG_I(PHY, "[VNF] %s() DL_CONFIG_REQ sfn_sf:%d_%d number_of_pdus:%d\n", __FUNCTION__,
NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),NFAPI_SFNSF2SF(dl_config_req->sfn_sf), dl_config_req->dl_config_request_body.number_pdu);
if (dl_config_req->dl_config_request_body.number_pdu > 0) if (dl_config_req->dl_config_request_body.number_pdu > 0)
{ {
// TODO: Decide if we really need these logs in the future:
for (int i = 0; i < dl_config_req->dl_config_request_body.number_pdu; i++) for (int i = 0; i < dl_config_req->dl_config_request_body.number_pdu; i++)
{ {
uint8_t pdu_type = dl_config_req->dl_config_request_body.dl_config_pdu_list[i].pdu_type; uint8_t pdu_type = dl_config_req->dl_config_request_body.dl_config_pdu_list[i].pdu_type;
...@@ -1220,7 +1223,8 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) ...@@ -1220,7 +1223,8 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_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;
tx_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!! tx_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
tx_req->header.message_id = NFAPI_TX_REQUEST; tx_req->header.message_id = NFAPI_TX_REQUEST;
LOG_I(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus); LOG_I(PHY, "[VNF] %s() TX_REQ sfn_sf:%d_%d number_of_pdus:%d\n", __FUNCTION__,
NFAPI_SFNSF2SFN(tx_req->sfn_sf),NFAPI_SFNSF2SF(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
int retval = nfapi_vnf_p7_tx_req(p7_config, tx_req); int retval = nfapi_vnf_p7_tx_req(p7_config, tx_req);
if (retval!=0) { if (retval!=0) {
......
...@@ -1256,7 +1256,9 @@ void *ue_standalone_pnf_task(void *context) ...@@ -1256,7 +1256,9 @@ void *ue_standalone_pnf_task(void *context)
assert(sd > 0); assert(sd > 0);
nfapi_tx_request_t tx_req; nfapi_tx_request_t tx_req;
nfapi_dl_config_request_t dl_config_req;
bool tx_req_valid = false; bool tx_req_valid = false;
bool dl_config_req_valid = false;
while (true) while (true)
{ {
ssize_t len = recvfrom(sd, buffer, sizeof(buffer), 0, (struct sockaddr *)&server_address, &addr_len); ssize_t len = recvfrom(sd, buffer, sizeof(buffer), 0, (struct sockaddr *)&server_address, &addr_len);
...@@ -1290,7 +1292,11 @@ void *ue_standalone_pnf_task(void *context) ...@@ -1290,7 +1292,11 @@ void *ue_standalone_pnf_task(void *context)
{ {
case NFAPI_DL_CONFIG_REQUEST: case NFAPI_DL_CONFIG_REQUEST:
{ {
nfapi_dl_config_request_t dl_config_req; if (dl_config_req_valid)
{
LOG_W(MAC, "Received consecutive dl_config_reqs. Previous dl_config_req frame: %u, subframe: %u\n",
dl_config_req.sfn_sf >> 4, dl_config_req.sfn_sf & 15);
}
if (nfapi_p7_message_unpack((void *)buffer, len, &dl_config_req, if (nfapi_p7_message_unpack((void *)buffer, len, &dl_config_req,
sizeof(dl_config_req), NULL) < 0) sizeof(dl_config_req), NULL) < 0)
{ {
...@@ -1298,32 +1304,34 @@ void *ue_standalone_pnf_task(void *context) ...@@ -1298,32 +1304,34 @@ void *ue_standalone_pnf_task(void *context)
break; break;
} }
// In multiUE scenario possible to get a dl_config_req before the tx_req? -Melissa
// How should we handle this? -Melissa
LOG_I(MAC, "dl_config_req Frame: %u Subframe: %u\n", dl_config_req.sfn_sf >> 4, LOG_I(MAC, "dl_config_req Frame: %u Subframe: %u\n", dl_config_req.sfn_sf >> 4,
dl_config_req.sfn_sf & 15); dl_config_req.sfn_sf & 15);
if (!tx_req_valid)
dl_config_req_valid = true;
if (tx_req_valid)
{ {
LOG_W(MAC, "The tx_req not valid.\n");
break;
}
if (dl_config_req.sfn_sf != tx_req.sfn_sf) if (dl_config_req.sfn_sf != tx_req.sfn_sf)
{ {
LOG_W(MAC, "sfnsf mismatch. dl_config_req Frame: %u Subframe: %u, tx_req Frame: %u Subframe: %u\n", LOG_W(MAC, "sfnsf mismatch. dl_config_req Frame: %u Subframe: %u, Discarding tx_req Frame: %u Subframe: %u\n",
dl_config_req.sfn_sf >> 4, dl_config_req.sfn_sf & 15, dl_config_req.sfn_sf >> 4, dl_config_req.sfn_sf & 15,
tx_req.sfn_sf >> 4, tx_req.sfn_sf & 15); tx_req.sfn_sf >> 4, tx_req.sfn_sf & 15);
tx_req_valid = false; tx_req_valid = false;
break; break;
} }
enqueue_dl_config_req_tx_req(&dl_config_req, &tx_req); enqueue_dl_config_req_tx_req(&dl_config_req, &tx_req);
dl_config_req_valid = false;
tx_req_valid = false; tx_req_valid = false;
}
break; break;
} }
case NFAPI_TX_REQUEST: case NFAPI_TX_REQUEST:
{ {
// lock this tx_req if (tx_req_valid)
{
LOG_W(MAC, "Received consecutive tx_reqs. Previous tx_req frame: %u, subframe: %u\n",
tx_req.sfn_sf >> 4, tx_req.sfn_sf & 15);
}
if (nfapi_p7_message_unpack((void *)buffer, len, &tx_req, if (nfapi_p7_message_unpack((void *)buffer, len, &tx_req,
sizeof(tx_req), NULL) < 0) sizeof(tx_req), NULL) < 0)
{ {
...@@ -1333,12 +1341,22 @@ void *ue_standalone_pnf_task(void *context) ...@@ -1333,12 +1341,22 @@ void *ue_standalone_pnf_task(void *context)
LOG_I(MAC, "tx_req Frame: %u Subframe: %u\n", tx_req.sfn_sf >> 4, LOG_I(MAC, "tx_req Frame: %u Subframe: %u\n", tx_req.sfn_sf >> 4,
tx_req.sfn_sf & 15); tx_req.sfn_sf & 15);
if (tx_req_valid)
{
LOG_W(MAC, "Received consecutive tx_reqs\n");
}
tx_req_valid = true; tx_req_valid = true;
if (dl_config_req_valid)
{
if (dl_config_req.sfn_sf != tx_req.sfn_sf)
{
LOG_W(MAC, "sfnsf mismatch. Discarding dl_config_req Frame: %u Subframe: %u, tx_req Frame: %u Subframe: %u\n",
dl_config_req.sfn_sf >> 4, dl_config_req.sfn_sf & 15,
tx_req.sfn_sf >> 4, tx_req.sfn_sf & 15);
dl_config_req_valid = false;
break;
}
enqueue_dl_config_req_tx_req(&dl_config_req, &tx_req);
dl_config_req_valid = false;
tx_req_valid = false;
}
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