behavioral-model
behavioral-model copied to clipboard
Clarify priority value when using Runtime CLI
The simple_switch.md document describes winner will be entry with maximum numeric priority whhen P4Runtime API is used.
https://github.com/p4lang/behavioral-model/blob/f16d0de3486aa7fb2e1fe554aac7d237cc1adc33/docs/simple_switch.md?plain=1#L440
Note that winner is one with maximum numeric priority value if you use the
P4Runtime API to specify the numeric priorities. Check the documentation of your
control plane API if you use a different one, as some might choose to use the
convention that minimum numeric priority values win over larger ones.
However, BMv2 handles this oppositely (minimum wins) which is visible this way if you use Runtime CLI. e.g. sswitch_CLI.py
It would be more clear if we mention about this in the doc, since there are may cases useing Runtime CLI for debugging and one will see different value if P4Runtime is used to set the entry.
How about adding description like this?
In BMv2 simple_switch, winner is one with minimum numeric priority value which is visible when using Runtime CLI (e.g. `sswitch_CLI.py`)
Note that if you use P4Runtime to set the entry and then read the entry via Runtime CLI, you will find the priority value will be different from what you specified in P4Runtime.
It's converted in P4Runtime Server when setting entry in BMv2.