Comment 18 for bug 1864822

Revision history for this message
James Denton (james-denton) wrote :

Hi Slawek,

I've tested the patch. Here's a before and after:

BEFORE:

root@aio1:/home/ubuntu# ovs-ofctl dump-flows br-ex
 cookie=0xae778d2777dbc1a9, duration=1103273.530s, table=0, n_packets=13043, n_bytes=1020882, priority=2,in_port="phy-br-ex" actions=resubmit(,1)
 cookie=0xae778d2777dbc1a9, duration=1103273.850s, table=0, n_packets=0, n_bytes=0, priority=0 actions=NORMAL
 cookie=0xae778d2777dbc1a9, duration=1103273.528s, table=0, n_packets=6389596, n_bytes=462254263, priority=1 actions=resubmit(,3)
 cookie=0xae778d2777dbc1a9, duration=1103273.527s, table=1, n_packets=13043, n_bytes=1020882, priority=0 actions=resubmit(,2)
 cookie=0xae778d2777dbc1a9, duration=854136.480s, table=2, n_packets=6, n_bytes=1702, priority=4,in_port="phy-br-ex",dl_vlan=3 actions=mod_vlan_vid:4,NORMAL
 cookie=0xae778d2777dbc1a9, duration=850505.570s, table=2, n_packets=393, n_bytes=51593, priority=4,in_port="phy-br-ex",dl_vlan=4 actions=mod_vlan_vid:1087,NORMAL
 cookie=0xae778d2777dbc1a9, duration=850505.563s, table=2, n_packets=59, n_bytes=18864, priority=4,in_port="phy-br-ex",dl_vlan=5 actions=mod_vlan_vid:6,NORMAL
 cookie=0xae778d2777dbc1a9, duration=848974.554s, table=2, n_packets=470, n_bytes=63722, priority=4,in_port="phy-br-ex",dl_vlan=6 actions=mod_vlan_vid:1041,NORMAL
 cookie=0xae778d2777dbc1a9, duration=1103273.525s, table=2, n_packets=12115, n_bytes=885001, priority=2,in_port="phy-br-ex" actions=drop
 cookie=0xae778d2777dbc1a9, duration=1103273.524s, table=3, n_packets=6389596, n_bytes=462254263, priority=1 actions=NORMAL

Simulate disconnect with a restart of openvswitch-switch:

root@aio1:/home/ubuntu# systemctl restart openvswitch-switch

Check flows. Notice the new cookies and the DROP flow in table 0:

root@aio1:/home/ubuntu# ovs-ofctl dump-flows br-ex
 cookie=0x532069c53a5426a6, duration=2.763s, table=0, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=drop
 cookie=0xae778d2777dbc1a9, duration=2.863s, table=0, n_packets=11, n_bytes=719, priority=1 actions=resubmit(,3)
 cookie=0x532069c53a5426a6, duration=2.768s, table=0, n_packets=0, n_bytes=0, priority=0 actions=NORMAL
 cookie=0xae778d2777dbc1a9, duration=2.861s, table=1, n_packets=0, n_bytes=0, priority=0 actions=resubmit(,2)
 cookie=0x532069c53a5426a6, duration=2.654s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=6 actions=mod_vlan_vid:1041,NORMAL
 cookie=0x532069c53a5426a6, duration=2.648s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=5 actions=mod_vlan_vid:6,NORMAL
 cookie=0x532069c53a5426a6, duration=2.471s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=4 actions=mod_vlan_vid:1087,NORMAL
 cookie=0x532069c53a5426a6, duration=2.466s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=3 actions=mod_vlan_vid:4,NORMAL
 cookie=0xae778d2777dbc1a9, duration=2.860s, table=2, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=drop
 cookie=0xae778d2777dbc1a9, duration=2.858s, table=3, n_packets=11, n_bytes=719, priority=1 actions=NORMAL

Restart the agent:

 root@aio1:/home/ubuntu# systemctl restart neutron-openvswitch-agent

Flows are rebuilt with a new cookie and the flows look OK:

 root@aio1:/home/ubuntu# ovs-ofctl dump-flows br-ex
  cookie=0xe1614569c555b7f1, duration=5.354s, table=0, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=resubmit(,1)
  cookie=0xe1614569c555b7f1, duration=5.688s, table=0, n_packets=0, n_bytes=0, priority=0 actions=NORMAL
  cookie=0xe1614569c555b7f1, duration=5.352s, table=0, n_packets=354, n_bytes=24761, priority=1 actions=resubmit(,3)
  cookie=0xe1614569c555b7f1, duration=5.351s, table=1, n_packets=0, n_bytes=0, priority=0 actions=resubmit(,2)
  cookie=0xe1614569c555b7f1, duration=2.870s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=6 actions=mod_vlan_vid:1041,NORMAL
  cookie=0xe1614569c555b7f1, duration=2.812s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=4 actions=mod_vlan_vid:1087,NORMAL
  cookie=0xe1614569c555b7f1, duration=2.806s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=3 actions=mod_vlan_vid:4,NORMAL
  cookie=0xe1614569c555b7f1, duration=2.798s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=5 actions=mod_vlan_vid:6,NORMAL
  cookie=0xe1614569c555b7f1, duration=5.349s, table=2, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=drop
  cookie=0xe1614569c555b7f1, duration=5.348s, table=3, n_packets=354, n_bytes=24761, priority=1 actions=NORMAL

