2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

dpif-netdev: Fix leak of AVX512 DPIF scratch pad.

dp_netdev_input_outer_avx512 allocates a 16KB scratch pad per PMD
thread, but it's never freed.  This may cause significant memory
drain in dynamic environments.

  ==4068109==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 38656 byte(s) in 2 object(s) allocated from:
   0 0xf069fd in posix_memalign (vswitchd/ovs-vswitchd+0xf069fd)
   1 0x1d7ed14 in xmalloc_size_align lib/util.c:254:13
   2 0x1d7ed14 in xmalloc_pagealign lib/util.c:352:12
   3 0x2098254 in dp_netdev_input_outer_avx512 lib/dpif-netdev-avx512.c:69:17
   4 0x191591a in dp_netdev_process_rxq_port lib/dpif-netdev.c:5332:19
   5 0x190a961 in pmd_thread_main lib/dpif-netdev.c:6963:17
   6 0x1c4b69a in ovsthread_wrapper lib/ovs-thread.c:422:12
   7 0x7fd5ea6f1179 in start_thread pthread_create.c

 SUMMARY: AddressSanitizer: 38656 byte(s) leaked in 2 allocation(s).

Fixes: 9ac84a1a36 ("dpif-avx512: Add ISA implementation of dpif.")
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Kumar Amber <kumar.amber@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Ilya Maximets
2022-06-29 12:22:49 +02:00
parent c8bff848ae
commit 603bc853fb

View File

@@ -7523,6 +7523,7 @@ dp_netdev_destroy_pmd(struct dp_netdev_pmd_thread *pmd)
seq_destroy(pmd->reload_seq);
ovs_mutex_destroy(&pmd->port_mutex);
ovs_mutex_destroy(&pmd->bond_mutex);
free(pmd->netdev_input_func_userdata);
free(pmd);
}