Current Behavior
If an NF tries to send a message to another NF using the onvm_nflib_send_msg_to_nf() function it will allocate memory to store the message and then enqueue the message for the other NF. If the enqueue fails (because the destination NF's ring is full), then the allocated memory will never be freed.
Expected behavior/code
If the enqueue fails, we should free the allocated message. So line 730 should be split into multiple lines that check if the enqueue succeeds or fails, calls rte_mempool_put on failure, and then returns the success/failure flag.
Steps to reproduce
I don't think any of our example NFs use this function (it has mainly been used in our research projects). We should create a simple test NF that demonstrates this functionality and helps us verify that the bug is fixed.
Bug Report
Current Behavior If an NF tries to send a message to another NF using the
onvm_nflib_send_msg_to_nf()
function it will allocate memory to store the message and then enqueue the message for the other NF. If the enqueue fails (because the destination NF's ring is full), then the allocated memory will never be freed.https://github.com/sdnfv/openNetVM/blob/61ce33a4ca6d3d7662bb091bdd8bcfc9a61c792d/onvm/onvm_nflib/onvm_nflib.c#L717-L731
Expected behavior/code If the enqueue fails, we should free the allocated message. So line 730 should be split into multiple lines that check if the enqueue succeeds or fails, calls
rte_mempool_put
on failure, and then returns the success/failure flag.Steps to reproduce I don't think any of our example NFs use this function (it has mainly been used in our research projects). We should create a simple test NF that demonstrates this functionality and helps us verify that the bug is fixed.