Add PSA meter example demonstrating indirect Meter and DirectMeter with color-aware policing - #1402
Conversation
…th color-aware policing Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>
|
Overall, this looks very good! Thanks for submitting it. |
Thank you for the feedback! Could you submit a formal review approval when you get a chance so this can be merged? |
I have added 4 comments that I hope you can make changes to address before I approve. |
|
Hi, thank you for the review! I am having trouble viewing the inline comments on GitHub. Could you please paste them here so I can address them? I want to make sure I implement all your suggestions correctly before you approve. |
|
Can you not see comments when you go to the page for the PR and scroll down? #1402 |
Hi @jafingerhut, thanks for following up. When I open the PR conversation and “Files changed” tabs, I’m unfortunately not seeing the 4 inline review comments you mentioned, it may be a GitHub UI/loading issue on my side. Could you please either:
Once I can see the requested changes, I’ll address them promptly. Thanks again for the review. |
jafingerhut
left a comment
There was a problem hiding this comment.
Trying to leave publicly viewable comments requesting changes.
| @@ -0,0 +1,380 @@ | |||
| /* | |||
| Copyright 2026 Contributors to the P4 Language Consortium | |||
There was a problem hiding this comment.
Please change to "Copyright 2026 The P4 Language Consortium". Minor nit, I know. I am on a sweep of issues for copyright and license details across p4lang repos.
| /* | ||
| Copyright 2026 Contributors to the P4 Language Consortium | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); |
There was a problem hiding this comment.
You can replace all of these paragraphs with:
* SPDX-License-Identifier: Apache-2.0
| EgressDeparserImpl()) ep; | ||
|
|
||
| PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; | ||
| // end::Meter_Example_Package[] No newline at end of file |
There was a problem hiding this comment.
Please remove the lines beginning with "// tag::" and "// end::". They are only needed for examples that we want to show an excerpt of in the PSA specification document.
Sorry, I think it was my fault in that I did not click the correct sequence of buttons to make my comments visible. Please look again. I can see them now even when I look at this issue from a browser where I am not logged in to Github with any account at all. |
Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>
45686a9 to
adedcea
Compare
|
Thanks for the review comments. I’ve addressed all requested changes:
Please take another look when you have time. Thanks again for the review. |
Adds psa-example-meters.p4, a new PSA example demonstrating traffic policing using the Meter and DirectMeter externs. The example covers:
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.