[P4-dev] Queries regarding reading/writing in key-action part of match-action table
rajjoshi at comp.nus.edu.sg
Wed May 6 02:28:25 EDT 2020
Following are the answers:
1. Counters are typically not available for access to dataplane packets.
But you can implement a counter using a register. In that case, answer to
your question is "yes". You can first read the register value in a metadata
field and have that metadata field in the key part of the match-action
2. Registers are externs and implemented by target architectures. Some
architectures like v1model should allow you to update a register value in
an action. So the answer is "mostly yes".
3. For hardcoded value, you could just use the control plane to add the
hardcoded value match into your table and make sure you don't change it (so
that it remains hardcoded). OR you can even hardcode a value in a register.
Then read it in a metadata field and compare the metadata field with your
packet header field. Some architectures can allow you to directly compare a
header field value with a hardcoded register value. So, in general the
answer is "yes".
On Wed, May 6, 2020 at 8:50 AM Sahil Gupta <sg5414 at rit.edu> wrote:
> Hi all,
> Is it possible:
> 1. to read/match register or counters in key parts of match-action tables?
> 2. to update register value in the action field?
> 3. to match any field of header packet to arbitrary hardcoded value or
> value of some register in P4?
> Sahil Gupta
> [image: Mailtrack]
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&> Sender
> notified by
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&> 05/05/20,
> 11:17:09 PM
> P4-dev mailing list
> P4-dev at lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev