[P4-dev] Ternary match-key field

Nate Foster jnfoster at cs.cornell.edu
Tue Aug 29 11:31:14 EDT 2017


In P4_16, you simply list the expressions that you want to be matched in
the key property.

> table MyTable {
>   key = {
>    e1 : ternary,
>    e2 : ternary,
>    ...
> }

You can include multiple expressions, you can mix and match exact matches
with ternary matches, and there's no distinction between headers and
metadata -- it's all just data that gets slotted into the table. There's
also no need to provide any masks in the P4 program itself. Any masking
would be done by the control plane when it populates the patterns that are
inserted into the table.

-N

On Tue, Aug 29, 2017 at 8:14 AM, Roshan Se <
roshan.sedar at student.uclouvain.be> wrote:

> Hi,
>
> I am trying to keep more than one metadata fields as ternary match-key
> fields in the table. Is it possible to keep more than one ternary
> match-key? Could give me an idea how it works and specially, both sides of
> &&&? Which part should be initialized in metadata to be able to match
> values in the table?
>
> any help would be great.
>
> Thanks,
>
> Regards.
>
> Roshan.
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170829/e9b682c1/attachment-0002.html>


More information about the P4-dev mailing list