ofproto-dpif: Fix inaccurate wildcard output in ofproto/trace.
authorBen Pfaff <blp@nicira.com>
Fri, 31 Jul 2015 20:33:16 +0000 (13:33 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 31 Jul 2015 20:33:16 +0000 (13:33 -0700)
Until now, the ofproto/trace command has tried to accumulate wildcards
independently of flow translation.  This was unnecessary, and in a few
cases where flow translation drops wildcards, it meant that ofproto/trace
printed inaccurate wildcards (because it keep the wildcards that flow
translation dropped).

This updates a test case whose output is now more accurate.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif.c
tests/ofproto-dpif.at

index d06d765..5826c9f 100644 (file)
@@ -4464,7 +4464,6 @@ struct trace_ctx {
     struct xlate_in xin;
     const struct flow *key;
     struct flow flow;
-    struct flow_wildcards wc;
     struct ds *result;
 };
 
@@ -4548,8 +4547,7 @@ trace_format_megaflow(struct ds *result, int level, const char *title,
 
     ds_put_char_multiple(result, '\t', level);
     ds_put_format(result, "%s: ", title);
-    flow_wildcards_or(&trace->wc, &trace->xout.wc, &trace->wc);
-    match_init(&match, trace->key, &trace->wc);
+    match_init(&match, trace->key, &trace->xout.wc);
     match_format(&match, result, OFP_DEFAULT_PRIORITY);
     ds_put_char(result, '\n');
 }
@@ -4891,8 +4889,6 @@ ofproto_trace(struct ofproto_dpif *ofproto, struct flow *flow,
     flow_format(ds, flow);
     ds_put_char(ds, '\n');
 
-    flow_wildcards_init_catchall(&trace.wc);
-
     trace.result = ds;
     trace.key = flow; /* Original flow key, used for megaflow. */
     trace.flow = *flow; /* May be modified by actions. */
index 7000e4f..2656ca7 100644 (file)
@@ -270,7 +270,7 @@ table=2 in_port=1,icmp6,icmpv6_type=135 actions=set_field:fe80::4->nd_target,set
 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,icmp6,ipv6_src=fe80::1,ipv6_dst=fe80::2,nw_tos=0,nw_ttl=128,icmpv6_type=135,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11'], [0], [stdout])
 AT_CHECK([tail -4 stdout], [0],
-  [Megaflow: recirc_id=0,icmp6,in_port=1,nw_frag=no,icmp_type=135,icmp_code=0x0/0xff,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11
+  [Megaflow: recirc_id=0,icmp6,in_port=1,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11
 Datapath actions: 10,set(nd(target=fe80::4,sll=cc:cc:cc:cc:cc:cc)),11,set(nd(target=fe80::3,sll=aa:aa:aa:aa:aa:aa)),13
 This flow is handled by the userspace slow path because it:
        - Uses action(s) not supported by datapath.