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

Add a new attribute SAI_BFD_SESSION_ATTR_NEXT_HOP_ID to saibfd.h #2117

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

baorliu
Copy link

@baorliu baorliu commented Dec 4, 2024

Adding a new attribute SAI_BFD_SESSION_ATTR_NEXT_HOP_ID to saibfd.h to support forwarding single hop bfd packet to specific nexthop.

The proposed usage is:
1, this attribute can be provided both in create_bfd_session and set_bfd_session_attribute.
2, if SAI_BFD_SESSION_ATTR_USE_NEXT_HOP (optional, default if false) is set to true, BFD session will get next hop from SAI_BFD_SESSION_ATTR_NEXT_HOP_ID value and forward the bfd packet to the next hop. If SAI_BFD_SESSION_ATTR_USE_NEXT_HOP is false, attribute SAI_BFD_SESSION_ATTR_NEXT_HOP_ID will be ignored.
3, when both SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID and SAI_BFD_SESSION_ATTR_USE_NEXT_HOP, the implementation is vender dependent.

@baorliu baorliu force-pushed the master branch 2 times, most recently from 5a8814a to 78a2f39 Compare December 4, 2024 22:25
@baorliu baorliu marked this pull request as ready for review December 10, 2024 00:41
@anamehra
Copy link

Hi @abdosi , @kcudnik , Please review. Thanks

Make sure it's always expected sai type

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
meta/parse.pl Outdated Show resolved Hide resolved
Adding a new attribute SAI_BFD_SESSION_ATTR_NEXT_HOP_ID to saibfd.h to support forwarding single hop bfd packet to specific nexthop.

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
remove condition because HW_LOOKUP_VALID is creation only, but the NEXT_HOP_ID can be updated through SET

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
the metadata sanity check fails when the interface is a portchannel. need to support SAI_OBJECT_TYPE_LAG

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
baorliu and others added 4 commits December 12, 2024 11:06
Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
* @flags CREATE_ONLY
* @default false
*/
SAI_BFD_SESSION_ATTR_USE_NEXT_HOP,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? If next hop is null it will not be used, does make sense to make only 1 attribute next hop without second one which acts flag ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kcudnik ,
SAI_NULL_OBJECT_ID is valid for SAI_BFD_SESSION_ATTR_NEXT_HOP_ID here.
The reason is that, when interface becomes DOWN, the corresponding nexthop will be removed. In this case, orchagent update SAI_BFD_SESSION_ATTR_NEXT_HOP_ID SAI attribute with value SAI_NULL_OBJECT_ID to that single hop BFD session, and update NPU/ASIC eventually, make NPU/ASIC drop the egress BFD packet on purpose.
When the interface becomes UP, orchagent update BFD session with a normal nexthop_id, so the BFD TX packet resume.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From your description I see no need for bool flag you described exactly how this can be done without that flag

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bool flag SAI_BFD_SESSION_ATTR_USE_NEXT_HOP is trying to direct SAI to use next_hop approach or to use "SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID == false" + SAI_BFD_SESSION_ATTR_DST_MAC_ADDRESS approach.

because 0 is a valid mac address (even it might not be valid for SAI_BFD_SESSION_ATTR_DST_MAC_ADDRESS), with SAI_BFD_SESSION_ATTR_USE_NEXT_HOP=true, we can avoid checking SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID==false && SAI_BFD_SESSION_ATTR_DST_MAC_ADDRESS==0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got confused here, what mac has to do wiht hthat ?

for me you have 4 options here:

  1. use_next_hop = true, && next_hop = valid_oid
  2. use_next_hop = true, && next_hop = NULL
  3. use_next_hop = false, && next_hop = valid_oid
  4. use_next_hop = false, && next_hop = NULL

in 2 3 and 4 you will not use next hop, since next hop is ether NULL or use_next_hop is false
so the only scenario when possible to use is scenario 1
thus this logic points that having use_next_hop is unnecessary flag, setting it to true when next hop is NULL have no effect, so actual value of next_hop NULL/valid_oid is the same as flag false/true

Copy link
Author

@baorliu baorliu Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusion here, let's forget SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID and SAI_BFD_SESSION_ATTR_DST_MAC_ADDRESS related things, and focus on NEXT_HOP only here.

  1. use_next_hop = true, && next_hop = valid_oid --> it tells HW to construct BFD packet using the nexthop info directly and skips HW_LOOKUP.
  2. use_next_hop = true, && next_hop = NULL --> it tells HW to use nexthop, but because of null value, HW is not able to construct TX BFD packet. The system stops BFD TX in this way. use_next_hop = true, && next_hop = NULL is a valid combination, NOS stops BFD session TX on purpose in the skip HW_LOOKUP case.
    The use case in second case, for portchannel, even portchannel is DOWN, part of its members might be still UP and packet can get through physically. if nexthop is used and BFD packet is sent directly to TX port, single hop BFD packet can reach peer system which is not expected when portchannel is DOWN.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im even more confused XD i dont know the workflow of pipeline here XD

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

Successfully merging this pull request may close these issues.

3 participants