Fix json configuration and duplicate instance id bugs #272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)