-
Notifications
You must be signed in to change notification settings - Fork 703
ICCP Bridgeport removal failure when MCLAG interface Bridgeport exist #2535
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
Open
prasanna-cls
wants to merge
3
commits into
sonic-net:master
Choose a base branch
from
prasanna-cls:icl_bp_delete_seq_issue
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 could cause race-conditions. The idea of notifying other subscribers is to let them know BridgePort deletion is complete. This flow doesn't honor that. Please propose a different solution.
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.
Hi,
From SAI point of view, the ISOLATION_GROUP_TABLE:MCLAG_ISO_GRP object depends upon the bridge port as a dependent object.
For this reason, when SWSS creates a bridge port, MCLAG is notified after the bridge port is created in SAI.
Similarly, during the bridge port deletion scenario, MCLAG has to be notified (to clean-up ISOLATION_GROUP) , before SAI deletes that bridge port.
And the MCLAG(for ISOLATION_GROUP_TABLE) is the only subscriber listening to this bridge port changes. and this changes are done as part of handling MCLAG in this pull request.
do you suggest to have a different message type, something like "SUBJECT_TYPE_BRIDGE_PORT_REMOVAL_HANDLE" that can be called before sai_bridge_api->remove_bridge_port() , instead of "SUBJECT_TYPE_BRIDGE_PORT_CHANGE", which could be retained to be called after SAI brdige port remove ?
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.
Hi @prsunny, @prasanna-cls, can we fix this issue as follows
This way there is no change in notification and Isolation group also removed.
diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp [9/1964]
index 376328f..804f356 100755
--- a/orchagent/portsorch.cpp
+++ b/orchagent/portsorch.cpp
@@ -4,6 +4,7 @@
#include "neighorch.h"
#include "gearboxutils.h"
#include "vxlanorch.h"
+#include "isolationgrouporch.h"
#include "directory.h"
#include "subintf.h"
@@ -49,6 +50,7 @@ extern NeighOrch *gNeighOrch;
extern CrmOrch *gCrmOrch;
extern BufferOrch *gBufferOrch;
extern FdbOrch *gFdbOrch;
+extern IsoGrpOrch gIsoGrpOrch;
extern Directory<Orch> gDirectory;
extern sai_system_port_api_t *sai_system_port_api;
extern string gMySwitchType;
@@ -4984,6 +4986,9 @@ bool PortsOrch::removeBridgePort(Port &port)
gFdbOrch->flushFDBEntries(port.m_bridge_port_id, SAI_NULL_OBJECT_ID);
SWSS_LOG_INFO("Flush FDB entries for port %s", port.m_alias.c_str());
PortUpdate update = { port, false };
gIsoGrpOrch->update (SUBJECT_TYPE_BRIDGE_PORT_CHANGE, static_cast<void *>(&update));
/* Remove bridge port */
status = sai_bridge_api->remove_bridge_port(port.m_bridge_port_id);
if (status != SAI_STATUS_SUCCESS)
@@ -5000,7 +5005,6 @@ bool PortsOrch::removeBridgePort(Port &port)
port.m_bridge_port_id = SAI_NULL_OBJECT_ID;
/* Remove bridge port */
PortUpdate update = { port, false };
notify(SUBJECT_TYPE_BRIDGE_PORT_CHANGE, static_cast<void *>(&update));
SWSS_LOG_NOTICE("Remove bridge port %s from default 1Q bridge", port.m_alias.c_str());
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.
Yes @kselvaraj2 , this looks ok to me. @prsunny is this approach fine ?
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.
@prsunny can I update the review with the approach suggested by @kselvaraj2 ?