Skip to content

Policer enhancement to support operational visibility and MEF Metering Modes - #2323

Open
AnandhiDhanabalan wants to merge 1 commit into
opencomputeproject:masterfrom
AnandhiDhanabalan:mrvl_policer
Open

Policer enhancement to support operational visibility and MEF Metering Modes#2323
AnandhiDhanabalan wants to merge 1 commit into
opencomputeproject:masterfrom
AnandhiDhanabalan:mrvl_policer

Conversation

@AnandhiDhanabalan

@AnandhiDhanabalan AnandhiDhanabalan commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Overview

This proposal enhances the SAI policer specification by introducing capabilities that improve operational transparency and broaden deployment readiness for carrier and enterprise ethernet environments.

Key Enhancements

1. Addition of MEF Standard Metering Modes
Introduce support for MEF 10.2 metering algorithms (MEF0 / MEF1), widely adopted in service provider and metro Ethernet networks. This expands SAI policer capabilities to align with established carrier bandwidth profiling models.

MEF0 is functionally compliant with TRTCM RFC 4115. Implementation that need to use TRTCM RFC 4115 can use SAI_POLICER_MODE_MEF0

2. Improved Hardware Configuration Visibility
Provide a standard mechanism to query the actual CIR / PIR / CBS / PBS values programmed in hardware. This gives operators clear insight into effective policer settings, helping validate SLA targets, understand hardware-applied values, and simplify troubleshooting.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@AnandhiDhanabalan

Copy link
Copy Markdown
Contributor Author

@kcudnik, I'd like to add an alias similar to the one below. However, I get a compilation error because two enum values resolve to the same value.

Is there a way to support enum aliases in this case?

SAI_POLICER_MODE_TR_TCM_V2 = 0x00000003,

/** MEF 10.2 with Coupling Flag = 0 (RFC 4115 compliant) */
SAI_POLICER_MODE_MEF0 = SAI_POLICER_MODE_TR_TCM_V2,

@kcudnik

kcudnik commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

why you want to add alias if you have explicit name for that alreay? add "@ignore" to this enum

@AnandhiDhanabalan

Copy link
Copy Markdown
Contributor Author

why you want to add alias if you have explicit name for that alreay? add "@ignore" to this enum

Current SAI supports only SAI_POLICER_MODE_TR_TCM (RFC 2698).

SAI_POLICER_MODE_MEF0 and RFC 4115 are functionally equivalent. As mentioned in my original comment, I'd like both enum names to resolve to the same underlying value since they are functionally equivalent but originate from different standards bodies.

Is supporting such enum aliases possible?

@kcudnik

kcudnik commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Is supporting such enum aliases possible?

yes

@AnandhiDhanabalan

AnandhiDhanabalan commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Is supporting such enum aliases possible?

yes

Can I update the PR even if warning/error for same comes when make -c meta is issued ?

@kcudnik

kcudnik commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

yes, you can force push

@AnandhiDhanabalan

Copy link
Copy Markdown
Contributor Author

@tjchadaga could you please assign a reviewer for this PR

@kcudnik

kcudnik commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@tjchadaga tjchadaga added the reviewed PR is discussed in SAI Meeting label Aug 12, 2026
@AnandhiDhanabalan

Copy link
Copy Markdown
Contributor Author

@kcudnik , can you help me rerun /azp run

@kcudnik

kcudnik commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@AnandhiDhanabalan

Copy link
Copy Markdown
Contributor Author

@kcudnik , Squashed the commits into a single commit and force-pushed. Verified locally that SAI_POLICER_MODE_TR_TCM_V2 is no longer present. make -C meta was also checked; the remaining failures are related to existing OCS metadata issues. OCS errors also occur on the base.

Setting SAI_VIRTUAL_CHANNEL_ATTR_CBFC_SENDER_ENABLE version to SAI_API_VERSION (future release)
ERROR: struct 'sai_ocs_api_t' defined, but enum entry SAI_API_OCS is missing on sai_api_t
ERROR: stat enum defined sai_ocs_port_stat_t but no object type SAI_OBJECT_TYPE_OCS_PORT exists
ERROR: stat enum defined sai_ocs_cross_connect_stat_t but no object type SAI_OBJECT_TYPE_OCS_CROSS_CONNECT exists
WARNING: stats sai_ocs_port_stat_t are defined, but no API 3 stat functions defined for ocs_port
WARNING: stats sai_ocs_cross_connect_stat_t are defined, but no API 3 stat functions defined for ocs_cross_connect
no need for END enum for SAI_IN_DROP_REASON_CUSTOM_RANGE_BASE
non range base SAI_OUTBOUND_PORT_MAP_PORT_RANGE_ENTRY_ATTR_BACKEND_PORT_BASE
non range base SAI_OUTBOUND_PORT_MAP_PORT_RANGE_ENTRY_ATTR_MATCH_PORT_BASE
no need for END enum for SAI_OUT_DROP_REASON_CUSTOM_RANGE_BASE
non range base SAI_UDF_ATTR_BASE
ERROR: missing attributes, expected 25, got 24
ERROR: missing attributes, expected 25, got 24
ERROR: missing attributes, expected 25, got 24
ERROR: missing attributes, expected 25, got 24
ERROR: missing attributes, expected 25, got 24
ERROR: missing attributes, expected 25, got 24
ERROR: missing attributes, expected 27, got 26
ERROR: missing attributes, expected 27, got 26
ERROR: missing attributes, expected 27, got 26

@kcudnik

kcudnik commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

i just now checked master, and master builds fine so i dont know wher you get those errors

@kcudnik

kcudnik commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@kcudnik

kcudnik commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

you have conflicts, you need to resolve

Signed-off-by: Anandhi Dhanabalan <adhanabalan@marvell.com>

Added separate enum alias for TRTCM (rfc-4115)

Signed-off-by: Anandhi Dhanabalan <adhanabalan@marvell.com>

Fix review comment to remove SAI_POLICER_MODE_TR_TCM_V2

Signed-off-by: Anandhi Dhanabalan <adhanabalan@marvell.com>
@AnandhiDhanabalan

Copy link
Copy Markdown
Contributor Author

@kcudnik , resolved conflicts and verified locally - no issues found.

@AnandhiDhanabalan

Copy link
Copy Markdown
Contributor Author

@tjchadaga can you approve this PR ?

@kcudnik

kcudnik commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

3 participants