|SUCCESS|dpdk|f5e1310f16| intel-Functional
sys_stv at intel.com
sys_stv at intel.com
Wed Jun 10 14:07:05 CEST 2026
Test-Label: intel-Functional
Test-Status: SUCCESS
_Functional PASS_
DPDK git repo: dpdk
commit f5e1310f16e0909e7e7f71807123644c63b23cba
Author: Morten Brørup <mb at smartsharesystems.com>
Date: Thu Jun 4 11:48:51 2026 +0000
mempool: improve cache behaviour and performance
This patch refactors the mempool cache to eliminate some unexpected
behaviour and reduce the mempool cache miss rate.
1.
The actual cache size was 1.5 times the cache size specified at run-time
mempool creation.
This was obviously not expected by application developers.
2.
In get operations, the check for when to use the cache as bounce buffer
did not respect the run-time configured cache size,
but compared to the build time maximum possible cache size
(RTE_MEMPOOL_CACHE_MAX_SIZE, default 512).
E.g. with a configured cache size of 32 objects, getting 256 objects
would first fetch 32 + 256 = 288 objects into the cache,
and then move the 256 objects from the cache to the destination memory,
instead of fetching the 256 objects directly to the destination memory.
This had a performance cost.
However, this is unlikely to occur in real applications, so it is not
important in itself.
3.
When putting objects into a mempool, and the mempool cache did not have
free space for so many objects,
the cache was flushed completely, and the new objects were then put into
the cache.
I.e. the cache drain level was zero.
This (complete cache flush) meant that a subsequent get operation (with
the same number of objects) completely emptied the cache,
so another subsequent get operation required replenishing the cache.
Similarly,
When getting objects from a mempool, and the mempool cache did not hold so
many objects,
the cache was replenished to cache->size + remaining objects,
and then (the remaining part of) the requested objects were fetched via
the cache,
which left the cache filled (to cache->size) at completion.
I.e. the cache refill level was cache->size (plus some, depending on
request size).
(1) was improved by generally comparing to cache->size instead of
cache->flushthresh, when considering the capacity of the cache.
The cache->flushthresh field is kept for API/ABI compatibility purposes,
and initialized to cache->size instead of cache->size * 1.5.
(2) was improved by generally comparing to cache->size / 2 instead of
RTE_MEMPOOL_CACHE_MAX_SIZE, when checking the bounce buffer limit.
(3) was improved by flushing and replenishing the cache by half its size,
so a flush/refill can be followed randomly by get or put requests.
This also reduced the number of objects in each flush/refill operation.
As a consequence of these changes, the size of the array holding the
objects in the cache (cache->objs[]) no longer needs to be
2 * RTE_MEMPOOL_CACHE_MAX_SIZE, and can be reduced to
RTE_MEMPOOL_CACHE_MAX_SIZE at an API/ABI breaking release.
Performance data:
With a real WAN Optimization application, where the number of allocated
packets varies (as they are held in e.g. shaper queues), the mempool
cache miss rate dropped from ca. 1/20 objects to ca. 1/48 objects.
This was deployed in production at an ISP, and using an effective cache
size of 384 objects.
Bugzilla ID: 1027
Fixes: ea5dd2744b90 ("mempool: cache optimisations")
Signed-off-by: Morten Brørup <mb at smartsharesystems.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Smoke-Testing Summary : 31 Case Done, 31 Successful, 0 Failures
OS : Ubuntu 24.04.4 LTS
Kernel : 6.8.0-71-generic
GCC : 13.3.0-6ubuntu2~24.04.1
NIC : Ethernet Controller XL710 for 40GbE QSFP+
Target : x86_64-native-linuxapp-gcc
Test result details:
+-----------------+---------------------------------------------------+-------+
| suite | case | status|
+-----------------+---------------------------------------------------+-------+
| checksum_offload| test_do_not_insert_checksum_on_the_transmit_packet| passed|
| checksum_offload| test_hardware_checksum_check_ip_rx | passed|
| checksum_offload| test_hardware_checksum_check_ip_tx | passed|
| checksum_offload| test_hardware_checksum_check_l4_rx | passed|
| checksum_offload| test_hardware_checksum_check_l4_tx | passed|
| checksum_offload| test_insert_checksum_on_the_transmit_packet | passed|
| checksum_offload| test_rx_checksum_valid_flags | passed|
| checksum_offload| test_checksum_offload_with_vlan | n/a |
| dual_vlan | test_dual_vlan_priority_rxtx | passed|
| dual_vlan | test_vlan_filter_config | passed|
| dual_vlan | test_vlan_filter_table | passed|
| dual_vlan | test_vlan_insert_config | passed|
| dual_vlan | test_vlan_random_test | passed|
| dual_vlan | test_vlan_strip_config | passed|
| dual_vlan | test_vlan_synthetic_test | passed|
| dual_vlan | test_vlan_tpid_config | passed|
| dual_vlan | test_vlan_stripq_config | n/a |
| jumboframes | test_jumboframes_bigger_jumbo | passed|
| jumboframes | test_jumboframes_jumbo_jumbo | passed|
| jumboframes | test_jumboframes_jumbo_nojumbo | passed|
| jumboframes | test_jumboframes_normal_jumbo | passed|
| jumboframes | test_jumboframes_normal_nojumbo | passed|
| rxtx_offload | test_rxoffload_port_all | passed|
| rxtx_offload | test_rxoffload_port_cmdline | passed|
| rxtx_offload | test_txoffload_port | passed|
| rxtx_offload | test_txoffload_port_all | passed|
| rxtx_offload | test_txoffload_port_checksum | passed|
| rxtx_offload | test_txoffload_port_cmdline | passed|
| rxtx_offload | test_txoffload_port_multi_segs | passed|
| rxtx_offload | test_txoffload_queue | passed|
| rxtx_offload | test_rxoffload_queue | n/a |
+-----------------+---------------------------------------------------+-------+
DPDK STV team
More information about the test-report
mailing list