sdnfv / openNetVM

A high performance container-based NFV platform from GW and UCR.
http://sdnfv.github.io/onvm/
Other
261 stars 134 forks source link

Weighted Random Policy #327

Closed xwedea closed 1 year ago

xwedea commented 1 year ago

This PR adds 2 new policies to the load balancer: Random and Weighted Random.

After this PR, there are 3 policies that can be specified in the configuration file as:

Summary:

Usage:

This PR includes
Resolves issues
Breaking API changes
Internal API changes
Usability improvements
Bug fixes
New functionality x
New NF/onvm_mgr args
Changes to starting NFs
Dependency updates
Web stats updates

Merging notes:

TODO before merging :

Test Plan:

Review:

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

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

xwedea commented 1 year ago

@twood02 we allocate and free lb->weights and lb->policy using standard malloc and free functions. However, in the previous of the code dpdk's function rte_calloc and rte_free are used. Should I edit this code to use those functions? I am not sure how to free them later in that case.

twood02 commented 1 year ago

@twood02 we allocate and free lb->weights and lb->policy using standard malloc and free functions. However, in the previous of the code dpdk's function rte_calloc and rte_free are used. Should I edit this code to use those functions? I am not sure how to free them later in that case.

The main differences between normal malloc and rte_malloc are:

For your use case, you are allocating memory which will only be used by the LB NF and you are only doing it once when the NF starts. So it is fine to use normal malloc here.

xwedea commented 1 year ago

@twood02 I removed the commented code and did a final check with all policies. this should be good to go

twood02 commented 1 year ago

@xwedea - can you put a description of what this PR adds at the top of this page. When we make our release notes for each ONVM version we go back to the PRs to get short descriptions of each new feature.

Otherwise this looks good and I will merge it into develop. Then next week we'll go through a full review process with @andreaseno's PR where he will run the NFs and demonstrate it working for me.

xwedea commented 1 year ago

@twood02 I put a description.