There is requirement to take the key and mask it to given value and then go for rule matching. And the mask can be 0 also.
Example:
keys = {
hdrs.mac.type & 0x0 : exact;
// other keys
}
But, the above mask expression is optimized by frontend and 0 is present in the place of (hdrs.mac.type & 0x0) at the end of frontend passes.
I checked if Mask operator (&&&) would help. But this operation is allowed only in constant entries of a table as per P4 language spec.
Is there any other cleaner way available? Or, should we stop frontend to optimize the & with 0 in table key expression?
There is requirement to take the key and mask it to given value and then go for rule matching. And the mask can be 0 also.
Example:
keys = {
hdrs.mac.type & 0x0 : exact;
// other keys
}
But, the above mask expression is optimized by frontend and 0 is present in the place of (hdrs.mac.type & 0x0) at the end of frontend passes.
I checked if Mask operator (&&&) would help. But this operation is allowed only in constant entries of a table as per P4 language spec.
Is there any other cleaner way available? Or, should we stop frontend to optimize the & with 0 in table key expression?