summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2016-06-30 13:49:25 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-01 12:35:57 +0200
commita0fd91cefcc054b770dec6d8fb60db0d3145c45a (patch)
treed84235ef19ac3a4ec1d0b4eb96cf18f3ce5591a3 /examples
parent43ea4004944404388c033055b130b53e8ba03806 (diff)
downloaddpdk-a0fd91cefcc054b770dec6d8fb60db0d3145c45a.zip
dpdk-a0fd91cefcc054b770dec6d8fb60db0d3145c45a.tar.gz
dpdk-a0fd91cefcc054b770dec6d8fb60db0d3145c45a.tar.xz
mempool: rename functions with confusing names
The mempool_count and mempool_free_count behaved contrary to what their names suggested. The free_count function actually returned the number of elements that were allocated from the pool, not the number unallocated as the name implied. Fix this by introducing two new functions to replace the old ones, * rte_mempool_avail_count to replace rte_mempool_count * rte_mempool_in_use_count to replace rte_mempool_free_count In this patch, the new functions are added, and the old ones are marked as deprecated. All apps and examples that use the old functions are updated to use the new functions. Fixes: af75078fece3 ("first public release") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/multi_process/l2fwd_fork/main.c3
-rw-r--r--examples/qos_sched/main.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index 368b309..2d951d9 100644
--- a/examples/multi_process/l2fwd_fork/main.c
+++ b/examples/multi_process/l2fwd_fork/main.c
@@ -442,7 +442,8 @@ reset_slave_all_ports(unsigned slaveid)
pool = rte_mempool_lookup(buf_name);
if (pool)
printf("Port %d mempool free object is %u(%u)\n", slave->port[i],
- rte_mempool_count(pool), (unsigned)NB_MBUF);
+ rte_mempool_avail_count(pool),
+ (unsigned int)NB_MBUF);
else
printf("Can't find mempool %s\n", buf_name);
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index e16b164..e10cfd4 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -201,8 +201,6 @@ app_stat(void)
stats.oerrors - tx_stats[i].oerrors);
memcpy(&tx_stats[i], &stats, sizeof(stats));
- //printf("MP = %d\n", rte_mempool_count(conf->app_pktmbuf_pool));
-
#if APP_COLLECT_STAT
printf("-------+------------+------------+\n");
printf(" | received | dropped |\n");