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

[dash] VNET mapping configuration is not processed correctly #3349

Open
Yakiv-Huryk opened this issue Oct 31, 2024 · 0 comments
Open

[dash] VNET mapping configuration is not processed correctly #3349

Yakiv-Huryk opened this issue Oct 31, 2024 · 0 comments
Assignees

Comments

@Yakiv-Huryk
Copy link
Contributor

When processing the DASH_VNET_MAPPING_TABLE configuration, post logic (addVnetMapPost) is not executed. This leads to incorrect CRM logic and a lack of error checking.

The reason is that when both CAtoPA and PA Validation entries are added with no issues, the addVnetMap() returns true which leads to the task removal from m_toSync.

addOutboundCaToPa() returns true

object_statuses.emplace_back();
outbound_ca_to_pa_bulker_.create_entry(&object_statuses.back(), &outbound_ca_to_pa_entry,
(uint32_t)outbound_ca_to_pa_attrs.size(), outbound_ca_to_pa_attrs.data());
return true;

addPaValidation() returns true

pa_refcount_table_[pa_ref_key] = 1;
SWSS_LOG_INFO("Initialize PA refcount to 1 for PA IP %s",
underlay_ip_str.c_str());
return true;

addVnetMap() returns true

return addOutboundCaToPa(key, ctxt) && addPaValidation(key, ctxt);

doTaskVnetMapTable() erases the task

if (addVnetMap(key, ctxt))
{
it = consumer.m_toSync.erase(it);
}

This is not executed since the task is no longer in the m_toSync

auto it_prev = consumer.m_toSync.begin();
while (it_prev != it)
{
KeyOpFieldsValuesTuple t = it_prev->second;
string key = kfvKey(t);
string op = kfvOp(t);
auto found = toBulk.find(make_pair(key, op));
if (found == toBulk.end())
{
it_prev++;
continue;
}
const auto& ctxt = found->second;
const auto& outbound_ca_to_pa_object_statuses = ctxt.outbound_ca_to_pa_object_statuses;
const auto& pa_validation_object_statuses = ctxt.pa_validation_object_statuses;
if (outbound_ca_to_pa_object_statuses.empty() || pa_validation_object_statuses.empty())
{
it_prev++;
continue;
}
if (op == SET_COMMAND)
{
if (addVnetMapPost(key, ctxt))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants