[P4-dev] P4 info table IDs changed?

Antonin Bas antonin at barefootnetworks.com
Thu Mar 22 13:30:30 EDT 2018


Hi Alan,

Yes we recently fixed an inconsistency in naming across p4lang/p4c and
p4lang/PI. We now make sure that the fully-qualified name - including the
name of the top-level control block - is used consistently throughout the
code for all top-level P4 objects. Because the least-significant 24 bits of
the ids are generated by computing a hash on the name, it means that ids
indeed changed.
I would recommend not hard-coding the ids in your code and instead using
p4info to lookup ids from names. However, note that you can also use the
@p4_id annotation in your P4_16 program to choose the least-significant 24
bits of the id and hence ensure stability.
BTW, we are in the process of specifying / documenting how ids are assigned
by the compiler when generating p4info, and it will be part of the
documentation for the v1.0 P4 Runtime release.

Thanks,

Antonin


On Thu, Mar 22, 2018 at 8:17 AM, Alan Lo <alanlo at mellanox.com> wrote:

> Hi all,
>
> I've just updated my P4C front end to the latest (had been working off a
> version from October for development stability). Just wanted to confirm
> that the following is an expected change to the p4info.
>
> *Before*:
>
> tables {
>
>   preamble {
>
>     id: 33619540
>
>     name: "filtering.fwd_classifier"
>
>     alias: "fwd_classifier"
>
>   }
>
>
> *Now*:
>
>
> tables {
>
>   preamble {
>
>     id: 33596298
>
>     name: "FabricIngress.filtering.fwd_classifier"
>
>     alias: "fwd_classifier"
>
>   }
>
>
> It appears the top level pipeline control name is now prefixed to the
> table name (and hence all the table IDs have changed) in the latest.
>
>
> Thanks,
>
> Alan
>
>
>
> _______________________________________________
> 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/20180322/ebb70f83/attachment.html>


More information about the P4-dev mailing list