From 12ee45a3620b30a99d21cbf5a25d787f088f0de9 Mon Sep 17 00:00:00 2001 From: Yong Wang Date: Wed, 11 Jan 2017 22:52:17 -0500 Subject: [PATCH] examples/vhost: fix calculation of mbuf count When calculating 'nr_mbufs_per_core', 'MAX_PKT_BURST' was mutiplied twice. Fix it by removing one of them. Fixes: bdb19b771e6f ("examples/vhost: fix mbuf allocation failure") Cc: stable@dpdk.org Signed-off-by: Yong Wang Acked-by: Yuanhan Liu --- examples/vhost/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index ac1f6e203c..81a6a8cf91 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1393,7 +1393,7 @@ create_mbuf_pool(uint16_t nr_port, uint32_t nr_switch_core, uint32_t mbuf_size, mtu = 64 * 1024; nr_mbufs_per_core = (mtu + mbuf_size) * MAX_PKT_BURST / - (mbuf_size - RTE_PKTMBUF_HEADROOM) * MAX_PKT_BURST; + (mbuf_size - RTE_PKTMBUF_HEADROOM); nr_mbufs_per_core += nr_rx_desc; nr_mbufs_per_core = RTE_MAX(nr_mbufs_per_core, nr_mbuf_cache); -- 2.20.1