[P4-dev] tables ordering in pipeline using "conditionals", "next_tables", ...?

Antonin Bas antonin at barefootnetworks.com
Tue Aug 15 12:56:57 EDT 2017


Yes, bmv2 indeed uses a table graph representation for the control flows.
The compiler takes care of doing the transformation from the imperative
representation to the graph representation. Some programs (with the same
table applied multiple times cannot be represented). See here for more
details: https://github.com/p4lang/p4c/issues/457

On Tue, Aug 15, 2017 at 8:59 AM, Hardik Soni <hardik.soni at inria.fr> wrote:

> Hello,
>
> I have a confusion between two constructs.
>
> 1) Why next tables are dependent on actions?
>     I have attached a screenshot, it shows fragment of .p4 against .json
> side by side.
>     For 3 actions, there are 3 values in "next_tables" tag from line 784
> to 786 in .json snippet.
>     In lines 1697 to 1713
> <https://github.com/p4lang/behavioral-model/blob/master/src/bm_sim/P4Objects.cpp#L1697>
> of P4Objects.cpp,  why MatchTableAbstract types have next_tables based on
> actions?
>     These actions are not kind of "goto table" semantics.
>     It is not really a pipeline if there are next_table options based on
> actions in one table, its a graph.
>     This semantic(control invocation from table) is not specified in the
> spec of P4-16 dated May 22, 2017 version 1.0.0.
>     For example, the idea of having different  next nodes even for __HIT__
> and __MISS__  are also not specified.
>
> 2) There is apply{...} in .p4 or conditionals in .json, so which order of
> table arrangement is finally used?
>     To me it seems, conditionals have final say.
>
> I went through https://github.com/p4lang/behavioral-model/blob/master/
> docs/JSON_format.md link.
> Still, did not understand why two ways to define control flow even if it
> is a graph?
> What is the difference, except the scope at which control transition is
> programmed?
>
> Best Regards,
> Hardik Soni
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170815/702bf7ab/attachment-0002.html>


More information about the P4-dev mailing list