behavioral-model
behavioral-model copied to clipboard
Improve error reporting when using P4Runtime
For example, these are the messages shown in the simple_switch_grpc log when trying to remove a group unsuccessfully:
[23:05:35.526] [bmv2] [E] [thread 13223] Error when trying to remove group 0 from action profile 'next.ecmp_selector'
[23:05:35.526] [bmv2] [E] [thread 13223] [P4Runtime] Error when deleting group on target
While the P4Runtime server reports a generic UNKNOWN error.
There's no trace of the actual reason why the remove operation was unsuccessful. However, when performing the same operation using the Thrift CLI, the following message is printed on screen:
RuntimeCmd: act_prof_delete_group FabricIngress.next.ecmp_selector 0
Invalid table operation (GRP_STILL_USED)
It seems BMv2 already defines detailed error codes. It would be helpful to have the same codes being printed on the log and reported via P4Runtime.