On Thu, Jul 19, 2012 at 03:27:58PM +0900, Simon Horman wrote: > On Thu, Jul 19, 2012 at 10:08:50AM +0900, Simon Horman wrote: > > On Wed, Jul 18, 2012 at 10:21:50AM -0700, Ben Pfaff wrote: > > > On Wed, Jul 18, 2012 at 12:02:19PM +0900, Simon Horman wrote: > > > > Signed-off-by: Simon Horman <ho...@verge.net.au> > > > > > > When I apply this to master (currently 333be161abe78), I get the > > > following test failure. It isn't immediately obvious to me why this > > > change should have an effect on dl_vlan_pcp, so I'll leave it to you > > > to take a look and let me know. > > > > Thanks. I thought I had checked that all the tests pass. > > I'll look into this. > > After much confusion on my part I believe that I have found the problem. > > Expanding struct flow_wildcards causes the value hash returned > by flow_wildcards_hash() to change. This in turn causes the order > of flows in a NXST_FLOW_MONITOR reply (and probably elsewhere) to > be changed. > > I applied the _hack_ shown at the end of this email to test this theory: it > should return the same hash as before the ipv6_label_mask element was sdded > to struct flow_wildcards. The result was that the test in question passes. > > So witht his in mond I propose adding a hunk to this patch to > correct the test for the new hash in a new version of this patch. > > Alternateively, perhaps the test could be reverted to the state > it was in before I recently expanded it. Perhaps that would lead to > a stable test.
I'd rather not revert it. Here's a workaround. --8<--------------------------cut here-------------------------->8-- From: Ben Pfaff <b...@nicira.com> Date: Thu, 19 Jul 2012 08:42:21 -0700 Subject: [PATCH] tests: Avoid hash order sensitivity in "ofproto - flow monitoring" test. The order in which flows appear in an NXST_FLOW_MONITOR reply depends on the hash order, which makes it depend on the details of the hash and on system endianness. This avoids sensitivity to the order by sorting the results. Reported-by: Simon Horman <ho...@verge.net.au> Signed-off-by: Ben Pfaff <b...@nicira.com> --- tests/ofproto.at | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/ofproto.at b/tests/ofproto.at index 1135d37..2d28131 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -779,7 +779,24 @@ ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3 ovs-ofctl del-flows br0 dl_vlan=123 ovs-ofctl del-flows br0 ovs-appctl -t ovs-ofctl ofctl/barrier -AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], +sort=' + # Sorts groups of lines that start with a space, without moving them + # past the nearest line that does not start with a space. + use warnings; + use strict; + my @buffer = (); + while (<STDIN>) { + if (/^ /) { + push(@buffer, $_); + } else { + print $_ foreach sort(@buffer); + print $_; + @buffer = (); + } + } + print $_ foreach sort(@buffer); +' +AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | perl -e "$sort"], [0], [NXST_FLOW_MONITOR reply (xid=0x0): event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2 NXST_FLOW_MONITOR reply (xid=0x0): @@ -829,17 +846,17 @@ NXST_FLOW_MONITOR reply (xid=0x0): event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3 NXST_FLOW_MONITOR reply (xid=0x0): - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22 + event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20 + event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18 + event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14 + event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13 + event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21 + event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19 - event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23 OFPT_BARRIER_REPLY: ]) -- 1.7.2.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev