[P4-dev] Help regarding implementing a counter in P4_16

Mihai Budiu mbudiu at vmware.com
Tue Jun 13 12:42:52 EDT 2017


You should be able to compile P4-14 programs with the P4-16 compiler by supplying the flag --p4-14.
If you also supply the flag --pp out.p4 the compiler will write the equivalent P4-16 program in the file out.p4.

Mihai

From: P4-dev [mailto:p4-dev-bounces at lists.p4.org] On Behalf Of Rakesh Datta
Sent: Monday, June 12, 2017 11:09 PM
To: p4-dev at lists.p4.org
Subject: [P4-dev] Help regarding implementing a counter in P4_16

Hello All,

I am trying to design a counter similar to the one mentioned in https://github.com/p4lang/tutorials/blob/master/SIGCOMM_2016/heavy_hitter/counter_example/heavy_hitter.p4<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_p4lang_tutorials_blob_master_SIGCOMM-5F2016_heavy-5Fhitter_counter-5Fexample_heavy-5Fhitter.p4&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=O6zRZd9uTKxigb16YoXXD-JlhEC_oynIfC6Nn5il1y8&s=x8xtcRt3BkI9H966wg6C66TnnZLYD8G7SisA2nFA7yM&e=>

I am running the compiled P4 code on top of bmv2. However, I am getting an error saying, 'Unknown primitive action: count'.
Most likely, the counters are designed in a different way (extern) in P4_16.

Can somebody please guide me how to code a counter in P4_16.

Thanks 'n' Regards,
Rakesh Datta

http://www.linkedin.com/in/rakeshdatta<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linkedin.com_in_rakeshdatta&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=O6zRZd9uTKxigb16YoXXD-JlhEC_oynIfC6Nn5il1y8&s=zhsPuk0gIl8HYQfPHXePUZiP_uFWyFtLLTCveN13umY&e=>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170613/8d699e22/attachment-0002.html>


More information about the P4-dev mailing list