Consolidates All NF Structs#117
Conversation
This code introduces **EXPERIMENTAL** support for NFs that can efficiently run on **shared** CPUs. NFs wait on semaphores when idle and are signaled by the manager when new packets arrive. Once the NF is in wake state, no additional notifications will be sent until it goes back to sleep. All code changes are featurized using INTERRUPT_SEM macro. See the ONVM README.md file for more information and warnings. Commit log: * merges rebased to master with sdnfv#147 * reverting num_clients update. * replace tabs with spaces * Readme describing experimental shared CPU support * Add usage and known limitations for shared CPU code
…fv#185) Fixes a race condition in NF instance ID assignment. Before, if two NFs were started at the same time, they would be assigned the same instance ID. This change modifies logic in `onvm_nf_next_instance_id` to avoid assigning the same ID to two starting NFs. Commit log: * Bug Fix: Fixes instance ID assignment race condition - Fixes sdnfv#178 - Changed incrementation of next_instance_id in onvm_mgr/onvm_nf.c such that the ID can't be reused before an NF becomes active.
…ith onvm_nf struct
…nd flow_tracker). Also did some small style changes in some other documentation in onvm_nflib.h
Conflicts: README.md onvm/onvm_mgr/onvm_init.c onvm/onvm_mgr/onvm_init.h onvm/onvm_mgr/onvm_mgr.h onvm/onvm_mgr/onvm_nf.c onvm/onvm_mgr/onvm_stats.c onvm/onvm_nflib/onvm_common.h onvm/onvm_nflib/onvm_nflib.c onvm/onvm_nflib/onvm_nflib.h
…experimental/shared_cpu
- Some stats were unused and broken(?) nuked them - added stats that are possible usefull to stdout (slightly ugly)
…multithread Conflicts: examples/speed_tester/speed_tester.c
- Keeping onvm_nf_info small, moved vars to onvm_nf - Added a callback function for the scaling child thread - Cleaned up code
- Adds ability to scale NFs with advanced rings - Adds a setup function for NFs - More docs and cleanup
- Moving nf_info as passed arg to packet_handler -> allows for spawned NF to access their own nf_info - Launching new NFs now accepts arguments for packet_handler function, setup function, callback function, advanced rings function - Add a data pointer to onvm_nflib_info to maintain state - Working on a scaling example (currently testing code, not in usable state) will showcase different features of spawning NFs
- This is a major change, a lot of nflib initlization is refactored to allow spawned NFs to launch with their own service id - There is a bug when the spawn a lot of new NFs we can no longer retrieve the nf_info from nf_info_mp, this needs to be fixed as it breaks stuff
- Fixed the nf_info bug where the mempool would get messed up as children weren't cleared properly. - Updated the example scaling NF - Removed most of the debugging code
Cleaned up messy bits, replacing macro branches with if statements, encapsulating code in functions, and getting rid of unnecessary code.
- Style fixes - Removing debug code - Making code prettier - Adding better docs - Implementing requested changes
|
@onvm only speed tester works will you work |
CI MessageYour results will arrive shortly |
CI MessageError: ERROR: Failed to fetch results from nimbnode30 Linter Outputonvm/onvm_nflib/onvm_nflib.c:465: Lines should be <= 120 characters long [whitespace/line_length] [5] |
|
I guess thats a no |
|
@onvm do your thing |
CI MessageYour results will arrive shortly |
CI MessageError: ERROR: Failed to analyze results from nimbnode30 Linter Outputexamples/aes_decrypt/aesdecrypt.c:173: Lines should be <= 120 characters long [whitespace/line_length] [5] |
|
@onvm you happy |
CI MessageYour results will arrive shortly |
onvm
left a comment
There was a problem hiding this comment.
@onvm you happy
CI Message
Run successful see results:
✔️ PR submitted to develop branch
✔️ Speed tester performance check passed
❌ Linter Failed (please fix style errors)
[Results from nimbnode30]
- Median TX pps for Speed Tester: 39169623
- Performance rating - 111.91% (compared to 35000000 average)
Linter Output
onvm/onvm_nflib/onvm_nflib.c:467: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
Total errors found: 1
|
@onvm lets do 3 out of 3 |
CI MessageYour results will arrive shortly |
onvm
left a comment
There was a problem hiding this comment.
@onvm lets do 3 out of 3
CI Message
Run successful see results:
✔️ PR submitted to develop branch
✔️ Speed tester performance check passed
✔️ Linter passed
[Results from nimbnode30]
- Median TX pps for Speed Tester: 39326084
- Performance rating - 112.36% (compared to 35000000 average)
This PR merges together onvm_nf_info and onvm_nf structs, into a single onvm_nf struct with internal variable groupings for readability, also renames key structs. Summary: The old `onvm_nf_info` is re purposed as `onvm_nf_init_cfg` a struct used to initialize the NF with the manager. This struct is passed to onvm_mgr and is then freed when initialization is complete. In attempt to merge these structs the usage of `onvm_nf_info` has been removed from all internal and external API calls. Excluding the startup sequence. The struct `onvm_nf_context` was renamed to `onvm_nf_local_ctx` Added a `nf_function_table` struct that will hold all the NF defined callback functions. Changed all NF facing API calls to pass `onvm_nf_local_ctx` instead of onvm_nf as NFs might need access to the keep_running variable. Commit log: * Remove bootstrap struct from context * Nuke some extra code * Fix firewall API * Remove unused globals in example NFs * Fix style nit * Fix double define * Global rename/regrouping of onvm_nf struct * Restructure scaling logic * Rename nf_context->nf_local_ctx * Further cleanup of scaling API * Update method name * Rename callbackhandlerfunc -> callback_func * Fix linter * Remove trailing whitespace * Fix docs * Fix more docs * Free fix, code cleanup * Set pointer to NULL on cleanup * Testing function table struct * Massive rename, API fixes, remove circular refr * Don't mind me fixin whitespace * Fix speed tester double func_table init bug * Enforce 120 char limit * Rem trailing whitespace * Rem extra api call in speed_tester * Fix docs * Huuuuge linter fix, well tested
This PR merges together
onvm_nf_infoandonvm_nfstructs, into a singleonvm_nfstruct with internal variable groupings for readability, also renames key structs.Summary:
onvm_nf_infois re purposed asonvm_nf_init_cfga struct used to initialize the NF with the manager. This struct is passed toonvm_mgrand is then freed when initialization is complete.onvm_nf_infohas been removed from all internal and external API calls. Excluding the startup sequence.onvm_nf_contextwas renamed toonvm_nf_local_ctxnf_function_tablestruct that will hold all the NF defined callback functions.onvm_nf_local_ctxinstead ofonvm_nfas NFs might need access to the keep_running variable.Usage:
Merging notes:
TODO before merging :
Test Plan:
Regular testing + pktgen
Review:
Please review, release is near