From ab4ade03559d1461d05a8e4fab7691cdce299c74 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Mar 01 2025 04:10:00 +0000 Subject: Import openvswitch3.4-3.4.2-55 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.4.0.patch b/SOURCES/openvswitch-3.4.0.patch index ac35254..b898ca8 100644 --- a/SOURCES/openvswitch-3.4.0.patch +++ b/SOURCES/openvswitch-3.4.0.patch @@ -2697,6 +2697,28 @@ index facd680ff3..354382f111 100644 } } +diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py +index c8cc543465..384428c3fc 100644 +--- a/python/ovs/db/idl.py ++++ b/python/ovs/db/idl.py +@@ -1731,7 +1731,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] +@@ -1856,7 +1856,7 @@ 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" diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index f129bc6462..8092fb5dbf 100644 --- a/rhel/openvswitch-fedora.spec.in @@ -3244,10 +3266,26 @@ index e2f4429ae5..2363b72aa8 100644 OVS_VSWITCHD_START diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at -index 9070ea051a..74ccaccdd2 100644 +index 9070ea051a..bdc1ed0276 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at -@@ -1881,7 +1881,10 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-c +@@ -494,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]) +@@ -1881,7 +1890,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]] @@ -3259,7 +3297,7 @@ index 9070ea051a..74ccaccdd2 100644 ]]) OVSDB_CHECK_IDL_PY([partial-map idl], -@@ -1944,7 +1947,9 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-c +@@ -1944,7 +1956,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> @@ -3270,6 +3308,39 @@ index 9070ea051a..74ccaccdd2 100644 ]]) OVSDB_CHECK_IDL_PY([partial-set idl], +@@ -2812,7 +2826,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]) + +@@ -2824,7 +2838,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]) + +@@ -2862,6 +2876,14 @@ OVSDB_CHECK_IDL_PERS_UUID_INSERT([simple idl, persistent uuid insert], + ]], + [['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 ++]]) + + OVSDB_CHECK_IDL_PY([simple idl, python, add_op], + [], diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at index e9be021f3f..7f029dbb07 100644 --- a/tests/system-common-macros.at @@ -5023,10 +5094,68 @@ 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 41c1525f45..710341b655 100644 +index 41c1525f45..8011850fdf 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c -@@ -3020,6 +3020,29 @@ do_idl_partial_update_map_column(struct ovs_cmdl_context *ctx) +@@ -2451,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); +@@ -2502,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; + +@@ -2515,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; + +@@ -2583,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); +@@ -3020,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++); @@ -5056,7 +5185,7 @@ index 41c1525f45..710341b655 100644 ovsdb_idl_destroy(idl); printf("%03d: End test\n", step); } -@@ -3118,6 +3141,21 @@ do_idl_partial_update_set_column(struct ovs_cmdl_context *ctx) +@@ -3118,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++); @@ -5078,6 +5207,37 @@ index 41c1525f45..710341b655 100644 ovsdb_idl_destroy(idl); printf("%03d: End test\n", step); } +diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py +index 60752ef4ae..ce82bf8f9e 100644 +--- a/tests/test-ovsdb.py ++++ b/tests/test-ovsdb.py +@@ -508,6 +508,8 @@ 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') +@@ -516,6 +518,17 @@ def idl_set(idl, commands, step): + 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 == "add_op": + if len(args) != 1: + sys.stderr.write('"add_op" command requires 1 argument\n') diff --git a/tests/tunnel-push-pop.at b/tests/tunnel-push-pop.at index 99b1b02bf9..cf4e622014 100644 --- a/tests/tunnel-push-pop.at diff --git a/SPECS/openvswitch3.4.spec b/SPECS/openvswitch3.4.spec index a11403b..10892a2 100644 --- a/SPECS/openvswitch3.4.spec +++ b/SPECS/openvswitch3.4.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.4.2 -Release: 54%{?dist} +Release: 55%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -787,6 +787,13 @@ exit 0 %endif %changelog +* Fri Feb 28 2025 Open vSwitch CI - 3.4.0-55 +- Merging upstream branch-3.4 [RH git: 682d47e755] + Commit list: + fa3585bc5f python: ovsdb-idl: Fix persist_uuid references. + 239fa55379 python: ovsdb-idl: Handle inserts w/o changes. + + * Thu Feb 27 2025 Open vSwitch CI - 3.4.0-54 - Merging upstream branch-3.4 [RH git: d7abaf0721] Commit list: