-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathoptimization_notes.txt
More file actions
220 lines (197 loc) · 4.58 KB
/
optimization_notes.txt
File metadata and controls
220 lines (197 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
action set_program(program, virt_ingress_port) {
modify_field(meta_ctrl.program, program);
modify_field(meta_ctrl.virt_ingress_port, virt_ingress_port);
}
table t_prog_select {
reads {
standard_metadata.ingress_port : exact;
}
actions {
set_program;
}
}
table t_virt_filter {
reads {
meta_ctrl.program : exact;
meta_ctrl.virt_egress_port : exact;
}
actions {
a_drop;
a_virt_ports_cleanup;
}
}
table t_recirc_cleanup {
actions {
a_recirc_cleanup;
}
}
table parse_control {
reads {
meta_ctrl.program : exact;
parse_ctrl.numbytes : exact;
parse_ctrl.state : exact;
}
actions {
set_next_action;
set_next_action_chg_program;
extract_more;
extract_more_chg_program;
}
}
t_inspect_<XX>_<XX>
t_norm_<XX>_<XX>
action a_set_first_table(tableID) {
modify_field(meta_ctrl.next_table, tableID);
modify_field(meta_ctrl.stage, NORM);
modify_field(meta_ctrl.next_stage, 1);
}
// Can't consolidate w/ parse_control because parse_control potentially changes
// both meta_ctrl.program AND parse_ctrl.state
table t_set_first_table {
reads {
meta_ctrl.program : exact;
parse_ctrl.state : exact;
}
actions {
a_set_first_table;
}
}
action a_set_validbits(val) {
modify_field(extracted.validbits, val);
}
// Definite candidate for consolidation: t_set_first_table
table t_set_validbits {
reads {
meta_ctrl.program : exact;
parse_ctrl.state : exact;
}
actions {
a_set_validbits;
_no_op;
}
}
// Why are we setting next_table here?
action init_program_state(action_ID, match_ID, next_table) {
modify_field(meta_primitive_state.action_ID, action_ID);
modify_field(meta_primitive_state.match_ID, match_ID);
modify_field(meta_primitive_state.primitive_index, 1);
modify_field(meta_ctrl.next_table, next_table);
}
// Next table varies according to meta_ctrl.next_table, but all eventually
// execute the init_program_state action
table t1_extracted_exact {
reads {
meta_ctrl.program : exact;
extracted.data : ternary;
}
actions {
init_program_state;
}
}
action a_set_primitive_metadata(primitive, primitive_subtype) {
modify_field(meta_primitive_state.primitive, primitive);
modify_field(meta_primitive_state.subtype, primitive_subtype);
}
// TODO:Rename action.p4; all tables are set_primitive_metadata_XX
table set_primitive_metadata_11 {
reads {
meta_ctrl.program : exact;
meta_primitive_state.action_ID : exact;
meta_primitive_state.primitive_index : exact;
}
actions {
a_set_primitive_metadata;
}
}
// Next table varies according to meta_primitive_state.primitive
table t_mod_11 {
reads {
meta_ctrl.program : exact;
meta_primitive_state.subtype : exact;
meta_primitive_state.match_ID : exact;
}
actions {
mod_meta_stdmeta_ingressport;
mod_meta_stdmeta_packetlength;
mod_meta_stdmeta_egressspec;
mod_meta_stdmeta_egressport;
mod_meta_stdmeta_egressinst;
mod_meta_stdmeta_insttype;
mod_stdmeta_egressspec_meta;
mod_meta_const;
mod_stdmeta_egressspec_const;
mod_extracted_const;
mod_stdmeta_egressspec_stdmeta_ingressport;
mod_extracted_extracted;
mod_meta_extracted;
mod_extracted_meta;
}
}
action set_program_state(action_ID, primitive_index, stage_state, next_stage) {
modify_field(meta_primitive_state.action_ID, action_ID);
modify_field(meta_primitive_state.primitive_index, primitive_index);
modify_field(meta_ctrl.stage_state, stage_state);
modify_field(meta_ctrl.next_stage, next_stage);
}
// Definite candidate for consolidation: set_primitive_metadata
table set_program_state_11 {
reads {
meta_ctrl.program : exact;
meta_primitive_state.action_ID : exact;
meta_primitive_state.primitive_index : exact;
}
actions {
set_program_state;
}
}
// --- Ingress continued ---
// --- Egress ---
table t_multicast {
reads {
meta_ctrl.program : exact;
meta_ctrl.multicast_seq_id : exact;
meta_ctrl.multicast_current_egress : exact;
standard_metadata.ingress_port : ternary;
}
actions {
mod_and_clone;
_no_op;
}
}
// TODO: insert conditional
table csum16 {
reads {
meta_ctrl.program : exact;
// TODO: extracted.validbits : ternary
}
actions {
a_ipv4_csum16;
_no_op;
}
}
table t_resize_pr {
reads {
parse_ctrl.numbytes : exact;
}
actions {
a_resize_pr_01;
a_resize_pr_02;
// ...
_no_op
}
}
table t_prep_deparse_SEB {
actions {
a_prep_deparse_SEB;
}
}
table t_virt_net {
reads {
meta_ctrl.program : exact;
meta_ctrl.virt_egress_port : exact;
}
actions {
_no_op;
a_virt_net;
}
}