Commit f13875b1 authored by Michael Cook's avatar Michael Cook

Merge branch 'episys/foobar' into 'episys/master'

Dl_config_req and tx_req filtering allowed for either order

See merge request aburger/openairinterface5g!13
parents b209f2ff 4fe4f6cd
......@@ -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;
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;
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)
{
// 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++)
{
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)
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.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);
if (retval!=0) {
......
......@@ -1256,7 +1256,9 @@ void *ue_standalone_pnf_task(void *context)
assert(sd > 0);
nfapi_tx_request_t tx_req;
nfapi_dl_config_request_t dl_config_req;
bool tx_req_valid = false;
bool dl_config_req_valid = false;
while (true)
{
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)
{
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,
sizeof(dl_config_req), NULL) < 0)
{
......@@ -1298,32 +1304,34 @@ void *ue_standalone_pnf_task(void *context)
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,
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)
{
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,
tx_req.sfn_sf >> 4, tx_req.sfn_sf & 15);
tx_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;
}
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,
sizeof(tx_req), NULL) < 0)
{
......@@ -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,
tx_req.sfn_sf & 15);
if (tx_req_valid)
{
LOG_W(MAC, "Received consecutive tx_reqs\n");
}
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;
}
......
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