[P4-dev] How to know the match status.

Nate Foster jnfoster at cs.cornell.edu
Fri Oct 12 09:05:12 EDT 2018


I'm sorry, I just realized I mis-read your note.

P4 does not provide information about why a match succeeds or fails. But
some targets do. For example, the Bmv2 target generates logs that include a
fairly detailed description of how tables were matched.

Another alternative would be to break the original table down into a
sequence of tables and then use the .hit boolean to collect the information
about which keys matched. This is admittedly pretty clunky, especially if
there are a large number of keys, but it should accomplish what you want.

-N

On Fri, Oct 12, 2018 at 9:02 AM Nate Foster <jnfoster at cs.cornell.edu> wrote:

> See https://p4.org/p4-spec/docs/P4-16-v1.0.0-spec.html#sec-invoke-mau
>
> -N
>
> On Thu, Oct 11, 2018 at 4:13 AM Kamal Bhatt <Kamal.Bhatt at stordis.com>
> wrote:
>
>> Hello Everyone,
>>
>> Can anyone help on how we know in p4 what all match happened for a
>> packet, for example.
>>
>>
>>
>> table ipv4_lpm {
>>
>>         key = {
>>
>>             hdr.ipv4.dstAddr: lpm;
>>
>>             hdr.ethernet.srcAddr:exact;
>>
>>             match3;
>>
>>             .
>>
>>             .
>>
>>         }
>>
>>
>>
>> Here, If a packet didn’t got the match and was dropped, I would like to
>> know what fields were not matched.
>>
>>
>>
>> *Mit freundlichen Grüßen / Best Regards*
>>
>>
>>
>> *Kamal Bhatt*
>>
>> Lead Software Engineer
>>
>>
>>
>> *STORDIS GmbH | *Rosenwiesstr.17 | 70567 Stuttgart | Germany | T: +49
>> (0)711 34 21 58 0 | www.stordis.com
>> Amtsgericht Stuttgart, HRB 724261, Geschäftsführer: Alexander Jeffries,
>> Waldemar Scheck
>>
>>
>> _______________________________________________
>> 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/20181012/43610e81/attachment.html>


More information about the P4-dev mailing list