Skip to content

Add PSA meter example demonstrating indirect Meter and DirectMeter with color-aware policing#1402

Open
Devansh-567 wants to merge 1 commit into
p4lang:mainfrom
Devansh-567:fix/psa-meter-example-doc-cleanup
Open

Add PSA meter example demonstrating indirect Meter and DirectMeter with color-aware policing#1402
Devansh-567 wants to merge 1 commit into
p4lang:mainfrom
Devansh-567:fix/psa-meter-example-doc-cleanup

Conversation

@Devansh-567
Copy link
Copy Markdown
Contributor

Adds psa-example-meters.p4, a new PSA example demonstrating traffic policing using the Meter and DirectMeter externs. The example covers:

  • Per-port indirect Meter for aggregate port rate limiting
  • Per-prefix DirectMeter attached to an LPM table for per-route policing
  • Color-aware metering (RFC 2698) where port color is passed to the DirectMeter
  • Egress rate limiting using a second indirect Meter

A meter example was missing from the PSA examples directory despite Meter and DirectMeter being defined in psa-for-bmv2.p4.

While psa-example-counters.p4 covers counters, meters have different semantics (rate limiting vs counting), which justify a dedicated example.

…th color-aware policing

Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>
@jafingerhut
Copy link
Copy Markdown
Collaborator

Overall, this looks very good! Thanks for submitting it.

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.

2 participants