p4lang / PI

An implementation framework for a P4Runtime server
Apache License 2.0
167 stars 107 forks source link

Support wildcard write Counters #612

Open duskmoon314 opened 5 months ago

duskmoon314 commented 5 months ago

bmv2 (simple_switch_grpc) lacks some p4runtime operations because PI currently does not support them. This issue, similar to #376, is created to discuss wildcard write Counters.

My basic thought is that we can add a loop to write all counter entries instead of only writing one entry when an index is provided. If this is not appropriate, please explain the reason.

I would like to contribute, but I don't fully understand how PI works with bmv2. PI has targets/bmv2, bmv2 has PI, and both have _pi_counter_write. Where should I start to add implementations? And how can I build bmv2 with a modified PI?

jafingerhut commented 5 months ago

One way to build bmv2 with a modified PI, slowly, is to slightly modify a script like the one named install-p4dev-v7.sh described here: https://github.com/jafingerhut/p4-guide/blob/master/bin/README-install-troubleshooting.md

It builds both from source code.

Once you do that one time, I am sure there are faster steps you can follow to rebuild only PI, and then only behavioral-model, but I have not worked out the re-building from slightly-modified source steps to verify that they work.