Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors Advanced Rings API/Examples #124

Merged
merged 203 commits into from
Jun 3, 2019
Merged

Conversation

koolzz
Copy link
Member

@koolzz koolzz commented May 26, 2019

Currently the advanced ring support in onvm is not clean, this pr attempts to resolve this.

Summary:

This PR resolves such issues as:

  • Removing unused APIs
  • Removing support for APIs written for advanced rings (see advanced rings scaling) that would never actually be used by the developers, because if developers are using advanced rings the assumption is they will also want to manage their own threads etc.
  • Remove Advanced Rings mode from the Speed tester NF
  • Cleanup and redo adv ring mode in the Scaling NF, the mode now does its own pthread creation instead of relying on onvm scaling APIs. Also make a clear separation between default and advanced ring mode.
  • Because of the adv rings changes some internal nflib APIs were exposed to the NF (onvm_nflib_start_nf, onvm_nflib_init_nf_init_cfg, onvm_nflib_inherit_parent_init_cfg)

Usage:

This PR includes
Resolves issues
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:

TODO before merging :

  • PR is ready for review

Test Plan:

Still working on it but primarily we will need to test the scaling NF

Review:

(optional) << @-mention people who should review these changes >>

(optional) Subscribers: << @-mention people who probably care about these changes >>

sameergk and others added 30 commits February 13, 2017 13:26
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.
…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
 - 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
…o_adv_rings

Conflicts:
	examples/scaling_example/scaling.c
	examples/speed_tester/speed_tester.c
	onvm/onvm_nflib/onvm_common.h
	onvm/onvm_nflib/onvm_nflib.c
	onvm/onvm_nflib/onvm_nflib.h
@koolzz
Copy link
Member Author

koolzz commented May 31, 2019

@onvm linty lint

@onvm
Copy link

onvm commented May 31, 2019

@onvm linty lint

CI Message

Your results will arrive shortly

Copy link

@onvm onvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onvm linty lint

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: 38253812
  • Performance rating - 109.30% (compared to 35000000 average)

Linter Output

examples/scaling_example/scaling.c:161: Lines should be <= 120 characters long [whitespace/line_length] [5]
examples/scaling_example/scaling.c:309: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
Total errors found: 2

@koolzz koolzz changed the title [WIP] Rewrite advanced rings API/examples Rewrite advanced rings API/examples May 31, 2019
@koolzz
Copy link
Member Author

koolzz commented May 31, 2019

@onvm gogogo

@onvm
Copy link

onvm commented May 31, 2019

@onvm gogogo

CI Message

Your results will arrive shortly

Copy link

@onvm onvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onvm gogogo

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: 38259380
  • Performance rating - 109.31% (compared to 35000000 average)

@koolzz
Copy link
Member Author

koolzz commented May 31, 2019

@dennisafa @kevindweb Check this out if you have time, if shows a clean separation between adv and normal rings(at least it should so comment if this needs any changes).

@nks5295 This is good for review now. Updated the description

Copy link
Contributor

@kevindweb kevindweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's PR review day, for me. Success! 13555168mpps for Pktgen, amazing 51877024 with 1 speed tester, dropped to 49639520 and 43844704 after a second was added. 19094944+ when running 2 speed_testers from 1 -d 4 and 4 -d 1. Approved 👍

@koolzz
Copy link
Member Author

koolzz commented Jun 2, 2019

@onvm comrade проверь код

@onvm
Copy link

onvm commented Jun 2, 2019

@onvm comrade проверь код

CI Message

Your results will arrive shortly

Copy link

@onvm onvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onvm comrade проверь код

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: 38243918
  • Performance rating - 109.27% (compared to 35000000 average)

…o_adv_rings

Conflicts:
	examples/scaling_example/scaling.c
	examples/speed_tester/speed_tester.c
	onvm/onvm_nflib/onvm_nflib.c
@koolzz
Copy link
Member Author

koolzz commented Jun 3, 2019

@onvm go for it

@onvm
Copy link

onvm commented Jun 3, 2019

@onvm go for it

CI Message

Your results will arrive shortly

Copy link

@onvm onvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onvm go for it

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: 38140314
  • Performance rating - 108.97% (compared to 35000000 average)

@koolzz
Copy link
Member Author

koolzz commented Jun 3, 2019

@nks5295 ready for your review 📝

@nks5295 nks5295 changed the title Rewrite advanced rings API/examples Refactors Advanced Rings API/Examples Jun 3, 2019
@nks5295 nks5295 merged commit 7da175f into sdnfv:develop Jun 3, 2019
@koolzz koolzz deleted the redo_adv_rings branch June 7, 2019 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants