Skip to content
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

Ensure worker-local fw_state reflects cleared global firewall state #250

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions dataplane/worker_gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,22 @@ void worker_gc_t::handle_acl_gc()

iter.unlock();
}
else
{
// The entry is invalid, likely due to a call to clearFWState().
iter.lock();
auto key = *iter.key();
iter.unlock();

common::idp::getFWState::key_t fw_key(
std::uint8_t(key.proto),
{rte_be_to_cpu_32(key.src_addr.address)},
{rte_be_to_cpu_32(key.dst_addr.address)},
key.src_port,
key.dst_port);

fw_state_remove_stack.emplace_back(fw_key);
}
}

if (fw4_state_gc.offset == 0)
Expand Down Expand Up @@ -729,6 +745,22 @@ void worker_gc_t::handle_acl_gc()

iter.unlock();
}
else
{
// The entry is invalid, likely due to a call to clearFWState().
iter.lock();
auto key = *iter.key();
iter.unlock();

common::idp::getFWState::key_t fw_key(
std::uint8_t(key.proto),
{key.src_addr.bytes},
{key.dst_addr.bytes},
key.src_port,
key.dst_port);

fw_state_remove_stack.emplace_back(fw_key);
}
}

if (fw6_state_gc.offset == 0)
Expand Down
Loading