-
Notifications
You must be signed in to change notification settings - Fork 37
[mstp] Fix for incorrectly passing mst internal index to stpsync #77
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
vganesan-nokia
wants to merge
1
commit into
sonic-net:master
Choose a base branch
from
vganesan-nokia:mstp-sync-idx-2-id-fix
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
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.
@vganesan-nokia
This call is intended for orchagent, and orchagent operates based on the MSTP index, not the MST ID.The MST ID is local to the STPd context and is used only for configuration and display purposes.
Therefore, for this call — as well as the other modified calls below — mstp_index is the correct parameter to use.
Uh oh!
There was an error while loading. Please reload this page.
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.
@divyachandralekha, thanks for the review comment.
In orchangent there is mapping between the given number (either MST ID or MSTP index or any number) and the OID of the created STP instance m_stpInstOId (Refer src/sonic-swss/orchagent/stporch.cpp addStpInstance(), for example). So, functinoality-wise orchagent is indifferent to MST ID (which is user given) or any internal number (like MSTP index corrsponding to the user given MST ID). As long we choose one (either MST ID or internal MSTP index corresponding to the user given MST ID) and use it consistently the MSTP works.
However, based on the orchagent code, it seems the STP_PORT_STATE_TABLE records in APPL_DB use the key STP_PORT_STATE_TABLE:<interface name>:<instance id>. If we use internal MSTP index, we'll see the port state records of CIST with key STP_PORT_STATE_TABLE:<interface name>:64 and the port records for non CIST MST ID (say MST 1), we'll see those records with key STP_PORT_STATE_TABLE:<interface name>:0. This is bit confusing and also the apis related to stp instance in src/sonic-stp/stpsync/stp_sync.cpp and the orchagent functions for STP_PORT_STATE_TABLE indicate using instance.
If passing mstp_index is the preferred way, I'll close this PR. But, I would recommend to document the schema for APPL_DB STP_PORT_STATE_TABLE to indicate that the key has internal MSTP index but not the user given MST ID and add a fv pair in this records to give MST ID of the index in the key in addition to the state value.
I'll be happy to update the HLD: STP_PORT_STATE_TABLE. to provide the schema details.