[PATCH v5 17/19] drivers: release DPAA bpid on driver destructor
Stephen Hemminger
stephen at networkplumber.org
Fri Jun 26 18:59:09 CEST 2026
On Fri, 26 Jun 2026 12:26:53 +0530
Hemant Agrawal <hemant.agrawal at nxp.com> wrote:
> From: Jun Yang <jun.yang at nxp.com>
>
> Track allocated BPIDs in a static per-BPID flag table and register a
> driver destructor that releases any BPIDs still marked as in use at
> process exit. This prevents BPID leaks when an application exits without
> calling rte_mempool_free(). Also tune the per-lcore mempool cache flush
> threshold to match the hardware bulk release size (DPAA_MBUF_MAX_ACQ_REL)
> so that buffers are returned to HW in optimal burst sizes.
>
> Signed-off-by: Jun Yang <jun.yang at nxp.com>
> ---
Build with ASAN fails with this patch.
Simple fix is usually replacing all use of rte_memcpy with memcpy.
Rte_memcpy on x86 confuses ASAN and it thinks certain sizes reference past
end of buffer. I would just do a global replace of rte_memcpy with memcpy
across all of drivers/bus/dpaa none of this is performance critical on old
versions of Gcc which is the only reason rte_memcpy still exists.
This needs to be fixed before merging.
In file included from /usr/lib/gcc/x86_64-linux-gnu/15/include/immintrin.h:43,
from /usr/lib/gcc/x86_64-linux-gnu/15/include/x86intrin.h:32,
from ../lib/eal/x86/include/rte_vect.h:24,
from ../lib/eal/x86/include/rte_memcpy.h:17,
from ../drivers/bus/dpaa/base/qbman/bman.c:7:
In function ‘_mm256_loadu_si256’,
inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:119:9,
inlined from ‘rte_mov64’ at ../lib/eal/x86/include/rte_memcpy.h:158:2,
inlined from ‘rte_mov128’ at ../lib/eal/x86/include/rte_memcpy.h:169:2,
inlined from ‘rte_memcpy_generic_more_than_64’ at ../lib/eal/x86/include/rte_memcpy.h:389:4,
inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:715:10,
inlined from ‘bman_release_fast’ at ../drivers/bus/dpaa/base/qbman/bman.c:296:3:
/usr/lib/gcc/x86_64-linux-gnu/15/include/avxintrin.h:873:10: warning: array subscript ‘__m256i_u[1]’ is partly outside array bounds of ‘struct bm_buffer[8]’ [-Warray-bounds=]
873 | return *__P;
| ^~~~
../drivers/bus/dpaa/base/qbman/bman.c: In function ‘bman_release_fast’:
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset 40 into object ‘bm_bufs’ of size 64
270 | struct bm_buffer bm_bufs[FSL_BM_BURST_MAX];
| ^~~~~~~
In function ‘_mm256_loadu_si256’,
inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:119:9,
inlined from ‘rte_mov64’ at ../lib/eal/x86/include/rte_memcpy.h:157:2,
inlined from ‘rte_mov128’ at ../lib/eal/x86/include/rte_memcpy.h:170:2,
inlined from ‘rte_memcpy_generic_more_than_64’ at ../lib/eal/x86/include/rte_memcpy.h:389:4,
inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:715:10,
inlined from ‘bman_release_fast’ at ../drivers/bus/dpaa/base/qbman/bman.c:296:3:
/usr/lib/gcc/x86_64-linux-gnu/15/include/avxintrin.h:873:10: warning: array subscript 2 is outside array bounds of ‘struct bm_buffer[8]’ [-Warray-bounds=]
873 | return *__P;
| ^~~~
../drivers/bus/dpaa/base/qbman/bman.c: In function ‘bman_release_fast’:
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset 72 into object ‘bm_bufs’ of size 64
270 | struct bm_buffer bm_bufs[FSL_BM_BURST_MAX];
| ^~~~~~~
In function ‘_mm256_loadu_si256’,
inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:119:9,
inlined from ‘rte_mov64’ at ../lib/eal/x86/include/rte_memcpy.h:158:2,
inlined from ‘rte_mov128’ at ../lib/eal/x86/include/rte_memcpy.h:170:2,
inlined from ‘rte_memcpy_generic_more_than_64’ at ../lib/eal/x86/include/rte_memcpy.h:389:4,
inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:715:10,
inlined from ‘bman_release_fast’ at ../drivers/bus/dpaa/base/qbman/bman.c:296:3:
/usr/lib/gcc/x86_64-linux-gnu/15/include/avxintrin.h:873:10: warning: array subscript 3 is outside array bounds of ‘struct bm_buffer[8]’ [-Warray-bounds=]
873 | return *__P;
| ^~~~
../drivers/bus/dpaa/base/qbman/bman.c: In function ‘bman_release_fast’:
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset 104 into object ‘bm_bufs’ of size 64
270 | struct bm_buffer bm_bufs[FSL_BM_BURST_MAX];
| ^~~~~~~
In function ‘_mm256_loadu_si256’,
inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:119:9,
inlined from ‘rte_mov64’ at ../lib/eal/x86/include/rte_memcpy.h:158:2,
inlined from ‘rte_memcpy_generic_more_than_64’ at ../lib/eal/x86/include/rte_memcpy.h:396:4,
inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:715:10,
inlined from ‘bman_release_fast’ at ../drivers/bus/dpaa/base/qbman/bman.c:296:3:
/usr/lib/gcc/x86_64-linux-gnu/15/include/avxintrin.h:873:10: warning: array subscript ‘__m256i_u[1]’ is partly outside array bounds of ‘const void[64]’ [-Warray-bounds=]
873 | return *__P;
| ^~~~
../drivers/bus/dpaa/base/qbman/bman.c: In function ‘bman_release_fast’:
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [40, 48] into object ‘bm_bufs’ of size 64
270 | struct bm_buffer bm_bufs[FSL_BM_BURST_MAX];
| ^~~~~~~
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [41, 64] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [168, 176] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [40, 48] into object ‘bm_bufs’ of size 64
In function ‘_mm256_loadu_si256’,
inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:119:9,
inlined from ‘rte_memcpy_generic_more_than_64’ at ../lib/eal/x86/include/rte_memcpy.h:401:4,
inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:715:10,
inlined from ‘bman_release_fast’ at ../drivers/bus/dpaa/base/qbman/bman.c:296:3:
/usr/lib/gcc/x86_64-linux-gnu/15/include/avxintrin.h:873:10: warning: array subscript [2, 66] is outside array bounds of ‘const void[64]’ [-Warray-bounds=]
873 | return *__P;
| ^~~~
../drivers/bus/dpaa/base/qbman/bman.c: In function ‘bman_release_fast’:
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [8, 64] into object ‘bm_bufs’ of size 64
270 | struct bm_buffer bm_bufs[FSL_BM_BURST_MAX];
| ^~~~~~~
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [9, 64] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [136, 208] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [8, 64] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [9, 64] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [136, 208] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [8, 64] into object ‘bm_bufs’ of size 64
In function ‘_mm256_loadu_si256’,
inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:119:9,
inlined from ‘rte_memcpy_generic_more_than_64’ at ../lib/eal/x86/include/rte_memcpy.h:402:4,
inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:715:10,
inlined from ‘bman_release_fast’ at ../drivers/bus/dpaa/base/qbman/bman.c:296:3:
/usr/lib/gcc/x86_64-linux-gnu/15/include/avxintrin.h:873:10: warning: array subscript [2, 67] is outside array bounds of ‘const void[64]’ [-Warray-bounds=]
873 | return *__P;
| ^~~~
../drivers/bus/dpaa/base/qbman/bman.c: In function ‘bman_release_fast’:
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [9, 64] into object ‘bm_bufs’ of size 64
270 | struct bm_buffer bm_bufs[FSL_BM_BURST_MAX];
| ^~~~~~~
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [10, 64] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [137, 209] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [9, 64] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [10, 64] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [137, 209] into object ‘bm_bufs’ of size 64
../drivers/bus/dpaa/base/qbman/bman.c:270:26: note: at offset [9, 64] into object ‘bm_bufs’ of size 64
More information about the dev
mailing list