-
Notifications
You must be signed in to change notification settings - Fork 29
Zeta Data path integration fixes #191
Zeta Data path integration fixes #191
Conversation
include/aca_zeta_programming.h
Outdated
@@ -27,11 +27,28 @@ static atomic_uint current_available_group_id(1); | |||
|
|||
namespace aca_zeta_programming | |||
{ | |||
struct fwd_info { |
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 looks like a c structure but it is using c++ feature operator overload. Please consider switching to c++ class.
include/aca_zeta_programming.h
Outdated
// Overload "=="for hash operation | ||
bool operator==(const fwd_info &other) const | ||
{ | ||
if (ip_addr == other.ip_addr && mac_addr == other.mac_addr) { |
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.
I would suggest simply doing this:
return ((ip_addr == other.ip_addr) && (mac_addr == other.mac_addr));
include/aca_zeta_programming.h
Outdated
unordered_set<string> zeta_buckets; | ||
|
||
// CTSL::HashMap <key: fwd_info, value: int* (not used)> | ||
CTSL::HashMap<fwd_info *, int *> zeta_buckets; |
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 this hashing based on the pointer address of "fwd_info *"? correct me if I am wrong.
include/aca_zeta_programming.h
Outdated
@@ -64,10 +82,14 @@ class ACA_Zeta_Programming { | |||
int _delete_group_punt_rule(uint tunnel_id); | |||
|
|||
int _create_zeta_group_entry(zeta_config *zeta_config_in); | |||
int _update_zeta_group_entry(zeta_config *zeta_cfg); |
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.
for consistance, please change *zeta_cfg to *zeta_config_in
src/zeta/aca_zeta_programming.cpp
Outdated
@@ -50,10 +51,18 @@ void ACA_Zeta_Programming::create_entry(string zeta_gateway_id, uint oam_port) | |||
// then add 1 after, doing both atomically | |||
// std::memory_order_relaxed option won't help much for x86 but other | |||
// CPU architecture can take advantage of it | |||
|
|||
new_zeta_cfg->oam_port = oam_port; |
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 move this line back to below so that the comments in line 51-53 still apply for current_available_group_id.fetch_add...
@er1cthe0ne The concurrency stop error has not completely disappeared, and I need to continue to modify it later. |
aa7ac3f
to
aff7839
Compare
|
||
// Overload "=="for hash operation | ||
bool operator==(const fwd_info &other) const | ||
FWD_Info(){}; |
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 great 👍
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.
LGTM
Add ZGC gateway entries' MAC addresses. #189
@er1cthe0ne There seems to be no quit error on my computer, but there is a small probability that the aca_zeta_scale_test will not pass. The cause is being investigated.