[P4-discuss] deparsing in P4 1.0.3

Ali Kheradmand a.i.kheradmand at gmail.com
Mon Jan 23 20:27:11 EST 2017


In section 5 of P4 language specification version 1.0.3 it is stated that
"P4 takes the approach that any format which should be generated on egress
should be represented by the parser used on ingress." Does that mean that
if a header instance is valid (e.g an action adds the instance) but is not
used in the parser, it won't be serialized?

Also regarding cycles in the parse graph, the specification says "In
general, cycles occur in the parse graph when parsing header stacks or a
set of optional headers. These may be treated as a single node in the parse
graph and serialized as a group." Does it mean any permutation of header
instances in a strongly connected component of parse graph is acceptable as
an order of serialization?

e.g are both ABC and ACB acceptable in:

parser start {
   return select (A.a) {
      1: P1;
      2: P2;

parser P1 {
   return ingress;

parser P2 {
   return ingress;

I see that p4c-bmv2 rejects this program.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-discuss_lists.p4.org/attachments/20170123/adc284ff/attachment-0002.html>

More information about the P4-discuss mailing list