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

NF pool #240

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open

NF pool #240

wants to merge 24 commits into from

Conversation

dennisafa
Copy link
Member

@dennisafa dennisafa commented Jun 24, 2020

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)
  • Figure out what to do about NF args.
  • 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.

@onvm
Copy link

onvm commented Jun 24, 2020

In response to PR creation

CI Message

Your results will arrive shortly

onvm
onvm previously approved these changes Jun 24, 2020
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.

In response to PR creation

CI Message

Run successful see results:
Test took: 3 minutes, 52 seconds
✔️ Pktgen performance check passed
✔️ Speed Test performance check passed

[Results from nimbnode23]

  • Median TX pps for Pktgen: 7739607
    Performance rating - 100.51% (compared to 7700000 average)

  • Median TX pps for Speed Tester: 42483508
    Performance rating - 101.15% (compared to 42000000 average)

@dennisafa
Copy link
Member Author

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

@dennisafa
Copy link
Member Author

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

token_len = strlen(token);
cwd = cwd + token_len;

cwd_len = strlen(cwd);
Copy link
Contributor

Choose a reason for hiding this comment

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

I got a compile error on this specific line.

In file included from /usr/include/string.h:495,
from /local/onvm/openNetVM/onvm/onvm_nflib/onvm_includes.h:62,
from /local/onvm/openNetVM/onvm/onvm_nflib/onvm_nflib.c:56:
In function ‘strncat’,
inlined from ‘onvm_nflib_get_go_script_path’ at /local/onvm/openNetVM/onvm/onvm_nflib/onvm_nflib.c:1721:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: error: ‘__builtin_strncat’ output truncated before terminating nul copying as many bytes from a
string as its length [-Werror=stringop-truncation]
136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/local/onvm/openNetVM/onvm/onvm_nflib/onvm_nflib.c: In function ‘onvm_nflib_get_go_script_path’:
/local/onvm/openNetVM/onvm/onvm_nflib/onvm_nflib.c:1715:19: note: length computed here
1715 | cwd_len = strlen(cwd);
| ^~~~~~~~~~~
cc1: all warnings being treated as errors
image

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you tell me what gcc version this is from? Maybe it's b/c I ran this on an older version of ubuntu.

Copy link
Contributor

Choose a reason for hiding this comment

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

gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
I think you're right, I'm testing on Ubuntu 20. Maybe I can try this on Ubuntu 18.

Copy link
Member

Choose a reason for hiding this comment

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

if we are going to merge this it will need to run on ubuntu20's super strict gcc. @sreyanalla fixed a lot of these errors when porting ONVM so you can check the commit log from that PR if you want to see how to get around it.

Copy link
Contributor

Choose a reason for hiding this comment

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

@WilliamMaa I just tried compiling and running an example, and it worked fine on Ubuntu 20 with gcc 9.3.0. Is there anything special you did to compile? I didn't get any weird compiler warnings or errors.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kevindweb I'll try again, I don't think I did anything special.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants