[P4-dev] Parser Exception Handling

Antonin Bas antonin at barefootnetworks.com
Tue Feb 16 14:58:50 EST 2016


Hi David,

The warning you get here is because you never reference your exception
anywhere in your parser.
However, even if the frontend will accept parser exceptions, they are
indeed not supported by bmv2, and I think exceptions are pretty low
priority right now (so won't be supported in the foreseeable future).

Thanks,

Antonin

On Tue, Feb 16, 2016 at 10:05 AM, David Hancock <dhancock at cs.utah.edu>
wrote:

> Hello,
>
> Please confirm but per my investigation, bmv2 does not yet support parser
> exception handling.  If it does, please explain how to use parser exception
> handlers.
>
> When I include this in my .p4:
>
>   parser_exception p4_pe_out_of_packet {
>     parser_drop;
>   }
>
> p4c-bmv2 throws a Semantic warning: "parser_exception
> 'p4_pe_out_of_packet' is not reachable and will be removed".
>
> The behavior evidently is to drop the packet anyway.  But really, I want
> to implement more advanced behavior that starts with setting metadata and
> returning to a control function and I can't get that going because p4c-bmv2
> removes the parser_exception block.
>
> Is there any estimate when support for parser exception handling might be
> implemented?
>
> Thanks,
> David
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160216/17391032/attachment-0002.html>


More information about the P4-dev mailing list