From e724092f46dfecfa8ea6964c4fd6d3168c8c54a5 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Nov 30 2024 04:47:52 +0000 Subject: Import openvswitch3.1-3.1.0-151 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index a449467..e6fa7a0 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -3837,7 +3837,7 @@ index 0292f715ec..fbbea40053 100644 __cpuid_count(leaf, 0, regs[EAX], regs[EBX], regs[ECX], regs[EDX]); return (regs[reg] & ((uint32_t) 1 << bit)) != 0; diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c -index 134496ef3f..3a8068b12c 100644 +index 134496ef3f..eeb0e3851c 100644 --- a/lib/db-ctl-base.c +++ b/lib/db-ctl-base.c @@ -820,6 +820,7 @@ check_condition(const struct ovsdb_idl_table_class *table, @@ -3848,7 +3848,33 @@ index 134496ef3f..3a8068b12c 100644 goto out; } -@@ -1374,6 +1375,7 @@ set_column(const struct ovsdb_idl_table_class *table, +@@ -830,14 +831,10 @@ check_condition(const struct ovsdb_idl_table_class *table, + } else { + struct ovsdb_datum a; + ++ ovsdb_datum_init_empty(&a); + if (found) { + a.n = 1; + a.keys = &have_datum->values[idx]; +- a.values = NULL; +- } else { +- a.n = 0; +- a.keys = NULL; +- a.values = NULL; + } + + retval = evaluate_relop(&a, &b, &type, operator); +@@ -1159,8 +1156,8 @@ list_record(const struct ovsdb_idl_row *row, + + atom.uuid = row->uuid; + ++ ovsdb_datum_init_empty(&datum); + datum.keys = &atom; +- datum.values = NULL; + datum.n = 1; + + cell->json = ovsdb_datum_to_json(&datum, &ovsdb_type_uuid); +@@ -1374,6 +1371,7 @@ set_column(const struct ovsdb_idl_table_class *table, error = ovsdb_atom_from_string(&value, NULL, &column->type.value, value_string, symtab); if (error) { @@ -3856,7 +3882,7 @@ index 134496ef3f..3a8068b12c 100644 goto out; } -@@ -1492,7 +1494,7 @@ cmd_add(struct ctl_context *ctx) +@@ -1492,7 +1490,7 @@ cmd_add(struct ctl_context *ctx) const struct ovsdb_idl_column *column; const struct ovsdb_idl_row *row; const struct ovsdb_type *type; @@ -3865,7 +3891,7 @@ index 134496ef3f..3a8068b12c 100644 int i; ctx->error = get_table(table_name, &table); -@@ -1516,13 +1518,7 @@ cmd_add(struct ctl_context *ctx) +@@ -1516,13 +1514,7 @@ cmd_add(struct ctl_context *ctx) } type = &column->type; @@ -3880,7 +3906,7 @@ index 134496ef3f..3a8068b12c 100644 for (i = 4; i < ctx->argc; i++) { struct ovsdb_type add_type; struct ovsdb_datum add; -@@ -1533,41 +1529,23 @@ cmd_add(struct ctl_context *ctx) +@@ -1533,41 +1525,23 @@ cmd_add(struct ctl_context *ctx) ctx->error = ovsdb_datum_from_string(&add, &add_type, ctx->argv[i], ctx->symtab); if (ctx->error) { @@ -6935,6 +6961,39 @@ index 5fc312f8c0..fa353eab5c 100644 return ODP_FIT_ERROR; } else { *expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_ND; +diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c +index d7e5f542a0..9bf00416c3 100644 +--- a/lib/ofp-actions.c ++++ b/lib/ofp-actions.c +@@ -3400,21 +3400,21 @@ ofpact_put_set_field(struct ofpbuf *ofpacts, const struct mf_field *field, + struct ofpact_set_field *sf = ofpact_put_SET_FIELD(ofpacts); + sf->field = field; + +- /* Fill in the value and mask if given, otherwise put zeroes so that the +- * caller may fill in the value and mask itself. */ ++ /* Fill with all zeroes to make sure the padding is initialized. */ ++ ofpbuf_put_zeros(ofpacts, total_size); ++ sf = ofpacts->header; ++ ++ /* Fill in the value and mask if given, otherwise keep the zeroes ++ * so that the caller may fill in the value and mask itself. */ + if (value) { +- ofpbuf_put_uninit(ofpacts, total_size); +- sf = ofpacts->header; + memcpy(sf->value, value, field->n_bytes); + if (mask) { + memcpy(ofpact_set_field_mask(sf), mask, field->n_bytes); + } else { + memset(ofpact_set_field_mask(sf), 0xff, field->n_bytes); + } +- } else { +- ofpbuf_put_zeros(ofpacts, total_size); +- sf = ofpacts->header; + } ++ + /* Update length. */ + ofpact_finish_SET_FIELD(ofpacts, &sf); + diff --git a/lib/ofp-ct.c b/lib/ofp-ct.c index 85a9d8beca..a140fba470 100644 --- a/lib/ofp-ct.c @@ -7131,7 +7190,7 @@ index a75ad36b73..65bbfe8768 100644 if (inner_error) { char *s = ovsdb_error_to_string_free(inner_error); diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c -index 634fbb56df..d92df28d19 100644 +index 634fbb56df..4c2a3e3aa9 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -177,6 +177,7 @@ static void ovsdb_idl_row_mark_backrefs_for_reparsing(struct ovsdb_idl_row *); @@ -7142,7 +7201,18 @@ index 634fbb56df..d92df28d19 100644 static void ovsdb_idl_txn_abort_all(struct ovsdb_idl *); static bool ovsdb_idl_txn_extract_mutations(struct ovsdb_idl_row *, -@@ -1374,6 +1375,7 @@ ovsdb_idl_track_clear__(struct ovsdb_idl *idl, bool flush_all) +@@ -727,7 +728,9 @@ ovsdb_idl_check_consistency(const struct ovsdb_idl *idl) + size_t n_columns = shash_count(&row->table->columns); + for (size_t j = 0; j < n_columns; j++) { + const struct ovsdb_type *type = &class->columns[j].type; +- const struct ovsdb_datum *datum = &row->new_datum[j]; ++ const struct ovsdb_datum *datum; ++ ++ datum = ovsdb_idl_read(row, &class->columns[j]); + add_row_references(&type->key, + datum->keys, datum->n, &row->uuid, + &dsts, &n_dsts, &allocated_dsts); +@@ -1374,6 +1377,7 @@ ovsdb_idl_track_clear__(struct ovsdb_idl *idl, bool flush_all) row->updated = NULL; } ovsdb_idl_row_untrack_change(row); @@ -7150,7 +7220,7 @@ index 634fbb56df..d92df28d19 100644 if (ovsdb_idl_row_is_orphan(row)) { ovsdb_idl_row_unparse(row); -@@ -1632,6 +1634,7 @@ ovsdb_idl_process_update(struct ovsdb_idl_table *table, +@@ -1632,6 +1636,7 @@ ovsdb_idl_process_update(struct ovsdb_idl_table *table, ru->columns); } else if (ovsdb_idl_row_is_orphan(row)) { ovsdb_idl_row_untrack_change(row); @@ -7158,7 +7228,7 @@ index 634fbb56df..d92df28d19 100644 ovsdb_idl_insert_row(row, ru->columns); } else { VLOG_ERR_RL(&semantic_rl, "cannot add existing row "UUID_FMT" to " -@@ -2283,11 +2286,15 @@ ovsdb_idl_row_untrack_change(struct ovsdb_idl_row *row) +@@ -2283,11 +2288,15 @@ ovsdb_idl_row_untrack_change(struct ovsdb_idl_row *row) return; } @@ -7176,7 +7246,7 @@ index 634fbb56df..d92df28d19 100644 } static struct ovsdb_idl_row * -@@ -3776,6 +3783,8 @@ ovsdb_idl_txn_delete(const struct ovsdb_idl_row *row_) +@@ -3776,6 +3785,8 @@ ovsdb_idl_txn_delete(const struct ovsdb_idl_row *row_) ovsdb_idl_remove_from_indexes(row_); if (!row->old_datum) { ovsdb_idl_row_unparse(row); @@ -7501,6 +7571,30 @@ index 3eb3a3816b..b3f541b6db 100644 } else { ok = parse_sockaddr_components(ss, host, port, default_port, target_, resolve_host, dns_failure); +diff --git a/lib/stream-replay.c b/lib/stream-replay.c +index 21da5220ef..eb552a529e 100644 +--- a/lib/stream-replay.c ++++ b/lib/stream-replay.c +@@ -114,8 +114,8 @@ stream_replay_open_wfd(struct stream *s, int open_result, const char *name) + ovs_replay_unlock(); + + if (ovs_replay_write(f, NULL, -open_result, true)) { +- VLOG_ERR_RL(&rl, "%s: failed to write 'open' failure: %d", +- s->name, open_result); ++ VLOG_ERR_RL(&rl, "%s: failed to write 'open' result: %d", ++ name, open_result); + } + if (open_result) { + /* We recorded failure to open the stream. */ +@@ -343,7 +343,7 @@ pstream_replay_open_wfd(struct pstream *ps, int listen_result, + + if (ovs_replay_write(f, NULL, -listen_result, true)) { + VLOG_ERR_RL(&rl, "%s: failed to write 'listen' result: %d", +- ps->name, listen_result); ++ name, listen_result); + } + + if (listen_result) { diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c index 62da9febb6..86747e58ba 100644 --- a/lib/stream-ssl.c @@ -7520,6 +7614,28 @@ index 62da9febb6..86747e58ba 100644 #if OPENSSL_VERSION_NUMBER < 0x3000000fL SSL_CTX_set_tmp_dh_callback(ctx, tmp_dh_callback); #else +diff --git a/lib/stream.c b/lib/stream.c +index 71039e24f1..6f5821689e 100644 +--- a/lib/stream.c ++++ b/lib/stream.c +@@ -216,7 +216,7 @@ int + stream_open(const char *name, struct stream **streamp, uint8_t dscp) + { + const struct stream_class *class; +- struct stream *stream; ++ struct stream *stream = NULL; + char *suffix_copy; + int error; + +@@ -547,7 +547,7 @@ int + pstream_open(const char *name, struct pstream **pstreamp, uint8_t dscp) + { + const struct pstream_class *class; +- struct pstream *pstream; ++ struct pstream *pstream = NULL; + char *suffix_copy; + int error; + diff --git a/lib/table.c b/lib/table.c index 48d18b6518..b7addbf390 100644 --- a/lib/table.c @@ -8475,7 +8591,7 @@ index f579a5ca46..f023b10cdf 100644 /* A node within a next_ct_states list. */ diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c -index e05ffe3128..dccbc8208a 100644 +index e05ffe3128..adfd5502ef 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -47,17 +47,22 @@ @@ -8569,15 +8685,18 @@ index e05ffe3128..dccbc8208a 100644 error = ENOSPC; } out: -@@ -1766,6 +1787,7 @@ ukey_create__(const struct nlattr *key, size_t key_len, +@@ -1764,8 +1785,10 @@ ukey_create__(const struct nlattr *key, size_t key_len, + ukey->state_thread = ovsthread_id_self(); + ukey->state_where = OVS_SOURCE_LOCATOR; ukey->created = ukey->flow_time = time_msec(); ++ ukey->missed_dumps = 0; memset(&ukey->stats, 0, sizeof ukey->stats); ukey->stats.used = used; + ukey->dp_layer = NULL; ukey->xcache = NULL; ukey->offloaded = false; -@@ -1893,15 +1915,15 @@ try_ukey_replace(struct umap *umap, struct udpif_key *old_ukey, +@@ -1893,15 +1916,15 @@ try_ukey_replace(struct umap *umap, struct udpif_key *old_ukey, transition_ukey(old_ukey, UKEY_DELETED); transition_ukey(new_ukey, UKEY_VISIBLE); replaced = true; @@ -8598,7 +8717,7 @@ index e05ffe3128..dccbc8208a 100644 return replaced; } -@@ -2095,10 +2117,12 @@ ukey_delete(struct umap *umap, struct udpif_key *ukey) +@@ -2095,10 +2118,12 @@ ukey_delete(struct umap *umap, struct udpif_key *ukey) } static bool @@ -8613,7 +8732,7 @@ index e05ffe3128..dccbc8208a 100644 if (!used) { /* Always revalidate the first time a flow is dumped. */ -@@ -2125,8 +2149,12 @@ should_revalidate(const struct udpif *udpif, uint64_t packets, +@@ -2125,8 +2150,12 @@ should_revalidate(const struct udpif *udpif, uint64_t packets, duration = now - used; metric = duration / packets; @@ -8628,7 +8747,7 @@ index e05ffe3128..dccbc8208a 100644 return true; } return false; -@@ -2302,6 +2330,27 @@ exit: +@@ -2302,6 +2331,27 @@ exit: return result; } @@ -8656,7 +8775,7 @@ index e05ffe3128..dccbc8208a 100644 /* Verifies that the datapath actions of 'ukey' are still correct, and pushes * 'stats' for it. * -@@ -2324,7 +2373,7 @@ static enum reval_result +@@ -2324,7 +2374,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, @@ -8665,7 +8784,7 @@ index e05ffe3128..dccbc8208a 100644 OVS_REQUIRES(ukey->mutex) { bool need_revalidate = ukey->reval_seq != reval_seq; -@@ -2335,15 +2384,19 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, +@@ -2335,15 +2385,19 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, push.used = stats->used; push.tcp_flags = stats->tcp_flags; @@ -8692,7 +8811,7 @@ index e05ffe3128..dccbc8208a 100644 if (!ukey->xcache) { ukey->xcache = xlate_cache_new(); } else { -@@ -2359,7 +2412,7 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, +@@ -2359,7 +2413,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) { @@ -8701,7 +8820,7 @@ index e05ffe3128..dccbc8208a 100644 ukey->stats = *stats; ukey->reval_seq = reval_seq; } -@@ -2455,6 +2508,15 @@ push_dp_ops(struct udpif *udpif, struct ukey_op *ops, size_t n_ops) +@@ -2455,6 +2509,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; @@ -8717,7 +8836,7 @@ index e05ffe3128..dccbc8208a 100644 ovs_mutex_unlock(&op->ukey->mutex); } else { push = stats; -@@ -2759,6 +2821,22 @@ revalidate(struct revalidator *revalidator) +@@ -2759,6 +2822,22 @@ revalidate(struct revalidator *revalidator) continue; } @@ -8740,7 +8859,7 @@ index e05ffe3128..dccbc8208a 100644 already_dumped = ukey->dump_seq == dump_seq; if (already_dumped) { /* The flow has already been handled during this flow dump -@@ -2790,8 +2868,7 @@ revalidate(struct revalidator *revalidator) +@@ -2790,8 +2869,7 @@ revalidate(struct revalidator *revalidator) result = UKEY_DELETE; } else { result = revalidate_ukey(udpif, ukey, &stats, &odp_actions, @@ -8750,7 +8869,7 @@ index e05ffe3128..dccbc8208a 100644 } ukey->dump_seq = dump_seq; -@@ -2857,6 +2934,7 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge) +@@ -2857,6 +2935,7 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge) /* Handler threads could be holding a ukey lock while it installs a * new flow, so don't hang around waiting for access to it. */ if (ovs_mutex_trylock(&ukey->mutex)) { @@ -8758,7 +8877,7 @@ index e05ffe3128..dccbc8208a 100644 continue; } ukey_state = ukey->state; -@@ -2876,8 +2954,22 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge) +@@ -2876,8 +2955,22 @@ 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, @@ -8782,7 +8901,7 @@ index e05ffe3128..dccbc8208a 100644 if (result != UKEY_KEEP) { /* Clears 'recircs' if filled by revalidate_ukey(). */ reval_op_init(&ops[n_ops++], result, udpif, ukey, &recircs, -@@ -3111,11 +3203,19 @@ upcall_unixctl_purge(struct unixctl_conn *conn, int argc OVS_UNUSED, +@@ -3111,11 +3204,19 @@ upcall_unixctl_purge(struct unixctl_conn *conn, int argc OVS_UNUSED, struct udpif *udpif; LIST_FOR_EACH (udpif, list_node, &all_udpifs) { @@ -18617,6 +18736,18 @@ index a38bf9e6df..86a223caff 100644 printf("%s: %6d", prefix, reader_elapsed); for (i = 0; i < n_threads; i++) { printf(" %6" PRIu64, thread_working_ms[i]); +diff --git a/tests/test-multipath.c b/tests/test-multipath.c +index 08d2cbaebf..4e9a3ab5c2 100644 +--- a/tests/test-multipath.c ++++ b/tests/test-multipath.c +@@ -63,6 +63,7 @@ test_multipath_main(int argc, char *argv[]) + struct flow flow; + + flow_random_hash_fields(&flow); ++ flow_wildcards_init_catchall(&wc); + + mp.max_link = n - 1; + multipath_execute(&mp, &flow, &wc); diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c index 1bc5ac17a0..371dc7314b 100644 --- a/tests/test-ovsdb.c @@ -19891,6 +20022,19 @@ index fc8245bfb5..c5ad24fb70 100644 # Original inspiration from # http://stackoverflow.com/questions/10060500/bash-how-to-evaluate-ps1-ps2, # but changed quite a lot to make it more robust. +diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c +index 2f5ac1a262..2bb37b5ddf 100644 +--- a/utilities/ovs-vsctl.c ++++ b/utilities/ovs-vsctl.c +@@ -278,7 +278,7 @@ parse_options(int argc, char *argv[], struct shash *local_options) + ctl_add_cmd_options(&options, &n_options, &allocated_options, OPT_LOCAL); + + for (;;) { +- int idx; ++ int idx = INT_MAX; + int c; + + c = getopt_long(argc, argv, short_options, options, &idx); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index bfb2adef1d..087869ff8b 100644 --- a/vswitchd/bridge.c @@ -20099,6 +20243,19 @@ index 2b57fc0e3f..ec3d3356d3 100644 +diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c +index e5d99714de..b392981a04 100644 +--- a/vtep/vtep-ctl.c ++++ b/vtep/vtep-ctl.c +@@ -206,7 +206,7 @@ parse_options(int argc, char *argv[], struct shash *local_options) + ctl_add_cmd_options(&options, &n_options, &allocated_options, OPT_LOCAL); + + for (;;) { +- int idx; ++ int idx = INT_MAX; + int c; + + c = getopt_long(argc, argv, short_options, options, &idx); diff --git a/dpdk/.github/workflows/build.yml b/dpdk/.github/workflows/build.yml index 82d83f4030..c08f6ae827 100644 --- a/dpdk/.github/workflows/build.yml diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index 37dbf8a..3681f18 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: 150%{?dist} +Release: 151%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -759,6 +759,18 @@ exit 0 %endif %changelog +* Fri Nov 29 2024 Open vSwitch CI - 3.1.0-151 +- Merging upstream branch-3.1 [RH git: f94bfbed6b] + Commit list: + 87e11b31f9 ovsdb-idl: Fix use of uninitialized datum for graph consistency check. + cc45504378 db-ctl-base: Fix uninitialized datum fields while checking conditions. + 9cc0ce76d1 ofproto-dpif-upcall: Fix use of uninitialized missed dumps counter. + c278d2a168 ovs-vsctl, vtep-ctl: Silence memory sanitizer warning for longindex. + 1d0d5ac9c6 tests: multipath: Fix use of uninitialized wildcards. + 9d02d6e62c stream: replay: Fix potential NULL dereference on write failure. + ce779b4fec ofp-actions: Fix use of uninitialized padding in set-field. + + * Sat Nov 16 2024 Open vSwitch CI - 3.1.0-150 - Merging upstream branch-3.1 [RH git: 8f34adb6ca] Commit list: