From a1190f9fd09ed99069e5e0697d92bcfd4ae493ed Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 10 Dec 2024 18:50:52 +0100 Subject: [PATCH] nFAPI: give more time for messages to arrive, make it work The time that a message between PNF/VNF to arrive depends mostly on the transport. To allow for some delays, there is a slot_ahead time, during which the VNF is allowed to schedule and send instructions to the PNF. This can be multiple slots; the 1ms hitherto given might typically too short. Increase to 10ms, to encompass a wider range of slot_ahead times. Make the corresponding log message of when old (stale) message are removed a bit clearer with respect to times. This is the first commit in which nFAPI works. Follow-up commits improve performance. --- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 10 ++++++++-- nfapi/open-nFAPI/vnf/src/vnf_p7.c | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index f10d37820c..9ad9bd9fe9 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -471,7 +471,7 @@ void pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7_t* pnf_p7, pnf_p7_rx_reas previous->next = iterator->next; } - NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting stale reassembly message (%u %u %d)\n", iterator->rx_hr_time, rx_hr_time, delta); + NFAPI_TRACE(NFAPI_TRACE_WARN, "Deleting stale reassembly message (packet rx_hr_time %u current rx_hr_time %u delta %d us)\n", iterator->rx_hr_time, rx_hr_time, delta); pnf_p7_rx_message_t* to_delete = iterator; iterator = iterator->next; @@ -2642,7 +2642,13 @@ void pnf_nr_handle_p7_message(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, } } - pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7, &(pnf_p7->reassembly_queue), rx_hr_time, 1000); + // The timeout used to be 1000, i.e., 1ms, which is too short. The below 10ms + // is selected to be able to encompass any "reasonable" slot ahead time for the VNF. + // Ideally, we would remove old msg (segments) if we detect packet loss + // (e.g., if the sequence numbers advances sufficiently); in the branch of + // this commit, our goal is to make the PNF work, so we content ourselves to + // just remove very old messages. + pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7, &(pnf_p7->reassembly_queue), rx_hr_time, 10000); } diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7.c b/nfapi/open-nFAPI/vnf/src/vnf_p7.c index 56ac43dde5..a61d836660 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_p7.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_p7.c @@ -241,7 +241,7 @@ void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reas previous->next = iterator->next; } - NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting stale reassembly message (%u %u %d)\n", iterator->rx_hr_time, rx_hr_time, delta); + NFAPI_TRACE(NFAPI_TRACE_WARN, "Deleting stale reassembly message (packet rx_hr_time %u current rx_hr_time %u delta %d us)\n", iterator->rx_hr_time, rx_hr_time, delta); vnf_p7_rx_message_t* to_delete = iterator; iterator = iterator->next; @@ -2505,7 +2505,8 @@ void vnf_nr_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7) vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7, &(phy->reassembly_queue), rx_msg); } - vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7, &(phy->reassembly_queue), 1000); + // see corresponding comment in pnf_nr_handle_p7_message() [same commit] + vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7, &(phy->reassembly_queue), 10000); } else {