From 995f7fe939ff6e2e13df94c3c8fd48db0e2937db Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Mar 21 2025 20:13:30 +0000 Subject: Import openvswitch3.3-3.3.4-104 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.3.0.patch b/SOURCES/openvswitch-3.3.0.patch index 52717d8..32f74e2 100644 --- a/SOURCES/openvswitch-3.3.0.patch +++ b/SOURCES/openvswitch-3.3.0.patch @@ -5234,7 +5234,7 @@ index 1cf4d5f7c9..818ef3a011 100644 } return; diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c -index f59d69c4d1..f6a80f1aec 100644 +index f59d69c4d1..ea02cd3a7a 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3669,6 +3669,16 @@ mirror_set__(struct ofproto *ofproto_, void *aux, @@ -5272,12 +5272,12 @@ index f59d69c4d1..f6a80f1aec 100644 + const char *type = netdev_get_type_from_name(devname); + const struct ofport *ofport = + shash_find_data(&ofproto->up.port_by_name, devname); - -- ofport = shash_find_data(&ofproto->up.port_by_name, devname); ++ + if (!type && ofport && ofport->netdev) { + type = netdev_get_type(ofport->netdev); + } -+ + +- ofport = shash_find_data(&ofproto->up.port_by_name, devname); + if (type) { ofproto_port->ofp_port = ofport ? ofport->ofp_port : OFPP_NONE; ofproto_port->name = xstrdup(devname); @@ -5295,6 +5295,53 @@ index f59d69c4d1..f6a80f1aec 100644 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); +@@ -5199,7 +5217,6 @@ group_set_selection_method(struct group_dpif *group) + const struct ofputil_group_props *props = &group->up.props; + const char *selection_method = props->selection_method; + +- VLOG_DBG("Constructing select group %"PRIu32, group->up.group_id); + if (selection_method[0] == '\0') { + VLOG_DBG("No selection method specified. Trying dp_hash."); + /* If the controller has not specified a selection method, check if +@@ -5266,6 +5283,7 @@ group_construct(struct ofgroup *group_) + group_construct_stats(group); + group->hash_map = NULL; + if (group->up.type == OFPGT11_SELECT) { ++ VLOG_DBG("Constructing select group %"PRIu32, group->up.group_id); + group_set_selection_method(group); + } + ovs_mutex_unlock(&group->stats_mutex); +@@ -5283,6 +5301,21 @@ group_destruct(struct ofgroup *group_) + } + } + ++static void ++group_modify(struct ofgroup *group_) ++{ ++ struct group_dpif *group = group_dpif_cast(group_); ++ ++ if (group->hash_map) { ++ free(group->hash_map); ++ group->hash_map = NULL; ++ } ++ if (group->up.type == OFPGT11_SELECT) { ++ VLOG_DBG("Modifying select group %"PRIu32, group->up.group_id); ++ group_set_selection_method(group); ++ } ++} ++ + static enum ofperr + group_get_stats(const struct ofgroup *group_, struct ofputil_group_stats *ogs) + { +@@ -6970,7 +7003,7 @@ const struct ofproto_class ofproto_dpif_class = { + group_construct, /* group_construct */ + group_destruct, /* group_destruct */ + group_dealloc, /* group_dealloc */ +- NULL, /* group_modify */ ++ group_modify, /* group_modify */ + group_get_stats, /* group_get_stats */ + get_datapath_version, /* get_datapath_version */ + get_datapath_cap, diff --git a/ovsdb/automake.mk b/ovsdb/automake.mk index eba713bb6d..d484fe9deb 100644 --- a/ovsdb/automake.mk @@ -6811,7 +6858,7 @@ index 55296e5593..0040a50b36 100644 AT_CHECK([ diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at -index e305e7b9cd..b89fe9559a 100644 +index e305e7b9cd..35b66e74f0 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -351,6 +351,49 @@ recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=ff: @@ -6991,7 +7038,7 @@ index e305e7b9cd..b89fe9559a 100644 AT_SETUP([ofproto-dpif - group actions have no effect afterwards]) OVS_VSWITCHD_START add_of_ports br0 1 10 -@@ -1132,6 +1281,60 @@ bucket3 >= 500 +@@ -1132,6 +1281,153 @@ bucket3 >= 500 OVS_VSWITCHD_STOP AT_CLEANUP @@ -7049,10 +7096,103 @@ index e305e7b9cd..b89fe9559a 100644 +OVS_VSWITCHD_STOP +AT_CLEANUP + ++AT_SETUP([ofproto-dpif - select group with dp_hash, insert/remove buckets]) ++ ++OVS_VSWITCHD_START ++add_of_ports br0 1 10 ++ ++AT_CHECK([ovs-appctl vlog/set ofproto_dpif:file:dbg]) ++ ++dnl Add a group without buckets. ++AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 \ ++ 'group_id=1235,type=select,selection_method=dp_hash']) ++AT_CHECK([grep -A3 "Constructing select group 1235" ovs-vswitchd.log \ ++ | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl ++ofproto_dpif|DBG|Constructing select group 1235 ++ofproto_dpif|DBG|Selection method specified: dp_hash. ++ofproto_dpif|DBG| Don't apply dp_hash method without buckets. ++ofproto_dpif|DBG|Falling back to default hash method. ++]) ++ ++m4_define([OFG_BUCKET], [bucket=weight=$1,bucket_id=$1,output:10]) ++ ++dnl Add two buckets one by one. ++get_log_next_line_num ++AT_CHECK([ovs-ofctl -O OpenFlow15 insert-buckets br0 \ ++ group_id=1235,command_bucket_id=last,OFG_BUCKET([5])]) ++AT_CHECK([tail -n +$LINENUM ovs-vswitchd.log | grep -E '(Bucket|group 1235)' \ ++ | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl ++ofproto_dpif|DBG|Constructing select group 1235 ++ofproto_dpif|DBG| Bucket 5: weight=5, target=16.00 hits=16 ++ofproto_dpif|DBG|Modifying select group 1235 ++ofproto_dpif|DBG| Bucket 5: weight=5, target=16.00 hits=16 ++]) ++get_log_next_line_num ++AT_CHECK([ovs-ofctl -O OpenFlow15 insert-buckets br0 \ ++ group_id=1235,command_bucket_id=last,OFG_BUCKET([6])]) ++AT_CHECK([tail -n +$LINENUM ovs-vswitchd.log | grep -E '(Bucket|group 1235)' \ ++ | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl ++ofproto_dpif|DBG|Constructing select group 1235 ++ofproto_dpif|DBG| Bucket 6: weight=6, target=16.00 hits=16 ++ofproto_dpif|DBG|Modifying select group 1235 ++ofproto_dpif|DBG| Bucket 5: weight=5, target=7.27 hits=7 ++ofproto_dpif|DBG| Bucket 6: weight=6, target=8.73 hits=9 ++]) ++dnl Add two more in the middle. ++get_log_next_line_num ++AT_CHECK([ovs-ofctl -O OpenFlow15 insert-buckets br0 \ ++ group_id=1235,command_bucket_id=5,OFG_BUCKET([7]),OFG_BUCKET([8])]) ++AT_CHECK([tail -n +$LINENUM ovs-vswitchd.log | grep -E '(Bucket|group 1235)' \ ++ | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl ++ofproto_dpif|DBG|Constructing select group 1235 ++ofproto_dpif|DBG| Bucket 7: weight=7, target=7.47 hits=7 ++ofproto_dpif|DBG| Bucket 8: weight=8, target=8.53 hits=9 ++ofproto_dpif|DBG|Modifying select group 1235 ++ofproto_dpif|DBG| Bucket 5: weight=5, target=3.08 hits=3 ++ofproto_dpif|DBG| Bucket 7: weight=7, target=4.31 hits=4 ++ofproto_dpif|DBG| Bucket 8: weight=8, target=4.92 hits=5 ++ofproto_dpif|DBG| Bucket 6: weight=6, target=3.69 hits=4 ++]) ++dnl Remove the last bucket. ++get_log_next_line_num ++AT_CHECK([ovs-ofctl -O OpenFlow15 remove-buckets br0 \ ++ group_id=1235,command_bucket_id=last]) ++AT_CHECK([tail -n +$LINENUM ovs-vswitchd.log | grep -E '(Bucket|group 1235)' \ ++ | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl ++ofproto_dpif|DBG|Constructing select group 1235 ++ofproto_dpif|DBG|Modifying select group 1235 ++ofproto_dpif|DBG| Bucket 5: weight=5, target=4.00 hits=4 ++ofproto_dpif|DBG| Bucket 7: weight=7, target=5.60 hits=6 ++ofproto_dpif|DBG| Bucket 8: weight=8, target=6.40 hits=6 ++]) ++dnl Remove the one in the middle. ++get_log_next_line_num ++AT_CHECK([ovs-ofctl -O OpenFlow15 remove-buckets br0 \ ++ group_id=1235,command_bucket_id=7]) ++AT_CHECK([tail -n +$LINENUM ovs-vswitchd.log | grep -E '(Bucket|group 1235)' \ ++ | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl ++ofproto_dpif|DBG|Constructing select group 1235 ++ofproto_dpif|DBG|Modifying select group 1235 ++ofproto_dpif|DBG| Bucket 5: weight=5, target=6.15 hits=6 ++ofproto_dpif|DBG| Bucket 8: weight=8, target=9.85 hits=10 ++]) ++dnl Remove all the remaining. ++get_log_next_line_num ++AT_CHECK([ovs-ofctl -O OpenFlow15 remove-buckets br0 \ ++ group_id=1235,command_bucket_id=all]) ++AT_CHECK([tail -n +$LINENUM ovs-vswitchd.log | grep -E '(Bucket|group 1235)' \ ++ | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl ++ofproto_dpif|DBG|Constructing select group 1235 ++ofproto_dpif|DBG|Modifying select group 1235 ++]) ++ ++OVS_VSWITCHD_STOP ++AT_CLEANUP ++ AT_SETUP([ofproto-dpif - select group with explicit dp_hash selection method]) OVS_VSWITCHD_START -@@ -5242,6 +5445,33 @@ AT_CHECK_UNQUOTED([tail -1 stdout], [0], +@@ -5242,6 +5538,33 @@ AT_CHECK_UNQUOTED([tail -1 stdout], [0], OVS_VSWITCHD_STOP AT_CLEANUP @@ -7086,7 +7226,7 @@ index e305e7b9cd..b89fe9559a 100644 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port]) AT_KEYWORDS([mirror mirrors mirroring]) OVS_VSWITCHD_START -@@ -6178,6 +6408,57 @@ AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc +@@ -6178,6 +6501,57 @@ AT_CHECK([test 1 = `$PYTHON3 "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc OVS_VSWITCHD_STOP AT_CLEANUP @@ -7144,7 +7284,7 @@ index e305e7b9cd..b89fe9559a 100644 AT_SETUP([ofproto-dpif - continuation with patch port]) AT_KEYWORDS([continuations pause resume]) OVS_VSWITCHD_START( -@@ -7653,12 +7934,14 @@ dummy@ovs-dummy: hit:0 missed:0 +@@ -7653,12 +8027,14 @@ dummy@ovs-dummy: hit:0 missed:0 vm1 5/3: (dummy: ifindex=2011) ]) @@ -7162,7 +7302,7 @@ index e305e7b9cd..b89fe9559a 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 +7952,13 @@ ovs-vsctl \ +@@ -7669,10 +8045,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 @@ -7178,7 +7318,7 @@ index e305e7b9cd..b89fe9559a 100644 ]) dnl add rule for int-br to force packet onto tunnel. There is no ifindex -@@ -8935,6 +9221,7 @@ AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using +@@ -8935,6 +9314,7 @@ AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using ], []) AT_CHECK([ovs-appctl time/stop]) AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) @@ -7186,7 +7326,7 @@ index e305e7b9cd..b89fe9559a 100644 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2]) AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3]) -@@ -9650,6 +9937,7 @@ m4_define([OFPROTO_DPIF_MEGAFLOW_DISABLED], +@@ -9650,6 +10030,7 @@ m4_define([OFPROTO_DPIF_MEGAFLOW_DISABLED], [AT_SETUP([ofproto-dpif megaflow - disabled$1]) OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])]) AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) @@ -7194,7 +7334,7 @@ index e305e7b9cd..b89fe9559a 100644 func=`printf '%s_' "$1" | cut -c 4-` add_${func}of_ports br0 1 2 AT_DATA([flows.txt], [dnl -@@ -12041,3 +12329,48 @@ AT_CHECK([test 1 = `ovs-ofctl parse-pcap p2-tx.pcap | wc -l`]) +@@ -12041,3 +12422,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 8c5f1cd..15d42c5 100644 --- a/SPECS/openvswitch3.3.spec +++ b/SPECS/openvswitch3.3.spec @@ -59,7 +59,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.3.4 -Release: 103%{?dist} +Release: 104%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -794,6 +794,12 @@ exit 0 %endif %changelog +* Fri Mar 21 2025 Open vSwitch CI - 3.3.0-104 +- Merging upstream branch-3.3 [RH git: 96844ab3e5] + Commit list: + 0a8f6beb54 ofproto-dpif: Fix dp_hash mapping after select group modification. () + + * Tue Mar 18 2025 Open vSwitch CI - 3.3.0-103 - Merging redhat subtree [RH git: 4e9f8bd3a0] Commit list: