Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions inc/saimirror.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,22 @@ typedef enum _sai_mirror_session_attr_t
*/
SAI_MIRROR_SESSION_ATTR_LABEL,

/**
* @brief Guarantee sample rate in packets per second (pps)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Newly introduced attr - SAI_MIRROR_SESSION_ATTR_GUARANTEE_RATE is in packet-rate threshold(pps) and existing SAI_MIRROR_SESSION_ATTR_SAMPLE_RATE statistical sampling (1:N statistical ratio) - Since these attribute operate in different domain - can you define the interaction semantics in this proposal.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have added the documentation, it should be much clearer now.

*
* While guarantee rate is not breached, all packets will be sampled (100% sampling).
* Once breached, packets will be sampled based on the mirror statistics (fallback to
* statistical sampling based on SAI_MIRROR_SESSION_ATTR_SAMPLE_RATE).
*
* This is expected to enable guaranteed sampling for very low pps flows.
* A value of 0 disables the guarantee rate feature.
*
* @type sai_uint64_t
* @flags CREATE_AND_SET
* @default 0
*/
SAI_MIRROR_SESSION_ATTR_GUARANTEE_RATE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR adds SAI_MIRROR_SESSION_ATTR_GUARANTEE_RATE to complement the existing SAI_MIRROR_SESSION_ATTR_SAMPLE_RATE on mirror sessions object. Similar 1-in-N statistical sampling concept (SAI_SAMPLEPACKET_ATTR_SAMPLE_RATE) exists independently on SAI_OBJECT_TYPE_SAMPLEPACKET in saisamplepacket.h as well

SAI defines two sampling architectures:
Method A: Mirror session owns the sampling rate
Method B : Sample session owns 1-in-N sampling decision; in such cases, the mirror session handles encapsulation only. In method B, there is no way to express a guarantee rate.

Does this PR scopes to extend the saisamplepacket.h as well ?


/**
* @brief End of attributes
*/
Expand Down
Loading