On Wed, Oct 30, 2013 at 06:17:20PM +0900, Simon Horman wrote:
> Signed-off-by: Simon Horman <ho...@verge.net.au>

I adjusted this for highest-random weight, which just meant that I
changed the scoring function to:
            uint32_t score = (hash_int(i, basis) & 0xffff) * bucket->weight;
and then I adjusted the test, too, like this:

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 84ddbb9..2a2d325 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -118,9 +118,17 @@ OVS_VSWITCHD_START
 ADD_OF_PORTS([br0], [1], [10], [11])
 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 
'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip 
actions=write_actions(group:1234)'])
-AT_CHECK([ovs-appctl ofproto/trace br0 
'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'],
 [0], [stdout])
-AT_CHECK([tail -1 stdout], [0],
+
+# Try a bunch of different flows and make sure that they get distributed
+# at least somewhat.
+for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
+    AT_CHECK([ovs-appctl ofproto/trace br0 
"in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"],
 [0], [stdout])
+    tail -1 stdout >> results
+done
+sort results | uniq -c
+AT_CHECK([sort results | uniq], [0],
   [Datapath actions: 10
+Datapath actions: 11
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to