From a48ae022033c897fddb7ff548ed7645de63f76c3 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Oct 08 2024 03:29:38 +0000 Subject: Import openvswitch3.3-3.3.0-54 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.3.0.patch b/SOURCES/openvswitch-3.3.0.patch index 76b58f1..b2465ab 100644 --- a/SOURCES/openvswitch-3.3.0.patch +++ b/SOURCES/openvswitch-3.3.0.patch @@ -3295,7 +3295,7 @@ index 1cf4d5f7c9..fec01aea1f 100644 } else { if (ctx->recirc_update_dp_hash) { diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c -index f59d69c4d1..7e300c3f97 100644 +index f59d69c4d1..f6a80f1aec 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3669,6 +3669,16 @@ mirror_set__(struct ofproto *ofproto_, void *aux, @@ -3343,6 +3343,19 @@ index f59d69c4d1..7e300c3f97 100644 ofproto_port->ofp_port = ofport ? ofport->ofp_port : OFPP_NONE; ofproto_port->name = xstrdup(devname); ofproto_port->type = xstrdup(type); +@@ -5150,8 +5166,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/ovsdb/automake.mk b/ovsdb/automake.mk index eba713bb6d..d484fe9deb 100644 --- a/ovsdb/automake.mk @@ -4736,7 +4749,7 @@ index 55296e5593..0040a50b36 100644 AT_CHECK([ diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at -index e305e7b9cd..8d4403b72a 100644 +index e305e7b9cd..d9c3334baa 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -547,6 +547,23 @@ ovs-appctl time/warp 1000 100 @@ -4866,7 +4879,68 @@ index e305e7b9cd..8d4403b72a 100644 AT_SETUP([ofproto-dpif - group actions have no effect afterwards]) OVS_VSWITCHD_START add_of_ports br0 1 10 -@@ -6178,6 +6284,57 @@ AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc +@@ -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 +@@ -6178,6 +6338,57 @@ AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc OVS_VSWITCHD_STOP AT_CLEANUP @@ -4924,7 +4998,7 @@ index e305e7b9cd..8d4403b72a 100644 AT_SETUP([ofproto-dpif - continuation with patch port]) AT_KEYWORDS([continuations pause resume]) OVS_VSWITCHD_START( -@@ -7653,12 +7810,14 @@ dummy@ovs-dummy: hit:0 missed:0 +@@ -7653,12 +7864,14 @@ dummy@ovs-dummy: hit:0 missed:0 vm1 5/3: (dummy: ifindex=2011) ]) @@ -4942,7 +5016,7 @@ index e305e7b9cd..8d4403b72a 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)']) -@@ -7669,10 +7828,13 @@ ovs-vsctl \ +@@ -7669,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 @@ -4958,7 +5032,7 @@ index e305e7b9cd..8d4403b72a 100644 ]) dnl add rule for int-br to force packet onto tunnel. There is no ifindex -@@ -12041,3 +12203,48 @@ AT_CHECK([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`]) +@@ -12041,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.3.spec b/SPECS/openvswitch3.3.spec index d7c5ed8..9d691b2 100644 --- a/SPECS/openvswitch3.3.spec +++ b/SPECS/openvswitch3.3.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.3.0 -Release: 53%{?dist} +Release: 54%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -769,6 +769,12 @@ exit 0 %endif %changelog +* Mon Oct 07 2024 Open vSwitch CI - 3.3.0-54 +- Merging upstream branch-3.3 [RH git: fecf6343f1] + Commit list: + 618944a79f ofproto-dpif: Improve load balancing in dp_hash select groups. (FDP-826) + + * Thu Oct 03 2024 Open vSwitch CI - 3.3.0-53 - Merging upstream branch-3.3 [RH git: d3700c65da] Commit list: