[P4-dev] [bmv2] Why does the <H> headers struct forbit nested structs?

hemant at mnkcg.com hemant at mnkcg.com
Fri Feb 1 18:33:56 EST 2019


If you see the p4-16 specification released in November 2018, it does forbit a struct inside a header. 

 

https://p4.org/p4-spec/docs/P4-16-v1.1.0-spec.html#sec-type-nesting

 

The nested struct feature made it into p4c around 7-10th January 2019.   The spec is being changed in a Pull Request (PR) as we speak.  I am not sure when the new spec will be released next.

 

Hemant

 

From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of Kamila Soucková
Sent: Friday, February 01, 2019 11:42 AM
To: p4-dev at lists.p4.org
Subject: Re: [P4-dev] [bmv2] Why does the <H> headers struct forbit nested structs?

 

Hello,

 

I am trying to create a modular design in P4, and I have come across the "Type struct scion_all_headers_t should only contain headers, header stacks, or header unions" error. After some searching, I found https://github.com/p4lang/behavioral-model/blob/master/docs/simple_switch.md#p4_16-plus-v1model-architecture-notes , which confirms that structs in the headers type are in fact not allowed in v1model, although the spec does not forbid it. This means that I cannot easily keep things hierarchical. So I am wondering, why does this restriction exist? And is there any chance that it might go away?

A possible alternative question would be "is there an alternative target that can be used with p4c and does not have this restriction"?

 

(Also, did my email make it through? I do not see it in the archives...)

 

Thank you!

 

Best,

Kamila

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20190201/fad967aa/attachment.html>


More information about the P4-dev mailing list