rte_mempool_avail_count : returns bigger than mempool size
https://bugs.dpdk.org/show_bug.cgi?id=1229
Bug ID: 1229
Summary: rte_mempool_avail_count : returns bigger than mempool
size
Product: DPDK
Version: 22.11
Hardware: x86
OS: Linux
Status: UNCONFIRMED
Severity: minor
Priority: Normal
Component: core
Assignee: [email protected]
Reporter: [email protected]Target Milestone: ---
Hello,
Sometimes rte_mempool_avail_count function returns bigger than mempool size that cause mis-calculation/overflow/negative of in-use count ( rte_mempool_in_use_count)
11:51:48 NOTI [UseCount_mpool:00000065][avail_mpool:00010334] 11:51:48 NOTI [UseCount_mpool:4294967135][avail_mpool:00010560]
After adding a condition, it is fixed.
/* Return the number of entries in the mempool */ unsigned intrte_mempool_avail_count(const struct rte_mempool *mp)
{
unsigned count;
unsigned lcore_id;
count = rte_mempool_ops_get_count(mp);
if (mp->cache_size == 0){
if (count > mp->size){
return mp->size;
}
return count;
}
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++)
count += mp->local_cache[lcore_id].len;
/*
* due to race condition (access to len is not locked), the
* total can be greater than size... so fix the result
*/
if (count > mp->size){
return mp->size;
}
return count;
}Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
https://bugs.dpdk.org/show_bug.cgi?id=1229
Morten Brørup ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED--- Comment #3 from Morten Brørup ([email protected]) --- It turned out to be a bug in the application, freeing an object twice.
Note: If building DPDK and the application with RTE_LIBRTE_MEMPOOL_DEBUG set in config/rte_config.h, the mempool cookies should catch any double frees.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.