When the SB database is disconnected we cannot commit any of the
MAC bindings. The 'struct mac_binding' remain in the hash map until
SB is writable again. All mac_binding structures are leaked when
controller exists before it manages to write them into SB. The same
problem applies to map of 'struct fdb'. This doesn't cause any issues
on its own because the controller is exiting anyway, but it can
trigger test failure with following leak message:
Direct leak of 144 byte(s) in 2 object(s) allocated from:
0x4c8d13 in malloc (controller/ovn-controller+0x4c8d13)
0x8a5848 in xmalloc__ ovs/lib/util.c:141:15
0x8a5848 in xmalloc ovs/lib/util.c:176:12
0x6577d5 in mac_binding_add controller/mac-cache.c:167:14
0x5db85b in pinctrl_handle_put_mac_binding controller/pinctrl.c:4720:5
0x5a3002 in process_packet_in controller/pinctrl.c
0x5a3002 in pinctrl_recv controller/pinctrl.c:3872:9
0x5a3002 in pinctrl_handler controller/pinctrl.c:3954:17
0x8781ec in ovsthread_wrapper ovs/lib/ovs-thread.c:429:12
0x4c4ecc in asan_thread_start(void*) asan_interceptors.cpp.o
Fixes: fb96ae36793a ("controller: Merge the mac-cache and mac-learn.")
Signed-off-by: Ales Musil <[email protected]>
---
v2: Rebase on top of latest main.
Fix the same leak for FDB.
---
controller/pinctrl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index b92c2b339..47c4bf78b 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -4683,6 +4683,7 @@ init_put_mac_bindings(void)
static void
destroy_put_mac_bindings(void)
{
+ mac_bindings_clear(&put_mac_bindings);
hmap_destroy(&put_mac_bindings);
}
@@ -9109,6 +9110,7 @@ init_fdb_entries(void)
static void
destroy_fdb_entries(void)
{
+ fdbs_clear(&put_fdbs);
hmap_destroy(&put_fdbs);
}
--
2.48.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev