Users can now re-launch NFs with the same instance ID, and memory bugs were fixed allowing JSON configs to work again.
Summary:
This PR fixes 2 bugs that were referenced heavily in Slack and in a different issue (#233). I made a strlenn function which is an adaptation on string.h's strlen std library function. Normally, strlen does not include the null terminator when calculating the length of the string. This is a memory leak problem for our situation because we memcpy the string and need the '\0' to denote when to stop reading the config.
The second issue was the re-launch of instance IDs. This required a ring cleanup, but also on the stats side in onvm_stats.c, we needed to update nf_rx_last (a static function variable) after cleaning up the rx stats on the nfs table. This part is probably messy with the unlikely, but it's purpose is to avoid underflow with subtracting unsigned integers.
Usage:
This PR includes
Resolves issues
#233
Breaking API changes
Internal API changes
Usability improvements
Bug fixes
👍
New functionality
New NF/onvm_mgr args
Changes to starting NFs
Dependency updates
Web stats updates
Merging notes:
Dependencies: None
TODO before merging :
[ ] PR is ready for review
Test Plan:
If you notice with the current version of develop, running (with the bridge NF) ./go.sh -F ../example_config.json does not work. Also, if you try to run speed_tester for example twice with the same instance ID
(./go.sh -l 5 -- -m -r 3 -n 2 -- 3 -d 3), there will be an rte_exit from the manager because the rings weren't freed. Those are the two main tests to run and see that they are now fixed.
Review:
@twood02
(optional) Subscribers: << @-mention people who probably care about these changes >>
anyone else (maybe @catherinemeadows because you made the previous issue report)
Users can now re-launch NFs with the same instance ID, and memory bugs were fixed allowing JSON configs to work again.
Summary:
This PR fixes 2 bugs that were referenced heavily in Slack and in a different issue (#233). I made a
strlenn
function which is an adaptation onstring.h
'sstrlen
std library function. Normally,strlen
does not include the null terminator when calculating the length of the string. This is a memory leak problem for our situation because wememcpy
the string and need the '\0' to denote when to stop reading the config.The second issue was the re-launch of instance IDs. This required a ring cleanup, but also on the stats side in
onvm_stats.c
, we needed to updatenf_rx_last
(a static function variable) after cleaning up the rx stats on thenfs
table. This part is probably messy with theunlikely
, but it's purpose is to avoidunderflow
with subtracting unsigned integers.Usage:
Merging notes:
TODO before merging :
Test Plan:
If you notice with the current version of develop, running (with the bridge NF)
./go.sh -F ../example_config.json
does not work. Also, if you try to runspeed_tester
for example twice with the same instance ID (./go.sh -l 5 -- -m -r 3 -n 2 -- 3 -d 3
), there will be anrte_exit
from the manager because the rings weren't freed. Those are the two main tests to run and see that they are now fixed.Review:
@twood02
(optional) Subscribers: << @-mention people who probably care about these changes >> anyone else (maybe @catherinemeadows because you made the previous issue report)