From 3a2968f1d0a84ed22e49821eec81f043593e6121 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Jun 23 2023 17:55:17 +0000 Subject: Import openvswitch3.1-3.1.0-40 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index 1842a2f..0ffdff9 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -2673,7 +2673,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..89df92242 100644 +index e05ffe312..b44c72969 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -47,17 +47,20 @@ @@ -2763,7 +2763,35 @@ index e05ffe312..89df92242 100644 return true; } return false; -@@ -2324,7 +2346,7 @@ static enum reval_result +@@ -2302,6 +2324,27 @@ exit: + return result; + } + ++static void ++log_unexpected_stats_jump(struct udpif_key *ukey, ++ const struct dpif_flow_stats *stats) ++ OVS_REQUIRES(ukey->mutex) ++{ ++ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5); ++ struct ds ds = DS_EMPTY_INITIALIZER; ++ struct ofpbuf *actions; ++ ++ odp_format_ufid(&ukey->ufid, &ds); ++ ds_put_cstr(&ds, ", "); ++ odp_flow_key_format(ukey->key, ukey->key_len, &ds); ++ ds_put_cstr(&ds, ", actions:"); ++ actions = ovsrcu_get(struct ofpbuf *, &ukey->actions); ++ format_odp_actions(&ds, actions->data, actions->size, NULL); ++ VLOG_WARN_RL(&rll, "Unexpected jump in packet stats from %"PRIu64 ++ " to %"PRIu64" when handling ukey %s", ++ ukey->stats.n_packets, stats->n_packets, ds_cstr(&ds)); ++ ds_destroy(&ds); ++} ++ + /* Verifies that the datapath actions of 'ukey' are still correct, and pushes + * 'stats' for it. + * +@@ -2324,7 +2367,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, @@ -2772,24 +2800,34 @@ index e05ffe312..89df92242 100644 OVS_REQUIRES(ukey->mutex) { bool need_revalidate = ukey->reval_seq != reval_seq; -@@ -2342,8 +2364,15 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, - ? stats->n_bytes - ukey->stats.n_bytes - : 0); - +@@ -2335,15 +2378,19 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, + + push.used = stats->used; + push.tcp_flags = stats->tcp_flags; +- push.n_packets = (stats->n_packets > ukey->stats.n_packets +- ? stats->n_packets - ukey->stats.n_packets +- : 0); +- push.n_bytes = (stats->n_bytes > ukey->stats.n_bytes +- ? stats->n_bytes - ukey->stats.n_bytes +- : 0); ++ push.n_packets = stats->n_packets - ukey->stats.n_packets; ++ push.n_bytes = stats->n_bytes - ukey->stats.n_bytes; ++ + if (stats->n_packets < ukey->stats.n_packets && + ukey->stats.n_packets < UINT64_THREE_QUARTERS) { + /* Report cases where the packet counter is lower than the previous + * instance, but exclude the potential wrapping of an uint64_t. */ + COVERAGE_INC(ukey_invalid_stat_reset); ++ log_unexpected_stats_jump(ukey, stats); + } -+ + if (need_revalidate) { - if (should_revalidate(udpif, push.n_packets, ukey->stats.used)) { + if (should_revalidate(udpif, ukey, push.n_packets)) { if (!ukey->xcache) { ukey->xcache = xlate_cache_new(); } else { -@@ -2359,7 +2388,7 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, +@@ -2359,7 +2406,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) { @@ -2798,7 +2836,7 @@ index e05ffe312..89df92242 100644 ukey->stats = *stats; ukey->reval_seq = reval_seq; } -@@ -2455,6 +2484,15 @@ push_dp_ops(struct udpif *udpif, struct ukey_op *ops, size_t n_ops) +@@ -2455,6 +2502,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; @@ -2814,7 +2852,7 @@ index e05ffe312..89df92242 100644 ovs_mutex_unlock(&op->ukey->mutex); } else { push = stats; -@@ -2759,6 +2797,22 @@ revalidate(struct revalidator *revalidator) +@@ -2759,6 +2815,22 @@ revalidate(struct revalidator *revalidator) continue; } @@ -2837,7 +2875,7 @@ index e05ffe312..89df92242 100644 already_dumped = ukey->dump_seq == dump_seq; if (already_dumped) { /* The flow has already been handled during this flow dump -@@ -2790,8 +2844,7 @@ revalidate(struct revalidator *revalidator) +@@ -2790,8 +2862,7 @@ revalidate(struct revalidator *revalidator) result = UKEY_DELETE; } else { result = revalidate_ukey(udpif, ukey, &stats, &odp_actions, @@ -2847,7 +2885,7 @@ index e05ffe312..89df92242 100644 } ukey->dump_seq = dump_seq; -@@ -2876,7 +2929,7 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge) +@@ -2876,7 +2947,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, diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index cb7035d..7bcf5fd 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: 39%{?dist} +Release: 40%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -757,6 +757,12 @@ exit 0 %endif %changelog +* Fri Jun 23 2023 Open vSwitch CI - 3.1.0-40 +- Merging upstream branch-3.1 [RH git: 4ccf29c3a3] + Commit list: + aba1862d8b ofproto-dpif-upcall: Don't set statistics to 0 when they jump back. + + * Mon Jun 12 2023 Open vSwitch CI - 3.1.0-39 - Merging upstream branch-3.1 [RH git: a8358be74b] Commit list: