p4lang / p4c-bm

Generates the JSON configuration for the behavioral-model (bmv2), as well as the C/C++ PD code
Apache License 2.0
24 stars 29 forks source link

primitive actions clone_ingress_pkt_to_ingress/clone_ingress_pkt_to_egress not defined #60

Closed cw299 closed 8 years ago

cw299 commented 8 years ago

clone_ingress_pkt_to_ingress/clone_ingress_pkt_to_egress is not supported for the ingress/egress pipeline, respectively. For clone_ingress_pkt_to_ingress the compiler gives the error:

Semantic error: Invalid reference to clone_ingress_pkt_to_ingress in file /bla/bla/bla.p4 at line 123: object was not defined

antoninbas commented 8 years ago

clone_ingress_pkt_to_egress is actually supported (as is clone_egress_pkt_to_egress) clone_ingress_pkt_to_ingress and clone_egress_pkt_to_ingress are not. We have decided not to support these primitives in simpleswitch. The next version of the P4 spec won't include architecture-specific primitives (like the `cloneprimitives); each architecture will chose to expose primitives (whose signatures will be expressed in P4, so the primitive JSON files won't be needed any more). The standard architecture will be similar to the simple_switch bmv2 target and expose similar primitives; it is unlikely that we will be adding these 2 unsupported primitives to simple_switch. Anyone willing to use these primitives will have to extend the standard architecture (and implement them in a simple_switch "fork"). You can already do that today if you wish. This p4-dev mailing list thread describes how to add a primitive to simple_switch: http://lists.p4.org/pipermail/p4-dev_lists.p4.org/2016-May/000308.html. It is a 2 step-process: 1) implement the primitive in simple_switch (which is not trivial for theclone_` primitives) 2) expose the primitive to the compiler by writing a JSON description.

cw299 commented 8 years ago

I see. Thanks for your statement!