-
Notifications
You must be signed in to change notification settings - Fork 525
Add packet trimming counter #2177
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
Conversation
68dd6ac
to
d5a3896
Compare
inc/saiswitch.h
Outdated
SAI_SWITCH_STAT_START, | ||
|
||
/** Packets trimmed but dropped due to failed shared buffer admission on a new queue */ | ||
SAI_SWITCH_STAT_TRIM_DROPPED_PACKETS = SAI_SWITCH_STAT_START, |
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.
please follow concept on other ranges if that the range name
SAI_SWITCH_STAT_TRIM_DROPPED_PACKETS_RANGE_BASE = SAI_SWITCH_STAT_START
...
SAI_SWITCH_STAT_TRIM_DROPPED_PACKETS_RANGE_END = 0x00000fff
or introduce other range, are you sure your stat type dont fit any existing range ?
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 existing switch stats belong to clear group - in drop reasons (Debug counters), out drop reasons (debug counters) or fabric
While the trim stats are "regular" group
I don't see we keep regular group in other places like port or queue, nor do we group every stat to a group
in the future we may add other regular stats
hi @running-h , do you mind to rebase this PR and submit it again? The CI is somehow stuck. |
inc/saiswitch.h
Outdated
/** Switch stat range start */ | ||
SAI_SWITCH_STAT_START, | ||
|
||
/** Packets trimmed but dropped due to failed shared buffer admission on a new queue */ |
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.
Please update the comment to show this stat is a global-wise dropped trimmed packets for all original trim-enabled queues.
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.
Please update the comment to show this stat is a global-wise dropped trimmed packets for all original trim-enabled queues.
we will change to "Global counter of packets trimmed but dropped due to failed shared buffer admission on a new queue for trimmed packets". OK ?
inc/saiport.h
Outdated
@@ -3368,6 +3368,12 @@ typedef enum _sai_port_stat_t | |||
/** Packets trimmed due to failed shared buffer admission [uint64_t] */ | |||
SAI_PORT_STAT_TRIM_PACKETS, | |||
|
|||
/** Packets trimmed but dropped due to failed shared buffer admission on a new queue for trimmed packets */ |
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.
Is this "new queue" sam as the "trim-queue" ?
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.
Is this "new queue" sam as the "trim-queue" ?
Distinguish between trimming-eligible queue (where trimming instead of tail-drop is done) and queue where trimmed packets from all trimming-eligible queues are sent (new queue)
inc/saiswitch.h
Outdated
SAI_SWITCH_STAT_START, | ||
|
||
/** Packets trimmed but dropped due to failed shared buffer admission on a new queue */ | ||
SAI_SWITCH_STAT_TRIM_DROPPED_PACKETS = SAI_SWITCH_STAT_START, |
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.
Can the new enums be inserted at the end, and have an appropriate (new-range) base, instead of adding at the top ?
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.
i have already answered to kamil
The in/out drop reasons are in group to be able to support a bigger range of debug counters. There are 8 pre-defined in/out counters, but application can create more than that, so we need a range
whomever decided to add fabric, did it with a range
but i don't see a reason to do that, nor do we do it in all other objects we use counters, we are not grouping every counter subject into a range, and all regular counters are always at the beginning
@@ -3599,6 +3605,9 @@ typedef enum _sai_switch_stat_t | |||
/** Switch stat fabric drop reasons range end */ | |||
SAI_SWITCH_STAT_FABRIC_DROP_REASON_RANGE_END = 0x00003fff, | |||
|
|||
/** Switch stat range end */ | |||
SAI_SWITCH_STAT_END, |
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.
Along side PORT and QUEUE, why not introduce TRIM_SENT_PACKETS for SWITCH also ? Will be consistent across.
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.
added. Thanks for suggestion
trim-queue meant the queue where all trimmed packets are sent.
It is confusing for me with the "new queue" terminology.
Thanks
…On Wed, Jun 25, 2025 at 7:51 PM eddyk-nvidia ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In inc/saiport.h
<#2177 (comment)>
:
> @@ -3368,6 +3368,12 @@ typedef enum _sai_port_stat_t
/** Packets trimmed due to failed shared buffer admission [uint64_t] */
SAI_PORT_STAT_TRIM_PACKETS,
+ /** Packets trimmed but dropped due to failed shared buffer admission on a new queue for trimmed packets */
Is this "new queue" sam as the "trim-queue" ?
Distinguish between trimming-eligible queue (where trimming instead of
tail-drop is done) and queue where trimmed packets from all
trimming-eligible queues are sent (new queue)
—
Reply to this email directly, view it on GitHub
<#2177 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE7FUDTGZF656BHH5VLSMUD3FKV7PAVCNFSM6AAAAAB7R6HJLOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDSNJYGM4TMNZQGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
|
7e29369
to
b8013b6
Compare
inc/saiport.h
Outdated
@@ -3368,6 +3368,12 @@ typedef enum _sai_port_stat_t | |||
/** Packets trimmed due to failed shared buffer admission [uint64_t] */ | |||
SAI_PORT_STAT_TRIM_PACKETS, | |||
|
|||
/** Packets trimmed but dropped due to failed shared buffer admission on a new queue (for trimmed packets) */ | |||
SAI_PORT_STAT_TRIM_DROPPED_PACKETS, |
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.
We are following a fixed nomenclature like TRIM QUEUES, TRIM PACKET and so on.
Keeping consistent with it, please change the attr to
SAI_PORT_STAT_DROPPED_TRIM_PACKETS
|
||
/** Packets trimmed and successfully transmitted on port */ | ||
SAI_PORT_STAT_TRIM_SENT_PACKETS, | ||
|
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.
Same as above. Please change it to
SAI_PORT_STAT_TX_TRIM_PACKETS
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.
@JaiOCP - done
inc/saiqueue.h
Outdated
@@ -433,6 +433,12 @@ typedef enum _sai_queue_stat_t | |||
/** Get watermark queue shared occupancy in cells [uint64_t] */ | |||
SAI_QUEUE_STAT_SHARED_WATERMARK_CELLS = 0x0000002c, | |||
|
|||
/** Packets trimmed but failed to be admitted on a new queue (for trimmed packets) due to congestion. Counted on the original trimming-eligible queue [uint64_t] */ | |||
SAI_QUEUE_STAT_TRIM_DROPPED_PACKETS = 0x0000002d, |
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.
Please change it to
SAI_QUEUE_STAT_DROPPED_PACKETS
inc/saiqueue.h
Outdated
SAI_QUEUE_STAT_TRIM_DROPPED_PACKETS = 0x0000002d, | ||
|
||
/** Packets trimmed and successfully transmitted on a new queue (for trimmed packets). Counted on the original trimming-eligible queue [uint64_t] */ | ||
SAI_QUEUE_STAT_TRIM_SENT_PACKETS = 0x0000002e, |
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.
Please change it to
SAI_QUEUE_STAT_TX_TRIM_PACKETS
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.
done
inc/saiswitch.h
Outdated
SAI_SWITCH_STAT_START, | ||
|
||
/** Global (switch-wise) counter of packets trimmed but dropped due to failed shared buffer admission on a new queue (for trimmed packets) */ | ||
SAI_SWITCH_STAT_TRIM_DROPPED_PACKETS = SAI_SWITCH_STAT_START, |
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.
Please change it to
SAI_SWITCH_STAT_DROPPED_TRIM_PACKETS
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.
done
inc/saiswitch.h
Outdated
SAI_SWITCH_STAT_TRIM_DROPPED_PACKETS = SAI_SWITCH_STAT_START, | ||
|
||
/** Global (switch-wise) counter of packets trimmed and successfully sent on a new queue (for trimmed packets) */ | ||
SAI_SWITCH_STAT_TRIM_SENT_PACKETS, |
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.
Please change it to
SAI_SWITCH_STAT_TX_TRIM_PACKETS
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.
@JaiOCP - done. Jay, could you please approve the PR if everything is OK ? Thanks in advance
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@kcudnik @r12f @bandaru-viswanath @JaiOCP |
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.
as comments
SAI_QUEUE_STAT_DROPPED_TRIM_PACKETS = 0x0000002d, | ||
|
||
/** Packets trimmed and successfully transmitted on a new queue (for trimmed packets). Counted on the original trimming-eligible queue [uint64_t] */ | ||
SAI_QUEUE_STAT_TX_TRIM_PACKETS = 0x0000002e, |
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 functional relationship between DROPPED_TRIM_PACKETS
and TX_TRIM_PACKETS
isn't clear. If TX_TRIM_PACKETS
represents successfully transmitted trimmed packets, consider clarifying whether these are mutually exclusive counts or if there's overlap.
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.
no overlap.
DROPPED_TRIM_PACKETS == trimmed & not sent
TX_TRIM_PACKETS == trimmed & sent
SAI_SWITCH_STAT_DROPPED_TRIM_PACKETS = SAI_SWITCH_STAT_START, | ||
|
||
/** Global (switch-wise) counter of packets trimmed and successfully sent on a new queue (for trimmed packets) */ | ||
SAI_SWITCH_STAT_TX_TRIM_PACKETS, |
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.
is this for all ports and therefore queues cumulatively? if so, please make this explicit in the comments
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.
it is mentioned as "Global (switch-wise)"
inc/saiqueue.h
Outdated
@@ -433,6 +433,12 @@ typedef enum _sai_queue_stat_t | |||
/** Get watermark queue shared occupancy in cells [uint64_t] */ | |||
SAI_QUEUE_STAT_SHARED_WATERMARK_CELLS = 0x0000002c, | |||
|
|||
/** Packets trimmed but failed to be admitted on a new queue (for trimmed packets) due to congestion. Counted on the original trimming-eligible queue [uint64_t] */ |
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 switch enum is the only one getting START/END markers. For consistency, please add similar markers to port and queue enums, if necessary. Moreover, what is the overflow behavior here?
@eddyk-nvidia , pls capture the changes in the document SAI-Proposal-Packet-Trimming.md |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This PR adds the following: SAI_PORT_STAT_DROPPED_TRIM_PACKETS SAI_PORT_STAT_TX_TRIM_PACKETS SAI_QUEUE_STAT_DROPPED_TRIM_PACKETS SAI_QUEUE_STAT_TX_TRIM_PACKETS SAI_SWITCH_STAT_DROPPED_TRIM_PACKETS SAI_SWITCH_STAT_TX_TRIM_PACKETS Signed-off-by: Running Huang <[email protected]>
/azp run opencomputeproject.SAI |
Commenter does not have sufficient privileges for PR 2177 in repo opencomputeproject/SAI |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@JaiOCP, @bandaru-viswanath - could you please help complete the review on this PR? |
This PR adds the following:
SAI_PORT_STAT_DROPPED_TRIM_PACKETS
SAI_PORT_STAT_TX_TRIM_PACKETS
SAI_QUEUE_STAT_DROPPED_TRIM_PACKETS
SAI_QUEUE_STAT_TX_TRIM_PACKETS
SAI_SWITCH_STAT_DROPPED_TRIM_PACKETS
SAI_SWITCH_STAT_TX_TRIM_PACKETS