Problem Statement

Hello DPDK community,

We've been using DPDK's ACL library in a long-running network application and 
observed a concerning issue regarding memory fragmentation. The 
rte_acl_build()function internally uses rte_zmalloc_socket()for dynamic memory 
allocation during ACL rule compilation.

While this design works well for short-lived processes, it creates challenges 
for long-running applications (days/weeks) where memory fragmentation becomes a 
critical concern. Each ACL rebuild (due to rule updates, configuration changes, 
etc.) allocates variable-sized memory blocks for the trie structures and 
transition tables, which are then freed when the ACL context is destroyed or 
rebuilt.

This pattern leads to:
1. Memory fragmentation​ over time, as the heap accumulates "holes" of 
varying sizes
2. Potential allocation failures​ even when total free memory appears 
sufficient
3. Difficulty in memory budgeting for deterministic systems


Current Limitation

The current API doesn't allow applications to provide pre-allocated memory for 
ACL construction, forcing dynamic allocations that contribute to heap 
fragmentation. This is particularly problematic for applications that 
prioritize long-term stability and predictable memory usage.

Proposed Solution

We propose extending the ACL API to support external memory buffers for the 
build process. This would allow applications to manage memory allocation 
strategies according to their specific requirements (pool-based, static 
allocation, etc.).






发自我的企业微信

Reply via email to