From 3ef26cc0c599915cc8558adbbf18c91b10de20e1 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Oct 21 2023 05:14:24 +0000 Subject: Import openvswitch3.1-3.1.0-69 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index 63ce542..aae6daf 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -3791,7 +3791,7 @@ index 62da9febb..86747e58b 100644 SSL_CTX_set_tmp_dh_callback(ctx, tmp_dh_callback); #else diff --git a/lib/tc.c b/lib/tc.c -index 4c07e2216..270dc95ce 100644 +index 4c07e2216..0c0f07767 100644 --- a/lib/tc.c +++ b/lib/tc.c @@ -36,6 +36,7 @@ @@ -3909,7 +3909,48 @@ index 4c07e2216..270dc95ce 100644 return tc_transact(&request, NULL); } -@@ -3821,8 +3836,15 @@ tc_replace_flower(struct tcf_id *id, struct tc_flower *flower) +@@ -3720,15 +3735,13 @@ log_tc_flower_match(const char *msg, + + ds_put_cstr(&s, "\nExpected Actions:\n"); + for (i = 0, action = a->actions; i < a->action_count; i++, action++) { +- ds_put_cstr(&s, " - "); +- ds_put_hex(&s, action, sizeof *action); +- ds_put_cstr(&s, "\n"); ++ ds_put_format(&s, " - %d -\n", i); ++ ds_put_sparse_hex_dump(&s, action, sizeof *action, 0, false); + } +- ds_put_cstr(&s, "Received Actions:\n"); ++ ds_put_cstr(&s, "\nReceived Actions:\n"); + for (i = 0, action = b->actions; i < b->action_count; i++, action++) { +- ds_put_cstr(&s, " - "); +- ds_put_hex(&s, action, sizeof *action); +- ds_put_cstr(&s, "\n"); ++ ds_put_format(&s, " - %d -\n", i); ++ ds_put_sparse_hex_dump(&s, action, sizeof *action, 0, false); + } + } else { + /* Only dump the delta in actions. */ +@@ -3737,12 +3750,13 @@ log_tc_flower_match(const char *msg, + + for (int i = 0; i < a->action_count; i++, action_a++, action_b++) { + if (memcmp(action_a, action_b, sizeof *action_a)) { +- ds_put_format(&s, +- "\nAction %d mismatch:\n - Expected Action: ", +- i); +- ds_put_hex(&s, action_a, sizeof *action_a); +- ds_put_cstr(&s, "\n - Received Action: "); +- ds_put_hex(&s, action_b, sizeof *action_b); ++ ds_put_format(&s, "\nAction %d mismatch:\n" ++ " - Expected Action:\n", i); ++ ds_put_sparse_hex_dump(&s, action_a, sizeof *action_a, ++ 0, false); ++ ds_put_cstr(&s, " - Received Action:\n"); ++ ds_put_sparse_hex_dump(&s, action_b, sizeof *action_b, ++ 0, false); + } + } + } +@@ -3821,8 +3835,15 @@ tc_replace_flower(struct tcf_id *id, struct tc_flower *flower) error = tc_transact(&request, &reply); if (!error) { @@ -4294,7 +4335,7 @@ index 742eed399..f13478a88 100644 uint64_t export_time_usec; uint32_t export_time_sec; diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c -index e05ffe312..b44c72969 100644 +index e05ffe312..0fceeba18 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -47,17 +47,20 @@ @@ -4346,7 +4387,33 @@ index e05ffe312..b44c72969 100644 atomic_store_relaxed(&udpif->n_flows, flow_count); ovs_mutex_unlock(&udpif->n_flows_mutex); } else { -@@ -1766,6 +1781,7 @@ ukey_create__(const struct nlattr *key, size_t key_len, +@@ -972,7 +987,7 @@ udpif_revalidator(void *arg) + udpif->reval_exit = latch_is_set(&udpif->exit_latch); + + start_time = time_msec(); +- if (!udpif->reval_exit) { ++ if (!udpif->reval_exit && !udpif->pause) { + bool terse_dump; + + terse_dump = udpif_use_ufid(udpif); +@@ -981,10 +996,15 @@ udpif_revalidator(void *arg) + } + } + +- /* Wait for the leader to start the flow dump. */ ++ /* Wait for the leader to reach this point. */ + ovs_barrier_block(&udpif->reval_barrier); + if (udpif->pause) { + revalidator_pause(revalidator); ++ if (!udpif->reval_exit) { ++ /* The main thread resumed all validators, but the leader ++ * didn't start the dump, go to next iteration. */ ++ continue; ++ } + } + + if (udpif->reval_exit) { +@@ -1766,6 +1786,7 @@ ukey_create__(const struct nlattr *key, size_t key_len, ukey->created = ukey->flow_time = time_msec(); memset(&ukey->stats, 0, sizeof ukey->stats); ukey->stats.used = used; @@ -4354,7 +4421,7 @@ index e05ffe312..b44c72969 100644 ukey->xcache = NULL; ukey->offloaded = false; -@@ -2095,10 +2111,12 @@ ukey_delete(struct umap *umap, struct udpif_key *ukey) +@@ -2095,10 +2116,12 @@ ukey_delete(struct umap *umap, struct udpif_key *ukey) } static bool @@ -4369,7 +4436,7 @@ index e05ffe312..b44c72969 100644 if (!used) { /* Always revalidate the first time a flow is dumped. */ -@@ -2125,8 +2143,12 @@ should_revalidate(const struct udpif *udpif, uint64_t packets, +@@ -2125,8 +2148,12 @@ should_revalidate(const struct udpif *udpif, uint64_t packets, duration = now - used; metric = duration / packets; @@ -4384,7 +4451,7 @@ index e05ffe312..b44c72969 100644 return true; } return false; -@@ -2302,6 +2324,27 @@ exit: +@@ -2302,6 +2329,27 @@ exit: return result; } @@ -4412,7 +4479,7 @@ index e05ffe312..b44c72969 100644 /* Verifies that the datapath actions of 'ukey' are still correct, and pushes * 'stats' for it. * -@@ -2324,7 +2367,7 @@ static enum reval_result +@@ -2324,7 +2372,7 @@ static enum reval_result revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, const struct dpif_flow_stats *stats, struct ofpbuf *odp_actions, uint64_t reval_seq, @@ -4421,7 +4488,7 @@ index e05ffe312..b44c72969 100644 OVS_REQUIRES(ukey->mutex) { bool need_revalidate = ukey->reval_seq != reval_seq; -@@ -2335,15 +2378,19 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, +@@ -2335,15 +2383,19 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, push.used = stats->used; push.tcp_flags = stats->tcp_flags; @@ -4448,7 +4515,7 @@ index e05ffe312..b44c72969 100644 if (!ukey->xcache) { ukey->xcache = xlate_cache_new(); } else { -@@ -2359,7 +2406,7 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, +@@ -2359,7 +2411,7 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, /* Stats for deleted flows will be attributed upon flow deletion. Skip. */ if (result != UKEY_DELETE) { @@ -4457,7 +4524,7 @@ index e05ffe312..b44c72969 100644 ukey->stats = *stats; ukey->reval_seq = reval_seq; } -@@ -2455,6 +2502,15 @@ push_dp_ops(struct udpif *udpif, struct ukey_op *ops, size_t n_ops) +@@ -2455,6 +2507,15 @@ push_dp_ops(struct udpif *udpif, struct ukey_op *ops, size_t n_ops) push->tcp_flags = stats->tcp_flags | op->ukey->stats.tcp_flags; push->n_packets = stats->n_packets - op->ukey->stats.n_packets; push->n_bytes = stats->n_bytes - op->ukey->stats.n_bytes; @@ -4473,7 +4540,7 @@ index e05ffe312..b44c72969 100644 ovs_mutex_unlock(&op->ukey->mutex); } else { push = stats; -@@ -2759,6 +2815,22 @@ revalidate(struct revalidator *revalidator) +@@ -2759,6 +2820,22 @@ revalidate(struct revalidator *revalidator) continue; } @@ -4496,7 +4563,7 @@ index e05ffe312..b44c72969 100644 already_dumped = ukey->dump_seq == dump_seq; if (already_dumped) { /* The flow has already been handled during this flow dump -@@ -2790,8 +2862,7 @@ revalidate(struct revalidator *revalidator) +@@ -2790,8 +2867,7 @@ revalidate(struct revalidator *revalidator) result = UKEY_DELETE; } else { result = revalidate_ukey(udpif, ukey, &stats, &odp_actions, @@ -4506,7 +4573,7 @@ index e05ffe312..b44c72969 100644 } ukey->dump_seq = dump_seq; -@@ -2876,7 +2947,7 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge) +@@ -2876,7 +2952,7 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge) COVERAGE_INC(revalidate_missed_dp_flow); memcpy(&stats, &ukey->stats, sizeof stats); result = revalidate_ukey(udpif, ukey, &stats, &odp_actions, @@ -4515,6 +4582,26 @@ index e05ffe312..b44c72969 100644 } if (result != UKEY_KEEP) { /* Clears 'recircs' if filled by revalidate_ukey(). */ +@@ -3111,11 +3187,19 @@ upcall_unixctl_purge(struct unixctl_conn *conn, int argc OVS_UNUSED, + struct udpif *udpif; + + LIST_FOR_EACH (udpif, list_node, &all_udpifs) { ++ bool wake_up = false; + int n; + ++ if (!latch_is_set(&udpif->pause_latch)) { ++ udpif_pause_revalidators(udpif); ++ wake_up = true; ++ } + for (n = 0; n < udpif->n_revalidators; n++) { + revalidator_purge(&udpif->revalidators[n]); + } ++ if (wake_up) { ++ udpif_resume_revalidators(udpif); ++ } + } + unixctl_command_reply(conn, ""); + } diff --git a/ofproto/ofproto-dpif-xlate-cache.c b/ofproto/ofproto-dpif-xlate-cache.c index 9224ee2e6..2e1fcb3a6 100644 --- a/ofproto/ofproto-dpif-xlate-cache.c @@ -7740,10 +7827,10 @@ index c37852b21..81123f730 100644 ADD_NAMESPACES(at_ns0, at_ns1) diff --git a/tests/system-offloads-traffic.at b/tests/system-offloads-traffic.at -index d36da0580..8dd3bdf88 100644 +index d36da0580..1d02ce6c0 100644 --- a/tests/system-offloads-traffic.at +++ b/tests/system-offloads-traffic.at -@@ -742,3 +742,118 @@ recirc_id(),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:29, bytes +@@ -742,3 +742,116 @@ recirc_id(),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:29, bytes OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP @@ -7856,8 +7943,6 @@ index d36da0580..8dd3bdf88 100644 + +OVS_TRAFFIC_VSWITCHD_STOP(["/could not open network device ovs-p0/d +/on nonexistent port/d -+/failed to flow_get/d -+/Failed to acquire udpif_key/d +/No such device/d +/failed to offload flow/d +"]) diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index 9afe71e..2b9d45f 100644 --- a/SPECS/openvswitch3.1.spec +++ b/SPECS/openvswitch3.1.spec @@ -63,7 +63,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.1.0 -Release: 68%{?dist} +Release: 69%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -757,6 +757,13 @@ exit 0 %endif %changelog +* Fri Oct 20 2023 Open vSwitch CI - 3.1.0-69 +- Merging upstream branch-3.1 [RH git: 274c70054f] + Commit list: + 32ca3bd2c2 tc: Improve logging of mismatched actions. + f330d7a311 ofproto-dpif-upcall: Pause revalidators when purging. + + * Wed Oct 18 2023 Open vSwitch CI - 3.1.0-68 - Merging upstream branch-3.1 [RH git: 5862bfd2f9] Commit list: