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

Kamal Bhatt Kamal.Bhatt at stordis.com
Fri Oct 12 09:20:19 EDT 2018


Thanks Nate, I thought so. Will try as suggested.

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<http://www.stordis.com/>
Amtsgericht Stuttgart, HRB 724261, Geschäftsführer: Alexander Jeffries, Waldemar Scheck

From: Nate Foster <jnfoster at cs.cornell.edu>
Sent: 12 October 2018 15:05
To: Kamal Bhatt <Kamal.Bhatt at stordis.com>
Cc: p4-dev <p4-dev at lists.p4.org>
Subject: Re: [P4-dev] How to know the match status.

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<mailto: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<mailto: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<http://www.stordis.com/>
Amtsgericht Stuttgart, HRB 724261, Geschäftsführer: Alexander Jeffries, Waldemar Scheck

_______________________________________________
P4-dev mailing list
P4-dev at lists.p4.org<mailto: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/907772d6/attachment-0001.html>


More information about the P4-dev mailing list