Hi ,
I have a question about TCAM matching capability on Tofino2, especially regarding non-contiguous wildcard patterns.
Suppose I want to install a TCAM entry with the following bit-level match pattern:
LCP = 000*1*
Here * means don’t care / wildcard, so the intended semantics is:
-
bit[5:3] = 000
-
bit[2] = *
-
bit[1] = 1
-
bit[0] = *
This is not a prefix, and the wildcards are non-contiguous.
My questions:
-
Does Tofino2 TCAM support this kind of arbitrary bitmask matching?
That is, can a TCAM entry match something like:value = 000010 mask = 111010to represent
000*1*? -
If yes, how should this be expressed from the P4 control plane?
-
In P4Runtime / BFRT, how can I specify such a bitmask / ternary match?
-
Is it done by explicitly providing
(value, mask)pairs?
-
-
Are there any hardware constraints or performance implications when using such sparse wildcard patterns in Tofino2 TCAM (e.g., entry expansion, resource overhead, pipeline limitations)?
Background:
I am implementing a range / prefix encoding scheme for packet classification, and some of the generated codes naturally produce patterns like 000*1*, which cannot be expressed as simple prefixes. I want to confirm whether Tofino2 TCAM can directly support this type of encoding, and what the recommended way is to program it via the control plane.
Any insight, examples, or references would be greatly appreciated.
Thanks in advance!