openNetVM icon indicating copy to clipboard operation
openNetVM copied to clipboard

NF pool

Open dennisafa opened this issue 5 years ago • 3 comments

This PR implements a NF pool API.

Summary:

This PR allows developers to create add and remove NF's from a pool. The pool is a hashmap that maps an NF to a pool context structure, which holds a ring of initialized network functions. Developers can add/remove from the pool by using the enqueue/dequeue function calls. Adding to the pool means instantiating a new NF and storing its NF struct pointer within a ring. Dequeueing will remove from the ring and intialize the network function. When an NF is added to the pool, it is put to sleep on a semaphore. The semaphore is then posted to when a dequeue occurs. This is very similar to the shared core functionality that we already have.

Usage: I will be uploading a sample NF that shows usage of the pool API. It can be used from any network function, probably one that needs to do loadbalancing or just needs duplicate NF's that must be activated in a time sensitive manner.

This PR includes
Resolves issues
Breaking API changes
Internal API changes X
Usability improvements
Bug fixes
New functionality X
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
  • [ ] Documentation (probably a wiki page or something)
  • [ ] Sample NF (probably gonna use the scaling NF and repurpose it)
  • [x] Figure out what to do about NF args.
  • [x] Fix having to lookup semaphore on each dequeue (located in onvm_nflib.c, dequeue_pool function)

Test Plan:

The big thing we need to figure out is how to parse NF args. Right now the enqueue function takes a struct argument that contains args for the NF being instantiated. Im thinking of doing some sort of JSON implementation of this. Discuss below on what you think is best

Review:

Anyone. This is a good chunk of new functionality.

dennisafa avatar Jun 24 '20 22:06 dennisafa

In response to PR creation

CI Message

Your results will arrive shortly

onvm avatar Jun 24 '20 22:06 onvm

have been slammed with work. I'll try to get this improved this coming weekend.

dennisafa avatar Jul 22 '20 05:07 dennisafa

I know you are all slammed but if you have time give this a look.

dennisafa avatar Oct 04 '20 15:10 dennisafa