Skip to content

Packet Drop Monitoring#2298

Open
JaiOCP wants to merge 1 commit into
opencomputeproject:masterfrom
JaiOCP:DropMon
Open

Packet Drop Monitoring#2298
JaiOCP wants to merge 1 commit into
opencomputeproject:masterfrom
JaiOCP:DropMon

Conversation

@JaiOCP

@JaiOCP JaiOCP commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR introduces packet drop monitoring where monitoring can be enabled for a specific set of drop reasons for a specific stage of pipeline like ingress, egress and buffer. If this is done with hw learning enabled for deduplcation then this form packet drop monitoring is considered stateful.

This PR introduces framework for both stateful and stateless packet drop monitoring.

Accidentally closed PR
#2290

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>
@JaiOCP JaiOCP mentioned this pull request Jun 22, 2026
Comment thread inc/saitam.h
*
* @objects SAI_OBJECT_TYPE_TAM_EVENT_LEARN_ENTRY
*/
sai_object_id_t le_id;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

does it make sense to make this object first in the structure?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The attributes need a reference to the object hence I have kept it here in structure.
Any other suggestions?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

im just saying make it first field

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just for curiosity. How does it help.

Alignment ??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it does not change alignement, just from order perspective it make sense to have object id first and then it;s attributes, for example the same idea is when you create object or call set api, object id is first

Comment thread inc/saiswitch.h
SAI_SWITCH_ATTR_OUT_DROP_REASON_LIST,

/**
* @brief List of supported buffer drop reasons

@johevans johevans Jun 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In both Ingress and Egress, there are two kinds of drops: drops before packet processing and drops after packet processing. For example, most architectures have an early drop mechanism to handle oversubscription. Based only on packet header attributes (such as the dscp or ieee priority bits), low priority packets are dropped before even entering the pipeline. This is done to conserve pipeline resources and allow control packets through even during heavy, ASIC-wide congestion such as oversubscription. However, since the packets have not been processed, the drop decision is rather crude and without any exceptions. Ideally, you want to drop packets after packet processing, which could remark the priority of the packet or a set a pipeline attribute such as "drop precedence". Most architectures have a set of virtual statistics queues (VSQs) for this purpose where buffer limits can be set based on priority, class, filter results, etc. Note: the drop decision may be probabilistic such as WRED, but fundamentally it is the same mechanism. Both kinds of drops, pre and post packet processing, could be considered "buffer drops" or "mmu drops" since they're based on buffer thresholds. Therefore, it might be useful to separate Ingress admission drops from Ingress processing drops. In addition, there are also rare, hardware related buffer drops such as corrupted dram reads.

The situation at Egress is similar. In a fabric architecture, packets could be dropped before they are even assembled, e.g. cells dropped due to CRC errors. Also, packets could be dropped before entering the pipeline based on various thresholds, such as the global buffer limits for unicast/multicast, the drop precedence carried from Ingress, packet buffer and descriptor limits per QoS, multicast replication resource limits, etc. Once in the Egress pipeline, packets may be dropped because the destination queue is full or an Egress filter has decided to drop the packet. And again, there also are esoteric hardware specific reasons.

In summary, it would be useful to separate Ingress/Egress admission (pre pipeline) drops from post-processing drops.

Comment thread inc/saidebugcounter.h
SAI_BUFFER_DROP_REASON_ANY = SAI_BUFFER_DROP_REASON_START,

/** IPG packet drops */
SAI_BUFFER_DROP_REASON_IPG,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Create two sections using comments for "BUFFER_IN_DROP"
Ingress Priority Group Buffer
Queue Buffer Drops

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.

3 participants