From a086eea54875480cf24b1d7a630d2361b41f1865 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Thu, 3 Mar 2022 22:33:28 -0500 Subject: [PATCH] Issue #936 - packets experiencing parsing errors are not automatically dropped --- p4-16/psa/PSA.mdk | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/p4-16/psa/PSA.mdk b/p4-16/psa/PSA.mdk index c19cff6f2b..1f1838ab44 100644 --- a/p4-16/psa/PSA.mdk +++ b/p4-16/psa/PSA.mdk @@ -748,6 +748,19 @@ For packets from a port, including the CPU port, both of the `in` parameters `resubmit_meta` and `recirculate_meta` are undefined. +## Behavior of packets after ingress parsing is complete {#sec-after-ingress-parser} + +Ingress parsing can end either by reaching a transition to `accept` or +`reject`, as defined in the P4~16~ language specification. Regardless +of which way ingress parsing completes, the packet will always go on +to be processed by the ingress control and then to the ingress +deparser. Packets that experience an error during ingress parsing are +not automatically dropped. It is up to the ingress P4 code to make +that decision. A P4 developer may wish to use the `parser_error` +standard metadata field to decide to drop the packet, or do whatever +you wish with it, e.g. send it to the CPU port. + + ## Behavior of packets after ingress processing is complete {#sec-after-ingress} The pseudocode below defines where copies of packets will be made @@ -1149,6 +1162,15 @@ mentioned above, will be the same for every copy of the same original replicated packet. +## Behavior of packets after egress parsing is complete {#sec-after-egress-parser} + +The same notes mentioned in Section [#sec-after-ingress-parser] also +apply for packets that experience an error during egress parsing. +That is, they always go on to be processed by the egress control and +then the egress deparser. It is up to the P4 developer to cause them +to be dropped, if that is the behavior you wish. + + ## Behavior of packets after egress processing is complete {#sec-after-egress} @@ -3608,6 +3630,12 @@ table, and (b) the additional restrictions it has over match kind more efficiently than `ternary`. +### Explicitly document that packets experiencing parsing errors are not automatically dropped. + +This is detailed in two new sections, [#sec-after-ingress-parser] and +[#sec-after-egress-parser]. + + ## Changes made in version 1.1