File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -6049,16 +6049,21 @@ struct apply_result(T) {
6049
6049
~ End P4Pseudo
6050
6050
6051
6051
The evaluation of the `apply` method sets the `hit` field to `true`
6052
- if a match is found in the lookup-table. This bit can be used to drive
6053
- the execution of the control-flow in the control block that invoked
6054
- the table:
6052
+ and the field `miss` to `false` if a match is found in the lookup-table;
6053
+ if a match is not found `hit` is set to `false` and `miss` to `true`.
6054
+ These bits can be used to drive the execution of the control-flow in the
6055
+ control block that invoked the table:
6055
6056
6056
6057
~ Begin P4Example
6057
6058
if (ipv4_match.apply().hit) {
6058
6059
// there was a hit
6059
6060
} else {
6060
6061
// there was a miss
6061
6062
}
6063
+
6064
+ if (ipv4_host.apply().miss) {
6065
+ ipv4_lpm.apply(); // Lookup the route only if host table missed
6066
+ }
6062
6067
~ End P4Example
6063
6068
6064
6069
The `action_run` field indicates which kind of action was executed
@@ -7139,6 +7144,7 @@ The P4 compiler should provide:
7139
7144
7140
7145
## Summary of changes made in version 1.2.0
7141
7146
7147
+ * Added `table.apply().miss`
7142
7148
* Added `string` type (Section [#sec-string].)
7143
7149
* Allow 1-bit signed values
7144
7150
* Define the type of bit slices from signed and unsigned values to be unsigned.
You can’t perform that action at this time.
0 commit comments