>> With patch:

root@aio1:/home/ubuntu# ovs-ofctl dump-flows br-ex
 cookie=0x59aaed658e18691e, duration=36.459s, table=0, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=resubmit(,1)
 cookie=0x59aaed658e18691e, duration=36.827s, table=0, n_packets=0, n_bytes=0, priority=0 actions=NORMAL
 cookie=0x59aaed658e18691e, duration=36.458s, table=0, n_packets=1206, n_bytes=85733, priority=1 actions=resubmit(,3)
 cookie=0x59aaed658e18691e, duration=36.456s, table=1, n_packets=0, n_bytes=0, priority=0 actions=resubmit(,2)
 cookie=0x59aaed658e18691e, duration=34.224s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=3 actions=mod_vlan_vid:4,NORMAL
 cookie=0x59aaed658e18691e, duration=34.216s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=4 actions=mod_vlan_vid:1087,NORMAL
 cookie=0x59aaed658e18691e, duration=34.209s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=5 actions=mod_vlan_vid:6,NORMAL
 cookie=0x59aaed658e18691e, duration=34.057s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=6 actions=mod_vlan_vid:1041,NORMAL
 cookie=0x59aaed658e18691e, duration=36.455s, table=2, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=drop
 cookie=0x59aaed658e18691e, duration=36.453s, table=3, n_packets=1206, n_bytes=85733, priority=1 actions=NORMAL

Simulate disconnect with restart of OVS:

root@aio1:/home/ubuntu# systemctl restart openvswitch-switch

Notice the drop flow and mix of cookies:

root@aio1:/home/ubuntu# ovs-ofctl dump-flows br-ex
 cookie=0x8e2d73e3b171f9c0, duration=1.822s, table=0, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=drop
 cookie=0x59aaed658e18691e, duration=1.922s, table=0, n_packets=13, n_bytes=853, priority=1 actions=resubmit(,3)
 cookie=0x8e2d73e3b171f9c0, duration=1.826s, table=0, n_packets=3, n_bytes=180, priority=0 actions=NORMAL
 cookie=0x59aaed658e18691e, duration=1.920s, table=1, n_packets=0, n_bytes=0, priority=0 actions=resubmit(,2)
 cookie=0x8e2d73e3b171f9c0, duration=1.732s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=3 actions=mod_vlan_vid:4,NORMAL
 cookie=0x8e2d73e3b171f9c0, duration=1.726s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=4 actions=mod_vlan_vid:1087,NORMAL
 cookie=0x8e2d73e3b171f9c0, duration=1.719s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=5 actions=mod_vlan_vid:6,NORMAL
 cookie=0x8e2d73e3b171f9c0, duration=1.569s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=6 actions=mod_vlan_vid:1041,NORMAL
 cookie=0x59aaed658e18691e, duration=1.919s, table=2, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=drop
 cookie=0x59aaed658e18691e, duration=1.918s, table=3, n_packets=13, n_bytes=853, priority=1 actions=NORMAL

"Old" flows are cleaned ip, but the drop flow is still there:

root@aio1:/home/ubuntu# ovs-ofctl dump-flows br-ex
 cookie=0x8e2d73e3b171f9c0, duration=10.484s, table=0, n_packets=0, n_bytes=0, priority=2,in_port="phy-br-ex" actions=drop
 cookie=0x8e2d73e3b171f9c0, duration=10.488s, table=0, n_packets=59, n_bytes=4055, priority=0 actions=NORMAL
 cookie=0x8e2d73e3b171f9c0, duration=10.394s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=3 actions=mod_vlan_vid:4,NORMAL
 cookie=0x8e2d73e3b171f9c0, duration=10.388s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=4 actions=mod_vlan_vid:1087,NORMAL
 cookie=0x8e2d73e3b171f9c0, duration=10.381s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=5 actions=mod_vlan_vid:6,NORMAL
 cookie=0x8e2d73e3b171f9c0, duration=10.231s, table=2, n_packets=0, n_bytes=0, priority=4,in_port="phy-br-ex",dl_vlan=6 actions=mod_vlan_vid:1041,NORMAL