Skip to content

Commit

Permalink
ofproto-dpif: Fix inaccurate wildcard output in ofproto/trace.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
blp committed Jul 31, 2015
1 parent bb00fde commit ed5648b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions ofproto/ofproto-dpif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion tests/ofproto-dpif.at
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ed5648b

Please sign in to comment.