diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index 4347b19..d20db90 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -8875,7 +8875,7 @@ index a9cf3cbee0..73dd5d1910 100644 return; } diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c -index f87e27a8cd..0b06257a47 100644 +index f87e27a8cd..bdf130bd4d 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -714,12 +714,6 @@ close_dpif_backer(struct dpif_backer *backer, bool del) @@ -9024,6 +9024,19 @@ index f87e27a8cd..0b06257a47 100644 if (error) { goto error_out; } +@@ -5144,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 a84ddc1d06..9f7b8b6e83 100644 --- a/ofproto/ofproto-provider.h @@ -12216,7 +12229,7 @@ index 14aa554169..6a07e23c64 100644 + AT_CLEANUP diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at -index fa6111c1ed..fd87f97ead 100644 +index fa6111c1ed..4fef5dd2aa 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -547,6 +547,23 @@ ovs-appctl time/warp 1000 100 @@ -12382,7 +12395,68 @@ index fa6111c1ed..fd87f97ead 100644 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11 ]) OVS_VSWITCHD_STOP -@@ -1536,17 +1642,17 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +@@ -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 +@@ -1536,17 +1696,17 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout]) AT_CHECK([tail -4 stdout], [0], [ Final flow: ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1,nw_frag=no @@ -12403,7 +12477,7 @@ index fa6111c1ed..fd87f97ead 100644 Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4 ]) -@@ -1656,7 +1762,7 @@ AT_CHECK([ovs-vsctl -- \ +@@ -1656,7 +1816,7 @@ AT_CHECK([ovs-vsctl -- \ --id=@q2 create Queue dscp=2], [0], [ignore]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], @@ -12412,7 +12486,7 @@ index fa6111c1ed..fd87f97ead 100644 Datapath actions: dnl 100,dnl set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl -@@ -5349,7 +5455,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +@@ -5349,7 +5509,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout]) AT_CHECK_UNQUOTED([tail -1 stdout], [0], @@ -12421,7 +12495,7 @@ index fa6111c1ed..fd87f97ead 100644 ]) flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -@@ -5388,7 +5494,7 @@ flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x080 +@@ -5388,7 +5548,7 @@ flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x080 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout]) actual=`tail -1 stdout | sed 's/Datapath actions: //'` @@ -12430,7 +12504,7 @@ index fa6111c1ed..fd87f97ead 100644 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout]) mv stdout expout AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout]) -@@ -5656,7 +5762,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +@@ -5656,7 +5816,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout]) AT_CHECK_UNQUOTED([tail -1 stdout], [0], @@ -12439,7 +12513,7 @@ index fa6111c1ed..fd87f97ead 100644 ]) flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -@@ -5854,6 +5960,40 @@ OVS_WAIT_UNTIL([check_flows], [ovs-ofctl dump-flows br0]) +@@ -5854,6 +6014,40 @@ OVS_WAIT_UNTIL([check_flows], [ovs-ofctl dump-flows br0]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -12480,7 +12554,7 @@ index fa6111c1ed..fd87f97ead 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 @@ -12538,7 +12612,7 @@ index fa6111c1ed..fd87f97ead 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) ]) @@ -12556,7 +12630,7 @@ index fa6111c1ed..fd87f97ead 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 @@ -12572,7 +12646,7 @@ index fa6111c1ed..fd87f97ead 100644 ]) dnl add rule for int-br to force packet onto tunnel. There is no ifindex -@@ -11884,7 +12080,7 @@ ovs-ofctl dump-flows br0 +@@ -11884,7 +12134,7 @@ ovs-ofctl dump-flows br0 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) AT_CHECK([tail -3 stdout], [0], [dnl @@ -12581,7 +12655,7 @@ index fa6111c1ed..fd87f97ead 100644 Datapath actions: drop Translation failed (Recursion too deep), packet is dropped. ]) -@@ -11985,3 +12181,48 @@ AT_CHECK([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`]) +@@ -11985,3 +12235,48 @@ AT_CHECK([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`]) OVS_VSWITCHD_STOP AT_CLEANUP diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index 6d6bb46..77b7cb0 100644 --- a/SPECS/openvswitch3.1.spec +++ b/SPECS/openvswitch3.1.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.1.0 -Release: 132%{?dist} +Release: 133%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -756,6 +756,12 @@ exit 0 %endif %changelog +* Mon Oct 07 2024 Open vSwitch CI - 3.1.0-133 +- Merging upstream branch-3.1 [RH git: ce59df0fd1] + Commit list: + a0af48b753 ofproto-dpif: Improve load balancing in dp_hash select groups. (FDP-826) + + * Fri Sep 20 2024 Open vSwitch CI - 3.1.0-132 - Merging upstream branch-3.1 [RH git: 1d07e7a1d1] Commit list: