diff --git a/SOURCES/openvswitch-2.17.0.patch b/SOURCES/openvswitch-2.17.0.patch index d06651e..8df94e3 100644 --- a/SOURCES/openvswitch-2.17.0.patch +++ b/SOURCES/openvswitch-2.17.0.patch @@ -59412,7 +59412,7 @@ index 851088d794..2ba90e999c 100644 void xlate_bundle_set(struct ofproto_dpif *, struct ofbundle *, const char *name, enum port_vlan_mode, diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c -index 8143dd965f..f9562dee87 100644 +index 8143dd965f..b3e575bcd0 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -215,10 +215,6 @@ struct shash all_dpif_backers = SHASH_INITIALIZER(&all_dpif_backers); @@ -59426,7 +59426,64 @@ index 8143dd965f..f9562dee87 100644 static bool ofproto_use_tnl_push_pop = true; static void ofproto_unixctl_init(void); static void ct_zone_config_init(struct dpif_backer *backer); -@@ -1663,7 +1659,7 @@ static int +@@ -718,12 +714,6 @@ close_dpif_backer(struct dpif_backer *backer, bool del) + free(backer); + } + +-/* Datapath port slated for removal from datapath. */ +-struct odp_garbage { +- struct ovs_list list_node; +- odp_port_t odp_port; +-}; +- + static void check_support(struct dpif_backer *backer); + + static int +@@ -733,8 +723,6 @@ open_dpif_backer(const char *type, struct dpif_backer **backerp) + struct dpif_port_dump port_dump; + struct dpif_port port; + struct shash_node *node; +- struct ovs_list garbage_list; +- struct odp_garbage *garbage; + + struct sset names; + char *backer_name; +@@ -796,25 +784,23 @@ open_dpif_backer(const char *type, struct dpif_backer **backerp) + dpif_flow_flush(backer->dpif); + } + +- /* Loop through the ports already on the datapath and remove any +- * that we don't need anymore. */ +- ovs_list_init(&garbage_list); ++ /* Loop through the ports already on the datapath and find ones that are ++ * not on the initial OpenFlow ports list. These are stale ports, that we ++ * do not need anymore, or tunnel backing interfaces, that do not generally ++ * match the name of OpenFlow tunnel ports, or both. Add all of them to ++ * the list of tunnel backers. type_run() will garbage collect those that ++ * are not active tunnel backing interfaces during revalidation. */ + dpif_port_dump_start(&port_dump, backer->dpif); + while (dpif_port_dump_next(&port_dump, &port)) { + node = shash_find(&init_ofp_ports, port.name); + if (!node && strcmp(port.name, dpif_base_name(backer->dpif))) { +- garbage = xmalloc(sizeof *garbage); +- garbage->odp_port = port.port_no; +- ovs_list_push_front(&garbage_list, &garbage->list_node); ++ simap_put(&backer->tnl_backers, port.name, ++ odp_to_u32(port.port_no)); ++ backer->need_revalidate = REV_RECONFIGURE; + } + } + dpif_port_dump_done(&port_dump); + +- LIST_FOR_EACH_POP (garbage, list_node, &garbage_list) { +- dpif_port_del(backer->dpif, garbage->odp_port, false); +- free(garbage); +- } +- + shash_add(&all_dpif_backers, type, backer); + + check_support(backer); +@@ -1663,7 +1649,7 @@ static int construct(struct ofproto *ofproto_) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); @@ -59435,7 +59492,7 @@ index 8143dd965f..f9562dee87 100644 int error; /* Tunnel module can get used right after the udpif threads are running. */ -@@ -1701,7 +1697,7 @@ construct(struct ofproto *ofproto_) +@@ -1701,7 +1687,7 @@ construct(struct ofproto *ofproto_) ofproto->ams_seqno = seq_read(ofproto->ams_seq); @@ -59444,7 +59501,7 @@ index 8143dd965f..f9562dee87 100644 struct iface_hint *iface_hint = node->data; if (!strcmp(iface_hint->br_name, ofproto->up.name)) { -@@ -1720,9 +1716,6 @@ construct(struct ofproto *ofproto_) +@@ -1720,9 +1706,6 @@ construct(struct ofproto *ofproto_) hmap_insert(&all_ofproto_dpifs_by_name, &ofproto->all_ofproto_dpifs_by_name_node, hash_string(ofproto->up.name, 0)); @@ -59454,7 +59511,7 @@ index 8143dd965f..f9562dee87 100644 memset(&ofproto->stats, 0, sizeof ofproto->stats); ofproto_init_tables(ofproto_, N_TABLES); -@@ -1820,8 +1813,6 @@ destruct(struct ofproto *ofproto_, bool del) +@@ -1820,8 +1803,6 @@ destruct(struct ofproto *ofproto_, bool del) hmap_remove(&all_ofproto_dpifs_by_name, &ofproto->all_ofproto_dpifs_by_name_node); @@ -59463,7 +59520,7 @@ index 8143dd965f..f9562dee87 100644 OFPROTO_FOR_EACH_TABLE (table, &ofproto->up) { CLS_FOR_EACH (rule, up.cr, &table->cls) { -@@ -1857,6 +1848,8 @@ destruct(struct ofproto *ofproto_, bool del) +@@ -1857,6 +1838,8 @@ destruct(struct ofproto *ofproto_, bool del) seq_destroy(ofproto->ams_seq); @@ -59472,7 +59529,7 @@ index 8143dd965f..f9562dee87 100644 close_dpif_backer(ofproto->backer, del); } -@@ -1945,7 +1938,7 @@ run(struct ofproto *ofproto_) +@@ -1945,7 +1928,7 @@ run(struct ofproto *ofproto_) new_dump_seq = seq_read(udpif_dump_seq(ofproto->backer->udpif)); if (ofproto->dump_seq != new_dump_seq) { @@ -59481,7 +59538,7 @@ index 8143dd965f..f9562dee87 100644 long long now = time_msec(); /* We know stats are relatively fresh, so now is a good time to do some -@@ -1955,7 +1948,7 @@ run(struct ofproto *ofproto_) +@@ -1955,7 +1938,7 @@ run(struct ofproto *ofproto_) /* Expire OpenFlow flows whose idle_timeout or hard_timeout * has passed. */ ovs_mutex_lock(&ofproto_mutex); @@ -59490,7 +59547,7 @@ index 8143dd965f..f9562dee87 100644 &ofproto->up.expirable) { rule_expire(rule_dpif_cast(rule), now); } -@@ -2346,6 +2339,7 @@ set_ipfix( +@@ -2346,6 +2329,7 @@ set_ipfix( struct dpif_ipfix *di = ofproto->ipfix; bool has_options = bridge_exporter_options || flow_exporters_options; bool new_di = false; @@ -59498,7 +59555,7 @@ index 8143dd965f..f9562dee87 100644 if (has_options && !di) { di = ofproto->ipfix = dpif_ipfix_create(); -@@ -2355,7 +2349,7 @@ set_ipfix( +@@ -2355,7 +2339,7 @@ set_ipfix( if (di) { /* Call set_options in any case to cleanly flush the flow * caches in the last exporters that are to be destroyed. */ @@ -59507,7 +59564,7 @@ index 8143dd965f..f9562dee87 100644 di, bridge_exporter_options, flow_exporters_options, n_flow_exporters_options); -@@ -2371,6 +2365,10 @@ set_ipfix( +@@ -2371,6 +2355,10 @@ set_ipfix( dpif_ipfix_unref(di); ofproto->ipfix = NULL; } @@ -59518,7 +59575,7 @@ index 8143dd965f..f9562dee87 100644 } return 0; -@@ -2493,11 +2491,11 @@ set_lldp(struct ofport *ofport_, +@@ -2493,11 +2481,11 @@ set_lldp(struct ofport *ofport_, { struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); @@ -59532,7 +59589,7 @@ index 8143dd965f..f9562dee87 100644 ofport->lldp = lldp_create(ofport->up.netdev, ofport_->mtu, cfg); } -@@ -2509,6 +2507,9 @@ set_lldp(struct ofport *ofport_, +@@ -2509,6 +2497,9 @@ set_lldp(struct ofport *ofport_, } else if (ofport->lldp) { lldp_unref(ofport->lldp); ofport->lldp = NULL; @@ -59542,7 +59599,7 @@ index 8143dd965f..f9562dee87 100644 ofproto->backer->need_revalidate = REV_RECONFIGURE; } -@@ -3106,11 +3107,11 @@ bundle_flush_macs(struct ofbundle *bundle, bool all_ofprotos) +@@ -3106,11 +3097,11 @@ bundle_flush_macs(struct ofbundle *bundle, bool all_ofprotos) { struct ofproto_dpif *ofproto = bundle->ofproto; struct mac_learning *ml = ofproto->ml; @@ -59556,7 +59613,7 @@ index 8143dd965f..f9562dee87 100644 if (mac_entry_get_port(ml, mac) == bundle) { if (all_ofprotos) { struct ofproto_dpif *o; -@@ -3141,13 +3142,13 @@ bundle_move(struct ofbundle *old, struct ofbundle *new) +@@ -3141,13 +3132,13 @@ bundle_move(struct ofbundle *old, struct ofbundle *new) { struct ofproto_dpif *ofproto = old->ofproto; struct mac_learning *ml = ofproto->ml; @@ -59572,7 +59629,7 @@ index 8143dd965f..f9562dee87 100644 if (mac_entry_get_port(ml, mac) == old) { mac_entry_set_port(ml, mac, new); } -@@ -3244,7 +3245,7 @@ static void +@@ -3244,7 +3235,7 @@ static void bundle_destroy(struct ofbundle *bundle) { struct ofproto_dpif *ofproto; @@ -59581,7 +59638,7 @@ index 8143dd965f..f9562dee87 100644 if (!bundle) { return; -@@ -3257,7 +3258,7 @@ bundle_destroy(struct ofbundle *bundle) +@@ -3257,7 +3248,7 @@ bundle_destroy(struct ofbundle *bundle) xlate_bundle_remove(bundle); xlate_txn_commit(); @@ -59590,7 +59647,7 @@ index 8143dd965f..f9562dee87 100644 bundle_del_port(port); } -@@ -3347,9 +3348,7 @@ bundle_set(struct ofproto *ofproto_, void *aux, +@@ -3347,9 +3338,7 @@ bundle_set(struct ofproto *ofproto_, void *aux, } } if (!ok || ovs_list_size(&bundle->ports) != s->n_members) { @@ -59601,7 +59658,7 @@ index 8143dd965f..f9562dee87 100644 for (i = 0; i < s->n_members; i++) { if (s->members[i] == port->up.ofp_port) { goto found; -@@ -3963,6 +3962,10 @@ port_add(struct ofproto *ofproto_, struct netdev *netdev) +@@ -3963,6 +3952,10 @@ port_add(struct ofproto *ofproto_, struct netdev *netdev) simap_put(&ofproto->backer->tnl_backers, dp_port_name, odp_to_u32(port_no)); } @@ -59612,7 +59669,7 @@ index 8143dd965f..f9562dee87 100644 } if (netdev_get_tunnel_config(netdev)) { -@@ -4471,12 +4474,14 @@ rule_dpif_lookup_from_table(struct ofproto_dpif *ofproto, +@@ -4471,12 +4464,14 @@ rule_dpif_lookup_from_table(struct ofproto_dpif *ofproto, atomic_add_relaxed(&tbl->n_matched, stats->n_packets, &orig); } if (xcache) { @@ -59632,7 +59689,7 @@ index 8143dd965f..f9562dee87 100644 } return rule; } -@@ -4507,12 +4512,14 @@ rule_dpif_lookup_from_table(struct ofproto_dpif *ofproto, +@@ -4507,12 +4502,14 @@ rule_dpif_lookup_from_table(struct ofproto_dpif *ofproto, stats->n_packets, &orig); } if (xcache) { @@ -59652,7 +59709,7 @@ index 8143dd965f..f9562dee87 100644 } if (rule) { goto out; /* Match. */ -@@ -5550,9 +5557,9 @@ ct_zone_timeout_policy_sweep(struct dpif_backer *backer) +@@ -5550,9 +5547,9 @@ ct_zone_timeout_policy_sweep(struct dpif_backer *backer) { if (!ovs_list_is_empty(&backer->ct_tp_kill_list) && time_msec() >= timeout_policy_cleanup_timer) { @@ -59664,7 +59721,7 @@ index 8143dd965f..f9562dee87 100644 if (!ct_dpif_del_timeout_policy(backer->dpif, ct_tp->tp_id)) { ovs_list_remove(&ct_tp->list_node); ct_timeout_policy_destroy(ct_tp, backer->tp_ids); -@@ -5594,6 +5601,7 @@ ct_set_zone_timeout_policy(const char *datapath_type, uint16_t zone_id, +@@ -5594,6 +5591,7 @@ ct_set_zone_timeout_policy(const char *datapath_type, uint16_t zone_id, ct_timeout_policy_unref(backer, ct_zone->ct_tp); ct_zone->ct_tp = ct_tp; ct_tp->ref_count++; @@ -59672,7 +59729,7 @@ index 8143dd965f..f9562dee87 100644 } } else { struct ct_zone *new_ct_zone = ct_zone_alloc(zone_id); -@@ -5601,6 +5609,7 @@ ct_set_zone_timeout_policy(const char *datapath_type, uint16_t zone_id, +@@ -5601,6 +5599,7 @@ ct_set_zone_timeout_policy(const char *datapath_type, uint16_t zone_id, cmap_insert(&backer->ct_zones, &new_ct_zone->node, hash_int(zone_id, 0)); ct_tp->ref_count++; @@ -59680,7 +59737,7 @@ index 8143dd965f..f9562dee87 100644 } } -@@ -5617,6 +5626,7 @@ ct_del_zone_timeout_policy(const char *datapath_type, uint16_t zone_id) +@@ -5617,6 +5616,7 @@ ct_del_zone_timeout_policy(const char *datapath_type, uint16_t zone_id) if (ct_zone) { ct_timeout_policy_unref(backer, ct_zone->ct_tp); ct_zone_remove_and_destroy(backer, ct_zone); @@ -59688,7 +59745,7 @@ index 8143dd965f..f9562dee87 100644 } } -@@ -5818,15 +5828,7 @@ ofproto_dpif_lookup_by_name(const char *name) +@@ -5818,15 +5818,7 @@ ofproto_dpif_lookup_by_name(const char *name) struct ofproto_dpif * ofproto_dpif_lookup_by_uuid(const struct uuid *uuid) { @@ -66648,6 +66705,73 @@ index c3ee6990ca..7d2715c4a7 100644 AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl Miniflow extract implementation set to autovalidator. ]) +diff --git a/tests/system-interface.at b/tests/system-interface.at +index 784bada12c..3bf339582d 100644 +--- a/tests/system-interface.at ++++ b/tests/system-interface.at +@@ -63,3 +63,62 @@ AT_CHECK([ + [stdout], [Device "br-p1" does not exist.] + ) + AT_CLEANUP ++ ++AT_SETUP([interface - datapath ports garbage collection]) ++OVS_CHECK_GENEVE() ++OVS_TRAFFIC_VSWITCHD_START() ++ ++dnl Not relevant for userspace datapath. ++AT_SKIP_IF([! ovs-appctl dpctl/show | grep -q ovs-system]) ++ ++AT_CHECK([ovs-vsctl add-port br0 tunnel_port dnl ++ -- set Interface tunnel_port dnl ++ type=geneve options:remote_ip=flow options:key=123]) ++ ++AT_CHECK([ip link add ovs-veth0 type veth peer name ovs-veth1]) ++on_exit 'ip link del ovs-veth0' ++ ++AT_CHECK([ovs-vsctl add-port br0 ovs-veth0]) ++ ++OVS_WAIT_UNTIL([ip link show | grep -q " genev_sys_[[0-9]]*: .* ovs-system "]) ++ ++dnl Store the output of ip link for geneve port to compare ifindex later. ++AT_CHECK([ip link show | grep " genev_sys_[[0-9]]*: .* ovs-system " > geneve.0]) ++ ++AT_CHECK([ovs-appctl dpctl/show | grep port], [0], [dnl ++ port 0: ovs-system (internal) ++ port 1: br0 (internal) ++ port 2: genev_sys_6081 (geneve: packet_type=ptap) ++ port 3: ovs-veth0 ++]) ++ ++OVS_APP_EXIT_AND_WAIT_BY_TARGET([ovs-vswitchd], [ovs-vswitchd.pid]) ++ ++dnl Check that geneve backing interface is still in the datapath. ++AT_CHECK([ip link show | grep " genev_sys_[[0-9]]*: .* ovs-system " | diff -u - geneve.0]) ++ ++dnl Remove the veth port from the database while ovs-vswitchd is down. ++AT_CHECK([ovs-vsctl --no-wait del-port ovs-veth0]) ++ ++dnl Check that it is still tied to the OVS datapath. ++AT_CHECK([ip link show ovs-veth0 | grep -q ovs-system]) ++ ++dnl Bring ovs-vswitchd back up. ++AT_CHECK([ovs-vswitchd --detach --no-chdir --pidfile --log-file -vdpif:dbg], ++ [0], [], [stderr]) ++ ++dnl Wait for the veth port to be removed from the datapath. ++OVS_WAIT_WHILE([ip link show ovs-veth0 | grep -q ovs-system]) ++ ++AT_CHECK([ovs-appctl dpctl/show | grep port], [0], [dnl ++ port 0: ovs-system (internal) ++ port 1: br0 (internal) ++ port 2: genev_sys_6081 (geneve: packet_type=ptap) ++]) ++ ++dnl Check that geneve backing interface is still in the datapath and it wasn't ++dnl re-created, i.e. the ifindex is the same. ++AT_CHECK([ip link show | grep " genev_sys_[[0-9]]*: .* ovs-system " | diff -u - geneve.0]) ++ ++OVS_TRAFFIC_VSWITCHD_STOP ++AT_CLEANUP diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at index 86d633ac4f..f0aaae63eb 100644 --- a/tests/system-kmod-macros.at diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index 5090efb..46cae95 100644 --- a/SPECS/openvswitch2.17.spec +++ b/SPECS/openvswitch2.17.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.17.0 -Release: 67%{?dist} +Release: 68%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -748,6 +748,12 @@ exit 0 %endif %changelog +* Mon Feb 27 2023 Open vSwitch CI - 2.17.0-68 +- Merging upstream branch-2.17 [RH git: 33a871473f] + Commit list: + 8661abd4c4 ofproto: Fix re-creation of tunnel backing interfaces on restart. + + * Tue Feb 21 2023 Open vSwitch CI - 2.17.0-67 - Merging upstream branch-2.17 [RH git: 54dfe953e9] Commit list: