From dc19a3154d4a48f43c0d49330fcd50f68db41cc2 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Feb 08 2022 17:20:08 +0000 Subject: Import openvswitch2.13-2.13.0-156 from Fast DataPath --- diff --git a/SOURCES/openvswitch-2.13.0.patch b/SOURCES/openvswitch-2.13.0.patch index 085e0aa..7f6710b 100644 --- a/SOURCES/openvswitch-2.13.0.patch +++ b/SOURCES/openvswitch-2.13.0.patch @@ -85040,7 +85040,7 @@ index 30d1d08eba..00497d940c 100644 struct ovsdb_idl_class { diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c -index 190143f363..3fd500dec3 100644 +index 190143f363..ba73ea8d63 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -219,9 +219,12 @@ struct ovsdb_idl_db { @@ -85355,7 +85355,7 @@ index 190143f363..3fd500dec3 100644 } } -@@ -1610,6 +1709,73 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) +@@ -1610,6 +1709,94 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) return jsonrpc_create_request("monitor_cond_change", params, NULL); } @@ -85409,18 +85409,39 @@ index 190143f363..3fd500dec3 100644 + ovsdb_idl_condition_move(&table->ack_cond, &table->req_cond); + } + } else { -+ /* If there was no "unsent" condition but instead a -+ * monitor_cond_change request was in flight, move table->req_cond -+ * to table->new_cond and set db->cond_changed to trigger a new -+ * monitor_cond_change request. -+ * -+ * However, if a new condition has been set by the IDL client, -+ * monitor_cond_change will be sent anyway and will use the most -+ * recent table->new_cond so there's no need to update it here. -+ */ -+ if (table->req_cond && !table->new_cond) { -+ ovsdb_idl_condition_move(&table->new_cond, &table->req_cond); ++ if (table->req_cond) { ++ /* There was an in-flight monitor_cond_change request. It's no ++ * longer relevant in the restarted FSM, so clear it. */ ++ if (table->new_cond) { ++ /* We will send a new monitor_cond_change with the new ++ * condition. The previously in-flight condition is ++ * irrelevant and we can just forget about it. */ ++ ovsdb_idl_condition_destroy(table->req_cond); ++ table->req_cond = NULL; ++ } else { ++ /* The restarted FSM needs to again send a request for the ++ * previously in-flight condition. */ ++ ovsdb_idl_condition_move(&table->new_cond, ++ &table->req_cond); ++ } + db->cond_changed = true; ++ ++ /* There are two cases: ++ * a. either the server already processed the requested monitor ++ * condition change but the FSM was restarted before the ++ * client was notified. In this case the client should ++ * clear its local cache because it's out of sync with the ++ * monitor view on the server side. ++ * ++ * b. OR the server hasn't processed the requested monitor ++ * condition change yet. ++ * ++ * As there's no easy way to differentiate between the two, ++ * and given that this condition should be rare, reset the ++ * 'last_id', essentially flushing the local cached DB ++ * contents. ++ */ ++ db->last_id = UUID_ZERO; + } + } + } @@ -85429,7 +85450,7 @@ index 190143f363..3fd500dec3 100644 static void ovsdb_idl_send_cond_change(struct ovsdb_idl *idl) { -@@ -1739,7 +1905,7 @@ ovsdb_idl_track_add_all(struct ovsdb_idl *idl) +@@ -1739,7 +1926,7 @@ ovsdb_idl_track_add_all(struct ovsdb_idl *idl) } /* Returns true if 'table' has any tracked column. */ @@ -85438,7 +85459,7 @@ index 190143f363..3fd500dec3 100644 ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) { size_t i; -@@ -1753,29 +1919,37 @@ ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) +@@ -1753,29 +1940,37 @@ ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) } /* Returns the first tracked row in table with class 'table_class' @@ -85483,7 +85504,7 @@ index 190143f363..3fd500dec3 100644 return NULL; } -@@ -1808,7 +1982,7 @@ ovsdb_idl_track_is_updated(const struct ovsdb_idl_row *row, +@@ -1808,7 +2003,7 @@ ovsdb_idl_track_is_updated(const struct ovsdb_idl_row *row, * loop when it is ready to do ovsdb_idl_run() again. */ static void @@ -85492,7 +85513,7 @@ index 190143f363..3fd500dec3 100644 { size_t i; -@@ -1823,19 +1997,34 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) +@@ -1823,19 +2018,34 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) free(row->updated); row->updated = NULL; } @@ -85538,7 +85559,7 @@ index 190143f363..3fd500dec3 100644 } } } -@@ -1850,7 +2039,7 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) +@@ -1850,7 +2060,7 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) void ovsdb_idl_track_clear(struct ovsdb_idl *idl) { @@ -85547,7 +85568,7 @@ index 190143f363..3fd500dec3 100644 } static void -@@ -2064,13 +2253,15 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, +@@ -2064,13 +2274,15 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, monitor_request = json_object_create(); json_object_put(monitor_request, "columns", columns); @@ -85566,7 +85587,7 @@ index 190143f363..3fd500dec3 100644 } json_object_put(monitor_requests, tc->name, json_array_create_1(monitor_request)); -@@ -2078,8 +2269,6 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, +@@ -2078,8 +2290,6 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, } free_schema(schema); @@ -85575,7 +85596,7 @@ index 190143f363..3fd500dec3 100644 struct json *params = json_array_create_3( json_string_create(db->class_->database), json_clone(db->monitor_id), -@@ -2379,6 +2568,33 @@ ovsdb_idl_db_parse_update(struct ovsdb_idl_db *db, +@@ -2379,6 +2589,33 @@ ovsdb_idl_db_parse_update(struct ovsdb_idl_db *db, } } @@ -85609,7 +85630,7 @@ index 190143f363..3fd500dec3 100644 static struct ovsdb_idl_row * ovsdb_idl_get_row(struct ovsdb_idl_table *table, const struct uuid *uuid) { -@@ -2418,6 +2634,7 @@ ovsdb_idl_process_update(struct ovsdb_idl_table *table, +@@ -2418,6 +2655,7 @@ ovsdb_idl_process_update(struct ovsdb_idl_table *table, if (!row) { ovsdb_idl_insert_row(ovsdb_idl_row_create(table, uuid), new); } else if (ovsdb_idl_row_is_orphan(row)) { @@ -85617,7 +85638,7 @@ index 190143f363..3fd500dec3 100644 ovsdb_idl_insert_row(row, new); } else { VLOG_WARN_RL(&semantic_rl, "cannot add existing row "UUID_FMT" to " -@@ -2504,22 +2721,20 @@ ovsdb_idl_process_update2(struct ovsdb_idl_table *table, +@@ -2504,22 +2742,20 @@ ovsdb_idl_process_update2(struct ovsdb_idl_table *table, return true; } @@ -85638,19 +85659,19 @@ index 190143f363..3fd500dec3 100644 + const struct ovsdb_idl_arc *arc; + LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) { + struct ovsdb_idl_row *ref = arc->src; ++ ++ if (ovs_list_is_empty(&ref->track_node) && ++ ovsdb_idl_track_is_set(ref->table)) { - const struct ovsdb_idl_arc *arc; - LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) { - add_tracked_change_for_references(arc->src); -+ if (ovs_list_is_empty(&ref->track_node) && -+ ovsdb_idl_track_is_set(ref->table)) { -+ + ovsdb_idl_row_track_change(ref, OVSDB_IDL_CHANGE_MODIFY); + add_tracked_change_for_references(ref); } } } -@@ -2587,7 +2802,14 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json, +@@ -2587,7 +2823,14 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json, row->change_seqno[change] = row->table->change_seqno[change] = row->table->db->change_seqno + 1; @@ -85665,7 +85686,7 @@ index 190143f363..3fd500dec3 100644 add_tracked_change_for_references(row); if (!row->updated) { row->updated = bitmap_allocate(class->n_columns); -@@ -3021,7 +3243,7 @@ ovsdb_idl_row_clear_old(struct ovsdb_idl_row *row) +@@ -3021,7 +3264,7 @@ ovsdb_idl_row_clear_old(struct ovsdb_idl_row *row) { ovs_assert(row->old_datum == row->new_datum); if (!ovsdb_idl_row_is_orphan(row)) { @@ -85674,7 +85695,7 @@ index 190143f363..3fd500dec3 100644 row->tracked_old_datum = row->old_datum; } else { const struct ovsdb_idl_table_class *class = row->table->class_; -@@ -3104,6 +3326,32 @@ ovsdb_idl_row_reparse_backrefs(struct ovsdb_idl_row *row) +@@ -3104,6 +3347,32 @@ ovsdb_idl_row_reparse_backrefs(struct ovsdb_idl_row *row) } } @@ -85707,7 +85728,7 @@ index 190143f363..3fd500dec3 100644 static struct ovsdb_idl_row * ovsdb_idl_row_create__(const struct ovsdb_idl_table_class *class) { -@@ -3130,22 +3378,26 @@ ovsdb_idl_row_create(struct ovsdb_idl_table *table, const struct uuid *uuid) +@@ -3130,22 +3399,26 @@ ovsdb_idl_row_create(struct ovsdb_idl_table *table, const struct uuid *uuid) return row; } @@ -85744,7 +85765,7 @@ index 190143f363..3fd500dec3 100644 } } -@@ -3237,12 +3489,7 @@ ovsdb_idl_delete_row(struct ovsdb_idl_row *row) +@@ -3237,12 +3510,7 @@ ovsdb_idl_delete_row(struct ovsdb_idl_row *row) { ovsdb_idl_remove_from_indexes(row); ovsdb_idl_row_clear_arcs(row, true); @@ -85758,7 +85779,7 @@ index 190143f363..3fd500dec3 100644 } /* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false -@@ -4663,6 +4910,7 @@ ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn, +@@ -4663,6 +4931,7 @@ ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn, hmap_insert(&row->table->rows, &row->hmap_node, uuid_hash(&row->uuid)); hmap_insert(&txn->txn_rows, &row->txn_node, uuid_hash(&row->uuid)); ovsdb_idl_add_to_indexes(row); @@ -85766,7 +85787,7 @@ index 190143f363..3fd500dec3 100644 return row; } -@@ -5323,6 +5571,10 @@ void +@@ -5323,6 +5592,10 @@ void ovsdb_idl_loop_destroy(struct ovsdb_idl_loop *loop) { if (loop) { @@ -90285,7 +90306,7 @@ index 3a0bd4579e..cf43e9cf86 100644 done=0 for j in $(seq 0 $(expr $n1 - 1)); do diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at -index cc38d69c10..a1daf9a137 100644 +index cc38d69c10..6fbc56a1fc 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -12,25 +12,6 @@ ovsdb_start_idltest () { @@ -91591,7 +91612,7 @@ index cc38d69c10..a1daf9a137 100644 + 'condition simple [["i","==",2]]' \ + 'condition simple [["i","==",1]]' \ + '+reconnect' \ -+ '["idltest", ++ '?["idltest", + {"op": "update", + "table": "simple", + "where": [["i", "==", 1]], @@ -91602,7 +91623,7 @@ index cc38d69c10..a1daf9a137 100644 +003: table simple: i=2 r=1 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +004: change conditions +005: reconnect -+006: table simple: i=2 r=1 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++006: table simple +007: {"error":null,"result":[{"count":1}]} +008: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> +009: done @@ -92319,7 +92340,7 @@ index d7854a1df3..32a77392c6 100755 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c -index b1a4be36bb..a886f971e7 100644 +index b1a4be36bb..c4845956ca 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c @@ -19,6 +19,7 @@ @@ -92339,7 +92360,7 @@ index b1a4be36bb..a886f971e7 100644 struct test_ovsdb_pvt_context { bool track; }; -@@ -1844,164 +1847,319 @@ compare_link1(const void *a_, const void *b_) +@@ -1844,164 +1847,325 @@ compare_link1(const void *a_, const void *b_) return a->i < b->i ? -1 : a->i > b->i; } @@ -92358,7 +92379,8 @@ index b1a4be36bb..a886f971e7 100644 +} + +static char * -+format_idl_row(const struct ovsdb_idl_row *row, int step, const char *contents) ++format_idl_row(const struct ovsdb_idl_row *row, int step, const char *contents, ++ bool terse) +{ + const char *change_str = + !ovsdb_idl_track_is_set(row->table) @@ -92369,9 +92391,13 @@ index b1a4be36bb..a886f971e7 100644 + ? "deleted row: " + : ""; + -+ return xasprintf("%03d: table %s: %s%s uuid=" UUID_FMT, -+ step, row->table->class_->name, change_str, contents, -+ UUID_ARGS(&row->uuid)); ++ if (terse) { ++ return xasprintf("%03d: table %s", step, row->table->class_->name); ++ } else { ++ return xasprintf("%03d: table %s: %s%s uuid=" UUID_FMT, ++ step, row->table->class_->name, change_str, ++ contents, UUID_ARGS(&row->uuid)); ++ } +} + static void @@ -92477,7 +92503,14 @@ index b1a4be36bb..a886f971e7 100644 + ds_destroy(&updates); + } +} -+ + +- for (i = 0; i < IDLTEST_SINGLETON_N_COLUMNS; i++) { +- if (idltest_singleton_is_updated(sng, i)) { +- if (!updated) { +- printf("%03d: updated columns:", step); +- updated = true; +- } +- printf(" %s", idltest_singleton_columns[i].name); +static void +print_idl_row_updated_simple4(const struct idltest_simple4 *s4, int step) +{ @@ -92485,20 +92518,23 @@ index b1a4be36bb..a886f971e7 100644 + for (size_t i = 0; i < IDLTEST_SIMPLE4_N_COLUMNS; i++) { + if (idltest_simple4_is_updated(s4, i)) { + ds_put_format(&updates, " %s", idltest_simple4_columns[i].name); -+ } -+ } + } + } +- if (updated) { +- printf("\n"); + if (updates.length) { + print_and_log("%03d: table %s: updated columns:%s", + step, s4->header_.table->class_->name, + ds_cstr(&updates)); + ds_destroy(&updates); -+ } -+} + } + } -- for (i = 0; i < IDLTEST_SINGLETON_N_COLUMNS; i++) { -+static void + static void +-print_idl_row_simple(const struct idltest_simple *s, int step) +print_idl_row_updated_simple6(const struct idltest_simple6 *s6, int step) -+{ + { +- size_t i; + struct ds updates = DS_EMPTY_INITIALIZER; + for (size_t i = 0; i < IDLTEST_SIMPLE6_N_COLUMNS; i++) { + if (idltest_simple6_is_updated(s6, i)) { @@ -92518,35 +92554,26 @@ index b1a4be36bb..a886f971e7 100644 +{ + struct ds updates = DS_EMPTY_INITIALIZER; + for (size_t i = 0; i < IDLTEST_SINGLETON_N_COLUMNS; i++) { - if (idltest_singleton_is_updated(sng, i)) { -- if (!updated) { -- printf("%03d: updated columns:", step); -- updated = true; -- } -- printf(" %s", idltest_singleton_columns[i].name); ++ if (idltest_singleton_is_updated(sng, i)) { + ds_put_format(&updates, " %s", idltest_singleton_columns[i].name); - } - } -- if (updated) { -- printf("\n"); ++ } ++ } + if (updates.length) { + print_and_log("%03d: table %s: updated columns:%s", + step, sng->header_.table->class_->name, + ds_cstr(&updates)); + ds_destroy(&updates); - } - } ++ } ++} - static void - print_idl_row_simple(const struct idltest_simple *s, int step) - { -- size_t i; -- - printf("%03d: i=%"PRId64" r=%g b=%s s=%s u="UUID_FMT" ia=[", - step, s->i, s->r, s->b ? "true" : "false", - s->s, UUID_ARGS(&s->u)); - for (i = 0; i < s->n_ia; i++) { - printf("%s%"PRId64, i ? " " : "", s->ia[i]); ++static void ++print_idl_row_simple(const struct idltest_simple *s, int step, bool terse) ++{ + struct ds msg = DS_EMPTY_INITIALIZER; + ds_put_format(&msg, "i=%"PRId64" r=%g b=%s s=%s u="UUID_FMT" ia=[", + s->i, s->r, s->b ? "true" : "false", @@ -92585,7 +92612,7 @@ index b1a4be36bb..a886f971e7 100644 - printf("] uuid="UUID_FMT"\n", UUID_ARGS(&s->header_.uuid)); + ds_put_cstr(&msg, "]"); + -+ char *row_msg = format_idl_row(&s->header_, step, ds_cstr(&msg)); ++ char *row_msg = format_idl_row(&s->header_, step, ds_cstr(&msg), terse); + print_and_log("%s", row_msg); + ds_destroy(&msg); + free(row_msg); @@ -92594,7 +92621,8 @@ index b1a4be36bb..a886f971e7 100644 } static void - print_idl_row_link1(const struct idltest_link1 *l1, int step) +-print_idl_row_link1(const struct idltest_link1 *l1, int step) ++print_idl_row_link1(const struct idltest_link1 *l1, int step, bool terse) { - struct idltest_link1 **links; - size_t i; @@ -92625,7 +92653,7 @@ index b1a4be36bb..a886f971e7 100644 } - printf(" uuid="UUID_FMT"\n", UUID_ARGS(&l1->header_.uuid)); + -+ char *row_msg = format_idl_row(&l1->header_, step, ds_cstr(&msg)); ++ char *row_msg = format_idl_row(&l1->header_, step, ds_cstr(&msg), terse); + print_and_log("%s", row_msg); + ds_destroy(&msg); + free(row_msg); @@ -92634,7 +92662,8 @@ index b1a4be36bb..a886f971e7 100644 } static void - print_idl_row_link2(const struct idltest_link2 *l2, int step) +-print_idl_row_link2(const struct idltest_link2 *l2, int step) ++print_idl_row_link2(const struct idltest_link2 *l2, int step, bool terse) { - printf("%03d: i=%"PRId64" l1=", step, l2->i); + struct ds msg = DS_EMPTY_INITIALIZER; @@ -92645,7 +92674,7 @@ index b1a4be36bb..a886f971e7 100644 } - printf(" uuid="UUID_FMT"\n", UUID_ARGS(&l2->header_.uuid)); + -+ char *row_msg = format_idl_row(&l2->header_, step, ds_cstr(&msg)); ++ char *row_msg = format_idl_row(&l2->header_, step, ds_cstr(&msg), terse); + print_and_log("%s", row_msg); + ds_destroy(&msg); + free(row_msg); @@ -92653,9 +92682,12 @@ index b1a4be36bb..a886f971e7 100644 print_idl_row_updated_link2(l2, step); } -+static void -+print_idl_row_simple3(const struct idltest_simple3 *s3, int step) -+{ + static void +-print_idl_row_singleton(const struct idltest_singleton *sng, int step) ++print_idl_row_simple3(const struct idltest_simple3 *s3, int step, bool terse) + { +- printf("%03d: name=%s", step, sng->name); +- printf(" uuid="UUID_FMT"\n", UUID_ARGS(&sng->header_.uuid)); + struct ds msg = DS_EMPTY_INITIALIZER; + size_t i; + @@ -92673,7 +92705,7 @@ index b1a4be36bb..a886f971e7 100644 + } + ds_put_cstr(&msg, "]"); + -+ char *row_msg = format_idl_row(&s3->header_, step, ds_cstr(&msg)); ++ char *row_msg = format_idl_row(&s3->header_, step, ds_cstr(&msg), terse); + print_and_log("%s", row_msg); + ds_destroy(&msg); + free(row_msg); @@ -92682,12 +92714,12 @@ index b1a4be36bb..a886f971e7 100644 +} + +static void -+print_idl_row_simple4(const struct idltest_simple4 *s4, int step) ++print_idl_row_simple4(const struct idltest_simple4 *s4, int step, bool terse) +{ + struct ds msg = DS_EMPTY_INITIALIZER; + ds_put_format(&msg, "name=%s", s4->name); + -+ char *row_msg = format_idl_row(&s4->header_, step, ds_cstr(&msg)); ++ char *row_msg = format_idl_row(&s4->header_, step, ds_cstr(&msg), terse); + print_and_log("%s", row_msg); + ds_destroy(&msg); + free(row_msg); @@ -92696,7 +92728,7 @@ index b1a4be36bb..a886f971e7 100644 +} + +static void -+print_idl_row_simple6(const struct idltest_simple6 *s6, int step) ++print_idl_row_simple6(const struct idltest_simple6 *s6, int step, bool terse) +{ + struct ds msg = DS_EMPTY_INITIALIZER; + ds_put_format(&msg, "name=%s ", s6->name); @@ -92707,7 +92739,7 @@ index b1a4be36bb..a886f971e7 100644 + } + ds_put_cstr(&msg, "]"); + -+ char *row_msg = format_idl_row(&s6->header_, step, ds_cstr(&msg)); ++ char *row_msg = format_idl_row(&s6->header_, step, ds_cstr(&msg), terse); + print_and_log("%s", row_msg); + ds_destroy(&msg); + free(row_msg); @@ -92715,15 +92747,14 @@ index b1a4be36bb..a886f971e7 100644 + print_idl_row_updated_simple6(s6, step); +} + - static void - print_idl_row_singleton(const struct idltest_singleton *sng, int step) - { -- printf("%03d: name=%s", step, sng->name); -- printf(" uuid="UUID_FMT"\n", UUID_ARGS(&sng->header_.uuid)); ++static void ++print_idl_row_singleton(const struct idltest_singleton *sng, int step, ++ bool terse) ++{ + struct ds msg = DS_EMPTY_INITIALIZER; + ds_put_format(&msg, "name=%s", sng->name); + -+ char *row_msg = format_idl_row(&sng->header_, step, ds_cstr(&msg)); ++ char *row_msg = format_idl_row(&sng->header_, step, ds_cstr(&msg), terse); + print_and_log("%s", row_msg); + ds_destroy(&msg); + free(row_msg); @@ -92732,7 +92763,8 @@ index b1a4be36bb..a886f971e7 100644 } static void - print_idl(struct ovsdb_idl *idl, int step) +-print_idl(struct ovsdb_idl *idl, int step) ++print_idl(struct ovsdb_idl *idl, int step, bool terse) { + const struct idltest_simple3 *s3; + const struct idltest_simple4 *s4; @@ -92740,24 +92772,39 @@ index b1a4be36bb..a886f971e7 100644 const struct idltest_simple *s; const struct idltest_link1 *l1; const struct idltest_link2 *l2; -@@ -2020,49 +2178,65 @@ print_idl(struct ovsdb_idl *idl, int step) - print_idl_row_link2(l2, step); +@@ -2009,60 +2173,76 @@ print_idl(struct ovsdb_idl *idl, int step) + int n = 0; + + IDLTEST_SIMPLE_FOR_EACH (s, idl) { +- print_idl_row_simple(s, step); ++ print_idl_row_simple(s, step, terse); + n++; + } + IDLTEST_LINK1_FOR_EACH (l1, idl) { +- print_idl_row_link1(l1, step); ++ print_idl_row_link1(l1, step, terse); n++; } + IDLTEST_LINK2_FOR_EACH (l2, idl) { +- print_idl_row_link2(l2, step); ++ print_idl_row_link2(l2, step, terse); ++ n++; ++ } + IDLTEST_SIMPLE3_FOR_EACH (s3, idl) { -+ print_idl_row_simple3(s3, step); ++ print_idl_row_simple3(s3, step, terse); + n++; + } + IDLTEST_SIMPLE4_FOR_EACH (s4, idl) { -+ print_idl_row_simple4(s4, step); ++ print_idl_row_simple4(s4, step, terse); + n++; + } + IDLTEST_SIMPLE6_FOR_EACH (s6, idl) { -+ print_idl_row_simple6(s6, step); -+ n++; -+ } ++ print_idl_row_simple6(s6, step, terse); + n++; + } IDLTEST_SINGLETON_FOR_EACH (sng, idl) { - print_idl_row_singleton(sng, step); +- print_idl_row_singleton(sng, step); ++ print_idl_row_singleton(sng, step, terse); n++; } if (!n) { @@ -92768,7 +92815,7 @@ index b1a4be36bb..a886f971e7 100644 static void -print_idl_track(struct ovsdb_idl *idl, int step, unsigned int seqno) -+print_idl_track(struct ovsdb_idl *idl, int step) ++print_idl_track(struct ovsdb_idl *idl, int step, bool terse) { + const struct idltest_simple3 *s3; + const struct idltest_simple4 *s4; @@ -92784,7 +92831,7 @@ index b1a4be36bb..a886f971e7 100644 - } else { - print_idl_row_simple(s, step); - } -+ print_idl_row_simple(s, step); ++ print_idl_row_simple(s, step, terse); n++; } IDLTEST_LINK1_FOR_EACH_TRACKED (l1, idl) { @@ -92793,7 +92840,7 @@ index b1a4be36bb..a886f971e7 100644 - } else { - print_idl_row_link1(l1, step); - } -+ print_idl_row_link1(l1, step); ++ print_idl_row_link1(l1, step, terse); n++; } IDLTEST_LINK2_FOR_EACH_TRACKED (l2, idl) { @@ -92802,19 +92849,19 @@ index b1a4be36bb..a886f971e7 100644 - } else { - print_idl_row_link2(l2, step); - } -+ print_idl_row_link2(l2, step); - n++; - } -+ IDLTEST_SIMPLE3_FOR_EACH_TRACKED (s3, idl) { -+ print_idl_row_simple3(s3, step); ++ print_idl_row_link2(l2, step, terse); + n++; + } ++ IDLTEST_SIMPLE3_FOR_EACH_TRACKED (s3, idl) { ++ print_idl_row_simple3(s3, step, terse); + n++; + } + IDLTEST_SIMPLE4_FOR_EACH_TRACKED (s4, idl) { -+ print_idl_row_simple4(s4, step); ++ print_idl_row_simple4(s4, step, terse); + n++; + } + IDLTEST_SIMPLE6_FOR_EACH_TRACKED (s6, idl) { -+ print_idl_row_simple6(s6, step); ++ print_idl_row_simple6(s6, step, terse); + n++; + } + @@ -92824,7 +92871,7 @@ index b1a4be36bb..a886f971e7 100644 } } -@@ -2251,7 +2425,7 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) +@@ -2251,7 +2431,7 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) ovsdb_idl_check_consistency(idl); break; } else if (!strcmp(name, "destroy")) { @@ -92833,7 +92880,7 @@ index b1a4be36bb..a886f971e7 100644 ovsdb_idl_txn_destroy(txn); ovsdb_idl_check_consistency(idl); return; -@@ -2262,13 +2436,17 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) +@@ -2262,13 +2442,17 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) } status = ovsdb_idl_txn_commit_block(txn); @@ -92856,7 +92903,7 @@ index b1a4be36bb..a886f971e7 100644 ovsdb_idl_txn_destroy(txn); ovsdb_idl_check_consistency(idl); } -@@ -2282,6 +2460,12 @@ find_table_class(const char *name) +@@ -2282,6 +2466,12 @@ find_table_class(const char *name) return &idltest_table_link1; } else if (!strcmp(name, "link2")) { return &idltest_table_link2; @@ -92869,7 +92916,7 @@ index b1a4be36bb..a886f971e7 100644 } return NULL; } -@@ -2391,6 +2575,10 @@ update_conditions(struct ovsdb_idl *idl, char *commands) +@@ -2391,6 +2581,10 @@ update_conditions(struct ovsdb_idl *idl, char *commands) if (seqno == next_seqno ) { ovs_fatal(0, "condition unchanged"); } @@ -92880,7 +92927,7 @@ index b1a4be36bb..a886f971e7 100644 ovsdb_idl_condition_destroy(&cond); json_destroy(json); } -@@ -2436,7 +2624,7 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2436,7 +2630,7 @@ do_idl(struct ovs_cmdl_context *ctx) const char cond_s[] = "condition "; if (ctx->argc > 2 && strstr(ctx->argv[2], cond_s)) { update_conditions(idl, ctx->argv[2] + strlen(cond_s)); @@ -92889,16 +92936,32 @@ index b1a4be36bb..a886f971e7 100644 i = 3; } else { i = 2; -@@ -2465,7 +2653,7 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2445,6 +2639,13 @@ do_idl(struct ovs_cmdl_context *ctx) + char *arg = ctx->argv[i]; + struct jsonrpc_msg *request, *reply; + ++ bool terse = false; ++ if (*arg == '?') { ++ /* We're only interested in terse table contents. */ ++ terse = true; ++ arg++; ++ } ++ + if (*arg == '+') { + /* The previous transaction didn't change anything. */ + arg++; +@@ -2465,20 +2666,20 @@ do_idl(struct ovs_cmdl_context *ctx) /* Print update. */ if (track) { - print_idl_track(idl, step++, ovsdb_idl_get_seqno(idl)); -+ print_idl_track(idl, step++); ++ print_idl_track(idl, step++, terse); ovsdb_idl_track_clear(idl); } else { - print_idl(idl, step++); -@@ -2474,11 +2662,11 @@ do_idl(struct ovs_cmdl_context *ctx) +- print_idl(idl, step++); ++ print_idl(idl, step++, terse); + } + } seqno = ovsdb_idl_get_seqno(idl); if (!strcmp(arg, "reconnect")) { @@ -92912,7 +92975,7 @@ index b1a4be36bb..a886f971e7 100644 } else if (arg[0] != '[') { idl_set(idl, arg, step++); } else { -@@ -2489,13 +2677,17 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2489,13 +2690,17 @@ do_idl(struct ovs_cmdl_context *ctx) if (error || reply->error) { ovs_fatal(error, "jsonrpc transaction failed"); } @@ -92932,8 +92995,12 @@ index b1a4be36bb..a886f971e7 100644 } } ovsdb_symbol_table_destroy(symtab); -@@ -2515,7 +2707,7 @@ do_idl(struct ovs_cmdl_context *ctx) - print_idl(idl, step++); +@@ -2512,10 +2717,10 @@ do_idl(struct ovs_cmdl_context *ctx) + ovsdb_idl_wait(idl); + poll_block(); + } +- print_idl(idl, step++); ++ print_idl(idl, step++, false); ovsdb_idl_track_clear(idl); ovsdb_idl_destroy(idl); - printf("%03d: done\n", step); @@ -92941,7 +93008,7 @@ index b1a4be36bb..a886f971e7 100644 } static void -@@ -2625,27 +2817,6 @@ do_idl_partial_update_map_column(struct ovs_cmdl_context *ctx) +@@ -2625,34 +2830,13 @@ do_idl_partial_update_map_column(struct ovs_cmdl_context *ctx) printf("%03d: End test\n", step); } @@ -92969,8 +93036,25 @@ index b1a4be36bb..a886f971e7 100644 static void dump_simple3(struct ovsdb_idl *idl, const struct idltest_simple3 *myRow, + int step) + { + IDLTEST_SIMPLE3_FOR_EACH(myRow, idl) { +- print_idl_row_simple3(myRow, step); ++ print_idl_row_simple3(myRow, step, false); + } + } + +@@ -2794,7 +2978,7 @@ do_idl_compound_index_with_ref(struct ovs_cmdl_context *ctx) + idltest_simple3_index_set_uref(equal, &myRow2, 1); + printf("%03d: Query using index with reference\n", step++); + IDLTEST_SIMPLE3_FOR_EACH_EQUAL (myRow, equal, index) { +- print_idl_row_simple3(myRow, step++); ++ print_idl_row_simple3(myRow, step++, false); + } + idltest_simple3_index_destroy_row(equal); + diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py -index 1b94b79a07..72a319123e 100644 +index 1b94b79a07..123f89f081 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -28,6 +28,7 @@ import ovs.util @@ -93008,7 +93092,7 @@ index 1b94b79a07..72a319123e 100644 return get_simple_printable_row_string(row, simple_columns) -@@ -182,73 +189,118 @@ def get_simple2_table_printable_row(row): +@@ -182,73 +189,130 @@ def get_simple2_table_printable_row(row): def get_simple3_table_printable_row(row): @@ -93017,6 +93101,7 @@ index 1b94b79a07..72a319123e 100644 return get_simple_printable_row_string(row, simple3_columns) +-def print_idl(idl, step): +def get_simple4_table_printable_row(row): + simple4_columns = ["name"] + return get_simple_printable_row_string(row, simple4_columns) @@ -93056,13 +93141,16 @@ index 1b94b79a07..72a319123e 100644 + return "name=%s" % row.name + + -+def print_row(table, row, step, contents): -+ s = "%03d: table %s: %s " % (step, table, contents) -+ s += get_simple_printable_row_string(row, ["uuid"]) ++def print_row(table, row, step, contents, terse): ++ if terse: ++ s = "%03d: table %s" % (step, table) ++ else: ++ s = "%03d: table %s: %s " % (step, table, contents) ++ s += get_simple_printable_row_string(row, ["uuid"]) + print(s) + + - def print_idl(idl, step): ++def print_idl(idl, step, terse=False): n = 0 if "simple" in idl.tables: simple = idl.tables["simple"].rows @@ -93071,7 +93159,8 @@ index 1b94b79a07..72a319123e 100644 - s += get_simple_table_printable_row(row) - print(s) + print_row("simple", row, step, -+ get_simple_table_printable_row(row)) ++ get_simple_table_printable_row(row), ++ terse) n += 1 if "simple2" in idl.tables: @@ -93081,7 +93170,8 @@ index 1b94b79a07..72a319123e 100644 - s += get_simple2_table_printable_row(row) - print(s) + print_row("simple2", row, step, -+ get_simple2_table_printable_row(row)) ++ get_simple2_table_printable_row(row), ++ terse) n += 1 if "simple3" in idl.tables: @@ -93091,28 +93181,32 @@ index 1b94b79a07..72a319123e 100644 - s += get_simple3_table_printable_row(row) - print(s) + print_row("simple3", row, step, -+ get_simple3_table_printable_row(row)) ++ get_simple3_table_printable_row(row), ++ terse) + n += 1 + + if "simple4" in idl.tables: + simple4 = idl.tables["simple4"].rows + for row in simple4.values(): + print_row("simple4", row, step, -+ get_simple4_table_printable_row(row)) ++ get_simple4_table_printable_row(row), ++ terse) + n += 1 + + if "simple5" in idl.tables: + simple5 = idl.tables["simple5"].rows + for row in simple5.values(): + print_row("simple5", row, step, -+ get_simple5_table_printable_row(row)) ++ get_simple5_table_printable_row(row), ++ terse) + n += 1 + + if "simple6" in idl.tables: + simple6 = idl.tables["simple6"].rows + for row in simple6.values(): + print_row("simple6", row, step, -+ get_simple6_table_printable_row(row)) ++ get_simple6_table_printable_row(row), ++ terse) n += 1 if "link1" in idl.tables: @@ -93131,7 +93225,8 @@ index 1b94b79a07..72a319123e 100644 - s.append(" uuid=%s" % row.uuid) - print(''.join(s)) + print_row("link1", row, step, -+ get_link1_table_printable_row(row)) ++ get_link1_table_printable_row(row), ++ terse) n += 1 if "link2" in idl.tables: @@ -93145,7 +93240,8 @@ index 1b94b79a07..72a319123e 100644 - s.append(" uuid=%s" % row.uuid) - print(''.join(s)) + print_row("link2", row, step, -+ get_link2_table_printable_row(row)) ++ get_link2_table_printable_row(row), ++ terse) n += 1 if "singleton" in idl.tables: @@ -93157,11 +93253,12 @@ index 1b94b79a07..72a319123e 100644 - s.append(" uuid=%s" % row.uuid) - print(''.join(s)) + print_row("singleton", row, step, -+ get_singleton_table_printable_row(row)) ++ get_singleton_table_printable_row(row), ++ terse) n += 1 if not n: -@@ -303,6 +355,11 @@ def idltest_find_simple3(idl, i): +@@ -303,6 +367,11 @@ def idltest_find_simple3(idl, i): return next(idl.index_equal("simple3", "simple3_by_name", i), None) @@ -93173,7 +93270,7 @@ index 1b94b79a07..72a319123e 100644 def idl_set(idl, commands, step): txn = ovs.db.idl.Transaction(idl) increment = False -@@ -524,6 +581,12 @@ def idl_set(idl, commands, step): +@@ -524,6 +593,12 @@ def idl_set(idl, commands, step): setattr(new_row3, 'name', 'String3') new_row3.addvalue('uset', new_row41.uuid) assert len(getattr(new_row3, 'uset', [])) == 1 @@ -93186,7 +93283,7 @@ index 1b94b79a07..72a319123e 100644 else: sys.stderr.write("unknown command %s\n" % name) sys.exit(1) -@@ -616,7 +679,8 @@ def do_idl(schema_file, remote, *commands): +@@ -616,7 +691,8 @@ def do_idl(schema_file, remote, *commands): def mock_notify(event, row, updates=None): output = "%03d: " % step output += "event:" + str(event) + ", row={" @@ -93196,6 +93293,28 @@ index 1b94b79a07..72a319123e 100644 if updates is None: output += "None" else: +@@ -637,6 +713,12 @@ def do_idl(schema_file, remote, *commands): + step += 1 + + for command in commands: ++ terse = False ++ if command.startswith("?"): ++ # We're only interested in terse table contents. ++ terse = True ++ command = command[1:] ++ + if command.startswith("+"): + # The previous transaction didn't change anything. + command = command[1:] +@@ -650,7 +732,7 @@ def do_idl(schema_file, remote, *commands): + rpc.wait(poller) + poller.block() + +- print_idl(idl, step) ++ print_idl(idl, step, terse) + step += 1 + + seqno = idl.change_seqno diff --git a/tests/test-reconnect.c b/tests/test-reconnect.c index 5a14e7fe58..bf0463e25c 100644 --- a/tests/test-reconnect.c diff --git a/SPECS/openvswitch2.13.spec b/SPECS/openvswitch2.13.spec index 0922d65..f36f407 100644 --- a/SPECS/openvswitch2.13.spec +++ b/SPECS/openvswitch2.13.spec @@ -59,7 +59,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.13.0 -Release: 155%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} +Release: 156%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -715,6 +715,12 @@ exit 0 %endif %changelog +* Tue Feb 08 2022 Open vSwitch CI - 2.13.0-156 +- Merging upstream branch-2.13 [RH git: 8935857122] + Commit list: + 1760916f1a ovsdb-idl: Clear last_id on reconnect if condition changes in-flight. + + * Wed Feb 02 2022 Open vSwitch CI - 2.13.0-155 - Merging upstream branch-2.13 [RH git: 4d9e93b316] Commit list: