From 9bedd6e2ec0e74430b6bd52c17304a3bcaa438f7 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Jun 07 2024 16:30:22 +0000 Subject: Import openvswitch3.1-3.1.0-117 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index e15aa1d..49e97d8 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -10175,8 +10175,37 @@ index d00911828c..b0f444169c 100644 install-data-local: ovs-install-data-local UNINSTALL_LOCAL += ovs-uninstall-local +diff --git a/python/ovs/db/custom_index.py b/python/ovs/db/custom_index.py +index 587caf5e3e..3fa03d3c95 100644 +--- a/python/ovs/db/custom_index.py ++++ b/python/ovs/db/custom_index.py +@@ -90,14 +90,21 @@ class IndexedRows(DictBase, object): + index = self.indexes[name] = MultiColumnIndex(name) + return index + ++ def __getitem__(self, key): ++ return self.data[key][-1] ++ + def __setitem__(self, key, item): +- self.data[key] = item ++ try: ++ self.data[key].append(item) ++ except KeyError: ++ self.data[key] = [item] + for index in self.indexes.values(): + index.add(item) + + def __delitem__(self, key): +- val = self.data[key] +- del self.data[key] ++ val = self.data[key].pop() ++ if len(self.data[key]) == 0: ++ del self.data[key] + for index in self.indexes.values(): + index.remove(val) + diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py -index 9fc2159b04..a80da84e7a 100644 +index 9fc2159b04..52f08e881a 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -299,6 +299,7 @@ class Idl(object): @@ -10240,8 +10269,54 @@ index 9fc2159b04..a80da84e7a 100644 def compose_cond_change(self): if not self.cond_changed: return +@@ -980,7 +1013,9 @@ class Idl(object): + if not row: + raise error.Error('Modify non-existing row') + ++ del table.rows[uuid] + old_row = self.__apply_diff(table, row, row_update['modify']) ++ table.rows[uuid] = row + return Notice(ROW_UPDATE, row, Row(self, table, uuid, old_row)) + else: + raise error.Error(' unknown operation', +@@ -1011,9 +1046,10 @@ class Idl(object): + op = ROW_UPDATE + vlog.warn("cannot add existing row %s to table %s" + % (uuid, table.name)) ++ del table.rows[uuid] ++ + changed |= self.__row_update(table, row, new) +- if op == ROW_CREATE: +- table.rows[uuid] = row ++ table.rows[uuid] = row + if changed: + return Notice(ROW_CREATE, row) + else: +@@ -1025,9 +1061,11 @@ class Idl(object): + # XXX rate-limit + vlog.warn("cannot modify missing row %s in table %s" + % (uuid, table.name)) ++ else: ++ del table.rows[uuid] ++ + changed |= self.__row_update(table, row, new) +- if op == ROW_CREATE: +- table.rows[uuid] = row ++ table.rows[uuid] = row + if changed: + return Notice(op, row, Row.from_json(self, table, uuid, old)) + return False +@@ -1821,7 +1859,7 @@ class Transaction(object): + if row._data is None: + op["op"] = "insert" + if row._persist_uuid: +- op["uuid"] = row.uuid ++ op["uuid"] = str(row.uuid) + else: + op["uuid-name"] = _uuid_name_from_uuid(row.uuid) + diff --git a/python/ovs/flow/odp.py b/python/ovs/flow/odp.py -index db63afc8d6..4bfe5b59a2 100644 +index db63afc8d6..96d4a499d6 100644 --- a/python/ovs/flow/odp.py +++ b/python/ovs/flow/odp.py @@ -204,6 +204,7 @@ class ODPFlow(Flow): @@ -10252,7 +10327,7 @@ index db63afc8d6..4bfe5b59a2 100644 "lb_output": decode_int, "trunc": decode_int, "recirc": decode_int, -@@ -334,8 +335,31 @@ class ODPFlow(Flow): +@@ -334,48 +335,60 @@ class ODPFlow(Flow): ) ), **ODPFlow._tnl_action_decoder_args(), @@ -10284,10 +10359,10 @@ index db63afc8d6..4bfe5b59a2 100644 _decoders["clone"] = nested_kv_decoder( KVDecoders(decoders=_decoders, default_free=decode_free_output), is_list=True, -@@ -343,20 +367,6 @@ class ODPFlow(Flow): + ) - return { - **_decoders, +- return { +- **_decoders, - "sample": nested_kv_decoder( - KVDecoders( - { @@ -10302,27 +10377,50 @@ index db63afc8d6..4bfe5b59a2 100644 - } - ) - ), - "check_pkt_len": nested_kv_decoder( - KVDecoders( - { -@@ -365,13 +375,15 @@ class ODPFlow(Flow): - KVDecoders( - decoders=_decoders, - default_free=decode_free_output, +- "check_pkt_len": nested_kv_decoder( +- KVDecoders( +- { +- "size": decode_int, +- "gt": nested_kv_decoder( +- KVDecoders( +- decoders=_decoders, +- default_free=decode_free_output, - ) -+ ), -+ is_list=True, ++ _decoders["check_pkt_len"] = nested_kv_decoder( ++ KVDecoders( ++ { ++ "size": decode_int, ++ "gt": nested_kv_decoder( ++ KVDecoders( ++ decoders=_decoders, ++ default_free=decode_free_output, ), - "le": nested_kv_decoder( - KVDecoders( - decoders=_decoders, - default_free=decode_free_output, +- "le": nested_kv_decoder( +- KVDecoders( +- decoders=_decoders, +- default_free=decode_free_output, - ) -+ ), -+ is_list=True, ++ is_list=True, ++ ), ++ "le": nested_kv_decoder( ++ KVDecoders( ++ decoders=_decoders, ++ default_free=decode_free_output, ), - } - ) +- } +- ) +- ), ++ is_list=True, ++ ), ++ } ++ ) ++ ) ++ ++ return { ++ **_decoders, + } + + @staticmethod diff --git a/python/ovs/flow/ofp.py b/python/ovs/flow/ofp.py index 20231fd9f3..3d3226c919 100644 --- a/python/ovs/flow/ofp.py @@ -10382,7 +10480,7 @@ index ac5b0fd0c6..b32341076c 100644 return 0 diff --git a/python/ovs/tests/test_odp.py b/python/ovs/tests/test_odp.py -index f8017ca8a1..e9fd5e207f 100644 +index f8017ca8a1..2e6f42f1e6 100644 --- a/python/ovs/tests/test_odp.py +++ b/python/ovs/tests/test_odp.py @@ -13,6 +13,32 @@ from ovs.flow.decoders import ( @@ -10446,7 +10544,7 @@ index f8017ca8a1..e9fd5e207f 100644 @pytest.mark.parametrize( -@@ -496,48 +503,41 @@ def test_odp_fields(input_string, expected): +@@ -496,48 +503,70 @@ def test_odp_fields(input_string, expected): "check_pkt_len", { "size": 200, @@ -10479,6 +10577,35 @@ index f8017ca8a1..e9fd5e207f 100644 ], ), + ( ++ "actions:check_pkt_len(size=200,gt(check_pkt_len(size=400,gt(4),le(2))),le(check_pkt_len(size=100,gt(1),le(drop))))", # noqa: E501 ++ [ ++ KeyValue( ++ "check_pkt_len", ++ { ++ "size": 200, ++ "gt": [ ++ { ++ "check_pkt_len": { ++ "size": 400, ++ "gt": [{"output": {"port": 4}}], ++ "le": [{"output": {"port": 2}}], ++ } ++ } ++ ], ++ "le": [ ++ { ++ "check_pkt_len": { ++ "size": 100, ++ "gt": [{"output": {"port": 1}}], ++ "le": [{"drop": True}], ++ } ++ } ++ ], ++ }, ++ ) ++ ], ++ ), ++ ( + "actions:meter(1),hash(l4(0))", + [ + KeyValue("meter", 1), @@ -12264,7 +12391,7 @@ index e72bf06069..fd1c7a2395 100644 [{"count":1},{"details":"cannot delete b row <0> because of 2 remaining reference(s)","error":"referential integrity violation"}] [{"count":1}] diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at -index 5a7e76eaa9..aa60b1e5a1 100644 +index 5a7e76eaa9..3ed3ec86f8 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -1,17 +1,6 @@ @@ -12372,7 +12499,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3], -@@ -152,7 +159,7 @@ m4_define([OVSDB_CHECK_IDL_PY], +@@ -152,11 +159,20 @@ m4_define([OVSDB_CHECK_IDL_PY], m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY], [AT_SETUP([$1 - Python3 - register_columns]) AT_KEYWORDS([ovsdb server idl positive Python register_columns $5]) @@ -12380,8 +12507,23 @@ index 5a7e76eaa9..aa60b1e5a1 100644 + OVSDB_START_IDLTEST m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) - AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?simple3:name,uset,uref?simple4:name?simple6:name,weak_ref?link1:i,k,ka,l2?link2:i,l1?singleton:name $3], -@@ -166,7 +173,7 @@ m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY], +- AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?simple3:name,uset,uref?simple4:name?simple6:name,weak_ref?link1:i,k,ka,l2?link2:i,l1?singleton:name $3], +- [0], [stdout], [ignore]) ++ m4_define([REGISTER], m4_joinall([?], [], ++ [simple:b,ba,i,ia,r,ra,s,sa,u,ua], ++ [simple3:name,uset,uref], ++ [simple4:name], ++ [simple6:name,weak_ref], ++ [link1:i,k,ka,l2], ++ [link2:i,l1], ++ [indexed:i], ++ [singleton:name])) ++ AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema \ ++ unix:socket REGISTER $3], [0], [stdout], [ignore]) + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), + [0], [$4]) + OVSDB_SERVER_SHUTDOWN +@@ -166,7 +182,7 @@ m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY], m4_define([OVSDB_CHECK_IDL_TCP_PY], [AT_SETUP([$1 - Python3 - tcp]) AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5]) @@ -12390,7 +12532,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) m4_if([$2], [], [], -@@ -183,7 +190,7 @@ m4_define([OVSDB_CHECK_IDL_TCP_PY], +@@ -183,7 +199,7 @@ m4_define([OVSDB_CHECK_IDL_TCP_PY], m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PY], [AT_SETUP([$1 - Python3 (multiple remotes) - tcp]) AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5]) @@ -12399,7 +12541,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) WRONG_PORT_1=$((TCP_PORT + 101)) WRONG_PORT_2=$((TCP_PORT + 102)) -@@ -203,7 +210,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PY], +@@ -203,7 +219,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_PY], AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_SKIP_IF([test $HAVE_IPV6 = no]) AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5]) @@ -12408,7 +12550,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) echo "TCP_PORT=$TCP_PORT" -@@ -221,7 +228,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY], +@@ -221,7 +237,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY], AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_SKIP_IF([test $HAVE_IPV6 = no]) AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5]) @@ -12417,7 +12559,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) WRONG_PORT_1=$((TCP_PORT + 101)) WRONG_PORT_2=$((TCP_PORT + 102)) -@@ -287,13 +294,13 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY], +@@ -287,13 +303,13 @@ m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY], [AT_SETUP([$1 - Python3 - ptcp]) AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5]) # find free TCP port @@ -12433,7 +12575,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3], [0], [stdout], [ignore]) AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), -@@ -473,7 +480,7 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode], +@@ -473,7 +489,7 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode], m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT], [AT_SETUP([$1 - Python3]) AT_KEYWORDS([ovsdb server idl positive Python $5]) @@ -12442,7 +12584,39 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3], -@@ -990,7 +997,7 @@ AT_KEYWORDS([ovsdb server idl positive]) +@@ -732,6 +748,31 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple tables], + 009: done + ]]) + ++OVSDB_CHECK_IDL([indexed idl, modification and removal], ++ [], ++ [['["idltest", ++ {"op": "insert", ++ "table": "indexed", ++ "row": {"i": 123 }}]' \ ++ '["idltest", ++ {"op": "update", ++ "table": "indexed", ++ "where": [["i", "==", 123]], ++ "row": {"i": 456}}]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "indexed", ++ "where": [["i", "==", 456]]}]']], ++ [[000: empty ++001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} ++002: table indexed: i=123 uuid=<0> ++003: {"error":null,"result":[{"count":1}]} ++004: table indexed: i=456 uuid=<0> ++005: {"error":null,"result":[{"count":1}]} ++006: empty ++007: done ++]]) ++ + OVSDB_CHECK_IDL([self-linking idl, consistent ops], + [], + [['["idltest", +@@ -990,7 +1031,7 @@ AT_KEYWORDS([ovsdb server idl positive]) # table link2 and column l2 have been deleted. But the IDL still # expects them to be there, so this test checks that it properly # tolerates them being missing. @@ -12451,7 +12625,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest", {"op": "insert", "table": "link1", -@@ -1063,7 +1070,7 @@ AT_CLEANUP +@@ -1063,7 +1104,7 @@ AT_CLEANUP m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY], [AT_SETUP([$1 - Python3 - fetch]) AT_KEYWORDS([ovsdb server idl positive Python increment fetch $6]) @@ -12460,7 +12634,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4], -@@ -1107,7 +1114,7 @@ OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated], +@@ -1107,7 +1148,7 @@ OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated], m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY], [AT_SETUP([$1 - Python3]) AT_KEYWORDS([ovsdb server idl Python monitor $4]) @@ -12469,7 +12643,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond]) AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2], [0], [stdout], [ignore]) -@@ -1200,7 +1207,7 @@ OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond], +@@ -1200,7 +1241,7 @@ OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond], m4_define([OVSDB_CHECK_IDL_TRACK_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl tracking positive $5]) @@ -12478,7 +12652,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl unix:socket $3], -@@ -1213,10 +1220,10 @@ m4_define([OVSDB_CHECK_IDL_TRACK_C], +@@ -1213,10 +1254,10 @@ m4_define([OVSDB_CHECK_IDL_TRACK_C], m4_define([OVSDB_CHECK_IDL_TRACK_WRITE_CHANGED_ONLY_C], [AT_SETUP([$1 - write-changed-only - C]) AT_KEYWORDS([ovsdb server idl tracking positive $5]) @@ -12491,7 +12665,41 @@ index 5a7e76eaa9..aa60b1e5a1 100644 [0], [stdout], [ignore]) AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), [0], [$4]) -@@ -1451,6 +1458,56 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl +@@ -1259,6 +1300,33 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated], + 003: done + ]]) + ++OVSDB_CHECK_IDL_TRACK([track, indexed idl, modification and removal], ++ [], ++ [['["idltest", ++ {"op": "insert", ++ "table": "indexed", ++ "row": {"i": 123 }}]' \ ++ '["idltest", ++ {"op": "update", ++ "table": "indexed", ++ "where": [["i", "==", 123]], ++ "row": {"i": 456}}]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "indexed", ++ "where": [["i", "==", 456]]}]']], ++ [[000: empty ++001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} ++002: table indexed: inserted row: i=123 uuid=<0> ++002: table indexed: updated columns: i ++003: {"error":null,"result":[{"count":1}]} ++004: table indexed: i=456 uuid=<0> ++004: table indexed: updated columns: i ++005: {"error":null,"result":[{"count":1}]} ++006: empty ++007: done ++]]) ++ + 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. +@@ -1451,6 +1519,56 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, singl 006: done ]]) @@ -12548,7 +12756,7 @@ index 5a7e76eaa9..aa60b1e5a1 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], -@@ -1716,7 +1773,7 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], +@@ -1716,7 +1834,7 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl partial update map column positive $5]) @@ -12557,7 +12765,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-map-column unix:socket $3], -@@ -1777,7 +1834,7 @@ OVSDB_CHECK_IDL_PY([partial-map update set refmap idl], +@@ -1777,7 +1895,7 @@ OVSDB_CHECK_IDL_PY([partial-map update set refmap idl], m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl partial update set column positive $5]) @@ -12566,7 +12774,44 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-set-column unix:socket $3], -@@ -1966,7 +2023,7 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], +@@ -1957,6 +2075,36 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], + 015: done + ]]) + ++OVSDB_CHECK_IDL_NOTIFY([indexed idl, modification and removal notify], ++ [['track-notify' \ ++ '["idltest", ++ {"op": "insert", ++ "table": "indexed", ++ "row": {"i": 123 }}]' \ ++ '["idltest", ++ {"op": "update", ++ "table": "indexed", ++ "where": [["i", "==", 123]], ++ "row": {"i": 456}}]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "indexed", ++ "where": [["i", "==", 456]]}]']], ++ [[000: empty ++000: event:create, row={}, uuid=<0>, updates=None ++000: event:create, row={}, uuid=<1>, updates=None ++001: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} ++002: event:create, row={i=123}, uuid=<2>, updates=None ++002: table indexed: i=123 uuid=<2> ++003: {"error":null,"result":[{"count":1}]} ++004: event:update, row={i=456}, uuid=<2>, updates={i=123} ++004: table indexed: i=456 uuid=<2> ++005: {"error":null,"result":[{"count":1}]} ++006: empty ++006: event:delete, row={i=456}, uuid=<2>, updates=None ++007: done ++]]) ++ + # 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 +@@ -1966,7 +2114,7 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl compound_index_single_column compound_index positive $5]) @@ -12575,7 +12820,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) # Generate the data to be tested. -@@ -2113,7 +2170,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C([Compound_index, single column te +@@ -2113,7 +2261,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C([Compound_index, single column te m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl compound_index_double_column compound_index positive $5]) @@ -12584,7 +12829,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) # Generate the data to be tested. -@@ -2252,7 +2309,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C([Compound_index, double column te +@@ -2252,7 +2400,7 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C([Compound_index, double column te m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl compound_index compound_index_with_ref positive $5]) @@ -12593,7 +12838,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index-with-ref unix:socket $3], -@@ -2280,7 +2337,7 @@ m4_define([CHECK_STREAM_OPEN_BLOCK], +@@ -2280,7 +2428,7 @@ m4_define([CHECK_STREAM_OPEN_BLOCK], AT_SKIP_IF([test "$3" = "tcp6" && test "$IS_WIN32" = "yes"]) AT_SKIP_IF([test "$3" = "tcp6" && test "$HAVE_IPV6" = "no"]) AT_KEYWORDS([ovsdb server stream open_block $3]) @@ -12602,7 +12847,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) WRONG_PORT=$(($TCP_PORT + 101)) AT_CHECK([$2 tcp:$4:$TCP_PORT], [0], [ignore]) -@@ -2296,6 +2353,23 @@ CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], +@@ -2296,6 +2444,23 @@ CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], CHECK_STREAM_OPEN_BLOCK([Python3], [$PYTHON3 $srcdir/test-stream.py], [tcp6], [[[::1]]]) @@ -12626,7 +12871,7 @@ index 5a7e76eaa9..aa60b1e5a1 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], -@@ -2311,10 +2385,11 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], +@@ -2311,10 +2476,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], @@ -12639,7 +12884,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CLEANUP]) OVSDB_CHECK_IDL_LEADER_ONLY_PY([Check Python IDL connects to leader], 3, ['remote']) -@@ -2357,6 +2432,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_C], +@@ -2357,6 +2523,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])], [], []) @@ -12647,7 +12892,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CLEANUP]) # Same as OVSDB_CHECK_CLUSTER_IDL_C but uses the Python IDL implementation. -@@ -2377,6 +2453,7 @@ m4_define([OVSDB_CHECK_CLUSTER_IDL_PY], +@@ -2377,6 +2544,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])], [], []) @@ -12655,7 +12900,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CLEANUP]) m4_define([OVSDB_CHECK_CLUSTER_IDL], -@@ -2468,7 +2545,7 @@ reconnect.*waiting .* seconds before reconnect) +@@ -2468,7 +2636,7 @@ reconnect.*waiting .* seconds before reconnect) AT_SETUP([idl table and column presence check]) AT_KEYWORDS([ovsdb server idl table column check]) @@ -12664,7 +12909,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CHECK(ovsdb-tool create db2 $abs_srcdir/idltest.ovsschema) AT_CHECK(ovsdb-server -vconsole:warn --log-file=ovsdb-server2.log --detach dnl -@@ -2596,7 +2673,7 @@ OVSDB_CHECK_IDL_TRACK([track, insert and delete, refs to link2], +@@ -2596,7 +2764,7 @@ OVSDB_CHECK_IDL_TRACK([track, insert and delete, refs to link2], m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([idl persistent uuid insert]) @@ -12673,7 +12918,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $2], [0], [stdout], [stderr]) AT_CHECK([sort stdout], -@@ -2608,7 +2685,7 @@ m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_C], +@@ -2608,7 +2776,7 @@ m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_C], m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_PY], [AT_SETUP([$1 - Python3]) AT_KEYWORDS([idl persistent uuid insert]) @@ -12682,7 +12927,7 @@ index 5a7e76eaa9..aa60b1e5a1 100644 AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2], [0], [stdout], [stderr]) AT_CHECK([sort stdout], -@@ -2650,3 +2727,93 @@ OVSDB_CHECK_IDL_PERS_UUID_INSERT([simple idl, persistent uuid insert], +@@ -2650,3 +2818,93 @@ 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']]) @@ -16356,7 +16601,7 @@ index a38bf9e6df..86a223caff 100644 for (i = 0; i < n_threads; i++) { printf(" %6" PRIu64, thread_working_ms[i]); diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c -index 1bc5ac17a0..d6a47de336 100644 +index 1bc5ac17a0..e6d83e12da 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c @@ -870,7 +870,8 @@ do_parse_rows(struct ovs_cmdl_context *ctx) @@ -16414,7 +16659,92 @@ index 1bc5ac17a0..d6a47de336 100644 /* Initialize row and find equivalence class. */ rows[i].uuid = *ovsdb_row_get_uuid(row); -@@ -2799,6 +2800,13 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2022,6 +2023,24 @@ print_idl_row_updated_link2(const struct idltest_link2 *l2, int step) + } + } + ++static void ++print_idl_row_updated_indexed(const struct idltest_indexed *ind, int step) ++{ ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ ++ for (size_t i = 0; i < IDLTEST_INDEXED_N_COLUMNS; i++) { ++ if (idltest_indexed_is_updated(ind, i)) { ++ ds_put_format(&updates, " %s", idltest_indexed_columns[i].name); ++ } ++ } ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, ind->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); ++ } ++} ++ + static void + print_idl_row_updated_simple3(const struct idltest_simple3 *s3, int step) + { +@@ -2171,6 +2190,21 @@ print_idl_row_link2(const struct idltest_link2 *l2, int step, bool terse) + print_idl_row_updated_link2(l2, step); + } + ++static void ++print_idl_row_indexed(const struct idltest_indexed *ind, int step, bool terse) ++{ ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ++ ds_put_format(&msg, "i=%"PRId64, ind->i); ++ ++ char *row_msg = format_idl_row(&ind->header_, step, ds_cstr(&msg), terse); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ ++ print_idl_row_updated_indexed(ind, step); ++} ++ + static void + print_idl_row_simple3(const struct idltest_simple3 *s3, int step, bool terse) + { +@@ -2251,6 +2285,7 @@ print_idl_row_singleton(const struct idltest_singleton *sng, int step, + static void + print_idl(struct ovsdb_idl *idl, int step, bool terse) + { ++ const struct idltest_indexed *ind; + const struct idltest_simple3 *s3; + const struct idltest_simple4 *s4; + const struct idltest_simple6 *s6; +@@ -2284,6 +2319,10 @@ print_idl(struct ovsdb_idl *idl, int step, bool terse) + print_idl_row_simple6(s6, step, terse); + n++; + } ++ IDLTEST_INDEXED_FOR_EACH (ind, idl) { ++ print_idl_row_indexed(ind, step, terse); ++ n++; ++ } + IDLTEST_SINGLETON_FOR_EACH (sng, idl) { + print_idl_row_singleton(sng, step, terse); + n++; +@@ -2296,6 +2335,7 @@ print_idl(struct ovsdb_idl *idl, int step, bool terse) + static void + print_idl_track(struct ovsdb_idl *idl, int step, bool terse) + { ++ const struct idltest_indexed *ind; + const struct idltest_simple3 *s3; + const struct idltest_simple4 *s4; + const struct idltest_simple6 *s6; +@@ -2328,6 +2368,10 @@ print_idl_track(struct ovsdb_idl *idl, int step, bool terse) + print_idl_row_simple6(s6, step, terse); + n++; + } ++ IDLTEST_INDEXED_FOR_EACH (ind, idl) { ++ print_idl_row_indexed(ind, step, terse); ++ n++; ++ } + + if (!n) { + print_and_log("%03d: empty", step); +@@ -2799,6 +2843,13 @@ do_idl(struct ovs_cmdl_context *ctx) } else { print_idl(idl, step++, terse); } @@ -16429,7 +16759,7 @@ index 1bc5ac17a0..d6a47de336 100644 seqno = ovsdb_idl_get_seqno(idl); diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py -index a841adba4e..48f8ee2d70 100644 +index a841adba4e..67a45f044b 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -37,7 +37,7 @@ vlog.init(None) @@ -16441,7 +16771,33 @@ index a841adba4e..48f8ee2d70 100644 return json[0] else: return json -@@ -325,9 +325,9 @@ def substitute_uuids(json, symtab): +@@ -228,6 +228,10 @@ def get_link2_table_printable_row(row): + return s + + ++def get_indexed_table_printable_row(row): ++ return "i=%s" % row.i ++ ++ + def get_singleton_table_printable_row(row): + return "name=%s" % row.name + +@@ -307,6 +311,14 @@ def print_idl(idl, step, terse=False): + terse) + n += 1 + ++ if "indexed" in idl.tables: ++ ind = idl.tables["indexed"].rows ++ for row in ind.values(): ++ print_row("indexed", row, step, ++ get_indexed_table_printable_row(row), ++ terse) ++ n += 1 ++ + if "singleton" in idl.tables: + sng = idl.tables["singleton"].rows + for row in sng.values(): +@@ -325,9 +337,9 @@ def substitute_uuids(json, symtab): symbol = symtab.get(json) if symbol: return str(symbol) @@ -16453,7 +16809,7 @@ index a841adba4e..48f8ee2d70 100644 d = {} for key, value in json.items(): d[key] = substitute_uuids(value, symtab) -@@ -341,10 +341,10 @@ def parse_uuids(json, symtab): +@@ -341,10 +353,10 @@ def parse_uuids(json, symtab): name = "#%d#" % len(symtab) sys.stderr.write("%s = %s\n" % (name, json)) symtab[name] = json @@ -16466,7 +16822,26 @@ index a841adba4e..48f8ee2d70 100644 for value in json.values(): parse_uuids(value, symtab) -@@ -757,16 +757,23 @@ def do_idl(schema_file, remote, *commands): +@@ -434,7 +446,7 @@ def idl_set(idl, commands, step): + sys.stderr.write('"set" command requires 2 argument\n') + sys.exit(1) + +- s = txn.insert(idl.tables["simple"], new_uuid=args[0], ++ s = txn.insert(idl.tables["simple"], new_uuid=uuid.UUID(args[0]), + persist_uuid=True) + s.i = int(args[1]) + elif name == "delete": +@@ -690,6 +702,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") ++ if "indexed" in idl.tables: ++ idx = idl.index_create("indexed", "indexed_by_i") ++ idx.add_column("i") + + if commands: + remotes = remote.split(',') +@@ -757,16 +772,23 @@ def do_idl(schema_file, remote, *commands): poller.block() else: # Wait for update. @@ -16498,7 +16873,7 @@ index a841adba4e..48f8ee2d70 100644 seqno = idl.change_seqno -@@ -1049,14 +1056,14 @@ def main(argv): +@@ -1049,14 +1071,14 @@ def main(argv): sys.exit(1) func, n_args = commands[command_name] diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index eccf1df..e6dc04d 100644 --- a/SPECS/openvswitch3.1.spec +++ b/SPECS/openvswitch3.1.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.1.0 -Release: 116%{?dist} +Release: 117%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -754,6 +754,15 @@ exit 0 %endif %changelog +* Fri Jun 07 2024 Open vSwitch CI - 3.1.0-117 +- Merging upstream branch-3.1 [RH git: be9768a7ec] + Commit list: + a8cbe50c2b python: ovs: flow: Fix nested check_pkt_len acts. + b00be11dc1 python: idl: Fix index not being updated on row modification. + 5527145791 python: ovsdb-idl: Convert new_uuid insert() arg to UUID. + 9d7867bcba python: ovsdb-idl: Make IndexedRows mirror hmap. + + * Wed Jun 05 2024 Open vSwitch CI - 3.1.0-116 - Merging upstream branch-3.1 [RH git: bc729227ad] Commit list: