During some recent face-to-face talks regarding debugging ovs, an issue
was raised regarding the output.  The gist of the conversation was that as
it stands, ovs output is less-than-friendly, and a different output would
be helpful.

Looking a bit into it, it appears that the output routines for most of the
openflow / ovs data uses the dynamic string library to just append as much
structure data as possible, in whatever form was originally useful.  This
is fine for ovs wizards, but some 'mere mortals' would prefer prettier
output with the ability to tweak / omit the data that comes out of the tools.

As an example, this was something that was requested to come out of ovs:

ID PKT       TAB PRI   MATCH                                                    
   ACT
0  44        0   1     in_port=gre-ac1da15d                                     
   resubmit(,3)
1  1         0   1     in_port=gre-ac1da15f                                     
   resubmit(,3)
2  40        0   1     in_port=patch-int                                        
   resubmit(,2)
3  0         0   1     in_port=vxlan-ac1da15d                                   
   resubmit(,4)
4  0         0   1     in_port=vxlan-ac1da15f                                   
   resubmit(,4)
5  0         0   0     *                                                        
   drop
6  40        2   0     dl_dst=00::00/01:00::00                                  
   resubmit(,20)
7  0         2   0     dl_dst=01:00::00/01:00::00                               
   resubmit(,22)
8  44        3   1     tun_id=0x2                                               
   mod_vlan_vid:1,resubmit(,10)
9  1         3   0     *                                                        
   drop
10 0         4   0     *                                                        
   drop
11 44        10  1     *                                                        
   
learn(table=20,hard_timeout=300,priority=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:0->NXM_OF_VLAN_TCI[],load:NXM_NX_TUN_ID[]->NXM_NX_TUN_ID[],output:NXM_OF_IN_PORT[]),output:patch-int
12 3         20  0     *                                                        
   resubmit(,22)
13 3         22  0                                                              
   strip_vlan,set_tunnel:0x2,output:gre-ac1da15f,output:gre-ac1da15d
14 0         22  0     *                                                        
   drop

To that end, I'd like to start working on a large refactoring series that will
give a flexible output for the various openvswitch utilities.  Posted is the
proposed underpinning datastructure to accomplish this - the ovs "printable
table".  I'm submitting this RFC to get early feedback to help steer the
direction for this work.  I expect the completed work will take quite a while.

The code itself is only complete insofar as it will compile, and run - no
serious debugging or instrumentation effort has gone into it.  It is also not
currently connected with the output of utilities such as ovs-ofctl, etc.  The
plan would be to update the ofp-print so that we can integrate it.

The table output should be flexible enough that we can continue to print out
data in the same way it currently is displayed (ie: backwards compatible),
while providing a way for the user to specify custom format strings that will
output the fields they are interested in.

To see the proposed framework in action, after running `make check`, you will
need to manually execute `./tests/ovstest test-util printable_table`.  The
expected output is::

Dilbert 1366.989990     =       22.299999       *       61.299999
Dogbert 142.199997      =       7.900000        *       18.000000
Walley  331.500000      =       51.000000       *       6.500000
PHB     6200.000000     =       155.000000      *       40.000000
Alice   1149.200073     =       22.100000       *       52.000000
Catbert 5000.000000     =       250.000000      *       20.000000

This can be tweaked by playing with the strings on lines 1193, and 1194 of
tests/test-util.c to change the output.

Aaron Conole (1):
  Printing Table Framework

 lib/util.c        | 326 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/util.h        |  56 ++++++++++
 tests/test-util.c |  49 ++++++++
 3 files changed, 431 insertions(+)

-- 
2.7.4

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to