Bug 1315065

Summary: [OVS] ovs-ofctl dump-flows should be more readable and easy to follow.
Product: Red Hat Enterprise Linux 7 Reporter: Toni Freger <tfreger>
Component: openvswitchAssignee: Aaron Conole <aconole>
Status: CLOSED CURRENTRELEASE QA Contact: qding
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: aconole, aloughla, amuller, atragler, fleitner, hmlnarik, mleitner, mschuppe, nyechiel, pablo.iranzo, qding, rkhan, sukulkar, tredaelli
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: openvswitch-2.8.0-1.el7fdb Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-16 13:11:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1333923, 1411862    

Description Toni Freger 2016-03-06 12:12:38 UTC
Description of problem:

Since OpenStack  projects ( OVS firewall driver, ODL) will increase usage of OVS flows, we should create more readable structure of the OVS flows in order to display and to debug them better.

Several thoughts:

1)Instead of numerous lines to create tables display of the flows.
2)To add some meaningful names for these tables instead of numbers.

Version-Release number of selected component (if applicable):
openvswitch-2.4.0-1.el7.x86_64

Comment 2 Hynek Mlnarik 2016-05-23 07:09:47 UTC
Additional thoughts to the original description:

* Having the rules from a table grouped is indeed useful, hence it would be nice to be able to specify --sort=table (currently it outputs "ovs-ofctl: table: unknown field name" as of 2.5.0 ovs-ofctl)

* Would it be possible e.g. to add an option for human-readable output (e.g. by enhancing -F option set) that would produce the rules formatted into the table?

* In this human-readable format, it would be beneficial to maintain a default set of displayed fields and sorting order, e.g. not to display cookie and have the rules sorted by table and priority. Still it should be possible for the user to specify displayed fields. 

* Readability would benefit if the names of the commonly used fields (e.g. priority, table, n_packets) were headers of the columns in a table with flows and did not repeat in every flow. Output might be e.g. as follows:

  table  priority  in_port  match                action
  0      10        *        icmp_type=136,icmp6  NORMAL
  0      0         *                             drop

* It would also help if the in_port and output port numbers were translated to port names in the human-readable format.

Comment 11 qding 2017-11-29 02:45:04 UTC
Run all OVS cases as regression test

[root@dell-per730-04 openvswitch]# rpm -q openvswitch
openvswitch-2.8.0-4.el7fdb.x86_64
[root@dell-per730-25 ~]# ovs-ofctl dump-flows ovsbr0
 cookie=0x0, duration=0.023s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=100,ct_state=-trk,tcp actions=ct(table=1)
 cookie=0x0, duration=0.044s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,arp,in_port=10 actions=output:11
 cookie=0x0, duration=0.042s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,arp,in_port=11 actions=output:10
 cookie=0x0, duration=0.039s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,arp,in_port=20 actions=output:21
 cookie=0x0, duration=0.037s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,arp,in_port=21 actions=output:20
 cookie=0x0, duration=0.034s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,sctp,in_port=10 actions=output:11
 cookie=0x0, duration=0.031s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,sctp,in_port=11 actions=output:10
 cookie=0x0, duration=0.029s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,sctp,in_port=20 actions=output:21
 cookie=0x0, duration=0.026s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=10,sctp,in_port=21 actions=output:20
 cookie=0x0, duration=0.047s, table=0, n_packets=0, n_bytes=0, idle_age=0, priority=1 actions=drop
 cookie=0x0, duration=0.021s, table=1, n_packets=0, n_bytes=0, idle_age=0, ct_state=+new+trk,tcp,in_port=10,nw_src=16.0.0.0/24,nw_dst=48.0.0.0/16,tp_dst=80 actions=ct(commit),output:11
 cookie=0x0, duration=0.018s, table=1, n_packets=0, n_bytes=0, idle_age=0, ct_state=+new+trk,tcp,in_port=21,nw_src=16.0.0.0/24,nw_dst=48.0.0.0/16,tp_dst=80 actions=ct(commit),output:20
 cookie=0x0, duration=0.015s, table=1, n_packets=0, n_bytes=0, idle_age=0, ct_state=+est+trk,tcp,in_port=10 actions=output:11
 cookie=0x0, duration=0.013s, table=1, n_packets=0, n_bytes=0, idle_age=0, ct_state=+est+trk,tcp,in_port=11 actions=output:10
 cookie=0x0, duration=0.010s, table=1, n_packets=0, n_bytes=0, idle_age=0, ct_state=+est+trk,tcp,in_port=20 actions=output:21
 cookie=0x0, duration=0.007s, table=1, n_packets=0, n_bytes=0, idle_age=0, ct_state=+est+trk,tcp,in_port=21 actions=output:20
 cookie=0x0, duration=0.005s, table=1, n_packets=0, n_bytes=0, idle_age=0, ct_state=+inv+trk,tcp actions=drop
 cookie=0x0, duration=0.002s, table=1, n_packets=0, n_bytes=0, idle_age=0, actions=drop

Comment 16 Flavio Leitner 2018-02-16 13:11:47 UTC
Closing resolved bugs.