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

SAI proposal for icmp echo offload #2020

Merged
merged 4 commits into from
Jul 10, 2024
Merged

SAI proposal for icmp echo offload #2020

merged 4 commits into from
Jul 10, 2024

Conversation

chikkaiah-work
Copy link
Contributor

@chikkaiah-work chikkaiah-work commented May 28, 2024

This specification suggests:

The idea of an ICMP echo object or session that can be transferred to HW/ASIC or other modules for faster link detection.
The introduction of SAI APIs to outline ICMP echo session properties.
The introduction of a switch-level notification API to monitor changes in ICMP echo session states.
The switchover flow on link down detection. 

Creating this PR to recommit #1943.

Copy link

@zjswhhh zjswhhh left a comment

Choose a reason for hiding this comment

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

Please update with:

  1. Jai's questions in the offline emails
  2. LAG solution

Signed-off-by: chikkaiah-work <[email protected]>

fix sanity

Signed-off-by: chikkaiah-work <[email protected]>

add LAG info

Signed-off-by: chikkaiah-work <[email protected]>

sanity fix

Signed-off-by: chikkaiah-work <[email protected]>

fix sanity

Signed-off-by: chikkaiah-work <[email protected]>

sanity fix

Signed-off-by: chikkaiah-work <[email protected]>

sanity fix

Signed-off-by: chikkaiah-work <[email protected]>
Signed-off-by: chikkaiah-work <[email protected]>
@chikkaiah-work
Copy link
Contributor Author

Please update with:

1. Jai's questions in the offline emails

2. LAG solution

@chikkaiah-work
Copy link
Contributor Author

closed by mistake

@chikkaiah-work
Copy link
Contributor Author

Please update with:

1. Jai's questions in the offline emails

2. LAG solution

Added SAI_ICMP_ECHO_SESSION_ATTR_RX_PORT to specify RX port.
Added doc section "“ICMP echo session with LAG”

@chikkaiah-work chikkaiah-work requested a review from zjswhhh June 7, 2024 01:39
* @flags CREATE_ONLY
* @default true
*/
SAI_ICMP_ECHO_SESSION_ATTR_HW_LOOKUP_VALID = SAI_ICMP_ECHO_SESSION_ATTR_START,
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe hw lookup means that ICMP packet is forwarded using L3 lookup instead of forwarding to a port. Please rename the attribute and add comments to that intent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct. It's intended for L3 lookup for forwarding. I am willing to rename it, but the same naming convention is also used in saitwamp.h and saibfd.h, and I prefer to maintain consistency. Please let me know if still want me to rename it.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case please add details in comments clearly stating what happens when flag is set to true or false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a brief description for this attribute. Also, this attribute is mentioned explained in the examples.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank You

* @objects SAI_OBJECT_TYPE_PORT
* @condition SAI_ICMP_ECHO_SESSION_ATTR_HW_LOOKUP_VALID == false
*/
SAI_ICMP_ECHO_SESSION_ATTR_PORT,
Copy link
Contributor

Choose a reason for hiding this comment

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

This means that session is created between peering links. How do we specify more sessions i.e. monitoring between multiple peering links

Copy link
Contributor Author

@chikkaiah-work chikkaiah-work Jun 20, 2024

Choose a reason for hiding this comment

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

This is for directly connected ports. only one session is allowed per port. same concept as in BFD.

Copy link
Contributor

Choose a reason for hiding this comment

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

This means that SONiC has to create multiple echo sessions; one per peering ports.
If thats the requirement then you may want to add the CRM attribute in switch. Something like
SAI_SWITCH_ATTR_AVAILABLE_ICMP_ECHO_SESSIONS read only attribute.
Initial read will give the max and as more sessions as added subsequent reads will give remaining.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added SAI_SWITCH_ATTR_AVAILABLE_ICMP_ECHO_SESSION and SAI_SWITCH_ATTR_MAX_ICMP_ECHO_SESSION.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank You

* @flags CREATE_AND_SET
* @default false
*/
SAI_ICMP_ECHO_SESSION_ATTR_SET_NEXT_HOP_GROUP_SWITCHOVER,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very fuzzy. What happens if there are multiple such protection NHGs. How does this attribute indicates which one to of the protection NHG takes effect. We just can't trigger all the protection NHG to take over.

Copy link
Contributor

Choose a reason for hiding this comment

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

