-
Notifications
You must be signed in to change notification settings - Fork 136
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
JSON load balancer config file #328
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some small changes to make. After #327 is updated you will need to merge it into your branch too.
@andreaseno I merged #327 so now you will need to resolve conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple more edits.
@@ -600,6 +674,10 @@ main(int argc, char *argv[]) { | |||
int arg_offset; | |||
const char *progname = argv[0]; | |||
|
|||
time_t t; | |||
/* Intializes RANDOM number generator */ | |||
srand((unsigned) time(&t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the issue with the indentation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like tabs not spaces. @catherinemeadows -- do you know if we have a working linter script that checks for this kind of formatting issue in ONVM? I thought our GitHub actions would do it automatically, but it seems not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in /openNetVM/style
, there is documentation about manually running our linter scripts. I think the GitHub actions weren't triggered yet because there are still merge conflicts.
examples/load_balancer/server.json
Outdated
{ | ||
"Info" : { | ||
"list_size": 2, | ||
"policy": "random" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be all caps?
@@ -555,6 +628,7 @@ packet_handler(struct rte_mbuf *pkt, struct onvm_pkt_meta *meta, | |||
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) { | |||
flow_info->s_addr_bytes[i] = ehdr->s_addr.addr_bytes[i]; | |||
} | |||
if(debug_mode) printf("New connection made with server %d.\n",flow_info->dest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have this display the src IP and port? Something like:
192.168.1.100:4256 assigned to server 2
@andreaseno @xwedea I added a couple more changes. If you can fix them sometime in the next few weeks - great! If not I'll get another student to help out later. |
Replaced the server.conf file inside the load balancer nf with a json file called server.json. Because the config file parser was written for a plaintext file rather than a json file, I had to rewrite the backend config file parse function. It now uses cjson to parse the config file.
Summary:
Usage:
Merging notes:
TODO before merging :
Test Plan:
I tested the changes by doing a full setup of a 2 server ONVM experiment, made sure the arp_response and load balancer nf's ran correctly without error, and used iperf to verify that the packets would still send correctly. The only other necessary testing I can think of off the top of my head is verifying it works with more than 2 servers.
Review:
(optional) << @-mention people who should review these changes >>
(optional) Subscribers: << @-mention people who probably care about these changes >>