sdnfv / openNetVM

A high performance container-based NFV platform from GW and UCR.
http://sdnfv.github.io/onvm/
Other
261 stars 134 forks source link

Memory leak when sending messages between NFs with full rings #293

Closed twood02 closed 2 years ago

twood02 commented 3 years ago

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.

twood02 commented 3 years ago

@NoahChinitzGWU - this can be a good first issue for you

NoahChinitz commented 3 years ago

@twood02 - will definitely work on this

twood02 commented 2 years ago

resolved by #296