[P4-dev] statefulness in BMv2

Andy Fingerhut andy.fingerhut at gmail.com
Fri Oct 12 13:57:03 EDT 2018

The error message says not supported "in parser".  The BMv2 with v1model
architecture does not support the use of registers in the parser code.

You should be able to achieve success by using registers in a control like
ingress or egress.


On Fri, Oct 12, 2018 at 10:26 AM cs.lev <cs.lev at gmx.com> wrote:

> Hi,
> On of the main reason I have started to play with P4 is to have
> (persistent) states in pipeline which are global states, not just per-
> packet states (e.g., metadata).
> I have found some descriptions that registers can be used for this, but
> maybe it is not working in BMv2, is it?
> I can compile my code with such a declaration:
> register<bit<8>>(2) r;
> But, when I want to access it (e.g., m.write(1,1)), the compiler (p4c-
> bm2-ss) says:
> MethodCallStatement: not supported in parser on this target
> Am I doing something wrong, or persistent states cannot be introduced
> in programs for the software switch?
> Is there any other way to do this?
> Maybe storing data in the match-action tables can be some workaround,
> but then the table and its content should be modified by the switch
> program not the controller. Is there a way to do this?
> Thanks,
> cslev
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20181012/98b8144b/attachment.html>

More information about the P4-dev mailing list