@@ -90,9 +90,22 @@ Here are the fields:
90
90
ingress. If your P4 program assigns a value of DROP_PORT to ` egress_spec ` , it
91
91
will still behave according to the "after-ingress pseudocode", even if you
92
92
never call ` mark_to_drop ` (P4_16) or ` drop ` (P4_14).
93
+ Note that if you never assign a value to this field, nor drop the
94
+ packet, during ingress processing, its default initial value is 0,
95
+ and the packet will be unicast to output port 0.
93
96
- ` egress_port ` (sm14, v1m) - Only intended to be accessed during
94
- egress processing, read only. The output port this packet is
95
- destined to.
97
+ egress processing, read only. While you can read its value during
98
+ ingress processing, you should think of its value as uninitialized
99
+ garbage during ingress. This field is assigned a predictable value
100
+ just before the packet begins egress processing, equal to the output
101
+ port that this packet is destined to (if it is not dropped during
102
+ egress processing). There is no compile-time error or warning if
103
+ you do assign to this field, but if you wish your P4 code to be
104
+ easier to port to other programmable switches, do not ever assign it
105
+ a value. See [ Appendix D.2 "No output port change during egress" of
106
+ the PNA
107
+ specification] ( https://staging.p4.org/p4-spec/docs/psa-working-draft-html-version.html#appendix-rationale-egress-cannot-change-output-port )
108
+ for some explanation of why.
96
109
- ` egress_instance ` (sm14) - Renamed ` egress_rid ` in simple_switch.
97
110
See ` egress_rid ` below.
98
111
- ` instance_type ` (sm14, v1m) - Contains a value that can be read by
0 commit comments