-
Notifications
You must be signed in to change notification settings - Fork 29
Conversation
luyaoluo
commented
Nov 20, 2020
- add aca_arp_responder.cpp and aca_arp_responder.h
- modify entry in aca_ovs_control.cpp
@lly00 - do you have any update on this implementation? Thanks. |
Yes, there are some updates. I'm testing l2 and l3 neighbors currently. I'll make a commmit after finishing it. |
@er1cthe0ne I commit some updates on L2 neighbors. There are still some things I have not done: send packet out if it don't find the corresponding mac, and how to get the vlan information from goal state. |
src/ovs/aca_arp_responder.cpp
Outdated
} | ||
|
||
_arp_db_mutex.lock(); | ||
_arp_db->insert(make_pair(stData,arp_cfg_in->mac_address)); |
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.
this unordered_map with mutex lock will work with concurrent threads but will perform poorly, please switch to the new concurrent hashtable and look at the below define in aca_vlan_manager for reference:
// hashtable <key: tunnel ID, value: vpc_table_entry>
CTSL::HashMap<uint, vpc_table_entry *> _vpcs_table;
You can skip that for now since we haven't find a need for it.
you can call this to go from tunnel_id to internal vlan_id: ACA_Vlan_Manager::get_instance().get_or_create_vlan_id(tunnel_id);
I looked through the change and didn't see obvious problem on that. You may need to step through the line of those code when you run it in a debugger or print a lot of logs to see what's wrong. Please work with @Gzure to see if he can give you some pointer or help. |
@lly00 my PR #176 has been merged and I resolved the conflicts in your branch. Please go ahead to do git pull to get the latest change. The git automatic merge may not work perfectly, so please review the merge and clean up your code if needed. The goal is to get this change ready to merge this week. So please get yourself familiar with running aca_tests and confirm passing when you are ready: https://github.com/futurewei-cloud/alcor-control-agent/wiki/How-to-run-the-full-suite-of-aca_tests |
@lly00 - let's update this PR with your latest code so what we can see the status. Following up on the two issues:
|
@er1cthe0ne I made some update based on your feedback. I use two dockers to ping each other in my test, and the received packets have vlan tags if I do nothing else. However, since both dockers are connected to br-int, I don't want them to send arp request through the NORMAL flow entry, so I add a flow entry in br-int(arp,arp_op=1,actions=OUTPUT:"patch-tun"). After that, the received packets have on vlan tags anymore. |
Let me layout the remaining items:
|
It seems that ACA can not handle the received message without a thread( |
@er1cthe0ne I modify some tests in order to pass them(now all tests passed) |
@@ -134,9 +134,6 @@ int ACA_OVS_L2_Programmer::setup_ovs_bridges_if_need() | |||
execute_openflow_command("add-flow br-tun \"table=20,priority=1 actions=resubmit(,22)\"", | |||
not_care_culminative_time, overall_rc); | |||
|
|||
execute_openflow_command("add-flow br-tun \"table=2,priority=25,arp,arp_op=1,in_port=\"patch-int\" actions=resubmit(,51)\"", | |||
not_care_culminative_time, overall_rc); | |||
|
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.
please go ahead and remove the rule below also, since table=51 is for static ARP responder only and it is no longer needed.
execute_openflow_command("add-flow br-tun "table=51,priority=1 actions=resubmit(,22)"",
not_care_culminative_time, overall_rc);
@@ -736,6 +746,12 @@ TEST(ovs_l2_test_cases, DISABLED_2_ports_CREATE_test_traffic_CHILD) | |||
ASSERT_EQ(overall_rc, EXIT_SUCCESS); | |||
overall_rc = EXIT_SUCCESS; | |||
|
|||
// monitor br-tun for arp request message |
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.
since all the traffic test cases will need to have this monitoring thread running, it is possible to just add it to "int main(int argc, char **argv)" in aca_test_main.cpp?
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.
there are different places in arp/dhcp tests, one on "br-tun" and one on "br-int"
test/gtest/aca_test_ovs_l3.cpp
Outdated
overall_rc = Aca_Net_Config::get_instance().execute_system_command( | ||
"docker exec con1 ping -c1 " + vip_address_4); | ||
EXPECT_NE(overall_rc, EXIT_SUCCESS); | ||
// overall_rc = Aca_Net_Config::get_instance().execute_system_command( |
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.
why comment this three lines out?
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.
Forget to remove it. I commented it speed up the test, otherwise there are too many error messages.
@lly00 Design update: With Zeta gateway coming online, for ARP request of virtual IP which is unknown to ACA, the same packet needs to be sent back to OVS so that it will be forwarded to Zeta. Just send the original packet down to table 22 will do the trick, you don't need to worry about the Zeta openflow rules since it is handled by Zeta code. Let me know if you have any questions. |
I'll try it. By the way, I meet some problems while using two threads for br-int and br-tun. I don't clearly know how ACA_OVS_Control::monitor works, can it handle two bridges at the same time? The error occurs while add flow like "table=0,...,actions=CONTROLLER" |
We hit this assert previously when we are calling ovs library call in different threads concurrently. We were compiling ovs library in debug mode. Later we merged the change to compile ovs library in release mode and don't hit that assert (assert is disabled in release builds) then move forward without issue. Please go ahead to rebase your branch, rerun the part of getting start guide script to rebuild ovs library which will create release binary with the latest code at master. |
@er1cthe0ne There are still some problems. Some tests try to delete br-tun and br-int to clean up, and we will meet the error(could not initialize control socket). |
Got it. Thanks for trying that out. Let's don't worry about putting the adding the monitoring thread in aca_test_main.cpp.
That's the idea, dhcp code is doing similar things already: ACA_Dhcp_Server::dhcps_xmit |
|
The program terminated after throwing an instance of 'google::protobuf::FatalException': This program was compiled against version 3.3.0 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.8.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/pulsar/pulsar-client-cpp/pkg/deb/BUILD/apache-pulsar-2.6.1/pulsar-client-cpp/generated/lib/PulsarApi.pb.cc".) |
src/ovs/aca_arp_responder.cpp
Outdated
@@ -222,12 +222,13 @@ void ACA_ARP_Responder::arp_recv(uint32_t in_port, void *vlan_hdr, void *message | |||
return; | |||
|
|||
} | |||
void ACA_ARP_Responder::arp_xmit(uint32_t in_port, void *vlanmsg, void *message){ | |||
void ACA_ARP_Responder::arp_xmit(uint32_t in_port, void *vlanmsg, void *message, int is_find){ |
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.
is_found
@lly00 - please update this PR soon so that we can merge this in and avoid merge conflict with other changes. |
The change in my last commit is that I use thread.join() to make the child test cases wait for parent until interrupted. |
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 good. Thanks for addressing all the comments and get this through.