[P4-design] A thought on "reject" in the parser

Andy Fingerhut (jafinger) jafinger at cisco.com
Fri Aug 4 12:17:26 EDT 2017

Yes, at least much of an architecture’s description is expected to be in a document, not P4 code.

There is an issue open for the PSA (Portable Switch Architecture) specification, under development now.


It proposes that in that architecture, all packets start ingress processing, regardless of whether the parser reached the accept or reject state, and there is a metadata field available in ingress that contains the error type found by the parser, which is “error.NoError” if the parser found no error.  This gives flexibility to the P4 programmer to decide whether they wish to drop such packets completely, or perhaps some other action, e.g. stick a header at the front indicating what error occurred, and send the packet to a control CPU.


From: P4-design <p4-design-bounces at lists.p4.org> on behalf of David George <david.george at netronome.com>
Date: Friday, August 4, 2017 at 5:54 AM
To: "p4-design at lists.p4.org" <p4-design at lists.p4.org>
Subject: [P4-design] A thought on "reject" in the parser

The spec says:

>> An architecture must specify the behavior when the accept and reject states are reached. For example,
>> an architecture may specify that all packets reaching the reject state are dropped without further pro-
>> cessing. Alternatively, it may specify that such packets are passed to the next block after the parser, with
>> intrinsic metadata indicating that the parser reached the reject state, along with the error recorded.
I'm wondering how the architecture would specify this. I would assume in a document and not in the model P4 source. Is this correct?
My feeling is that this behaviour is a little vague. I was thinking it might be better to allow the user to define a custom "reject" parse node which explicitly performs this function. If the reject node is not defined then the packet is rejected.
This would make it possible to implement something like parser exceptions in P4-16.

David George

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-design_lists.p4.org/attachments/20170804/445cc83b/attachment-0002.html>

More information about the P4-design mailing list