On 8/6/25 7:40 PM, Mark Michelson via dev wrote: > This patch series seeks to refactor how northbound datapath types are > synced with southbound Datapath_Bindings. > > In current OVN, the en-northd node is responsible for creating, updating > and deleting all southbound Datapath_Bindings. This means that if you > have a new type of Datapath_Binding that you want to add to OVN, it > needs to be added to the en-northd node. > > An upcoming feature (composable services) will be adding new types of > southbound Datapath_Bindings. However, it does not fit well into the > current en_northd environment and would do better separated into its own > set of engine nodes. In order to allow this, the Datapath_Binding > syncing code needs to be extracted to separate nodes. > > This series does just that. The en_northd node is stripped of its > previous functionality of creating, updating, and deleting southbound > Datapath_Bindings. These are now accomplished in dedicated incremental > engine nodes that are inputs to the en_northd engine node. > > Lorenzo Bianconi (3): > northd: Add IP for new logical switches in en-datapath-logical-switch > node. > northd: datapath-sync: Move dp_tnlids map in ovn_synced_datapaths. > northd: datapath-sync: Add IP for LS and LR inputs. > > Mark Michelson (6): > Datapath_Binding: Separate type and UUID external-ids. > northd: Refactor datapath syncing. > northd: Create cachable pointer for datapath bindings. > en-datapath-logical-router: Incrementally process unsynced routers. > datapaths: Add incremental processing for synced datapaths. > northd: Use synced datapaths everywhere. > > TODO.rst | 12 + > controller/local_data.c | 2 +- > ic/ovn-ic.c | 5 +- > lib/ovn-util.c | 45 +++ > lib/ovn-util.h | 8 + > northd/aging.c | 8 +- > northd/automake.mk | 8 + > northd/datapath-sync.c | 143 +++++++ > northd/datapath-sync.h | 151 +++++++ > northd/en-advertised-route-sync.c | 10 +- > northd/en-datapath-logical-router.c | 401 +++++++++++++++++++ > northd/en-datapath-logical-router.h | 68 ++++ > northd/en-datapath-logical-switch.c | 400 +++++++++++++++++++ > northd/en-datapath-logical-switch.h | 65 +++ > northd/en-datapath-sync.c | 589 ++++++++++++++++++++++++++++ > northd/en-datapath-sync.h | 34 ++ > northd/en-global-config.c | 11 + > northd/en-lb-data.c | 267 ++++++++----- > northd/en-lb-data.h | 4 +- > northd/en-multicast.c | 4 +- > northd/en-northd.c | 12 +- > northd/en-port-group.c | 2 +- > northd/inc-proc-northd.c | 51 ++- > northd/lflow-mgr.c | 4 +- > northd/northd.c | 454 ++++----------------- > northd/northd.h | 21 +- > ovn-sb.ovsschema | 11 +- > ovn-sb.xml | 21 +- > tests/ovn-controller.at | 4 + > tests/ovn-northd.at | 174 +++++++- > tests/ovn.at | 6 +- > utilities/ovn-sbctl.c | 4 +- > utilities/ovn-trace.c | 3 +- > 33 files changed, 2455 insertions(+), 547 deletions(-) > create mode 100644 northd/datapath-sync.c > create mode 100644 northd/datapath-sync.h > create mode 100644 northd/en-datapath-logical-router.c > create mode 100644 northd/en-datapath-logical-router.h > create mode 100644 northd/en-datapath-logical-switch.c > create mode 100644 northd/en-datapath-logical-switch.h > create mode 100644 northd/en-datapath-sync.c > create mode 100644 northd/en-datapath-sync.h >
FWIW, CI is all red due to many cases of use-after-free in this patch set and northd crashing. One example: ================================================================= ==183429==ERROR: AddressSanitizer: heap-use-after-free on address 0x5030000ea208 at pc 0x55c87b3ec480 bp 0x7fffe7fe0e70 sp 0x7fffe7fe0e68 READ of size 8 at 0x5030000ea208 thread T0 #0 0x55c87b3ec47f in en_mac_binding_aging_run /workspace/ovn-tmp/northd/aging.c:415:22 #1 0x55c87b5e68bc in engine_recompute /workspace/ovn-tmp/lib/inc-proc-eng.c:443:33 #2 0x55c87b5e4e6c in engine_run_node /workspace/ovn-tmp/lib/inc-proc-eng.c:532:17 #3 0x55c87b5e4e6c in engine_run /workspace/ovn-tmp/lib/inc-proc-eng.c:571:9 #4 0x55c87b558b54 in inc_proc_northd_run /workspace/ovn-tmp/northd/inc-proc-northd.c:561:5 #5 0x55c87b4d5042 in main /workspace/ovn-tmp/northd/ovn-northd.c:1079:36 #6 0x7f081d62f1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f) #7 0x7f081d62f28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f) #8 0x55c87b310eb4 in _start (/workspace/ovn-tmp/northd/ovn-northd+0x35aeb4) (BuildId: 4116368360f5e90c391d4dc2975436fbce4026e6) 0x5030000ea208 is located 24 bytes inside of 32-byte region [0x5030000ea1f0,0x5030000ea210) freed by thread T0 here: #0 0x55c87b3aba6a in free (/workspace/ovn-tmp/northd/ovn-northd+0x3f5a6a) (BuildId: 4116368360f5e90c391d4dc2975436fbce4026e6) #1 0x55c87b4e2ff8 in synced_logical_router_map_destroy /workspace/ovn-tmp/northd/en-datapath-logical-router.c:248:9 #2 0x55c87b4e2805 in en_datapath_synced_logical_router_run /workspace/ovn-tmp/northd/en-datapath-logical-router.c:285:5 #3 0x55c87b5e68bc in engine_recompute /workspace/ovn-tmp/lib/inc-proc-eng.c:443:33 #4 0x55c87b5e56f5 in engine_compute /workspace/ovn-tmp/lib/inc-proc-eng.c:486:17 #5 0x55c87b5e56f5 in engine_run_node /workspace/ovn-tmp/lib/inc-proc-eng.c:545:14 #6 0x55c87b5e56f5 in engine_run /workspace/ovn-tmp/lib/inc-proc-eng.c:571:9 #7 0x55c87b558b54 in inc_proc_northd_run /workspace/ovn-tmp/northd/inc-proc-northd.c:561:5 #8 0x55c87b4d5042 in main /workspace/ovn-tmp/northd/ovn-northd.c:1079:36 #9 0x7f081d62f1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f) #10 0x7f081d62f28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f) #11 0x55c87b310eb4 in _start (/workspace/ovn-tmp/northd/ovn-northd+0x35aeb4) (BuildId: 4116368360f5e90c391d4dc2975436fbce4026e6) previously allocated by thread T0 here: #0 0x55c87b3abd03 in malloc (/workspace/ovn-tmp/northd/ovn-northd+0x3f5d03) (BuildId: 4116368360f5e90c391d4dc2975436fbce4026e6) #1 0x55c87b8dcd28 in xmalloc__ /workspace/ovn-tmp/ovs/lib/util.c:141:15 #2 0x55c87b8dcd28 in xmalloc /workspace/ovn-tmp/ovs/lib/util.c:176:12 #3 0x55c87b4e312f in synced_logical_router_alloc /workspace/ovn-tmp/northd/en-datapath-logical-router.c:267:44 #4 0x55c87b4e3898 in en_datapath_synced_logical_router_datapath_sync_handler /workspace/ovn-tmp/northd/en-datapath-logical-router.c:341:14 #5 0x55c87b5e5496 in engine_compute /workspace/ovn-tmp/lib/inc-proc-eng.c:473:23 #6 0x55c87b5e5496 in engine_run_node /workspace/ovn-tmp/lib/inc-proc-eng.c:545:14 #7 0x55c87b5e5496 in engine_run /workspace/ovn-tmp/lib/inc-proc-eng.c:571:9 #8 0x55c87b558b54 in inc_proc_northd_run /workspace/ovn-tmp/northd/inc-proc-northd.c:561:5 #9 0x55c87b4d5042 in main /workspace/ovn-tmp/northd/ovn-northd.c:1079:36 #10 0x7f081d62f1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f) #11 0x7f081d62f28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f) #12 0x55c87b310eb4 in _start (/workspace/ovn-tmp/northd/ovn-northd+0x35aeb4) (BuildId: 4116368360f5e90c391d4dc2975436fbce4026e6) SUMMARY: AddressSanitizer: heap-use-after-free /workspace/ovn-tmp/northd/aging.c:415:22 in en_mac_binding_aging_run Best regards, Ilya Maximets. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev