[P4-dev] const entries with multiple actions

Mihai Budiu mbudiu at vmware.com
Thu Oct 11 11:48:11 EDT 2018

The definition of P4 says that on each match exactly one action is executed.
So you would have to define a new action a_composite which calls both a and a_with_control_params.
Actions can call other actions as if they are functions.


From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of Hardik Kiritkumar Soni
Sent: Thursday, October 11, 2018 8:46 AM
To: p4-dev at lists.p4.org
Subject: [P4-dev] const entries with multiple actions


How to define entries with multiple actions for an entry in tables?

e.g., Following is a table from P4-16 spec

table t_exact_ternary {
  key = {
    h.h.e : exact;
    h.h.t : ternary;
  actions = {
  default_action = a;
  const entries = {
    (0x01, 0x1111 &&& 0xF) : a_with_control_params(1); // Here, action "a" should also be executed
    (0x02, 0x1181               ) : a_with_control_params(2);
    (0x03, 0x1111 &&& 0xF000) : a_with_control_params(3);
    (0x04, 0x1211 &&& 0x02F0) : a_with_control_params(4);
    (0x04, 0x1311 &&& 0x02F0) : a_with_control_params(5);
    (0x06, _                               ) : a_with_control_params(6);

-Hardik Soni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20181011/2cbb9181/attachment-0001.html>

More information about the P4-dev mailing list