diff --git a/SOURCES/openvswitch-3.2.0.patch b/SOURCES/openvswitch-3.2.0.patch index 3486247..9eec134 100644 --- a/SOURCES/openvswitch-3.2.0.patch +++ b/SOURCES/openvswitch-3.2.0.patch @@ -5362,7 +5362,7 @@ index 47ea0f47e7..79d62a831a 100644 } return; diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c -index e22ca757ac..1796cb5414 100644 +index e22ca757ac..e8556569a9 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1255,7 +1255,7 @@ check_ct_eventmask(struct dpif_backer *backer) @@ -5437,6 +5437,19 @@ index e22ca757ac..1796cb5414 100644 if (error) { goto error_out; } +@@ -5138,8 +5154,10 @@ group_setup_dp_hash_table(struct group_dpif *group, size_t max_hash) + min_weight, total_weight); + + uint64_t min_slots = DIV_ROUND_UP(total_weight, min_weight); +- uint64_t min_slots2 = ROUND_UP_POW2(min_slots); +- uint64_t n_hash = MAX(16, min_slots2); ++ uint64_t min_slots2 = ++ MAX(min_slots, MIN(n_buckets * 4, MAX_SELECT_GROUP_HASH_VALUES)); ++ uint64_t min_slots3 = ROUND_UP_POW2(min_slots2); ++ uint64_t n_hash = MAX(16, min_slots3); + if (n_hash > MAX_SELECT_GROUP_HASH_VALUES || + (max_hash != 0 && n_hash > max_hash)) { + VLOG_DBG(" Too many hash values required: %"PRIu64, n_hash); diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 143ded6904..9f7b8b6e83 100644 --- a/ofproto/ofproto-provider.h @@ -7912,7 +7925,7 @@ index 14aa554169..6a07e23c64 100644 + AT_CLEANUP diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at -index f242f77f31..2bf568d7e3 100644 +index f242f77f31..e7810acd4a 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -547,6 +547,23 @@ ovs-appctl time/warp 1000 100 @@ -8042,7 +8055,68 @@ index f242f77f31..2bf568d7e3 100644 AT_SETUP([ofproto-dpif - group actions have no effect afterwards]) OVS_VSWITCHD_START add_of_ports br0 1 10 -@@ -5854,6 +5960,40 @@ OVS_WAIT_UNTIL([check_flows], [ovs-ofctl dump-flows br0]) +@@ -1132,6 +1238,60 @@ bucket3 >= 500 + OVS_VSWITCHD_STOP + AT_CLEANUP + ++AT_SETUP([ofproto-dpif - select group with dp_hash and equal weights]) ++ ++OVS_VSWITCHD_START ++add_of_ports br0 1 10 ++ ++AT_CHECK([ovs-appctl vlog/set ofproto_dpif:file:dbg vconn:file:info]) ++ ++AT_DATA([stddev.awk], [ ++ { ++ # $1 (target) is a mean value, because all weights are the same. ++ # $2 (hits) is an actual number of hashes assigned to this bucket. ++ n_hashes += $2 ++ n_buckets++ ++ sum_sq_diff += ($2 - $1) * ($2 - $1) ++ } ++ END { ++ mean = n_hashes / n_buckets ++ stddev = sqrt(sum_sq_diff / n_buckets) ++ stddevp = stddev * 100 / mean ++ ++ print "hashes:", n_hashes, "buckets:", n_buckets ++ print "mean:", mean, "stddev:", stddev, "(", stddevp, "% )" ++ ++ # Make sure that standard deviation of load between buckets is below 12.5%. ++ # Note: it's not a strict requirement, but a good number that passes tests. ++ if (stddevp <= 12.5) { print "PASS" } ++ else { print "FAIL" } ++ } ++]) ++ ++m4_define([CHECK_DISTRIBUTION], [ ++ AT_CHECK([tail -n $1 ovs-vswitchd.log | grep 'ofproto_dpif|DBG|.*Bucket' \ ++ | sed 's/.*target=\([[0-9\.]]*\) hits=\([[0-9]]*\)/\1 \2/' \ ++ | awk -f stddev.awk], [0], [stdout]) ++ AT_CHECK([grep -q "buckets: $2" stdout]) ++ AT_CHECK([grep -q 'PASS' stdout]) ++]) ++ ++m4_define([OF_GROUP], [group_id=$1,type=select,selection_method=dp_hash]) ++m4_define([OFG_BUCKET], [bucket=weight=$1,output:10]) ++ ++dnl Test load distribution in groups with up to 64 equally weighted buckets. ++m4_define([OFG_BUCKETS], [OFG_BUCKET(100)]) ++m4_for([id], [1], [64], [1], [ ++ get_log_next_line_num ++ AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 \ ++ "OF_GROUP(id),OFG_BUCKETS()"]) ++ CHECK_DISTRIBUTION([+$LINENUM], [id]) ++ m4_append([OFG_BUCKETS], [,OFG_BUCKET(100)]) ++]) ++ ++OVS_VSWITCHD_STOP ++AT_CLEANUP ++ + AT_SETUP([ofproto-dpif - select group with explicit dp_hash selection method]) + + OVS_VSWITCHD_START +@@ -5854,6 +6014,40 @@ OVS_WAIT_UNTIL([check_flows], [ovs-ofctl dump-flows br0]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -8083,7 +8157,7 @@ index f242f77f31..2bf568d7e3 100644 AT_SETUP([ofproto-dpif - debug_slow action]) OVS_VSWITCHD_START add_of_ports br0 1 2 3 -@@ -6144,6 +6284,57 @@ AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc +@@ -6144,6 +6338,57 @@ AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc OVS_VSWITCHD_STOP AT_CLEANUP @@ -8141,7 +8215,7 @@ index f242f77f31..2bf568d7e3 100644 AT_SETUP([ofproto-dpif - continuation with patch port]) AT_KEYWORDS([continuations pause resume]) OVS_VSWITCHD_START( -@@ -7619,12 +7810,14 @@ dummy@ovs-dummy: hit:0 missed:0 +@@ -7619,12 +7864,14 @@ dummy@ovs-dummy: hit:0 missed:0 vm1 5/3: (dummy: ifindex=2011) ]) @@ -8159,7 +8233,7 @@ index f242f77f31..2bf568d7e3 100644 dnl Prime ARP Cache for 1.1.2.92 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)']) -@@ -7635,10 +7828,13 @@ ovs-vsctl \ +@@ -7635,10 +7882,13 @@ ovs-vsctl \ --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \ header=128 sampling=1 polling=0 @@ -8175,7 +8249,7 @@ index f242f77f31..2bf568d7e3 100644 ]) dnl add rule for int-br to force packet onto tunnel. There is no ifindex -@@ -12007,3 +12203,48 @@ AT_CHECK([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`]) +@@ -12007,3 +12257,48 @@ AT_CHECK([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`]) OVS_VSWITCHD_STOP AT_CLEANUP diff --git a/SPECS/openvswitch3.2.spec b/SPECS/openvswitch3.2.spec index 1dc63ee..5774f57 100644 --- a/SPECS/openvswitch3.2.spec +++ b/SPECS/openvswitch3.2.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.2.0 -Release: 102%{?dist} +Release: 103%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -763,6 +763,12 @@ exit 0 %endif %changelog +* Mon Oct 07 2024 Open vSwitch CI - 3.2.0-103 +- Merging upstream branch-3.2 [RH git: 988c5180d6] + Commit list: + c2f2870130 ofproto-dpif: Improve load balancing in dp_hash select groups. (FDP-826) + + * Fri Sep 20 2024 Open vSwitch CI - 3.2.0-102 - Merging upstream branch-3.2 [RH git: 62e58d201b] Commit list: