This series of patches makes the ofproto/trace show the megaflow fields
for each resubmit.

An exmaple is given below:

Setup:
ovs-vsctl add-br br0
ovs-vsctl add-port br0 p1 -- set Interface p1 ofport_request=1

ovs-ofctl add-flow br0 "table=0, dl_src=01:00:00:00:00:00/01:00:00:00:00:00, 
actions=drop"
ovs-ofctl add-flow br0 "table=0, dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0, 
actions=drop"
ovs-ofctl add-flow br0 "table=0, priority=0, actions=resubmit(,1)"
ovs-ofctl add-flow br0 "table=1, priority=99, in_port=1, vlan_tci=0, 
actions=mod_vlan_vid:10, resubmit(,2)"

Test:
ovs-appctl ofproto/trace br0 in_port=1

Output:
Flow: 
metadata=0,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000
Rule: table=0 cookie=0 priority=0
OpenFlow actions=resubmit(,1)

         Resubmitted flow: unchanged
         Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 
reg5=0x0 reg6=0x0 reg7=0x0
         Resubmitted  odp: drop
         Resubmitted megaflow: 
skb_priority=0,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00/01:00:00:00:00:00,dl_dst=00:00:00:00:00:00/ff:ff:ff:ff:ff:f0,dl_type=0x0000,nw_frag=no
         Rule: table=1 cookie=0 priority=99,in_port=1,vlan_tci=0x0000
         OpenFlow actions=mod_vlan_vid:10,resubmit(,2)

                  Resubmitted flow: 
metadata=0,in_port=1,dl_vlan=10,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000
                  Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 
reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0
                  Resubmitted  odp: drop
                  Resubmitted megaflow: 
skb_priority=0,in_port=1,dl_vlan=10,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00/01:00:00:00:00:00,dl_dst=00:00:00:00:00:00/ff:ff:ff:ff:ff:f0,dl_type=0x0000,nw_frag=no
                  No match

Final flow: unchanged
Megaflow: 
skb_priority=0,in_port=1,dl_vlan=10,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00/01:00:00:00:00:00,dl_dst=00:00:00:00:00:00/ff:ff:ff:ff:ff:f0,dl_type=0x0000,nw_frag=no
Datapath actions: drop

Description:
- The original flow is displayed first on top
- Resubmitted flow and final flow are the modified flow during xlate_actions()
- Resubmitted megaflow shows how the megaflow changes during xlate_actions()

Alex Wang (4):
  ofproto/trace: Use final flow to compute "Relevant fields".
  ofproto/trace: Remove the unused variables.
  ofproto/trace: Change output field name.
  ofproto/trace: Show megaflow fields in each resubmit.

 ofproto/ofproto-dpif-upcall.c |    5 +++--
 ofproto/ofproto-dpif-xlate.c  |   10 ++++++++--
 ofproto/ofproto-dpif-xlate.h  |    7 ++++++-
 ofproto/ofproto-dpif.c        |   36 ++++++++++++++++++++----------------
 4 files changed, 37 insertions(+), 21 deletions(-)

--
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to