[P4-dev] Resubmit Primitive and Instance_type in bmv2

hemant at mnkcg.com hemant at mnkcg.com
Sat Aug 18 15:21:50 EDT 2018

You could use gdb and debug what happens to standard_metadata.instance_type


Also, if the full P4 program can be shared, we could take a look.






From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of Yukinari He
Sent: Saturday, August 18, 2018 12:27 PM
To: p4-dev at lists.p4.org
Subject: [P4-dev] Resubmit Primitive and Instance_type in bmv2




I just complete a program with resubmit() as I’d like to deal with a loop-like behavior. I make standatd_metadata.instance_type as a field to check if a packet is resubmitted. However, I find that the condition which aims to check if the packet is resubmitted is never satisfied, so I’m not sure if the resubmit() is executed. 


Below is the pseudo-code of my program:


        // do something, Part A

        If standard_metadata.instance_type == 6

            If indicator < limit

              // do something and resubmit again, Part B

       Else if standard_metadata.instance_type != 6




I expect that when a packet comes, the switch should do something and resubmit it. The switch will then do Part A again and execute Part B as well for resubmitted packets until the termination condition comes true, but I find that the condition “standard_metadata.instance_type == 6” is never satisfied and the instance_type is always 0.


Are there any mistakes I made?




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180818/201d4514/attachment.html>

More information about the P4-dev mailing list