-
Notifications
You must be signed in to change notification settings - Fork 273
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
[sairedis]vs SAI support for voq neighbor #725
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
184e5f6
[sairedis]vs SAI support for voq neighbor
afd3b78
[sairedis]vs sai voq neigh support - review comments fix 1
035ee0b
Merge branch 'master' into vssai-voq-nbr-1
vganesan-nokia e06db53
[switchstate] vs sai voq neigh support - review comments fix 2
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 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 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.
according to:
if encap index is not provided default value is zero and not ipv4
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.
When we create local neighbors, we either set this to 0 or do not send this attribute at all. Imposing encap index is optional for local neighbors. In SAI, when we see encap index = 0 and if the neighbor is local SAI knows that it has to assign the encap index by itself. This is what I do in here. If it was remote neighbor, encap index = 0 is an error, because for remote neighbor a valid encap index must be imposed. This is what is done in bcm SAI code, which I also emulate here.
Please also note that using last 32 bits of ip address as the encap index is vs test thing. I just wanted to have a locally unique number. We can use any mechanism to get a unique number. I just chose IP address since under normal conditions, it is expected that host ip address attached to any given asic must be unique. In actual SAI, encap index will be a unique number starting from a base number representing the FEC (used in egress encapsulation, depending on platfrom).
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.
issue i have here is that this attribute is set internally, by headers definition this value is 0, so possibly when we create this neighbor, this value will be not zero, but current sonic code will expect zero, if attribute is not provided, seems like this default value should be set to "inernal" in SAI headers ?
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.
if user will pass this attribute would it be set to user value or also assigned internally ?
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.
The encap index is not set by user but assigned internally by SAI. The normal work flow is: When a neighbor is learnt, it is sent to SAI without encap index (since it is local). For VOQ switch, SAI assigns a unique encap index to the neighbor internally. The upper layer (orchagent), retrieves this encap index after neighbor is created and syncs the neighbor info including the retrieved encap index with other asics (via chassis app db in supervisor card). In other asics, this neighbor is remote neighbor. For VOQ switches, all asics should have equivalent neighbor record for every neighbor from other asics to have proper forwarding for hosts from different asics. So when an asic creates neighbor record for remote neighbors, it uses the same exact encap index synced and the encap index attribute is sent to SAI along with attributes for is local flag = false and impose index flag = true.
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.
Sorry. I gave the line #2834 after I rebased to resolve conflict. The correct line number (from commit 1) is #2732.
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.
but when it's at line 2759, it could still mean SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_IMPOSE_INDEX is true, and doing the encap_index assignment when (encap_index == 0) is not the intended usage of the SAI API.
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. impose encap index == true and encap_index == 0 is invalid combination. We'll return error (based on check in line #2732) even before hitting #2759.
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.
Changed to check for impose encap index flag instead of ecap index value == 0 to decide on allocating unique encap index. This is to align with SAI API intended usage as suggested.
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.
need fixing: opencomputeproject/SAI#1165