@@ -126,6 +126,172 @@ Datapath actions: drop`,
126126 "output:1" ,
127127 },
128128 },
129+
130+ {
131+ name : "connection tracker trace with 3 legs" ,
132+ output : ` Flow: icmp,in_port=4,dl_vlan=2,dl_vlan_pcp=0,vlan_tci1=0x0000,dl_src=10:0e:7e:be:fc:40,dl_dst=3c:fd:fe:b6:fb:50,nw_src=10.126.86.66,nw_dst=10.39.144.8,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
133+
134+ bridge("br0")
135+ -------------
136+ 0. ip,in_port=4,dl_vlan=2,nw_dst=10.39.144.8, priority 900, cookie 0x1dfd9000410000
137+ resubmit(,25)
138+ 25. ip,in_port=4,dl_vlan=2,nw_dst=10.39.144.8, priority 2020, cookie 0x1dfd9000410000
139+ pop_vlan
140+ set_field:fe:00:00:00:01:01->eth_src
141+ set_field:a6:c1:a7:15:a4:3d->eth_dst
142+ resubmit(,28)
143+ 28. priority 100
144+ resubmit(,35)
145+ 35. priority 100
146+ resubmit(,45)
147+ 45. priority 100
148+ resubmit(,50)
149+ 50. ip,dl_dst=a6:c1:a7:15:a4:3d, priority 110, cookie 0x1dfd9000500000
150+ ct(table=51)
151+ drop
152+ -> A clone of the packet is forked to recirculate. The forked pipeline will be resumed at table 51.
153+ -> Sets the packet to an untracked state, and clears all the conntrack fields.
154+ Final flow: icmp,in_port=4,vlan_tci=0x0000,dl_src=fe:00:00:00:01:01,dl_dst=a6:c1:a7:15:a4:3d,nw_src=10.126.86.66,nw_dst=10.39.144.8,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
155+ Megaflow: recirc_id=0,eth,ip,tun_id=0,in_port=4,dl_vlan=2,dl_vlan_pcp=0,dl_src=10:0e:7e:be:fc:40,dl_dst=3c:fd:fe:b6:fb:50,nw_src=10.64.0.0/10,nw_dst=10.39.144.8,nw_frag=no
156+ Datapath actions: set(eth(src=fe:00:00:00:01:01,dst=a6:c1:a7:15:a4:3d)),pop_vlan,ct,recirc(0x908)
157+ ===============================================================================
158+ recirc(0x908) - resume conntrack with default ct_state=trk|new (use --ct-next to customize)
159+ ===============================================================================
160+ Flow: recirc_id=0x908,ct_state=new|trk,eth,icmp,in_port=4,vlan_tci=0x0000,dl_src=fe:00:00:00:01:01,dl_dst=a6:c1:a7:15:a4:3d,nw_src=10.126.86.66,nw_dst=10.39.144.8,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
161+ bridge("br0")
162+ -------------
163+ thaw
164+ Resuming from table 51
165+ 51. priority 200
166+ resubmit(,55)
167+ 55. ct_state=+new+trk,icmp,dl_dst=a6:c1:a7:15:a4:3d, priority 1000, cookie 0x1dfd9000500000
168+ ct(commit,table=60,exec(set_field:0x1dfd90->ct_mark))
169+ set_field:0x1dfd90->ct_mark
170+ -> A clone of the packet is forked to recirculate. The forked pipeline will be resumed at table 60.
171+ -> Sets the packet to an untracked state, and clears all the conntrack fields.
172+ Final flow: recirc_id=0x908,eth,icmp,in_port=4,vlan_tci=0x0000,dl_src=fe:00:00:00:01:01,dl_dst=a6:c1:a7:15:a4:3d,nw_src=10.126.86.66,nw_dst=10.39.144.8,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
173+ Megaflow: recirc_id=0x908,ct_state=+new-est-rel-rpl+trk,ct_mark=0,eth,icmp,in_port=4,dl_dst=a6:c1:a7:15:a4:3d,nw_frag=no
174+ Datapath actions: ct(commit,mark=0x1dfd90/0xffffffff),recirc(0x909)
175+ ===============================================================================
176+ recirc(0x909) - resume conntrack with default ct_state=trk|new (use --ct-next to customize)
177+ ===============================================================================
178+ Flow: recirc_id=0x909,ct_state=new|trk,ct_mark=0x1dfd90,eth,icmp,in_port=4,vlan_tci=0x0000,dl_src=fe:00:00:00:01:01,dl_dst=a6:c1:a7:15:a4:3d,nw_src=10.126.86.66,nw_dst=10.39.144.8,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
179+ bridge("br0")
180+ -------------
181+ thaw
182+ Resuming from table 60
183+ 60. priority 100
184+ resubmit(,62)
185+ 62. priority 100
186+ resubmit(,65)
187+ 65. ip,vlan_tci=0x0000/0x1fff,dl_dst=a6:c1:a7:15:a4:3d,nw_dst=10.39.144.8, priority 1000, cookie 0x1dfd9000400000
188+ output:30
189+ Final flow: unchanged
190+ Megaflow: recirc_id=0x909,eth,ip,tun_id=0,in_port=4,vlan_tci=0x0000/0x1fff,dl_dst=a6:c1:a7:15:a4:3d,nw_src=10.64.0.0/10,nw_dst=10.39.144.8,nw_frag=no
191+ Datapath actions: 7` ,
192+ datapathActions : NewDataPathActions ("7" ),
193+ flowActions : []string {
194+ "resubmit(,25)" ,
195+ "pop_vlan" ,
196+ "set_field:fe:00:00:00:01:01->eth_src" ,
197+ "set_field:a6:c1:a7:15:a4:3d->eth_dst" ,
198+ "resubmit(,28)" ,
199+ "resubmit(,35)" ,
200+ "resubmit(,45)" ,
201+ "resubmit(,50)" ,
202+ "ct(table=51)" ,
203+ "drop" ,
204+ "recirc" ,
205+ "resubmit(,55)" ,
206+ "ct(commit,table=60,exec(set_field:0x1dfd90->ct_mark))" ,
207+ "set_field:0x1dfd90->ct_mark" ,
208+ "recirc" ,
209+ "resubmit(,62)" ,
210+ "resubmit(,65)" ,
211+ "output:30" ,
212+ },
213+ },
214+ {
215+ name : "connection tracker trace with 2 legs" ,
216+ output : `Flow: ct_mark=0x1e240,ip,in_port=6,vlan_tci=0x0000,dl_src=56:03:b3:97:ac:c8,dl_dst=4a:72:d2:56:78:d1,nw_src=10.36.96.36,nw_dst=10.36.96.37,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
217+
218+ bridge("br0")
219+ -------------
220+ 0. ip,in_port=6,dl_src=56:03:b3:97:ac:c8,nw_src=10.36.96.36, priority 2000, cookie 0x1e24001800000
221+ resubmit(,25)
222+ 25. ip,vlan_tci=0x0000/0x1fff,nw_src=10.36.96.36, priority 2000, cookie 0x1e24001800000
223+ push_vlan:0x8100
224+ set_field:4118->vlan_vid
225+ resubmit(,25)
226+ 25. ip,dl_vlan=22,nw_dst=10.36.96.37, priority 2020, cookie 0x1d97c01800000
227+ pop_vlan
228+ resubmit(,28)
229+ 28. ip,in_port=6, priority 110, cookie 0x1e24001900000
230+ ct(table=30)
231+ drop
232+ -> A clone of the packet is forked to recirculate. The forked pipeline will be resumed at table 30.
233+
234+ Final flow: ip,in_port=6,vlan_tci=0x0000,dl_src=56:03:b3:97:ac:c8,dl_dst=4a:72:d2:56:78:d1,nw_src=10.36.96.36,nw_dst=10.36.96.37,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
235+ Megaflow: recirc_id=0,eth,ip,in_port=6,vlan_tci=0x0000/0x1fff,dl_src=56:03:b3:97:ac:c8,dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,nw_src=10.36.96.36,nw_dst=10.36.96.37,nw_proto=0,nw_frag=no
236+ Datapath actions: ct,recirc(0x2)
237+
238+ ===============================================================================
239+ recirc(0x2) - resume conntrack with ct_state=est|trk
240+ ===============================================================================
241+
242+ Flow: recirc_id=0x2,ct_state=est|trk,ct_mark=0x1e240,eth,ip,in_port=6,vlan_tci=0x0000,dl_src=56:03:b3:97:ac:c8,dl_dst=4a:72:d2:56:78:d1,nw_src=10.36.96.36,nw_dst=10.36.96.37,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
243+
244+ bridge("br0")
245+ -------------
246+ thaw
247+ Resuming from table 30
248+ 30. ct_state=+est+trk,ct_mark=0x1e240,in_port=6, priority 220, cookie 0x1e24001900000
249+ resubmit(,35)
250+ 35. priority 100
251+ resubmit(,45)
252+ 45. priority 100
253+ resubmit(,50)
254+ 50. priority 100
255+ resubmit(,60)
256+ 60. ip,in_port=6,dl_src=56:03:b3:97:ac:c8,nw_src=10.36.96.36, priority 1020, cookie 0x1e24001800000
257+ resubmit(,62)
258+ 62. ip,tun_id=0,nw_dst=10.36.96.0/20, priority 1000
259+ resubmit(,67)
260+ 67. conj_id=2, priority 1500, cookie 0x200020000
261+ set_field:0x2->tun_id
262+ resubmit(,68)
263+ 68. ip,tun_id=0x2,nw_dst=10.36.96.37, priority 1500, cookie 0x200020000
264+ set_field:10.39.129.11->tun_dst
265+ output:9
266+ -> output to native tunnel
267+ >> native tunnel routing failed
268+
269+ Final flow: recirc_id=0x2,ct_state=est|trk,ct_mark=0x1e240,eth,ip,tun_src=0.0.0.0,tun_dst=10.39.129.11,tun_ipv6_src=::,tun_ipv6_dst=::,tun_gbp_id=0,tun_gbp_flags=0,tun_tos=0,tun_ttl=0,tun_flags=0,in_port=6,vlan_tci=0x0000,dl_src=56:03:b3:97:ac:c8,dl_dst=4a:72:d2:56:78:d1,nw_src=10.36.96.36,nw_dst=10.36.96.37,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
270+ Megaflow: recirc_id=0x2,ct_state=+est+trk,ct_mark=0x1e240,eth,ip,tun_id=0,tun_dst=0.0.0.0,in_port=6,dl_src=56:03:b3:97:ac:c8,dl_dst=4a:72:d2:56:78:d1,nw_src=10.36.96.36,nw_dst=10.36.96.37,nw_ecn=0,nw_frag=no
271+ Datapath actions: drop` ,
272+ datapathActions : NewDataPathActions ("drop" ),
273+ flowActions : []string {
274+ "resubmit(,25)" ,
275+ "push_vlan:0x8100" ,
276+ "set_field:4118->vlan_vid" ,
277+ "resubmit(,25)" ,
278+ "pop_vlan" ,
279+ "resubmit(,28)" ,
280+ "ct(table=30)" ,
281+ "drop" ,
282+ "recirc" ,
283+ "resubmit(,35)" ,
284+ "resubmit(,45)" ,
285+ "resubmit(,50)" ,
286+ "resubmit(,60)" ,
287+ "resubmit(,62)" ,
288+ "resubmit(,67)" ,
289+ "set_field:0x2->tun_id" ,
290+ "resubmit(,68)" ,
291+ "set_field:10.39.129.11->tun_dst" ,
292+ "output:9" ,
293+ },
294+ },
129295 }
130296
131297 for _ , testcase := range testcases {
0 commit comments