[P4-dev] Loops in p4 action definitions
andy.fingerhut at gmail.com
Thu Jul 13 10:57:12 EDT 2017
P4 does not have variable length loops, by design, to bound the amount of
work done per packet to a fixed amount (or at least a fixed amount per
I do not know if it would work in your situation, but if the maximum number
of loop iterations is a compile time constant, you can use a
Perl/Python/whatever-language-you-like program to generate an 'unrolled'
version of your loop as a P4 program. See this earlier message for an
On Thu, Jul 13, 2017 at 3:49 AM, Hassan Ali Khan <18100116 at lums.edu.pk>
> Hi All;
> Does anyone know how to add loops in action definition associated with a
> table. We are working on a project which requires us to make seperate
> states depending on the outgoing links. If we have a fixed value for the
> links we want to iterate over that value to maintain the states.
> We would really appreciate if someone can suggest any method.
> Hassan Ali Khan
> P4-dev mailing list
> P4-dev at lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev