From 9499cebc539680c15118207c6b464209baba8121 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Mar 01 2025 00:39:03 +0000 Subject: Import openvswitch3.2-3.2.0-121 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.2.0.patch b/SOURCES/openvswitch-3.2.0.patch index c0c895b..432a15b 100644 --- a/SOURCES/openvswitch-3.2.0.patch +++ b/SOURCES/openvswitch-3.2.0.patch @@ -7661,7 +7661,7 @@ index 587caf5e3e..3fa03d3c95 100644 index.remove(val) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py -index 9fc2159b04..52f08e881a 100644 +index 9fc2159b04..6319009223 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -299,6 +299,7 @@ class Idl(object): @@ -7762,7 +7762,22 @@ index 9fc2159b04..52f08e881a 100644 if changed: return Notice(op, row, Row.from_json(self, table, uuid, old)) return False -@@ -1821,7 +1859,7 @@ class Transaction(object): +@@ -1691,7 +1729,7 @@ class Transaction(object): + and ovs.ovsuuid.is_valid_string(json[1])): + uuid = ovs.ovsuuid.from_string(json[1]) + row = self._txn_rows.get(uuid, None) +- if row and row._data is None: ++ if row and row._data is None and not row._persist_uuid: + return ["named-uuid", _uuid_name_from_uuid(uuid)] + else: + return [self._substitute_uuids(elem) for elem in json] +@@ -1816,12 +1854,12 @@ class Transaction(object): + else: + # Let ovsdb-server decide whether to really delete it. + pass +- elif row._changes: ++ else: + op = {"table": row._table.name} if row._data is None: op["op"] = "insert" if row._persist_uuid: @@ -9836,7 +9851,7 @@ index 9fbf5dc897..987e05103d 100644 OVS_START_SHELL_HELPERS diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at -index df5a9d2fd2..a914ccb7d1 100644 +index df5a9d2fd2..75fd590589 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -29,8 +29,8 @@ m4_define([OVSDB_START_IDLTEST], @@ -9883,7 +9898,23 @@ index df5a9d2fd2..a914ccb7d1 100644 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) OVSDB_SERVER_SHUTDOWN -@@ -747,6 +756,31 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple tables], +@@ -485,6 +494,15 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode], + 003: done + ]]) + ++OVSDB_CHECK_IDL([simple idl, inserting without modifying a column, insert_no_columns_changed], ++ [], ++ [['insert_no_columns_changed']], ++ [[000: empty ++001: commit, status=success ++002: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: done ++]]) ++ + m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT], + [AT_SETUP([$1 - Python3]) + AT_KEYWORDS([ovsdb server idl positive Python $5]) +@@ -747,6 +765,31 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple tables], 009: done ]]) @@ -9915,7 +9946,7 @@ index df5a9d2fd2..a914ccb7d1 100644 OVSDB_CHECK_IDL([self-linking idl, consistent ops], [], [['["idltest", -@@ -1274,6 +1308,33 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated], +@@ -1274,6 +1317,33 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated], 003: done ]]) @@ -9949,7 +9980,7 @@ index df5a9d2fd2..a914ccb7d1 100644 dnl This test creates database with weak references and checks that orphan dnl rows created for weak references are not available for iteration via dnl list of tracked changes. -@@ -1466,6 +1527,56 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl +@@ -1466,6 +1536,56 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl 006: done ]]) @@ -10006,7 +10037,7 @@ index df5a9d2fd2..a914ccb7d1 100644 dnl This test checks that deleting both the destination and source of the dnl reference doesn't remove the reference in the source tracked record. OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, weak references, multiple deletes], -@@ -1756,7 +1867,10 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-c +@@ -1756,7 +1876,10 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-c 007: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]] 008: After trying to delete a deleted element 009: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]] @@ -10018,7 +10049,7 @@ index df5a9d2fd2..a914ccb7d1 100644 ]]) OVSDB_CHECK_IDL_PY([partial-map idl], -@@ -1819,7 +1933,9 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-c +@@ -1819,7 +1942,9 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-c 009: table simple3: name=String2 uset=[<0>,<1>,<4>] uref=[] uuid=<2> 010: After add to other table + set of strong ref 011: table simple3: name=String2 uset=[<0>,<1>,<4>] uref=[<5>] uuid=<2> @@ -10029,7 +10060,7 @@ index df5a9d2fd2..a914ccb7d1 100644 ]]) OVSDB_CHECK_IDL_PY([partial-set idl], -@@ -1972,6 +2088,36 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], +@@ -1972,6 +2097,36 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], 015: done ]]) @@ -10066,7 +10097,7 @@ index df5a9d2fd2..a914ccb7d1 100644 # Tests to verify the functionality of the one column compound index. # It tests index for one column string and integer indexes. # The run of test-ovsdb generates the output of the display of data using the different indexes defined in -@@ -2332,6 +2478,23 @@ CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], +@@ -2332,6 +2487,23 @@ CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], [ssl6], [[[::1]]]) @@ -10090,7 +10121,7 @@ index df5a9d2fd2..a914ccb7d1 100644 # same as OVSDB_CHECK_IDL but uses Python IDL implementation with tcp # with multiple remotes to assert the idl connects to the leader of the Raft cluster m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], -@@ -2347,10 +2510,11 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], +@@ -2347,10 +2519,11 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], pids=$(cat s2.pid s3.pid s1.pid | tr '\n' ',') echo $pids AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t30 idl-cluster $srcdir/idltest.ovsschema $remotes $pids $3], @@ -10103,7 +10134,7 @@ index df5a9d2fd2..a914ccb7d1 100644 AT_CLEANUP]) OVSDB_CHECK_IDL_LEADER_ONLY_PY([Check Python IDL connects to leader], 3, ['remote']) -@@ -2393,6 +2557,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_C], +@@ -2393,6 +2566,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_C], AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]), [0], [$5]) m4_ifval([$8], [AT_CHECK([grep '$8' stderr], [1])], [], []) @@ -10111,7 +10142,7 @@ index df5a9d2fd2..a914ccb7d1 100644 AT_CLEANUP]) # Same as OVSDB_CHECK_CLUSTER_IDL_C but uses the Python IDL implementation. -@@ -2413,6 +2578,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_PY], +@@ -2413,6 +2587,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_PY], AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]), [0], [$5]) m4_if([$8], [AT_CHECK([grep '$8' stderr], [1])], [], []) @@ -10119,11 +10150,37 @@ index df5a9d2fd2..a914ccb7d1 100644 AT_CLEANUP]) m4_define([OVSDB_CHECK_CLUSTER_IDL], -@@ -2686,3 +2852,93 @@ OVSDB_CHECK_IDL_PERS_UUID_INSERT([simple idl, persistent uuid insert], +@@ -2637,7 +2812,7 @@ m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_C], + [0], [stdout], [stderr]) + AT_CHECK([sort stdout], + [0], [$3]) +- AT_CHECK([grep $4 stderr], [0], [ignore]) ++ m4_if([$4], [], [], [AT_CHECK([grep $4 stderr], [0], [ignore])]) + OVSDB_SERVER_SHUTDOWN + AT_CLEANUP]) + +@@ -2649,7 +2824,7 @@ m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_PY], + [0], [stdout], [stderr]) + AT_CHECK([sort stdout], + [0], [$3]) +- AT_CHECK([grep $4 stderr], [0], [ignore]) ++ m4_if([$4], [], [], [AT_CHECK([grep $4 stderr], [0], [ignore])]) + OVSDB_SERVER_SHUTDOWN + AT_CLEANUP]) + +@@ -2686,3 +2861,101 @@ OVSDB_CHECK_IDL_PERS_UUID_INSERT([simple idl, persistent uuid insert], 011: done ]], [['This UUID would duplicate a UUID already present within the table or deleted within the same transaction']]) + ++OVSDB_CHECK_IDL_PERS_UUID_INSERT([simple idl, persistent uuid insert uref], ++ [['insert_uuid_uref d7f2845f-2e8d-46a9-8330-f6d0b7d2ca36 689420a0-515b-4c0f-8eba-7ad59a344b54']], ++ [[000: empty ++001: commit, status=success ++002: table simple3: name= uset=[] uref=[689420a0-515b-4c0f-8eba-7ad59a344b54] uuid=d7f2845f-2e8d-46a9-8330-f6d0b7d2ca36 ++002: table simple4: name= uuid=689420a0-515b-4c0f-8eba-7ad59a344b54 ++003: done ++]]) + +m4_define([OVSDB_CHECK_IDL_CHANGE_AWARE], + [AT_SETUP([simple idl, database change aware, online conversion - $1]) @@ -13683,7 +13740,7 @@ index 08d2cbaebf..4e9a3ab5c2 100644 mp.max_link = n - 1; multipath_execute(&mp, &flow, &wc); diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c -index c761822e62..371dc7314b 100644 +index c761822e62..c96140e0ea 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c @@ -2023,6 +2023,24 @@ print_idl_row_updated_link2(const struct idltest_link2 *l2, int step) @@ -13771,7 +13828,65 @@ index c761822e62..371dc7314b 100644 if (!n) { print_and_log("%03d: empty", step); -@@ -2800,6 +2843,13 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2408,6 +2451,10 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) + struct ovsdb_idl_txn *txn; + enum ovsdb_idl_txn_status status; + bool increment = false; ++ /* FIXME: ovsdb_idl_check_consistency() doesn't currently handle refs added ++ * in the same txn, so if any op does this, we need to skip the check until ++ * that is fixed. */ ++ bool skip_pre_commit_consistency_check = false; + + txn = ovsdb_idl_txn_create(idl); + ovsdb_idl_check_consistency(idl); +@@ -2459,6 +2506,8 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) + + s = idltest_simple_insert(txn); + idltest_simple_set_i(s, atoi(arg1)); ++ } else if (!strcmp(name, "insert_no_columns_changed")) { ++ idltest_simple_insert(txn); + } else if (!strcmp(name, "insert_uuid")) { + struct idltest_simple *s; + +@@ -2472,6 +2521,26 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) + } + s = idltest_simple_insert_persist_uuid(txn, &s_uuid); + idltest_simple_set_i(s, atoi(arg2)); ++ } else if (!strcmp(name, "insert_uuid_uref")) { ++ struct idltest_simple3 *s3; ++ struct idltest_simple4 *s4; ++ ++ if (!arg1 || !arg2) { ++ ovs_fatal(0, ++ "\"insert_uuid_uref\" command requires 2 arguments"); ++ } ++ ++ struct uuid s3_uuid; ++ struct uuid s4_uuid; ++ if (!uuid_from_string(&s3_uuid, arg1) || ++ !uuid_from_string(&s4_uuid, arg2)) { ++ ovs_fatal( ++ 0, "\"insert_uuid_uref\" command requires 2 valid uuids"); ++ } ++ s4 = idltest_simple4_insert_persist_uuid(txn, &s4_uuid); ++ s3 = idltest_simple3_insert_persist_uuid(txn, &s3_uuid); ++ idltest_simple3_set_uref(s3, &s4, 1); ++ skip_pre_commit_consistency_check = true; + } else if (!strcmp(name, "delete")) { + const struct idltest_simple *s; + +@@ -2540,7 +2609,9 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) + } else { + ovs_fatal(0, "unknown command %s", name); + } +- ovsdb_idl_check_consistency(idl); ++ if (!skip_pre_commit_consistency_check) { ++ ovsdb_idl_check_consistency(idl); ++ } + } + + status = ovsdb_idl_txn_commit_block(txn); +@@ -2800,6 +2871,13 @@ do_idl(struct ovs_cmdl_context *ctx) } else { print_idl(idl, step++, terse); } @@ -13785,7 +13900,7 @@ index c761822e62..371dc7314b 100644 } seqno = ovsdb_idl_get_seqno(idl); -@@ -2970,6 +3020,29 @@ do_idl_partial_update_map_column(struct ovs_cmdl_context *ctx) +@@ -2970,6 +3048,29 @@ do_idl_partial_update_map_column(struct ovs_cmdl_context *ctx) printf("%03d: After trying to delete a deleted element\n", step++); dump_simple2(idl, myRow, step++); @@ -13815,7 +13930,7 @@ index c761822e62..371dc7314b 100644 ovsdb_idl_destroy(idl); printf("%03d: End test\n", step); } -@@ -3068,6 +3141,21 @@ do_idl_partial_update_set_column(struct ovs_cmdl_context *ctx) +@@ -3068,6 +3169,21 @@ do_idl_partial_update_set_column(struct ovs_cmdl_context *ctx) ovsdb_idl_get_initial_snapshot(idl); printf("%03d: After add to other table + set of strong ref\n", step++); dump_simple3(idl, myRow, step++); @@ -13838,7 +13953,7 @@ index c761822e62..371dc7314b 100644 printf("%03d: End test\n", step); } diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py -index a841adba4e..67a45f044b 100644 +index a841adba4e..fece1040c4 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -37,7 +37,7 @@ vlog.init(None) @@ -13901,7 +14016,14 @@ index a841adba4e..67a45f044b 100644 for value in json.values(): parse_uuids(value, symtab) -@@ -434,7 +446,7 @@ def idl_set(idl, commands, step): +@@ -429,14 +441,26 @@ def idl_set(idl, commands, step): + + s = txn.insert(idl.tables["simple"]) + s.i = int(args[0]) ++ elif name == "insert_no_columns_changed": ++ txn.insert(idl.tables["simple"]) + elif name == "insert_uuid": + if len(args) != 2: sys.stderr.write('"set" command requires 2 argument\n') sys.exit(1) @@ -13909,8 +14031,20 @@ index a841adba4e..67a45f044b 100644 + s = txn.insert(idl.tables["simple"], new_uuid=uuid.UUID(args[0]), persist_uuid=True) s.i = int(args[1]) ++ elif name == "insert_uuid_uref": ++ if len(args) != 2: ++ sys.stderr.write('"set" command requires 2 argument\n') ++ sys.exit(1) ++ ++ s4 = txn.insert(idl.tables["simple4"], new_uuid=uuid.UUID(args[1]), ++ persist_uuid=True) ++ s3 = txn.insert(idl.tables["simple3"], new_uuid=uuid.UUID(args[0]), ++ persist_uuid=True) ++ s3.uref = s4 elif name == "delete": -@@ -690,6 +702,9 @@ def do_idl(schema_file, remote, *commands): + if len(args) != 1: + sys.stderr.write('"delete" command requires 1 argument\n') +@@ -690,6 +714,9 @@ def do_idl(schema_file, remote, *commands): idl = ovs.db.idl.Idl(remote, schema_helper, leader_only=False) if "simple3" in idl.tables: idl.index_create("simple3", "simple3_by_name") @@ -13920,7 +14054,7 @@ index a841adba4e..67a45f044b 100644 if commands: remotes = remote.split(',') -@@ -757,16 +772,23 @@ def do_idl(schema_file, remote, *commands): +@@ -757,16 +784,23 @@ def do_idl(schema_file, remote, *commands): poller.block() else: # Wait for update. @@ -13952,7 +14086,7 @@ index a841adba4e..67a45f044b 100644 seqno = idl.change_seqno -@@ -1049,14 +1071,14 @@ def main(argv): +@@ -1049,14 +1083,14 @@ def main(argv): sys.exit(1) func, n_args = commands[command_name] diff --git a/SPECS/openvswitch3.2.spec b/SPECS/openvswitch3.2.spec index 576c500..3e77255 100644 --- a/SPECS/openvswitch3.2.spec +++ b/SPECS/openvswitch3.2.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.2.0 -Release: 120%{?dist} +Release: 121%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -763,6 +763,13 @@ exit 0 %endif %changelog +* Fri Feb 28 2025 Open vSwitch CI - 3.2.0-121 +- Merging upstream branch-3.2 [RH git: e48554605f] + Commit list: + c35ff51722 python: ovsdb-idl: Fix persist_uuid references. + 3db925a972 python: ovsdb-idl: Handle inserts w/o changes. + + * Thu Feb 27 2025 Open vSwitch CI - 3.2.0-120 - Merging upstream branch-3.2 [RH git: 3e91737540] Commit list: