[P4-dev] Default switch case should not be reachable with new extern function primitive

cs.lev cs.lev at gmx.com
Mon Feb 4 05:56:23 EST 2019


I am not entirely sure about this, but I guess the error is raised
because, you apply your ipv4_lpm table, which either forwards your
packet or drops, then everything else you are doing (from lines
starting bit<32> resu=0...) will be omitted, i.e., your lines will
never be executed!

Try to put ipv4_lpm.apply(); to the end of your apply {} clause in your
ingress processing.


On Sat, 2019-02-02 at 19:33 -0600, Hamidreza Almasi wrote:
> I have defined an extern function as follows:
> extern void int_div(out bit<32> result, in bit<32> op1, in bit<32>
> op2);
> and have implemented its functionality as a simple_switch primitive
> from p4 tutorials suggested checkouts tags. I compile the p4 code
> with:
> p4c-bm2-ss --p4v 16 --p4runtime-file basic.p4info --p4runtime-format
> text -o basic.json basic.p4
> and feed it to simple_switch_grpc but when I send a packet, the
> switch fails noting:
> Assertion 'Default switch case should not be reachable' failed, file
> '../../include/bm/bm_sim/actions.h' line '282'.
> I have attached the p4 code, the switch log and the json file and
> would appreciate your help on why this happens and what should the
> fix be.
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

More information about the P4-dev mailing list