aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/buffer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/dpdk/buffer.c b/src/plugins/dpdk/buffer.c
index 575660ba7f5..97184519428 100644
--- a/src/plugins/dpdk/buffer.c
+++ b/src/plugins/dpdk/buffer.c
@@ -414,7 +414,15 @@ dpdk_ops_vpp_dequeue_no_cache (struct rte_mempool *mp, void **obj_table,
static unsigned
dpdk_ops_vpp_get_count (const struct rte_mempool *mp)
{
- clib_warning ("");
+ vlib_main_t *vm = vlib_get_main ();
+ if (mp)
+ {
+ vlib_buffer_pool_t *pool = vlib_get_buffer_pool (vm, mp->pool_id);
+ if (pool)
+ {
+ return pool->n_avail;
+ }
+ }
return 0;
}