@chikkaiah-work Please look at this comment as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You brought up a valid point. If it's possible for various NHGs to share the same monitor object, it seems reasonable to consider modifying this attribute to the NHG object ID. Should this attribute be left unset (which is null as default), automatic switchover will not occur. Instead, the switchover should be initiated based on the specified NHG. Please let me know if this sounds fine to you

Copy link

@lolyu lolyu Jun 21, 2024

Choose a reason for hiding this comment

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

This attribute is acting as a knob to enable/disable the switchover of the protection groups that have monitor object as this ICMP echo session.
@chikkaiah-work, maybe you could provide protection group examples to justify this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lolyu, you are right. Also I have updated the FRR document by mentioning echo session could be included as monitor object. I have added an example under the section "ICMP echo session with protection group"

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for updating the spec with an example workflow. Looks good to me.

#### sai_icmp_echo_session_attr_t ####
This defines icmp echo session attributes. These attributes collectively define the configuration and behavior of ICMP echo sessions in the SAI framework.

- SAI_ICMP_ECHO_SESSION_ATTR_VIRTUAL_ROUTER: Specifies whether hardware lookup is valid, allowing for virtual router configuration.
Copy link

Choose a reason for hiding this comment

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

should be SAI_ICMP_ECHO_SESSION_ATTR_HW_LOOKUP_VALID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

```
***GUID:*** Global unique identifier for the ICMP echo session to correlate probe and reply packets with a session, especially when the session is offloaded to hardware, a unique identifier is required.

***Session Cookie:*** The offloading engine interprets this value to decide whether the packet should undergo processing by the ICMP echo session or not. Packets not matching the cookie are punted to NOS. This can also be used to differentiate regular icmp response and icmp link monitoring response.
Copy link

Choose a reason for hiding this comment

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

should we use the same cookie for sessions on the same device or we can use multiple cookies?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each session can share the same cookie, but if a device needs to communicate with multiple devices, each session can have its own unique cookie. The decision to assign cookies to sessions is implementation-specific, and the device can implement a check to enforce the desired behavior.


### 4.0 Examples ###

#### 4.0.1 Create session using egress interface: ####
Copy link

Choose a reason for hiding this comment

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

Please provide examples with LAG

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a section "ICMP echo session with LAG" and explained session creation process.

* @flags CREATE_AND_SET
* @default false
*/
SAI_ICMP_ECHO_SESSION_ATTR_SET_NEXT_HOP_GROUP_SWITCHOVER,
Copy link

@lolyu lolyu Jun 21, 2024

Choose a reason for hiding this comment

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

This attribute is acting as a knob to enable/disable the switchover of the protection groups that have monitor object as this ICMP echo session.
@chikkaiah-work, maybe you could provide protection group examples to justify this.


### 4.0 Examples ###

#### 4.0.1 Create session using egress interface: ####
Copy link

Choose a reason for hiding this comment

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

also, please provide examples of sessions with protection group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added example with section tiltled " ICMP echo session with protection group"

Signed-off-by: chikkaiah-work <[email protected]>
@@ -422,3 +469,12 @@ void myCallbackFunction(uint32_t count, sai_icmp_echo_session_state_notification
}
}
```
### ICMP echo session with LAG ###

- Sessions across a LAG bundle: Individual sessions are created on each of the member links. The device creates ICMP echo requests for each configured probing session, which are sent through the port specified by the Session attribute SAI_ICMP_ECHO_SESSION_ATT_PORT.
Copy link

Choose a reason for hiding this comment

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

s/SAI_ICMP_ECHO_SESSION_ATT_PORT/SAI_ICMP_ECHO_SESSION_ATTR_PORT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: chikkaiah-work <[email protected]>
Copy link

@zjswhhh zjswhhh left a comment

Choose a reason for hiding this comment

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

LGTM.

Please wait for Jai's approval before merging.

@chikkaiah-work chikkaiah-work changed the title Recommit - SAI proposal for icmp echo offload #1943 SAI proposal for icmp echo offload Jul 8, 2024
@chikkaiah-work
Copy link
Contributor Author

@kcudnik - can you please help merge this.

@chikkaiah-work
Copy link
Contributor Author

@kcudnik - can you please help merge this.

@rlhui - can we get this merged please ?

@tjchadaga tjchadaga merged commit 19b30c1 into opencomputeproject:master Jul 10, 2024
3 checks passed
siqbal1986 pushed a commit to siqbal1986/SAI that referenced this pull request Sep 30, 2024
erohsik pushed a commit to erohsik/SAI that referenced this pull request Nov 7, 2024
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.

6 participants