Skip to content

Commit be3e2f8

Browse files
running-htjchadaga
authored andcommitted
Add packet trimming counter (#2177)
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 <runningh@nvidia.com>
1 parent 23d8579 commit be3e2f8

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

inc/saiport.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,6 +3368,12 @@ typedef enum _sai_port_stat_t
33683368
/** Packets trimmed due to failed shared buffer admission [uint64_t] */
33693369
SAI_PORT_STAT_TRIM_PACKETS,
33703370

3371+
/** Packets trimmed but dropped due to failed shared buffer admission on a trim queue */
3372+
SAI_PORT_STAT_DROPPED_TRIM_PACKETS,
3373+
3374+
/** Packets trimmed and successfully transmitted on port */
3375+
SAI_PORT_STAT_TX_TRIM_PACKETS,
3376+
33713377
/** Port stat in drop reasons range start */
33723378
SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE = 0x00001000,
33733379

inc/saiqueue.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ typedef enum _sai_queue_stat_t
433433
/** Get watermark queue shared occupancy in cells [uint64_t] */
434434
SAI_QUEUE_STAT_SHARED_WATERMARK_CELLS = 0x0000002c,
435435

436+
/** Packets trimmed but failed to be admitted on a trim queue due to congestion. Counted on the original trimming-eligible queue [uint64_t] */
437+
SAI_QUEUE_STAT_DROPPED_TRIM_PACKETS = 0x0000002d,
438+
439+
/** Packets trimmed and successfully transmitted on a trim queue. Counted on the original trimming-eligible queue [uint64_t] */
440+
SAI_QUEUE_STAT_TX_TRIM_PACKETS = 0x0000002e,
441+
436442
/** Custom range base value */
437443
SAI_QUEUE_STAT_CUSTOM_RANGE_BASE = 0x10000000
438444

inc/saiswitch.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3374,6 +3374,15 @@ typedef enum _sai_switch_asic_sdk_health_category_t
33743374
*/
33753375
typedef enum _sai_switch_stat_t
33763376
{
3377+
/** Switch stat range start */
3378+
SAI_SWITCH_STAT_START,
3379+
3380+
/** Global (switch-wise) counter of packets trimmed but dropped due to failed shared buffer admission on a trim queue */
3381+
SAI_SWITCH_STAT_DROPPED_TRIM_PACKETS = SAI_SWITCH_STAT_START,
3382+
3383+
/** Global (switch-wise) counter of packets trimmed and successfully sent on a trim queue */
3384+
SAI_SWITCH_STAT_TX_TRIM_PACKETS,
3385+
33773386
/** Switch stat in drop reasons range start */
33783387
SAI_SWITCH_STAT_IN_DROP_REASON_RANGE_BASE = 0x00001000,
33793388

@@ -3455,6 +3464,9 @@ typedef enum _sai_switch_stat_t
34553464
/** Switch stat fabric drop reasons range end */
34563465
SAI_SWITCH_STAT_FABRIC_DROP_REASON_RANGE_END = 0x00003fff,
34573466

3467+
/** Switch stat range end */
3468+
SAI_SWITCH_STAT_END,
3469+
34583470
} sai_switch_stat_t;
34593471

34603472
/**

0 commit comments

Comments
 (0)