Skip to content

Add PFC Deadlock Detection timer granularity attributes#2250

Open
pinky-nexthop wants to merge 3 commits intoopencomputeproject:masterfrom
pinky-nexthop:feature/pfc-timer-granularity
Open

Add PFC Deadlock Detection timer granularity attributes#2250
pinky-nexthop wants to merge 3 commits intoopencomputeproject:masterfrom
pinky-nexthop:feature/pfc-timer-granularity

Conversation

@pinky-nexthop
Copy link

  • Add SAI_PORT_ATTR_PFC_TC_DLD_TIMER_INTERVAL to saiport.h
  • Add SAI_SWITCH_ATTR_PFC_TC_DLD_TIMER_INTERVAL to saiswitch.h

These attributes allow configuration of PFC deadlock detection timer granularity (1ms, 10ms, or 100ms) at port and switch levels.

- Add SAI_PORT_ATTR_PFC_TC_DLD_TIMER_INTERVAL to saiport.h
- Add SAI_SWITCH_ATTR_PFC_TC_DLD_TIMER_INTERVAL to saiswitch.h

These attributes allow configuration of PFC deadlock detection timer
granularity (1ms, 10ms, or 100ms) at port and switch levels.

Signed-off-by: pinky-nexthop <pinky@nexthop.ai>
Signed-off-by: Pinky Agrawal <pinky@nexthop.ai>
* @type sai_map_list_t
* @flags CREATE_AND_SET
* @default empty
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

@pinky-nexthop why list of granularities?

Copy link
Author

Choose a reason for hiding this comment

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

Good point. Removed.

* @flags CREATE_AND_SET
* @default empty
*/
SAI_PORT_ATTR_PFC_TC_DLD_TIMER_INTERVAL,
Copy link
Contributor

Choose a reason for hiding this comment

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

could you also add the unit of the granularity? Is this in milliseconds?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, updated. Thanks.

Address review comments:
- Add explicit units (milliseconds) to documentation
- Clarify that sai_map_list_t maps TC to granularity value
- Explain relationship with detection timer interval attribute
- Specify valid granularity values: 1, 10, or 100 milliseconds

Signed-off-by: pinky-nexthop <pinky@nexthop.ai>
Signed-off-by: Pinky Agrawal <pinky@nexthop.ai>
Remove detailed explanation to keep documentation concise.
The brief description is sufficient to understand the attribute purpose.

Signed-off-by: pinky-nexthop <pinky@nexthop.ai>
Signed-off-by: Pinky Agrawal <pinky@nexthop.ai>
@tjchadaga
Copy link
Collaborator

@pinky-nexthop - are you able to discuss this PR in the SAI community meeting on 3/12?

@pinky-nexthop
Copy link
Author

@pinky-nexthop - are you able to discuss this PR in the SAI community meeting on 3/12?

Could you please share the invite?

* @flags CREATE_AND_SET
* @default empty
*/
SAI_SWITCH_ATTR_PFC_TC_DLD_TIMER_INTERVAL,

Choose a reason for hiding this comment

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

Why not to use the existing SAI_SWITCH_ATTR_PFC_TC_DLD_INTERVAL SAI attribute ?

We will have 2 now : SAI_SWITCH_ATTR_PFC_TC_DLD_INTERVAL (old) and SAI_SWITCH_ATTR_PFC_TC_DLD_TIMER_INTERVAL (new)

Copy link
Author

Choose a reason for hiding this comment

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

SAI_SWITCH_ATTR_PFC_TC_DLD_INTERVAL and SAI_PORT_ATTR_PFC_TC_DLD_INTERVAL are existing attributes that define the detection time to trigger deadlock state on a port/queue.
However, the new proposal SAI_SWITCH_ATTR_PFC_TC_DLD_TIMER_INTERVAL is for setting the granularity of the h/w timers. For example, broadcom chips support granularity of 1ms, 10ms and 100ms. If granularity is set to 10ms, then h/w can only program detection timer range between 10-150ms. Similarly, if granularity is set to 100ms, then h/w can only program detection timer range between 100-1500ms.
therefore, a new SAI attribute is required to dynamically tune the detection timer range based on this new attribute.

Copy link
Contributor

@rck-innovium rck-innovium Mar 12, 2026

Choose a reason for hiding this comment

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

  • I agree with @eddyk-nvidia; this can be managed by the SAI/SDK implementation using the existing SAI attributes. For the above e.g., the SDK can choose to return the range {1 to 1500} as part of the get on SAI_PORT_ATTR_PFC_TC_DLD_INTERVAL_RANGE. When the user sets SAI_SWITCH_ATTR_PFC_TC_DLD_INTERVAL as 1500, the SDK can internally configure the h/w timer granularity to 100ms.
  • Reason: The above relationship between detection time and timer interval seems platform specific: that the detection interval must be <= 10 * timer_interval.

* @default empty
*/
SAI_PORT_ATTR_PFC_TC_DLD_TIMER_INTERVAL,

Choose a reason for hiding this comment

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

Real use-case of different timer intervals for different ports ? For uplink and downlink for example ?

Copy link
Contributor

@rck-innovium rck-innovium left a comment

Choose a reason for hiding this comment

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

Need more explanation:

  1. Why this cannot be managed within the SDK/SAI layer?
  2. An API workflow that does not have platform specific information

@tjchadaga
Copy link
Collaborator

@JaiOCP - please help review

@tjchadaga tjchadaga added the reviewed PR is discussed in SAI Meeting label Mar 12, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants