You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
shouxi
changed the title
Wrong action params references in ternary operator's expressions
Wrong action params references in ternary operator's conditional expressions
Aug 13, 2016
expression support was added late in bmv2. So a direct reference to an action parameter (e.g. hdrA.f1 = param1) is treated a little differently from a reference in an expression (e.g. hdrA.f1 = param1 + 7).
In the first case, you will see a runtime_data in the JSON. In the second case, the assignment will take as the source an expression and the parameter reference will appear as local. local in expression is a little more generic than just for handling runtime data in actions. It can be used for other things. For example, I may be using it in the parser code to compute the length of a variable length field (in this case local is used for previously extracted fields in the header). In other words, local can be used to represent arbitrary variables in an expression, whose value does not need to be known until the expression is evaluated.
Hi @antoninbas , a new bug follows #13
IIRC, the right reference of an action param is in the form of
But,
is given, if the param is used by a ternary operator. See L436 of the following json file as an example.
simple_router.json.txt
simple_router.p4.txt
The text was updated successfully, but these errors were encountered: