[P4-dev] How do P4 tables decide which actions are executed?

Robert Halstead robert.halstead at xilinx.com
Mon Jun 22 15:12:59 EDT 2015

I'm having trouble understanding how the control flow executes, and just wanted to ask some clarifying questions. They will all pertain to the basic_routing example under the p4-factory repository.

First, how is an action chosen when a table has multiple actions available? For example the ipv4_fib and ipv4_fib_lpm tables both have two actions; on_miss & fib_hit_nexthop. Are both actions executed, or is the first/last action that gets executed, or is it dependent on the statements under control ingress?

I think my issue is with the following statement. I'm not sure how to read it, and I just can't get it to gel in my head.
apply(ipv4_fib) {
               on_miss {apply(ipv4_fib_lpm);}

The first way I'm reading it is: "apply table ipv4_fib" only executing "action on_miss" then "apply table ipv4_fib_lpm" executing "actions on_miss & fib_nexthop". This interpretation doesn't make too much sense to me because the on_miss action does nothing, and the statement would be equivalent to apply(ipv4_fib_lpm).

Another way I'm reading it is: "apply table ipv4_fib" but after completing "action on_miss" "apply table ipv4_fib_lpm". However, this interpretation means the action fib_nexthop is executed twice.

I don't think they are, but are either of these interpretations correct? If not what is the correct way to read the statement?

Thank you,
- Robert

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20150622/f0e99dbc/attachment-0001.html>

More information about the P4-dev mailing list