[P4-dev] no semantic check for a variable-length match field into the table definition

Salvatore Signorello salvatore.signorello at uni.lu
Thu Aug 6 02:18:05 EDT 2015

Hi Antonin,

thank you for answering, few cents in line.


On 08/05/2015 10:53 PM, Antonin Bas wrote:
> Hi Salvatore,
> I can see that there is no warning / error, but do we really need one? 
> The compiler knows what the maximum length of a field is, so in theory 
> a table could match on this field. The compiler allocates for the 
> worst case and the match will compare the values, independently of the 
> actual bit width of the extracted field.
I think you're right saying that this is something that has to be 
eventually raised by the back-end compiler comparing the computed size 
against the available resources on a certain target. Nevertheless, I 
wonder more about how this variable-length field could affect the match 
logic built on such table, but I've not come up with a definitive idea 
about this yet.
> Do you see any issue with this? Note that the software switch on 
> p4lang does not support variable length field (not even their extraction).
was it for sake of time
> The TODO at line 923 probably refers to doing more checks on the size 
> attributes (what if max_size and min_size and size are specified), but 
> I am not sure. Probably just needs to be removed at this point...
> Best,
> Antonin
> On Tue, Aug 4, 2015 at 3:12 PM, Salvatore Signorello 
> <salvatore.signorello at uni.lu <mailto:salvatore.signorello at uni.lu>> wrote:
>     Hi all,
>     I've realized that the actual front-end doesn't generate any
>     warning/error if a table defines a field_match using a variable-length
>     header field.
>     There is a TODO at line 923 of the semantic_check.py (hlir module)
>     suggesting that this check has been voluntarily skipped. Could please
>     someone shed light on this?
>     Best,
>     Salvatore
>     _______________________________________________
>     P4-dev mailing list
>     P4-dev at p4.org <mailto:P4-dev at p4.org>
>     Listinfo - http://mail.p4.org/mailman/listinfo/p4-dev_p4.org
>     Archives - http://mail.p4.org/pipermail/p4-dev_p4.org/
> -- 
> Antonin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20150806/3e73bc53/attachment-0001.html>

More information about the P4-dev mailing list