Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Zeta Data path integration fixes #191

Merged
merged 3 commits into from
Jan 14, 2021

Conversation

zhangml
Copy link
Contributor

@zhangml zhangml commented Jan 13, 2021

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.

@@ -27,11 +27,28 @@ static atomic_uint current_available_group_id(1);

namespace aca_zeta_programming
{
struct fwd_info {
Copy link
Contributor

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.

// Overload "=="for hash operation
bool operator==(const fwd_info &other) const
{
if (ip_addr == other.ip_addr && mac_addr == other.mac_addr) {
Copy link
Contributor

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));

unordered_set<string> zeta_buckets;

// CTSL::HashMap <key: fwd_info, value: int* (not used)>
CTSL::HashMap<fwd_info *, int *> zeta_buckets;
Copy link
Contributor

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.

@@ -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);
Copy link
Contributor

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

@@ -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;
Copy link
Contributor

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...

@zhangml
Copy link
Contributor Author

zhangml commented Jan 14, 2021

@er1cthe0ne The concurrency stop error has not completely disappeared, and I need to continue to modify it later.

@zhangml zhangml force-pushed the data_path_integration branch from aa7ac3f to aff7839 Compare January 14, 2021 03:12

// Overload "=="for hash operation
bool operator==(const fwd_info &other) const
FWD_Info(){};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great 👍

Copy link
Contributor

@er1cthe0ne er1cthe0ne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@er1cthe0ne er1cthe0ne added the Zeta Integration with Zeta label Jan 14, 2021
@er1cthe0ne er1cthe0ne changed the title Data path integration Zeta Data path integration fixes Jan 14, 2021
@er1cthe0ne er1cthe0ne merged commit 68680e4 into futurewei-cloud:master Jan 14, 2021
@zhangml zhangml deleted the data_path_integration branch January 27, 2021 13:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Zeta Integration with Zeta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants