-
Notifications
You must be signed in to change notification settings - Fork 5
Af xdp multi threading #5
base: main
Are you sure you want to change the base?
Conversation
…socket, and able to parse packet until the ARP level
…d tx packets; however, more investigation is needed in order to use the db functions
…emented endpoint cache layer for better lookup performance; refactored functions in af_xdp_user to utils
…eighborInMemory from pointer to value, in order to make the packet correct after modification
…s; need to investigate how to add use round robin in kernel, how to make iperf work and how to user more threads
…en after trading from bpool. Made a hack to make iperf work.
… it still stops receiving traffic from time to time
…Completion Queue to have the same size
…bpf map fd for security group ebpf table; added sample code to insert data into security group ebpf maps
…need to be tested
…security_group_port_bindnig info from arion master, and program into the sg_cidr_map ebpf map
…elarted port bindings and programs the rules
|
||
struct SecurityGroupPortBindingProgrammingState { | ||
int version; | ||
}; // local db table 2 - security rule ebpf programmed version |
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.
"table 4"
@@ -4,14 +4,16 @@ set(SOURCES | |||
./util/dispatch_queue.cpp | |||
./util/segment_lock.cpp | |||
./comm/grpc_client.cpp | |||
) | |||
# db/db_client.cpp | |||
comm/af_xdp_user_multi_thread.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.
indentation alignment
@@ -25,6 +25,8 @@ | |||
#include "marl/event.h" | |||
#include "marl/scheduler.h" | |||
#include "marl/waitgroup.h" | |||
#include "af_xdp_user_multi_thread.h" | |||
#include "grpc_client.h" |
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's a //#include "grpc_client.h" above, please keep only 1
@@ -138,10 +144,16 @@ int main(int argc, char *argv[]) { | |||
marl::schedule([=] { | |||
g_grpc_client->RunClient(g_arion_master_address, | |||
g_arion_master_port, | |||
g_arion_group, | |||
g_arion_neighbor_table); | |||
g_arion_group,\ |
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.
do we need '' ?
// | ||
|
||
// SPDX-License-Identifier: GPL-2.0 | ||
/* Copyright(c) 2020 - 2022 Intel Corporation. */ |
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 add co-author of Futurewei, just like grpc server/client files?
// lock transaction section | ||
// segment lock allows some level of concurrent manipulations of concurrent version map | ||
// as long as the multi-threading version updates' keys are not hashed to the same slot in segment array | ||
segment_lock.lock(neighbor_key); |
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.
you didn't include util\segment_lock.h or .cpp
sg_key.local_ip = local_ip_sock.sin_addr.s_addr; | ||
sg_key.direction = direction == "egress" ? 0 : 1; // going out is 0 and coming in is 1 | ||
|
||
if (protocol == "TCP") { |
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 it be lower case?
|
||
if (protocol == "TCP") { | ||
sg_key.protocol = IPPROTO_TCP; | ||
} else if (protocol == "UDP") { |
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.
same as above
} | ||
|
||
printf("GPPC: Inserted this sg rule into map: vip: %s, vni: %d\n", vpc_ip.c_str(), vni); | ||
|
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.
empty line
add_programmed_security_group_port_binding_version_db_stmt); | ||
}); | ||
} | ||
|
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.
empty line
} | ||
|
||
} | ||
if (ebpf_rc < 0) { |
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.
line break 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.
After we test with DP E2E, and clean up dead code. Let's review again. Before that, you don't need to address.
This PR does the following:
db_client.h
, in order to use it among different files.std::unordered_map
for endpoint querying.arion-dp
repository.Performance:
As of 3a5d5b8, Arion Agent is able to achieve the following performance:
10 traffic flows (10
iperf
s), all traffic handled by AF_XDP , running for 200 seconds, 10G NIC card:Same test, but all traffic handled by in-kernel XDP:
Comparison:
What's next:
std::unordered_map
shall be replaced by some DB.