A pointer to the discussion on "size" P4 table property

6 views
Skip to first unread message

Andy Fingerhut

unread,
Feb 9, 2024, 1:38:29 PM2/9/24
to p4-api
If you go to the P4_16 language specification, the section 14.2.1 "Table Properties", which I can give a direct link to: https://staging.p4.org/p4-spec/docs/P4-16-v1.2.4.html?_ga=2.175084066.1694762119.1707503455-1897260381.1705352543&_gl=1*1d09mth*_ga*MTg5NzI2MDM4MS4xNzA1MzUyNTQz*_ga_FW0Q4274RH*MTcwNzUwMzQ1NS45LjEuMTcwNzUwMzQ1OC4wLjAuMA..*_ga_VXXZD2250K*MTcwNzUwMzQ1NS45LjEuMTcwNzUwMzQ1OC4wLjAuMA..#sec-table-props

There is a sub-section of that called "size" that there is no direct link to (at least not that I know of in the pre-generated HTML).

That sub-section gives a link to this article with gory details of examples of common data plane implementations in ASICs that make it difficult to guarantee a minimum size from the controller's perspective, at least for some table types: https://github.com/p4lang/p4-spec/blob/main/p4-16/spec/docs/p4-table-and-parser-value-set-sizes.md

And here is the text in the language spec that links to the article above:

If a table has a size value specified for it with value N, it is recommended that a compiler should choose a data plane implementation that is capable of storing N table entries. This does not guarantee that an arbitrary set of N entries can always be inserted in such a table, only that there is some set of N entries that can be inserted. For example, attempts to add some combinations of N entries may fail because the compiler selected a hash table with O(1) guaranteed search time. See “Size property of P4 tables and parser value sets” P4SizeProperty for further discussion on some P4 table implementations and what they are able to guarantee.

Andy
Reply all
Reply to author
Forward
0 new messages