Skip to content

SAI API Online Diagnostics - #2339

Open
sperak-cisco wants to merge 1 commit into
opencomputeproject:masterfrom
sperak-cisco:online-diag-api
Open

SAI API Online Diagnostics#2339
sperak-cisco wants to merge 1 commit into
opencomputeproject:masterfrom
sperak-cisco:online-diag-api

Conversation

@sperak-cisco

@sperak-cisco sperak-cisco commented Aug 24, 2026

Copy link
Copy Markdown

Summary

This proposal introduces the Online Diagnostics capability in SAI to validate switch datapath health while the device remains in service.
Online Diagnostics is modeled as a switch-scoped capability that periodically injects diagnostic probes, verifies proper packet reception/integrity and reports aggregated counters and health events to the NOS application.

Key Changes

  • Design Proposal: Added doc/SAI-Proposal-Online-Diag.md with the motivation, architecture and attribute specifications.
  • Switch Attributes & Statistics (inc/saiswitch.h):
    • SAI_SWITCH_ATTR_ONLINE_DIAG_ENABLE
    • SAI_SWITCH_ATTR_ONLINE_DIAG_INTERVAL_MS
    • SAI_SWITCH_ATTR_ONLINE_DIAG_LOSS_THRESHOLD
    • SAI_SWITCH_ATTR_ONLINE_DIAG_PAYLOAD_PATTERNS
    • SAI_SWITCH_ATTR_ONLINE_DIAG_PACKET_LENGTHS
    • Switch statistics counters: SAI_SWITCH_STAT_ONLINE_DIAG_TX_PACKETS, SAI_SWITCH_STAT_ONLINE_DIAG_RX_PACKETS, SAI_SWITCH_STAT_ONLINE_DIAG_PACKET_LOSS, SAI_SWITCH_STAT_ONLINE_DIAG_PACKET_CORRUPTIONS.
  • Health Events (inc/saitypes.h):
    • Added SAI_HEALTH_DATA_TYPE_ONLINE_DIAG to sai_health_data_type_t.
    • Added sai_switch_online_diag_event_type_t and sai_online_diag_health_data_t.
    • Extended sai_health_data_t to report online diagnostic loss, corruption, and recovery events via the existing switch health event callback.

Motivation

Standardizes an in-service active datapath health-check mechanism across silicon vendors, allowing applications to detect internal packet loss and corruption with configurable intervals and thresholds.
https://sonicfoundation.dev/2025-sonic-hackathon-most-innovative-award-spotlight-data-path-diagnostics-on-sonic/

Signed-off-by: Strahinja Perak <sperak@cisco.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
@tjchadaga tjchadaga added the reviewed PR is discussed in SAI Meeting label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed PR is discussed in SAI Meeting

2 participants